当前位置: 首页>>代码示例>>Java>>正文


Java ContactNotificationMessage类代码示例

本文整理汇总了Java中io.rong.message.ContactNotificationMessage的典型用法代码示例。如果您正苦于以下问题:Java ContactNotificationMessage类的具体用法?Java ContactNotificationMessage怎么用?Java ContactNotificationMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ContactNotificationMessage类属于io.rong.message包,在下文中一共展示了ContactNotificationMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onConversationClick

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
@Override
public boolean onConversationClick(Context context, View view, UIConversation uiConversation) {
    MessageContent messageContent = uiConversation.getMessageContent();
    if (messageContent instanceof ContactNotificationMessage) {
        ContactNotificationMessage contactNotificationMessage = (ContactNotificationMessage) messageContent;
        if (contactNotificationMessage.getOperation().equals("AcceptResponse")) {
            // 被加方同意请求后
            if (contactNotificationMessage.getExtra() != null) {
                ContactNotificationMessageData bean = null;
                try {
                    bean = JsonMananger.jsonToBean(contactNotificationMessage.getExtra(), ContactNotificationMessageData.class);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                RongIM.getInstance().startPrivateChat(context, uiConversation.getConversationSenderId(), bean.getSourceUserNickname());

            }
        } else {
            context.startActivity(new Intent(context, NewFriendListActivity.class));
        }
        return true;
    }
    return false;
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:25,代码来源:SealAppContext.java

示例2: onConversationClick

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
@Override
public boolean onConversationClick(Context context, View view, UIConversation uiConversation) {
    MessageContent messageContent = uiConversation.getMessageContent();
    if (messageContent instanceof ContactNotificationMessage) {
        ContactNotificationMessage contactNotificationMessage = (ContactNotificationMessage) messageContent;
        if (contactNotificationMessage.getOperation().equals("AcceptResponse")) {
            // 被加方同意请求后
            if (contactNotificationMessage.getExtra() != null) {
                ContactNotificationMessageData bean = null;
                try {
                    bean = JsonMananger.jsonToBean(contactNotificationMessage.getExtra(), ContactNotificationMessageData.class);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                RongIM.getInstance().startPrivateChat(context, uiConversation.getConversationSenderId(), bean.getSourceUserNickname());
            }
        } else {
            context.startActivity(new Intent(context, NewFriendListActivity.class));
        }
        return true;
    }
    return false;
}
 
开发者ID:zqHero,项目名称:rongyunDemo,代码行数:24,代码来源:SealAppContext.java

示例3: getContentSummary

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
@Override
public Spannable getContentSummary(ContactNotificationMessage content) {
    if (content != null && !TextUtils.isEmpty(content.getExtra())) {
        ContactNotificationMessageData bean = null;
        try {
            bean = JsonMananger.jsonToBean(content.getExtra(), ContactNotificationMessageData.class);
        } catch (HttpException e) {
            e.printStackTrace();
        } finally {
            if (bean != null && !TextUtils.isEmpty(bean.getSourceUserNickname())) {
                if (content.getOperation().equals("AcceptResponse")) {
                    return new SpannableString(bean.getSourceUserNickname() + "已同意你的好友请求");
                }
            } else {
                if (content.getOperation().equals("AcceptResponse")) {
                    return new SpannableString("对方已同意你的好友请求");
                }
            }
            if (content.getOperation().equals("Request")) {
                return new SpannableString(content.getMessage());
            }
        }
    }
    return null;
}
 
开发者ID:sealtalk,项目名称:sealtalk-android,代码行数:26,代码来源:ContactNotificationMessageProvider.java

示例4: onConversationClick

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
/**
 * 点击会话列表 item 后执行。
 *
 * @param context      上下文。
 * @param view         触发点击的 View。
 * @param conversation 会话条目。
 * @return 返回 true 不再执行融云 SDK 逻辑,返回 false 先执行融云 SDK 逻辑再执行该方法。
 */
@Override
public boolean onConversationClick(Context context, View view, UIConversation conversation) {
    MessageContent messageContent = conversation.getMessageContent();

    Log.e(TAG, "--------onConversationClick-------");
    if (messageContent instanceof TextMessage) {//文本消息

        TextMessage textMessage = (TextMessage) messageContent;

        textMessage.getExtra();
    } else if (messageContent instanceof ContactNotificationMessage) {
        Log.e(TAG, "---onConversationClick--ContactNotificationMessage-");

        context.startActivity(new Intent(context, NewFriendListActivity.class));
        return true;
    }

    return false;
}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:28,代码来源:RongCloudEvent.java

示例5: onItemLongClick

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
@Override
public void onItemLongClick(View view, int position, ContactNotificationMessage content, final UIMessage message) {
    String[] items;

    items = new String[] {view.getContext().getResources().getString(R.string.de_dialog_item_message_delete)};

    OptionsPopupDialog.newInstance(view.getContext(), items).setOptionsPopupDialogListener(new OptionsPopupDialog.OnOptionsItemClickedListener() {
        @Override
        public void onOptionsItemClicked(int which) {
            if (which == 0)
                RongIM.getInstance().deleteMessages(new int[] {message.getMessageId()}, null);
        }
    }).show();
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:15,代码来源:ContactNotificationMessageProvider.java

示例6: getConversationPush

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
private void getConversationPush() {
    if (getIntent() != null && getIntent().hasExtra("PUSH_CONVERSATIONTYPE") && getIntent().hasExtra("PUSH_TARGETID")) {
        final String conversationType = getIntent().getStringExtra("PUSH_CONVERSATIONTYPE");
        final String targetId = getIntent().getStringExtra("PUSH_TARGETID");
        RongIM.getInstance().getConversation(Conversation.ConversationType.valueOf(conversationType), targetId, new RongIMClient.ResultCallback<Conversation>() {
            @Override
            public void onSuccess(Conversation conversation) {
                if (conversation != null) {
                    if (conversation.getLatestMessage() instanceof ContactNotificationMessage) { //好友消息的push
                        startActivity(new Intent(MainActivity.this, NewFriendListActivity.class));
                    } else {
                        Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon().appendPath("conversation")
                                .appendPath(conversationType).appendQueryParameter("targetId", targetId).build();
                        Intent intent = new Intent(Intent.ACTION_VIEW);
                        intent.setData(uri);
                        startActivity(intent);
                    }
                }
            }

            @Override
            public void onError(RongIMClient.ErrorCode e) {

            }
        });
    }
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:28,代码来源:MainActivity.java

示例7: getConversationPush

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
private void getConversationPush() {
    if (getIntent() != null && getIntent().hasExtra("PUSH_CONVERSATIONTYPE") && getIntent().hasExtra("PUSH_TARGETID")) {

        final String conversationType = getIntent().getStringExtra("PUSH_CONVERSATIONTYPE");
        final String targetId = getIntent().getStringExtra("PUSH_TARGETID");


        RongIM.getInstance().getConversation(Conversation.ConversationType.valueOf(conversationType), targetId, new RongIMClient.ResultCallback<Conversation>() {
            @Override
            public void onSuccess(Conversation conversation) {

                if (conversation != null) {

                    if (conversation.getLatestMessage() instanceof ContactNotificationMessage) { //好友消息的push
                        startActivity(new Intent(MainActivity.this, NewFriendListActivity.class));
                    } else {
                        Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon().appendPath("conversation")
                                  .appendPath(conversationType).appendQueryParameter("targetId", targetId).build();
                        Intent intent = new Intent(Intent.ACTION_VIEW);
                        intent.setData(uri);
                        startActivity(intent);
                    }
                }
            }

            @Override
            public void onError(RongIMClient.ErrorCode e) {

            }
        });
    }
}
 
开发者ID:zqHero,项目名称:rongyunDemo,代码行数:33,代码来源:MainActivity.java

示例8: onItemLongClick

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
@Override
public void onItemLongClick(View view, int position, ContactNotificationMessage content, final UIMessage message) {
    String[] items;

    items = new String[]{view.getContext().getResources().getString(R.string.de_dialog_item_message_delete)};

    OptionsPopupDialog.newInstance(view.getContext(), items).setOptionsPopupDialogListener(new OptionsPopupDialog.OnOptionsItemClickedListener() {
        @Override
        public void onOptionsItemClicked(int which) {
            if (which == 0)
                RongIM.getInstance().deleteMessages(new int[]{message.getMessageId()}, null);
        }
    }).show();
}
 
开发者ID:sealtalk,项目名称:sealtalk-android,代码行数:15,代码来源:ContactNotificationMessageProvider.java

示例9: getConversationPush

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
private void getConversationPush() {
    if (getIntent() != null && getIntent().hasExtra("PUSH_CONVERSATIONTYPE") && getIntent().hasExtra("PUSH_TARGETID")) {

        final String conversationType = getIntent().getStringExtra("PUSH_CONVERSATIONTYPE");
        final String targetId = getIntent().getStringExtra("PUSH_TARGETID");


        RongIM.getInstance().getConversation(Conversation.ConversationType.valueOf(conversationType), targetId, new RongIMClient.ResultCallback<Conversation>() {
            @Override
            public void onSuccess(Conversation conversation) {

                if (conversation != null) {

                    if (conversation.getLatestMessage() instanceof ContactNotificationMessage) { //好友消息的push
                        startActivity(new Intent(MainActivity.this, NewFriendListActivity.class));
                    } else {
                        Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon().appendPath("conversation")
                                .appendPath(conversationType).appendQueryParameter("targetId", targetId).build();
                        Intent intent = new Intent(Intent.ACTION_VIEW);
                        intent.setData(uri);
                        startActivity(intent);
                    }
                }
            }

            @Override
            public void onError(RongIMClient.ErrorCode e) {

            }
        });
    }
}
 
开发者ID:sealtalk,项目名称:sealtalk-android,代码行数:33,代码来源:MainActivity.java

示例10: translateMessageContent

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
public static TranslatedMessageContent translateMessageContent(MessageContent msgContent) {
    TranslatedMessageContent content = null;
    if (msgContent == null)
        return null;

    if (msgContent instanceof TextMessage) {
        content = new TranslatedTextMessage(msgContent);
    } else if (msgContent instanceof ImageMessage) {
        content = new TranslatedImageMessage(msgContent);
    } else if (msgContent instanceof VoiceMessage) {
        content = new TranslatedVoiceMessage(msgContent);
    } else if (msgContent instanceof RichContentMessage) {
        content = new TranslatedRichContentMessage(msgContent);
    } else if (msgContent instanceof CommandNotificationMessage) {
        content = new TranslatedCommandNotificationMessage(msgContent);
    } else if (msgContent instanceof LocationMessage) {
        content = new TranslatedLocationMessage(msgContent);
    } else if (msgContent instanceof InformationNotificationMessage) {
        content = new TranslatedInformationNtfMessage(msgContent);
    } else if (msgContent instanceof DiscussionNotificationMessage) {
        content = new TranslatedDiscussionNtfMessage(msgContent);
    } else if (msgContent instanceof CommandMessage) {
        content = new TranslatedCommandMessage(msgContent);
    } else if (msgContent instanceof ContactNotificationMessage) {
        content = new TranslatedContactNtfMessage(msgContent);
    } else if (msgContent instanceof ProfileNotificationMessage) {
        content = new TranslatedProfileNtfMessage(msgContent);
    } else if (msgContent instanceof GroupNotificationMessage) {
        content = new TranslatedGrpNtfMessage(msgContent);
    }
    return content;
}
 
开发者ID:rongcloud,项目名称:apicloud-module-imlib-android,代码行数:33,代码来源:TranslatedMessage.java

示例11: TranslatedContactNtfMessage

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
public TranslatedContactNtfMessage(MessageContent content) {
    ContactNotificationMessage msg = (ContactNotificationMessage)content;
    operation = msg.getOperation() == null ? "" : msg.getOperation();
    sourceUserId = msg.getSourceUserId() == null ? "" : msg.getSourceUserId();
    targetUserId = msg.getTargetUserId() == null ? "" : msg.getTargetUserId();
    message = msg.getMessage() == null ? "" : msg.getMessage();
    extra = msg.getExtra() == null ? "" : msg.getExtra();
}
 
开发者ID:rongcloud,项目名称:apicloud-module-imlib-android,代码行数:9,代码来源:TranslatedContactNtfMessage.java

示例12: bindView

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
@Override
public void bindView(View v, int position, ContactNotificationMessage content, UIMessage message) {
    ViewHolder viewHolder = (ViewHolder) v.getTag();

    if (content != null) {
        if (!TextUtils.isEmpty(content.getMessage()))
            viewHolder.contentTextView.setText(content.getMessage());
    }

}
 
开发者ID:birdcopy,项目名称:Android-Birdcopy-Application,代码行数:11,代码来源:ContactNotificationMessageProvider.java

示例13: onItemLongClick

import io.rong.message.ContactNotificationMessage; //导入依赖的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

示例14: getConversationPush

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
/**
 *
 */
private void getConversationPush() {

    if (getIntent() != null && getIntent().hasExtra("PUSH_CONVERSATIONTYPE") &&getIntent().hasExtra("PUSH_TARGETID") ) {

        final String conversationType  = getIntent().getStringExtra("PUSH_CONVERSATIONTYPE");
        final String targetId = getIntent().getStringExtra("PUSH_TARGETID");

        if (RongIM.getInstance() != null && RongIM.getInstance().getRongIMClient() != null) {

            RongIM.getInstance().getRongIMClient().getConversation(Conversation.ConversationType.valueOf(conversationType), targetId, new RongIMClient.ResultCallback<Conversation>() {
                @Override
                public void onSuccess(Conversation conversation) {

                    if (conversation != null) {

                        if (conversation.getLatestMessage() instanceof ContactNotificationMessage) {
                            //startActivity(new Intent(MainActivity.this, NewFriendListActivity.class));
                        } else {
                            Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon().appendPath("conversation")
                                    .appendPath(conversationType).appendQueryParameter("targetId", targetId).build();
                            Intent intent = new Intent(Intent.ACTION_VIEW);
                            intent.setData(uri);
                            startActivity(intent);
                        }
                    }
                }

                @Override
                public void onError(RongIMClient.ErrorCode e) {

                }
            });
        }
    }
}
 
开发者ID:birdcopy,项目名称:Android-Birdcopy-Application,代码行数:39,代码来源:MainActivity.java

示例15: bindView

import io.rong.message.ContactNotificationMessage; //导入依赖的package包/类
@Override
public void bindView(View v, int position, ContactNotificationMessage content, UIMessage message) {
    ViewHolder viewHolder = (ViewHolder) v.getTag();

    if (content != null) {
        if (!TextUtils.isEmpty(content.getMessage()))
            viewHolder.contentTextView.setText(content.getMessage());
    }


}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:12,代码来源:ContactNotificationMessageProvider.java


注:本文中的io.rong.message.ContactNotificationMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。