本文整理汇总了Java中io.rong.imkit.fragment.ConversationListFragment类的典型用法代码示例。如果您正苦于以下问题:Java ConversationListFragment类的具体用法?Java ConversationListFragment怎么用?Java ConversationListFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConversationListFragment类属于io.rong.imkit.fragment包,在下文中一共展示了ConversationListFragment类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initConversationList
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
private Fragment initConversationList() {
if (mConversationList == null) {
ConversationListFragment listFragment = ConversationListFragment.getInstance();
Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "false") //设置私聊会话是否聚合显示
.build();
listFragment.setUri(uri);
return listFragment;
} else {
return mConversationList;
}
}
示例2: initView
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
private void initView() {
//顶部菜单
mBackView = (ImageView) findViewById(R.id.top_back);
mBackView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mTitleView = (TextView) findViewById(R.id.converationList_top_title);
mTitleView.setText(mTitle);
ConversationListFragment fragment = (ConversationListFragment)getSupportFragmentManager().findFragmentById(R.id.conversationShareList);
fragment.setUri(rongUri);
}
示例3: showChatListNow
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
public void showChatListNow()
{
ConversationListFragment contentFragment = ConversationListFragment.getInstance();
Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true")
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "true")
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "true")
.build();
contentFragment.setUri(uri);
fg=contentFragment;
android.support.v4.app.FragmentTransaction transaction =getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, contentFragment)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
transaction.addToBackStack(null);
transaction.commit();
}
示例4: onCreateView
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.social_fragment_message, container, false);
ButterKnife.inject(this, root);
around.setOnClickListener(v -> startActivity(new Intent(getActivity(), AroundActivity.class)));
search.setOnClickListener(c -> startActivity(new Intent(getActivity(), UserFindActivity.class)));
contacts.setOnClickListener(v -> startActivity(new Intent(getActivity(), ContactActivity.class)));
listFragment = ConversationListFragment.getInstance();
getChildFragmentManager().beginTransaction().add(R.id.container, listFragment, "ChatList").commit();
Uri uri = Uri.parse("rong://" + getActivity().getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")//群组
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true")//讨论组
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//应用公众服务。
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "false")//系统
.build();
listFragment.setUri(uri);
fabMenu.setOnTouchListener((v, event) -> {
if (fabMenu.isOpened()){
fabMenu.close(true);
return true;
}
return false;
});
return root;
}
示例5: initConversationList
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
/**
* 获取会话列表的Fragment方法
* @return
*/
private Fragment initConversationList() {
if (mConversationListFragment == null) {
ConversationListFragment listFragment = new ConversationListFragment();
listFragment.setAdapter(new ConversationListAdapterEx(RongContext.getInstance()));
Uri uri;
if (isDebug) {
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "true") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true")
.build();
mConversationsTypes = new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM,
Conversation.ConversationType.DISCUSSION
};
} else {
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "false")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.build();
mConversationsTypes = new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM
};
}
listFragment.setUri(uri);
mConversationListFragment = listFragment;
return listFragment;
} else {
return mConversationListFragment;
}
}
示例6: initConversationList
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
/**
* 聊天消息
* @return
*/
private Fragment initConversationList() {
if (mConversationListFragment == null) {
ConversationListFragment listFragment = new ConversationListFragment();
listFragment.setAdapter(new ConversationListAdapterEx(RongContext.getInstance()));
Uri uri;
if (isDebug) {
//解析
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "true") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true")
.build();
//聊天类型
mConversationsTypes = new Conversation.ConversationType[] {Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM,
Conversation.ConversationType.DISCUSSION
};
} else {
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "false")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.build();
mConversationsTypes = new Conversation.ConversationType[] {Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM
};
}
listFragment.setUri(uri);
mConversationListFragment = listFragment;
return listFragment;
} else {
return mConversationListFragment;
}
}
示例7: initConversationList
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
private Fragment initConversationList() {
if (mConversationListFragment == null) {
ConversationListFragment listFragment = new ConversationListFragment();
listFragment.setAdapter(new ConversationListAdapterEx(RongContext.getInstance()));
Uri uri;
if (isDebug) {
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "true") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true")
.build();
mConversationsTypes = new Conversation.ConversationType[] {Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM,
Conversation.ConversationType.DISCUSSION
};
} else {
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "false")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.build();
mConversationsTypes = new Conversation.ConversationType[] {Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM
};
}
listFragment.setUri(uri);
mConversationListFragment = listFragment;
return listFragment;
} else {
return mConversationListFragment;
}
}
示例8: initConversationList
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
private Fragment initConversationList() {
if (mConversationListFragment == null) {
ConversationListFragment listFragment = new ConversationListFragment();
listFragment.setAdapter(new ConversationListAdapterEx(RongContext.getInstance()));
Uri uri;
if (isDebug) {
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "true") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true")
.build();
mConversationsTypes = new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM,
Conversation.ConversationType.DISCUSSION
};
} else {
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "false")//群组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统
.build();
mConversationsTypes = new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE,
Conversation.ConversationType.GROUP,
Conversation.ConversationType.PUBLIC_SERVICE,
Conversation.ConversationType.APP_PUBLIC_SERVICE,
Conversation.ConversationType.SYSTEM
};
}
listFragment.setUri(uri);
mConversationListFragment = listFragment;
return listFragment;
} else {
return mConversationListFragment;
}
}
示例9: getItem
import io.rong.imkit.fragment.ConversationListFragment; //导入依赖的package包/类
@Override
public Fragment getItem(int i) {
Fragment fragment = null;
switch (i) {
case 0:
mMainConversationTv.setTextColor(getResources().getColor(R.color.de_title_bg));
//TODO
if (mConversationFragment == null) {
ConversationListFragment listFragment = ConversationListFragment.getInstance();
listFragment.setAdapter(new ConversationListAdapterEx(RongContext.getInstance()));
Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("conversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "true") //设置私聊会话是否聚合显示
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")//群组
.appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true")//讨论组
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "true")//公共服务号
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "true")//订阅号
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "false")//系统
.build();
listFragment.setUri(uri);
fragment = listFragment;
} else {
fragment = mConversationFragment;
}
break;
case 1:
if (mGroupListFragment == null) {
mGroupListFragment = new GroupListFragment();
}
fragment = mGroupListFragment;
break;
case 2:
if (mChatroomFragment == null) {
fragment = new ChatRoomListFragment();
} else {
fragment = mChatroomFragment;
}
break;
case 3:
if (mCustomerFragment == null) {
// fragment = new FriendListFragment();
fragment = new CustomerFragment();
} else {
fragment = mCustomerFragment;
}
break;
}
return fragment;
}