mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-28 11:41:00 +00:00
Clear search when opening the drawer
Before this change opening the drawer while a filter was active would hide the search bar but keep the conversation list filtered, so there was no indication of an active filter.
This commit is contained in:
parent
c719a48a2c
commit
7208018097
@ -325,6 +325,7 @@ public class ConversationListActivity extends PassphraseRequiredSherlockFragment
|
|||||||
public void onDrawerOpened(View drawerView) {
|
public void onDrawerOpened(View drawerView) {
|
||||||
|
|
||||||
super.onDrawerOpened(drawerView);
|
super.onDrawerOpened(drawerView);
|
||||||
|
fragment.resetQueryFilter();
|
||||||
|
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ import org.thoughtcrime.securesms.database.loaders.ConversationListLoader;
|
|||||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||||
import org.thoughtcrime.securesms.util.Dialogs;
|
import org.thoughtcrime.securesms.util.Dialogs;
|
||||||
|
import org.whispersystems.textsecure.util.Util;
|
||||||
|
|
||||||
import com.actionbarsherlock.app.SherlockListFragment;
|
import com.actionbarsherlock.app.SherlockListFragment;
|
||||||
import com.actionbarsherlock.view.ActionMode;
|
import com.actionbarsherlock.view.ActionMode;
|
||||||
@ -125,13 +126,23 @@ public class ConversationListFragment extends SherlockListFragment
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setQueryFilter(String query) {
|
||||||
|
this.queryFilter = query;
|
||||||
|
getLoaderManager().restartLoader(0, null, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetQueryFilter() {
|
||||||
|
if (!Util.isEmpty(this.queryFilter)) {
|
||||||
|
setQueryFilter("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void initializeSearch(SearchView searchView) {
|
private void initializeSearch(SearchView searchView) {
|
||||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
if (isAdded()) {
|
if (isAdded()) {
|
||||||
ConversationListFragment.this.queryFilter = query;
|
setQueryFilter(query);
|
||||||
ConversationListFragment.this.getLoaderManager().restartLoader(0, null, ConversationListFragment.this);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user