public Channel getChannel(Cursor cursor) { Channel channel = new Channel(); channel.setKey(cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.CHANNEL_KEY))); channel.setParentClientGroupId(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.PARENT_CLIENT_GROUP_ID))); channel.setClientGroupId(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.CLIENT_GROUP_ID))); channel.setName(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.CHANNEL_DISPLAY_NAME))); channel.setAdminKey(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.ADMIN_ID))); channel.setType(cursor.getShort(cursor.getColumnIndex(MobiComDatabaseHelper.TYPE))); channel.setImageUrl(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.CHANNEL_IMAGE_URL))); channel.setLocalImageUri(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.CHANNEL_IMAGE_LOCAL_URI))); int count = cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.UNREAD_COUNT)); channel.setNotificationAfterTime(cursor.getLong(cursor.getColumnIndex(MobiComDatabaseHelper.NOTIFICATION_AFTER_TIME))); channel.setDeletedAtTime(cursor.getLong(cursor.getColumnIndex(MobiComDatabaseHelper.DELETED_AT))); channel.setParentKey(cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.PARENT_GROUP_KEY))); String metadata = cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.CHANNEL_META_DATA)); channel.setMetadata(((Map<String, String>) GsonUtils.getObjectFromJson(metadata, Map.class))); if (count > 0) { channel.setUnreadCount(count); } return channel; }
channel.setDeletedAtTime(channelInfo.getDeletedAtTime()); individualMessageSendLayout.setVisibility(View.GONE); userNotAbleToChatLayout.setVisibility(VISIBLE);
public Channel getChannel(ChannelFeed channelFeed) { Channel channel = new Channel(channelFeed.getId(), channelFeed.getName(), channelFeed .getAdminName(), channelFeed.getType(), channelFeed.getUnreadCount(), channelFeed .getImageUrl()); channel.setClientGroupId(channelFeed.getClientGroupId()); channel.setNotificationAfterTime(channelFeed.getNotificationAfterTime()); channel.setDeletedAtTime(channelFeed.getDeletedAtTime()); channel.setMetadata(channelFeed.getMetadata()); channel.setParentKey(channelFeed.getParentKey()); channel.setParentClientGroupId(channelFeed.getParentClientGroupId()); return channel; }