Auto-hide FAB on scroll (#435)

* feat(composeButton): hide fab on scroll
* feat(composeButton): hide when scrolling in profile fragment
* refactor(compose-fab): show fab after small scroll distance
* refactor(compose-fab): code cleanup
* feat(composeButton): hide when scrolling in profile
* fix: duplicate fab var
* feat(fab): show when scrolled to top
* add option to turn it off

---------

Co-authored-by: FineFindus <63370021+FineFindus@users.noreply.github.com>
This commit is contained in:
sk22
2023-02-17 13:20:22 +01:00
committed by GitHub
parent 1567e5aba4
commit d20f8669e8
6 changed files with 90 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ public class GlobalUserPreferences{
public static boolean bottomEncoding;
public static boolean collapseLongPosts;
public static boolean spectatorMode;
public static boolean autoHideFab;
public static String publishButtonText;
public static ThemePreference theme;
public static ColorPreference color;
@@ -91,6 +92,7 @@ public class GlobalUserPreferences{
bottomEncoding=prefs.getBoolean("bottomEncoding", false);
collapseLongPosts=prefs.getBoolean("collapseLongPosts", true);
spectatorMode=prefs.getBoolean("spectatorMode", false);
autoHideFab=prefs.getBoolean("autoHideFab", true);
publishButtonText=prefs.getString("publishButtonText", "");
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
recentLanguages=fromJson(prefs.getString("recentLanguages", null), recentLanguagesType, new HashMap<>());
@@ -131,6 +133,7 @@ public class GlobalUserPreferences{
.putBoolean("prefixRepliesWithRe", prefixRepliesWithRe)
.putBoolean("collapseLongPosts", collapseLongPosts)
.putBoolean("spectatorMode", spectatorMode)
.putBoolean("autoHideFab", autoHideFab)
.putString("publishButtonText", publishButtonText)
.putBoolean("bottomEncoding", bottomEncoding)
.putInt("theme", theme.ordinal())