/** * This method loads the channel's image into the ImageView * * @param imageView CircularImageView in which the image is to be loaded * @param textView Although we do not display alphabeticImage for a group, but this is needed to handle the visibility for recycler view. * @param channel Channel object whose image is to be loaded */ public void loadChannelImage(CircleImageView imageView, TextView textView, Channel channel) { textView.setVisibility(View.GONE); imageView.setVisibility(View.VISIBLE); if (channel.getImageUrl() != null) { loadImage(imageView, textView, channel.getImageUrl(), R.drawable.applozic_group_icon); } else { imageView.setImageResource(R.drawable.applozic_group_icon); } }
public void run() { FragmentManager supportFragmentManager = getSupportFragmentManager(); Channel channel = ChannelService.getInstance(ChannelNameActivity.this).getChannel(groupInfoUpdate.getGroupId()); DialogFragment fragment = PictureUploadPopUpFragment.newInstance(true, TextUtils.isEmpty(channel.getImageUrl())); FragmentTransaction fragmentTransaction = supportFragmentManager .beginTransaction(); Fragment prev = getSupportFragmentManager().findFragmentByTag("PhotosAttachmentFragment"); if (prev != null) { fragmentTransaction.remove(prev); } fragmentTransaction.addToBackStack(null); fragment.show(fragmentTransaction, "PhotosAttachmentFragment"); } });
contentValues.put(MobiComDatabaseHelper.ADMIN_ID, channel.getAdminKey()); Channel oldChannel = null; if (!TextUtils.isEmpty(channel.getImageUrl())) { contentValues.put(MobiComDatabaseHelper.CHANNEL_IMAGE_URL, channel.getImageUrl()); oldChannel = ChannelDatabaseService.getInstance(context).getChannelByChannelKey(channel.getKey()); if (oldChannel != null && !TextUtils.isEmpty(channel.getImageUrl()) && !TextUtils.isEmpty(oldChannel.getImageUrl()) && !channel.getImageUrl().equals(oldChannel.getImageUrl())) { updateChannelLocalImageURI(channel.getKey(), null);
@Override public void setToolbarImage(Contact contact, Channel channel){ if(ApplozicSetting.getInstance(this).isShowImageOnToolbar() || alCustomizationSettings.isShowImageOnToolbar()) { conversationContactPhoto.setVisibility(View.VISIBLE); if (contact != null) { Glide.with(this) .load(contact.getImageURL()) .apply(new RequestOptions().placeholder(R.drawable.applozic_ic_contact_picture_holo_light)) .into(conversationContactPhoto); } else if (channel != null) { Glide.with(this) .load(channel.getImageUrl()) .apply(new RequestOptions().placeholder(R.drawable.applozic_group_icon)) .into(conversationContactPhoto); } else { conversationContactPhoto.setImageResource(R.drawable.applozic_ic_contact_picture_holo_light); } } }
public GroupInfoUpdate(Channel channel) { this.newName = channel.getName(); this.groupId = channel.getKey(); this.clientGroupId = channel.getClientGroupId(); this.imageUrl = channel.getImageUrl(); this.localImagePath = channel.getLocalImageUri(); }
@Override protected void onResume() { super.onResume(); LocalBroadcastManager.getInstance(this).registerReceiver(mobiComKitBroadcastReceiver, BroadcastService.getIntentFilter()); LocalBroadcastManager.getInstance(this).registerReceiver(refreshBroadcast, getIntentFilter()); if (channel != null) { BroadcastService.currentInfoId = String.valueOf(channel.getKey()); Channel newChannel = ChannelService.getInstance(this).getChannelByChannelKey(channel.getKey()); if (newChannel != null && TextUtils.isEmpty(newChannel.getImageUrl())) { if (!channel.isBroadcastMessage()) { channelImage.setImageResource(R.drawable.applozic_group_icon); } else { channelImage.setImageResource(R.drawable.applozic_ic_applozic_broadcast); } } } }
if (!TextUtils.isEmpty(channel.getImageUrl())) { mChannelImageLoader.loadImage(channel, holder.groupIcon); } else if (channel.isBroadcastMessage()) {
connection = openHttpConnection(contact.getImageURL()); } else { connection = openHttpConnection(channel.getImageUrl());
@Override public Bitmap downloadGroupImage(Context context, Channel channel) { if (channel != null && TextUtils.isEmpty(channel.getImageUrl())) { return null; } Bitmap attachedImage = ImageUtils.getBitMapFromLocalPath(channel.getLocalImageUri()); if (attachedImage != null) { return attachedImage; } Bitmap bitmap = fileClientService.downloadBitmap(null, channel); if (bitmap != null) { File file = FileClientService.getFilePath(String.valueOf(channel.getKey()), context.getApplicationContext(), "image", true); String imageLocalPath = ImageUtils.saveImageToInternalStorage(file, bitmap); channel.setLocalImageUri(imageLocalPath); } if (!TextUtils.isEmpty(channel.getLocalImageUri())) { ChannelService.getInstance(context).updateChannelLocalImageURI(channel.getKey(), channel.getLocalImageUri()); } return bitmap; }
myholder.contactImage.setVisibility(View.VISIBLE); if (channel != null && !TextUtils.isEmpty(channel.getImageUrl())) { channelImageLoader.loadImage(channel, myholder.contactImage); } else if (channel != null && channel.isBroadcastMessage()) {