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


Java SessionActivity类代码示例

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


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

示例1: setAdapter

import com.lqr.wechat.ui.activity.SessionActivity; //导入依赖的package包/类
private void setAdapter() {
    if (mAdapter == null) {
        mAdapter = new LQRAdapterForRecyclerView<Groups>(mContext, mData, R.layout.item_contact) {
            @Override
            public void convert(LQRViewHolderForRecyclerView helper, Groups item, int position) {
                LQRNineGridImageView ngvi = helper.setViewVisibility(R.id.ngiv, View.VISIBLE)
                        .setViewVisibility(R.id.ivHeader, View.GONE)
                        .setText(R.id.tvName, item.getName())
                        .getView(R.id.ngiv);
                ngvi.setAdapter(mNgivAdapter);
                List<GroupMember> groupMembers = DBManager.getInstance().getGroupMembers(item.getGroupId());
                ngvi.setImagesData(groupMembers);
            }
        };
        mAdapter.setOnItemClickListener((lqrViewHolder, viewGroup, view, i) -> {
            Intent intent = new Intent(mContext, SessionActivity.class);
            intent.putExtra("sessionId", mData.get(i).getGroupId());
            intent.putExtra("sessionType", SessionActivity.SESSION_TYPE_GROUP);
            mContext.jumpToActivity(intent);
            mContext.finish();
        });
        getView().getRvGroupList().setAdapter(mAdapter);
    } else {
        mAdapter.notifyDataSetChangedWrapper();
    }
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:27,代码来源:GroupListAtPresenter.java

示例2: setOnClick

import com.lqr.wechat.ui.activity.SessionActivity; //导入依赖的package包/类
private void setOnClick(LQRViewHolderForRecyclerView helper, Message item, int position) {
    helper.getView(R.id.llError).setOnClickListener(v ->
            RongIMClient.getInstance().deleteMessages(new int[]{item.getMessageId()}, new RongIMClient.ResultCallback<Boolean>() {
                @Override
                public void onSuccess(Boolean aBoolean) {
                    mData.remove(position);
                    mPresenter.setAdapter();
                    MessageContent content = item.getContent();
                    if (content instanceof TextMessage) {
                        mPresenter.sendTextMsg(((TextMessage) content).getContent());
                    } else if (content instanceof ImageMessage) {
                        mPresenter.sendImgMsg(((ImageMessage) content).getThumUri(), ((ImageMessage) content).getLocalUri());
                    } else if (content instanceof FileMessage) {
                        mPresenter.sendFileMsg(new File(((FileMessage) content).getLocalPath().getPath()));
                    } else if (content instanceof VoiceMessage) {
                        VoiceMessage voiceMessage = (VoiceMessage) content;
                        mPresenter.sendAudioFile(voiceMessage.getUri(), voiceMessage.getDuration());
                    }
                }

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

                }
            })
    );
    helper.getView(R.id.ivAvatar).setOnClickListener(v -> {
        UserInfo userInfo = DBManager.getInstance().getUserInfo(item.getSenderUserId());
        if (userInfo != null) {
            Intent intent = new Intent(mContext, UserInfoActivity.class);
            intent.putExtra("userInfo", userInfo);
            ((SessionActivity) mContext).jumpToActivity(intent);
        }
    });
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:36,代码来源:SessionAdapter.java


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