@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; }
File file = new File(groupInfoUpdate.getNewlocalPath()); channel = ChannelInfoActivity.this.channel; if (!TextUtils.isEmpty(channel.getLocalImageUri())) { file.renameTo(new File(channel.getLocalImageUri())); } else { file.renameTo(FileClientService.getFilePath(channel.getKey() + "_profile.jpeg", context.getApplicationContext(), "image"));
public GroupInfoUpdate(Channel channel) { this.newName = channel.getName(); this.groupId = channel.getKey(); this.clientGroupId = channel.getClientGroupId(); this.imageUrl = channel.getImageUrl(); this.localImagePath = channel.getLocalImageUri(); }
updateChannelLocalImageURI(channel.getKey(), null); if (!TextUtils.isEmpty(channel.getLocalImageUri())) { contentValues.put(MobiComDatabaseHelper.CHANNEL_IMAGE_LOCAL_URI, channel.getLocalImageUri());