本文整理汇总了Java中io.rong.imkit.widget.ArraysDialogFragment类的典型用法代码示例。如果您正苦于以下问题:Java ArraysDialogFragment类的具体用法?Java ArraysDialogFragment怎么用?Java ArraysDialogFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ArraysDialogFragment类属于io.rong.imkit.widget包,在下文中一共展示了ArraysDialogFragment类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemLongClick
import io.rong.imkit.widget.ArraysDialogFragment; //导入依赖的package包/类
@Override
public void onItemLongClick(final View view, int position, final CallSTerminateMessage content, final UIMessage message) {
String name = null;
if (message.getSenderUserId() != null) {
UserInfo userInfo = message.getUserInfo();
if (userInfo == null || userInfo.getName() == null)
userInfo = RongUserInfoManager.getInstance().getUserInfo(message.getSenderUserId());
if (userInfo != null)
name = userInfo.getName();
}
String[] items;
items = new String[] {view.getContext().getResources().getString(R.string.rc_dialog_item_message_delete)};
ArraysDialogFragment.newInstance(name, items).setArraysDialogItemListener(new ArraysDialogFragment.OnArraysDialogItemListener() {
@Override
public void OnArraysDialogItemClick(DialogInterface dialog, int which) {
if (which == 0) {
RongIM.getInstance().deleteMessages(new int[] {message.getMessageId()}, null);
}
}
}).show(((FragmentActivity) view.getContext()).getSupportFragmentManager());
}
示例2: onItemLongClick
import io.rong.imkit.widget.ArraysDialogFragment; //导入依赖的package包/类
@Override
public void onItemLongClick(View view, int position, ContactNotificationMessage content, final UIMessage message) {
String name = null;
if (message.getConversationType().getName().equals(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName()) ||
message.getConversationType().getName().equals(Conversation.ConversationType.PUBLIC_SERVICE.getName())) {
ConversationKey key = ConversationKey.obtain(message.getTargetId(), message.getConversationType());
PublicServiceProfile info = RongContext.getInstance().getPublicServiceInfoCache().get(key.getKey());
if (info != null)
name = info.getName();
} else {
UserInfo userInfo = RongContext.getInstance().getUserInfoCache().get(message.getSenderUserId());
if (userInfo != null)
name = userInfo.getName();
}
String[] items;
items = new String[]{view.getContext().getResources().getString(R.string.de_dialog_item_message_delete)};
ArraysDialogFragment.newInstance(name, items).setArraysDialogItemListener(new ArraysDialogFragment.OnArraysDialogItemListener() {
@Override
public void OnArraysDialogItemClick(DialogInterface dialog, int which) {
if (which == 0)
RongIM.getInstance().getRongIMClient().deleteMessages(new int[]{message.getMessageId()}, null);
}
}).show(((FragmentActivity) view.getContext()).getSupportFragmentManager());
}
开发者ID:birdcopy,项目名称:Android-Birdcopy-Application,代码行数:28,代码来源:ContactNotificationMessageProvider.java
示例3: onItemLongClick
import io.rong.imkit.widget.ArraysDialogFragment; //导入依赖的package包/类
@Override
public void onItemLongClick(final View view, int position, final RealTimeLocationStartMessage content, final UIMessage message) {
ViewHolder holder = (ViewHolder) view.getTag();
holder.longClick = true;
if (view instanceof TextView) {
CharSequence text = ((TextView) view).getText();
if (text != null && text instanceof Spannable)
Selection.removeSelection((Spannable) text);
}
String name = null;
if (message.getSenderUserId() != null) {
UserInfo userInfo = RongContext.getInstance().getUserInfoCache().get(message.getSenderUserId());
if (userInfo != null)
name = userInfo.getName();
}
String[] items;
Resources res = view.getContext().getResources();
items = new String[]{res.getString(R.string.rc_dialog_item_message_delete)};
ArraysDialogFragment.newInstance(name, items).setArraysDialogItemListener(new ArraysDialogFragment.OnArraysDialogItemListener() {
@Override
public void OnArraysDialogItemClick(DialogInterface dialog, int which) {
if (which == 0) {
RongIM.getInstance().getRongIMClient().deleteMessages(new int[]{message.getMessageId()}, null);
}
}
}).show(((FragmentActivity) view.getContext()).getSupportFragmentManager());
}
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:33,代码来源:RealTimeLocationMessageProvider.java
示例4: onPluginClick
import io.rong.imkit.widget.ArraysDialogFragment; //导入依赖的package包/类
@Override
public void onPluginClick(final View view) {
RealTimeLocationConstant.RealTimeLocationErrorCode errorCode = RongIMClient.getInstance().getRealTimeLocation(getCurrentConversation().getConversationType(), getCurrentConversation().getTargetId());
if (errorCode != null && errorCode != RealTimeLocationConstant.RealTimeLocationErrorCode.RC_REAL_TIME_LOCATION_CONVERSATION_NOT_SUPPORT) {
ArraysDialogFragment arraysDialogFragment = ArraysDialogFragment.newInstance("位置", new String[]{"发送位置", "实时位置共享"});
arraysDialogFragment.setArraysDialogItemListener(new ArraysDialogFragment.OnArraysDialogItemListener() {
@Override
public void OnArraysDialogItemClick(DialogInterface dialog, int which) {
if (which == 0) {
superOnPluginClick(view);
} else if (which == 1) {
RealTimeLocationConstant.RealTimeLocationStatus status = RongIMClient.getInstance().getRealTimeLocationCurrentState(getCurrentConversation().getConversationType(), getCurrentConversation().getTargetId());
if (status == null || status == RealTimeLocationConstant.RealTimeLocationStatus.RC_REAL_TIME_LOCATION_STATUS_IDLE) {
startRealTimeLocation(view.getContext());
EventBus.getDefault().post(RongEvent.RealTimeLocationMySelfJoinEvent.obtain(""));
} else {
joinRealTimeLocation(view.getContext());
}
}
}
});
arraysDialogFragment.show(getCurrentFragment().getFragmentManager());
} else {
superOnPluginClick(view);
}
}