Skip to content

Commit ca154b4

Browse files
committed
没有搜索条件,点击重置,不处理
1 parent 921e3ed commit ca154b4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/src/main/java/net/coding/program/common/DrawerLayoutHelper.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public void onDrawerStateChanged(int newState) {
8585

8686

8787
reset.setOnClickListener(v -> {
88-
if (filterListener != null) {
88+
//假如有搜索条件才重置
89+
if (filterListener != null && (!TextUtils.isEmpty(filterModel.keyword) || !TextUtils.isEmpty(filterModel.label) || filterModel.status != 0)) {
8990
filterListener.callback(new FilterModel());
9091
}
9192
dismiss();
@@ -113,9 +114,9 @@ public boolean onTouch(View v, MotionEvent event) {
113114
private EditText initKeyword(FilterListener filterListener) {
114115
EditText etSearch = (EditText) drawerLayout.findViewById(R.id.et_search);
115116

116-
if (mFilterModel != null && !TextUtils.isEmpty(mFilterModel.keyword)) {
117-
mFilterModel.keyword = "";
118-
}
117+
// if (mFilterModel != null && !TextUtils.isEmpty(mFilterModel.keyword)) {
118+
// mFilterModel.keyword = "";
119+
// }
119120
etSearch.setText("");
120121
etSearch.setOnEditorActionListener((v, actionId, event) -> {
121122
if (actionId == EditorInfo.IME_ACTION_SEARCH) {

0 commit comments

Comments
 (0)