Skip to content

Commit

Permalink
修复搜索框点击事件覆盖 bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonDevLifeLog committed Jan 8, 2020
1 parent 67f0a65 commit 9aded5b
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,13 @@ private void initMainCenterViews(Context context) {
etSearchHint.clearFocus();
etSearchHint.setFocusable(false);
etSearchHint.setOnClickListener(this);
} else {
etSearchHint.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
etSearchHint.setCursorVisible(true);
}
});
}
etSearchHint.setCursorVisible(false);
etSearchHint.setSingleLine(true);
Expand All @@ -575,12 +582,6 @@ private void initMainCenterViews(Context context) {
etSearchHint.addTextChangedListener(centerSearchWatcher);
etSearchHint.setOnFocusChangeListener(focusChangeListener);
etSearchHint.setOnEditorActionListener(editorActionListener);
etSearchHint.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
etSearchHint.setCursorVisible(true);
}
});
LayoutParams searchHintParams = new LayoutParams(MATCH_PARENT, MATCH_PARENT);
searchHintParams.addRule(RelativeLayout.END_OF, ivSearch.getId());
searchHintParams.addRule(RelativeLayout.START_OF, ivVoice.getId());
Expand Down

0 comments on commit 9aded5b

Please sign in to comment.