From 6abe02390e6d391d7147c05a0d2cbfc1c5126b68 Mon Sep 17 00:00:00 2001 From: ningwenqiang Date: Tue, 27 Aug 2024 14:22:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=A2=9E=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E7=AD=9B=E9=80=89=20=E7=BB=86=E8=8A=82=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter/MainConversationListAdapter.java | 2 ++ .../views/MsgChatTypeSelectPoPupView.java | 14 +++++---- .../res/layout/view_msg_select_chat_type.xml | 31 +++++++++++-------- .../main/views/MainMessageViewHolder.java | 6 +++- 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/adapter/MainConversationListAdapter.java b/common/src/main/java/com/yunbao/common/adapter/MainConversationListAdapter.java index a639fd5ea..008587ef0 100644 --- a/common/src/main/java/com/yunbao/common/adapter/MainConversationListAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/MainConversationListAdapter.java @@ -75,6 +75,8 @@ public class MainConversationListAdapter extends ConversationListAdapter { } public void setFilter(int mFilter) { + if (this.mFilter == mFilter) + return; this.mFilter = mFilter; super.setDataCollection(FilterData(mFilter, allDataList)); } diff --git a/common/src/main/java/com/yunbao/common/views/MsgChatTypeSelectPoPupView.java b/common/src/main/java/com/yunbao/common/views/MsgChatTypeSelectPoPupView.java index 183bc5b84..4165676c4 100644 --- a/common/src/main/java/com/yunbao/common/views/MsgChatTypeSelectPoPupView.java +++ b/common/src/main/java/com/yunbao/common/views/MsgChatTypeSelectPoPupView.java @@ -87,21 +87,23 @@ public class MsgChatTypeSelectPoPupView extends AttachPopupView implements andro @Override public void onClick(android.view.View v) { if (v.getId()==R.id.chatTypeImg1){ - mResultCallBack.callBack(MainConversationListAdapter.FILTER_ALL); + mResultCallBack.callBack(MainConversationListAdapter.FILTER_ALL,chatTypeTv1.getText().toString()); }else if (v.getId()==R.id.chatTypeImg2){ - mResultCallBack.callBack(MainConversationListAdapter.FILTER_ONLINE); + mResultCallBack.callBack(MainConversationListAdapter.FILTER_ONLINE,chatTypeTv2.getText().toString()); }else if (v.getId()==R.id.chatTypeImg3){ - mResultCallBack.callBack(MainConversationListAdapter.FILTER_OFFLINE); + mResultCallBack.callBack(MainConversationListAdapter.FILTER_OFFLINE,chatTypeTv3.getText().toString()); }else if (v.getId()==R.id.chatTypeImg4){ - mResultCallBack.callBack(MainConversationListAdapter.FILTER_READ); + mResultCallBack.callBack(MainConversationListAdapter.FILTER_READ,chatTypeTv4.getText().toString()); }else if (v.getId()==R.id.chatTypeImg5){ - mResultCallBack.callBack(MainConversationListAdapter.FILTER_UNREAD); + mResultCallBack.callBack(MainConversationListAdapter.FILTER_UNREAD,chatTypeTv5.getText().toString()); } dismiss(); } + + public interface ResultCallBack { - void callBack(int i); + void callBack(int i,String string); } } diff --git a/common/src/main/res/layout/view_msg_select_chat_type.xml b/common/src/main/res/layout/view_msg_select_chat_type.xml index 2ae32ab29..644c8b8cf 100644 --- a/common/src/main/res/layout/view_msg_select_chat_type.xml +++ b/common/src/main/res/layout/view_msg_select_chat_type.xml @@ -2,7 +2,7 @@ @@ -13,11 +13,12 @@ android:layout_marginStart="20dp" android:layout_marginTop="20dp" android:layout_weight="1" + android:text="@string/all_chats" android:textColor="#777777" - tools:textColor="@color/colorMainTab" + android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - android:text="@string/all_chats" /> + tools:textColor="@color/colorMainTab" /> + app:layout_constraintTop_toTopOf="@+id/chatTypeTv1" + tools:src="@mipmap/ic_chat_type_select" /> + app:layout_constraintTop_toBottomOf="@+id/chatTypeTv1" /> + app:layout_constraintTop_toBottomOf="@+id/chatTypeTv2" /> + app:layout_constraintTop_toBottomOf="@+id/chatTypeTv3" /> + app:layout_constraintTop_toBottomOf="@+id/chatTypeTv4" />