From dc0f942c9a372f7ca18a0f7b7a67d83bf3057f36 Mon Sep 17 00:00:00 2001 From: Jakob Nixdorf Date: Sun, 6 Aug 2017 17:43:53 +0200 Subject: [PATCH] Don't show the FloatingActionMenu when scrolling in search --- .../main/java/org/shadowice/flocke/andotp/MainActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java b/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java index ef4cd20b..50ce41b4 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java @@ -62,6 +62,7 @@ public class MainActivity extends BaseActivity private EntriesCardAdapter adapter; private FloatingActionMenu floatingActionMenu; + private SearchView searchView; private SimpleItemTouchHelperCallback touchHelperCallback; private SharedPreferences sharedPref; @@ -204,7 +205,8 @@ public class MainActivity extends BaseActivity if (dy > 0) { floatingActionMenu.hide(); } else { - floatingActionMenu.show(); + if (searchView == null || searchView.isIconified()) + floatingActionMenu.show(); } } }); @@ -318,7 +320,7 @@ public class MainActivity extends BaseActivity getMenuInflater().inflate(R.menu.menu_main, menu); MenuItem searchItem = menu.findItem(R.id.menu_search); - SearchView searchView = (SearchView) searchItem.getActionView(); + searchView = (SearchView) searchItem.getActionView(); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) {