public static Conversation getConversation(Cursor cursor) { Conversation conversation = new Conversation(); conversation.setId(cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.KEY))); conversation.setGroupId(cursor.getInt(cursor.getColumnIndex(MobiComDatabaseHelper.CHANNEL_KEY))); String topicId = cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.TOPIC_ID)); if (!TextUtils.isEmpty(topicId)) { conversation.setTopicId(topicId); } String topicDetail = cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.TOPIC_DETAIL)); if (!TextUtils.isEmpty(topicDetail)) { conversation.setTopicDetail(topicDetail); } String userId = cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.USERID)); if (!TextUtils.isEmpty(userId)) { conversation.setUserId(userId); } conversation.setTopicLocalImageUri(cursor.getString(cursor.getColumnIndex(MobiComDatabaseHelper.TOPIC_LOCAL_IMAGE_URL))); return conversation; }
public void updateContextBasedGroup() { if (channel != null) { Channel channelInfo = ChannelService.getInstance(getActivity()).getChannelInfo(channel.getKey()); if ((Channel.GroupType.GROUPOFTWO.getValue().equals(channelInfo.getType())) && channel.isContextBasedChat()) { Conversation conversation = new Conversation(); TopicDetail topic = new TopicDetail(); topic.setTitle(channelInfo.getMetadata().get(Channel.GroupMetaDataType.TITLE.getValue())); topic.setSubtitle(channelInfo.getMetadata().get(Channel.GroupMetaDataType.PRICE.getValue())); topic.setLink(channelInfo.getMetadata().get(Channel.GroupMetaDataType.LINK.getValue())); conversation.setTopicDetail(topic.getJson()); conversationList.get(0).setTopicDetail(topic.getJson()); applozicContextSpinnerAdapter.notifyDataSetChanged(); } } }
private Conversation buildConversation() { Conversation conversation = new Conversation(); conversation.setUserId("usertest2"); conversation.setTopicId("Topic#Id#Test"); TopicDetail topic = new TopicDetail(); topic.setTitle(getResources().getString(R.string.TestTopic2)); topic.setSubtitle(getResources().getString(R.string.Topic_1)); topic.setLink("https://www.applozic.com/resources/sidebox/images/applozic.png"); topic.setKey1(getResources().getString(R.string.Qty)); topic.setValue1("1000"); topic.setKey2(getResources().getString(R.string.Price)); topic.setValue2(getResources().getString(R.string.rs)); conversation.setSenderSmsFormat(MobiComUserPreference.getInstance(this).getUserId(), "SENDER SMS FORMAT"); conversation.setReceiverSmsFormat("usertest2", "RECEIVER SMS FORMAT"); conversation.setTopicDetail(topic.getJson()); return conversation; }
topic.setSubtitle(channel.getMetadata().get(Channel.GroupMetaDataType.PRICE.getValue())); topic.setLink(channel.getMetadata().get(Channel.GroupMetaDataType.LINK.getValue())); conversation.setTopicDetail(topic.getJson()); conversationList = new ArrayList<>(); conversationList.add(conversation);