From 1442d052625d4c597299ba717af3855e54f74557 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 21 Mar 2024 15:04:08 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=88=86=E4=BA=AB=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/ui/AppInternalShareDialog.java | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Share/src/main/java/com/yunbao/share/ui/AppInternalShareDialog.java b/Share/src/main/java/com/yunbao/share/ui/AppInternalShareDialog.java index 6ee31a9c2..3eddcabad 100644 --- a/Share/src/main/java/com/yunbao/share/ui/AppInternalShareDialog.java +++ b/Share/src/main/java/com/yunbao/share/ui/AppInternalShareDialog.java @@ -1,6 +1,8 @@ package com.yunbao.share.ui; import android.content.Context; +import android.text.Editable; +import android.text.TextWatcher; import android.widget.EditText; import androidx.annotation.NonNull; @@ -10,6 +12,7 @@ import com.lxj.xpopup.XPopup; import com.pdlive.shayu.R; import com.yunbao.common.dialog.AbsDialogFullScreenPopupWindow; import com.yunbao.common.interfaces.OnItemClickListener; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.share.adapters.InternalShareAdapter; @@ -65,7 +68,7 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow { dismiss(); }); findViewById(R.id.btn_share).setOnClickListener(view -> { - if(adapter.getSelectPosition()==-1){ + if (adapter.getSelectPosition() == -1) { ToastUtil.show(R.string.dialog_share_failure_not_select); return; } @@ -82,6 +85,37 @@ public class AppInternalShareDialog extends AbsDialogFullScreenPopupWindow { initRefreshView(); refreshData(); + search.addTextChangedListener(new TextWatcher() { + List searchList = new ArrayList<>(); + + @Override + public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { + + } + + @Override + public void afterTextChanged(Editable editable) { + String key = editable.toString(); + searchList.clear(); + if (StringUtil.isEmpty(key)) { + adapter.setList(listData); + return; + } + for (SingleConversation datum : listData) { + if (datum.mCore.getConversationTitle().contains(key)) { + searchList.add(datum); + } + } + adapter.setList(searchList); + + } + + }); }