|
@@ -125,14 +125,12 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
};
|
|
|
|
|
|
protected FrameLayout mCustomView;
|
|
|
- protected NoticeLayout mGroupApplyLayout;
|
|
|
protected View mRecordingGroup;
|
|
|
protected ImageView mRecordingIcon;
|
|
|
protected TextView mRecordingTips;
|
|
|
private TitleBarLayout mTitleBar;
|
|
|
private MessageRecyclerView mMessageRecyclerView;
|
|
|
private InputView mInputView;
|
|
|
- private NoticeLayout mNoticeLayout;
|
|
|
private LinearLayout mJumpMessageLayout;
|
|
|
private ImageView mArrowImageView;
|
|
|
private TextView mJumpMessageTextView;
|
|
@@ -140,10 +138,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
private boolean mJumpGroupAtInfoShow;
|
|
|
private boolean mClickLastMessageShow;
|
|
|
|
|
|
- private LinearLayout mForwardLayout;
|
|
|
- private View mForwardOneButton;
|
|
|
- private View mForwardMergeButton;
|
|
|
- private View mDeleteButton;
|
|
|
private long lastTypingTime = 0;
|
|
|
private boolean isSupportTyping = false;
|
|
|
|
|
@@ -174,16 +168,9 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
mRecordingGroup = findViewById(R.id.voice_recording_view);
|
|
|
mRecordingIcon = findViewById(R.id.recording_icon);
|
|
|
mRecordingTips = findViewById(R.id.recording_tips);
|
|
|
- mGroupApplyLayout = findViewById(R.id.chat_group_apply_layout);
|
|
|
- mNoticeLayout = findViewById(R.id.chat_notice_layout);
|
|
|
mCustomView = findViewById(R.id.custom_layout);
|
|
|
mCustomView.setVisibility(GONE);
|
|
|
|
|
|
- mForwardLayout = findViewById(R.id.forward_layout);
|
|
|
- mForwardOneButton = findViewById(R.id.forward_one_by_one_button);
|
|
|
- mForwardMergeButton = findViewById(R.id.forward_merge_button);
|
|
|
- mDeleteButton = findViewById(R.id.delete_button);
|
|
|
-
|
|
|
mJumpMessageLayout = findViewById(R.id.jump_message_layout);
|
|
|
mJumpMessageTextView = findViewById(R.id.jump_message_content);
|
|
|
mArrowImageView = findViewById(R.id.arrow_icon);
|
|
@@ -337,21 +324,9 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
return;
|
|
|
}
|
|
|
mInputView.setChatInfo(chatInfo);
|
|
|
- String chatTitle = chatInfo.getChatName();
|
|
|
setChatName();
|
|
|
setChatHandler();
|
|
|
|
|
|
- if (!TUIChatUtils.isC2CChat(chatInfo.getType())) {
|
|
|
- loadApplyList();
|
|
|
- mGroupApplyLayout.setOnNoticeClickListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- Bundle bundle = new Bundle();
|
|
|
- bundle.putString(TUIChatConstants.GROUP_ID, chatInfo.getId());
|
|
|
- TUICore.startActivity(getContext(), "GroupApplyManagerActivity", bundle);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
mMessageRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
|
|
|
@Override
|
|
|
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
|
|
@@ -493,7 +468,7 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
|
|
|
@Override
|
|
|
public void onApplied(int size) {
|
|
|
- ChatView.this.onApplied(size);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -516,23 +491,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void loadApplyList() {
|
|
|
- presenter.loadApplyList(new IUIKitCallback<List<GroupApplyInfo>>() {
|
|
|
- @Override
|
|
|
- public void onSuccess(List<GroupApplyInfo> data) {
|
|
|
- if (data != null && data.size() > 0) {
|
|
|
- mGroupApplyLayout.getContent().setText(getContext().getString(R.string.group_apply_tips, data.size()));
|
|
|
- mGroupApplyLayout.setVisibility(View.VISIBLE);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onError(String module, int errCode, String errMsg) {
|
|
|
- TUIChatLog.e(TAG, "loadApplyList onError: " + errMsg);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
public void onExitChat() {
|
|
|
if (getContext() instanceof Activity) {
|
|
|
((Activity) getContext()).finish();
|
|
@@ -547,15 +505,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
getTitleBar().setTitle(newName, ITitleBarLayout.Position.MIDDLE);
|
|
|
}
|
|
|
|
|
|
- public void onApplied(int size) {
|
|
|
- if (size <= 0) {
|
|
|
- mGroupApplyLayout.setVisibility(View.GONE);
|
|
|
- } else {
|
|
|
- mGroupApplyLayout.getContent().setText(getContext().getString(R.string.group_apply_tips, size));
|
|
|
- mGroupApplyLayout.setVisibility(View.VISIBLE);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public void loadMessages(TUIMessageBean lastMessage, int type) {
|
|
|
if (presenter != null) {
|
|
|
presenter.loadMessage(type, lastMessage);
|
|
@@ -571,22 +520,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public LinearLayout getForwardLayout() {
|
|
|
- return mForwardLayout;
|
|
|
- }
|
|
|
-
|
|
|
- public View getForwardOneButton() {
|
|
|
- return mForwardOneButton;
|
|
|
- }
|
|
|
-
|
|
|
- public View getDeleteButton() {
|
|
|
- return mDeleteButton;
|
|
|
- }
|
|
|
-
|
|
|
- public View getForwardMergeButton() {
|
|
|
- return mForwardMergeButton;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public InputView getInputLayout() {
|
|
|
return mInputView;
|
|
@@ -597,11 +530,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
return mMessageRecyclerView;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public NoticeLayout getNoticeLayout() {
|
|
|
- return mNoticeLayout;
|
|
|
- }
|
|
|
-
|
|
|
public FrameLayout getCustomView() {
|
|
|
return mCustomView;
|
|
|
}
|
|
@@ -1024,8 +952,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- getForwardLayout().setVisibility(GONE);
|
|
|
getInputLayout().setVisibility(VISIBLE);
|
|
|
}
|
|
|
|
|
@@ -1052,34 +978,6 @@ public class ChatView extends LinearLayout implements IChatLayout {
|
|
|
}
|
|
|
});
|
|
|
getInputLayout().setVisibility(GONE);
|
|
|
- getForwardLayout().setVisibility(VISIBLE);
|
|
|
- getForwardOneButton().setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- showForwardDialog(true, true);
|
|
|
- }
|
|
|
- });
|
|
|
- getForwardMergeButton().setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- showForwardDialog(true, false);
|
|
|
- }
|
|
|
- });
|
|
|
- getDeleteButton().setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- List<TUIMessageBean> msgIds = mAdapter.getSelectedItem();
|
|
|
-
|
|
|
- if (msgIds == null || msgIds.isEmpty()) {
|
|
|
- ToastUtil.toastShortMessage("please select message!");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- deleteMessageInfos(msgIds);
|
|
|
-
|
|
|
- resetForwardState(leftTitle.toString());
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
private void showForwardDialog(boolean isMultiSelect, boolean isOneByOne) {
|