本文整理汇总了Java中io.rong.imlib.model.Discussion类的典型用法代码示例。如果您正苦于以下问题:Java Discussion类的具体用法?Java Discussion怎么用?Java Discussion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Discussion类属于io.rong.imlib.model包,在下文中一共展示了Discussion类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDiscussionActionBar
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
/**
* 设置讨论组界面 ActionBar
*/
private void setDiscussionActionBar(String targetId) {
if (targetId != null) {
RongIM.getInstance().getDiscussion(targetId
, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
setTitle(discussion.getName());
}
@Override
public void onError(RongIMClient.ErrorCode e) {
if (e.equals(RongIMClient.ErrorCode.NOT_IN_DISCUSSION)) {
setTitle("不在讨论组中");
supportInvalidateOptionsMenu();
}
}
});
} else {
setTitle("讨论组");
}
}
示例2: setDiscussionActionBar
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
/**
* 设置讨论组界面 ActionBar
*/
private void setDiscussionActionBar(String targetId) {
if (targetId != null) {
RongIM.getInstance().getDiscussion(targetId
, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
setTitle(discussion.getName());
}
@Override
public void onError(RongIMClient.ErrorCode e) {
if (e.equals(RongIMClient.ErrorCode.NOT_IN_DISCUSSION)) {
setTitle("不在讨论组中");
supportInvalidateOptionsMenu();
}
}
});
} else {
setTitle("讨论组");
}
}
示例3: setDiscussionName
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
/**
* 讨论组名称修改后刷新本地缓存
*
* @param targetId 讨论组 id
*/
private void setDiscussionName(String targetId) {
if (RongIM.getInstance() != null && RongIM.getInstance().getRongIMClient() != null) {
RongIM.getInstance().getRongIMClient().getDiscussion(targetId, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
RongIM.getInstance().refreshDiscussionCache(discussion);
Log.i(TAG, "------discussion.getName---" + discussion.getName());
}
@Override
public void onError(RongIMClient.ErrorCode e) {
}
});
}
}
示例4: onCreate
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail_discussion);
setTitle("讨论组详情");
targetId = getIntent().getStringExtra("TargetId");
if (TextUtils.isEmpty(targetId)) {
return;
}
LoadDialog.show(this);
initView();
RongIM.getInstance().getDiscussion(targetId, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
mDiscussion = discussion;
if (mDiscussion != null) {
initData(mDiscussion);
}
}
@Override
public void onError(RongIMClient.ErrorCode e) {
}
});
}
示例5: initData
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
private void initData(Discussion mDiscussion) {
memberSize.setText("讨论组成员(" + mDiscussion.getMemberIdList().size() + ")");
createId = mDiscussion.getCreatorId();
ids = mDiscussion.getMemberIdList();
if (ids != null) {
request(FIND_USER_INFO);
}
}
示例6: jsmethod_getDiscussion
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
@UzJavascriptMethod
public void jsmethod_getDiscussion(final UZModuleContext context) {
String discussionId = context.optString("discussionId", null);
if (TextUtils.isEmpty(discussionId)) {
callModuleError(context, new RongException(ErrorCode.ARGUMENT_EXCEPTION));
return;
}
if (mRongClient == null) {
callModuleError(context, new RongException(ErrorCode.NOT_CONNECTED));
return;
}
mRongClient.getDiscussion(discussionId, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
TranslatedDiscussion td = null;
if (discussion == null) {
callModuleSuccess(context, "");
} else {
td = new TranslatedDiscussion(discussion);
callModuleSuccess(context, td);
}
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
callModuleError(context, new RongException(errorCode.getValue()));
}
});
}
示例7: TranslatedDiscussion
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
public TranslatedDiscussion(Discussion discussion) {
this.creatorId = discussion.getCreatorId();
this.id = discussion.getId();
this.name = discussion.getName();
this.memberIdList = discussion.getMemberIdList();
this.inviteStatus = discussion.isOpen() ? "OPENED" : "CLOSED";
}
示例8: setDiscussionActionBar
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
/**
* 设置讨论组界面 ActionBar
*/
private void setDiscussionActionBar(String targetId, String targetIds) {
if (targetId != null) {
RongIM.getInstance().getRongIMClient().getDiscussion(targetId
, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
getSupportActionBar().setTitle(discussion.getName());
}
@Override
public void onError(RongIMClient.ErrorCode e) {
if (e.equals(RongIMClient.ErrorCode.NOT_IN_DISCUSSION)) {
getSupportActionBar().setTitle("不在讨论组中");
isDiscussion = true;
supportInvalidateOptionsMenu();
}
}
});
} else if (targetIds != null) {
setDiscussionName(targetIds);
} else {
getSupportActionBar().setTitle("讨论组");
}
}
示例9: initDate
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
private void initDate() {
Intent intent = getIntent();
if(intent!=null && intent.hasExtra("DEMO_REPLY_CONVERSATIONTYPE")&&intent.hasExtra("DEMO_REPLY_TARGETID")) {
String conversationType = intent.getStringExtra("DEMO_REPLY_CONVERSATIONTYPE");
mTargetId = intent.getStringExtra("DEMO_REPLY_TARGETID");
mConversationType = Conversation.ConversationType.valueOf(conversationType);
if (mConversationType.equals(Conversation.ConversationType.DISCUSSION)) {
RongIM.getInstance().getRongIMClient().getDiscussion(mTargetId, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
mNumberlist = discussion.getMemberIdList();
String userId = FlyingDataManager.getCurrentRongID();
mNumberlist.remove(userId);
mUserInfoList = FlyingIMContext.getInstance().getUserInfoList(mNumberlist);
mNewTextReplyAdapter = new NewTextReplyAdapter(NewTextMessageActivity.this, mUserInfoList);
mReplyListView.setAdapter(mNewTextReplyAdapter);
}
@Override
public void onError(RongIMClient.ErrorCode e) {
}
});
} else if (mConversationType.equals(Conversation.ConversationType.GROUP)) {
}
}
mReplyListView.setOnItemClickListener(this);
}
示例10: showViewByConversationType
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
/**
* 通过 会话类型选择要展示的 fragment
*
* @param mConversationType 会话类型
*/
private void showViewByConversationType(Conversation.ConversationType mConversationType) {
if (mConversationType.equals(Conversation.ConversationType.DISCUSSION)) {
mDeleteBtn.setVisibility(View.VISIBLE);
mChatRoomRel.setVisibility(View.VISIBLE);
RongIM.getInstance().getRongIMClient().getDiscussion(targetId, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
mDiscussionName = discussion.getName();
mChatRoomName.setText(mDiscussionName);
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
}
});
} else if (mConversationType.equals(Conversation.ConversationType.PRIVATE)) {
} else if (mConversationType.equals(Conversation.ConversationType.CHATROOM)) {
fragmentTransaction.hide(mAddNumberFragment);
fragmentTransaction.hide(mToTopFragment);
fragmentTransaction.commit();
} else if (mConversationType.equals(Conversation.ConversationType.GROUP)) {
fragmentTransaction.hide(mAddNumberFragment);
fragmentTransaction.commit();
} else if (mConversationType.equals(Conversation.ConversationType.CUSTOMER_SERVICE)) {
fragmentTransaction.hide(mAddNumberFragment);
fragmentTransaction.hide(mToTopFragment);
fragmentTransaction.commit();
}
}
示例11: initDate
import io.rong.imlib.model.Discussion; //导入依赖的package包/类
private void initDate() {
Intent intent = getIntent();
if(intent!=null && intent.hasExtra("DEMO_REPLY_CONVERSATIONTYPE")&&intent.hasExtra("DEMO_REPLY_TARGETID")) {
String conversationType = intent.getStringExtra("DEMO_REPLY_CONVERSATIONTYPE");
mTargetId = intent.getStringExtra("DEMO_REPLY_TARGETID");
mConversationType = Conversation.ConversationType.valueOf(conversationType);
if (mConversationType.equals(Conversation.ConversationType.DISCUSSION)) {
RongIM.getInstance().getRongIMClient().getDiscussion(mTargetId, new RongIMClient.ResultCallback<Discussion>() {
@Override
public void onSuccess(Discussion discussion) {
mNumberlist = discussion.getMemberIdList();
if (DemoContext.getInstance().getSharedPreferences() != null) {
String userId = DemoContext.getInstance().getSharedPreferences().getString(Constants.APP_USER_ID,Constants.DEFAULT);
mNumberlist.remove(userId);
}
mUserInfoList = DemoContext.getInstance().getUserInfoList(mNumberlist);
mNewTextReplyAdapter = new NewTextReplyAdapter(NewTextMessageActivity.this, mUserInfoList);
mReplyListView.setAdapter(mNewTextReplyAdapter);
}
@Override
public void onError(RongIMClient.ErrorCode e) {
}
});
} else if (mConversationType.equals(Conversation.ConversationType.GROUP)) {
}
}
mReplyListView.setOnItemClickListener(this);
}