本文整理汇总了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();
}
}
示例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);
}
});
}