diff --git a/CHANGELOG.md b/CHANGELOG.md index 45e01d6a..4f256056 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * New feature: show a warning about backups on the first launch * Style/UI: rename Export and Import to Backup and Restore * Bug fix: don't require device authentication again after screen rotation (Issue #7) + * Bug fix: hide the FloatingActionMenu on scroll (Issue #8) * Bug fix: rename the apps launcher icon to "andOTP" (Issue #6) * Code: lots of internal refactoring 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 f8a99705..ba1f61ae 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/MainActivity.java @@ -192,6 +192,19 @@ public class MainActivity extends AppCompatActivity { adapter = new EntriesCardAdapter(this); recList.setAdapter(adapter); + recList.addOnScrollListener(new RecyclerView.OnScrollListener() { + @Override + public void onScrolled(RecyclerView recyclerView, int dx, int dy) { + super.onScrolled(recyclerView, dx, dy); + + if (dy > 0) { + floatingActionMenu.hide(); + } else { + floatingActionMenu.show(); + } + } + }); + touchHelperCallback = new SimpleItemTouchHelperCallback(adapter); ItemTouchHelper touchHelper = new ItemTouchHelper(touchHelperCallback); touchHelper.attachToRecyclerView(recList);