fixed search in abstractsearchablelistitem

This commit is contained in:
Daniel Gultsch 2018-02-16 14:57:49 +01:00
parent bf85d30421
commit bd90f2140d
3 changed files with 3 additions and 4 deletions

View File

@ -104,8 +104,7 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
getMenuInflater().inflate(R.menu.choose_contact, menu); getMenuInflater().inflate(R.menu.choose_contact, menu);
final MenuItem menuSearchView = menu.findItem(R.id.action_search); final MenuItem menuSearchView = menu.findItem(R.id.action_search);
final View mSearchView = menuSearchView.getActionView(); final View mSearchView = menuSearchView.getActionView();
mSearchEditText = (EditText) mSearchView mSearchEditText = (EditText) mSearchView.findViewById(R.id.search_field);
.findViewById(R.id.search_field);
mSearchEditText.addTextChangedListener(mSearchTextWatcher); mSearchEditText.addTextChangedListener(mSearchTextWatcher);
menuSearchView.setOnActionExpandListener(mOnActionExpandListener); menuSearchView.setOnActionExpandListener(mOnActionExpandListener);
return true; return true;

View File

@ -596,7 +596,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
menuHideOffline.setChecked(this.mHideOfflineContacts); menuHideOffline.setChecked(this.mHideOfflineContacts);
mMenuSearchView = menu.findItem(R.id.action_search); mMenuSearchView = menu.findItem(R.id.action_search);
mMenuSearchView.setOnActionExpandListener(mOnActionExpandListener); mMenuSearchView.setOnActionExpandListener(mOnActionExpandListener);
View mSearchView = MenuItemCompat.getActionView(mMenuSearchView); View mSearchView = mMenuSearchView.getActionView();
mSearchEditText = (EditText) mSearchView.findViewById(R.id.search_field); mSearchEditText = (EditText) mSearchView.findViewById(R.id.search_field);
mSearchEditText.addTextChangedListener(mSearchTextWatcher); mSearchEditText.addTextChangedListener(mSearchTextWatcher);
mSearchEditText.setOnEditorActionListener(mSearchDone); mSearchEditText.setOnEditorActionListener(mSearchDone);

View File

@ -4,7 +4,7 @@
<item <item
android:id="@+id/action_search" android:id="@+id/action_search"
android:actionLayout="@layout/actionview_search" app:actionLayout="@layout/actionview_search"
android:icon="?attr/icon_search" android:icon="?attr/icon_search"
app:showAsAction="collapseActionView|always" app:showAsAction="collapseActionView|always"
android:title="@string/search"/> android:title="@string/search"/>