Fixing up name of the setting, and making it disabled by default

This commit is contained in:
sk 2023-01-16 16:23:38 -03:00 committed by LucasGGamerM
parent 5b1188ce97
commit f1b0f828ac
3 changed files with 6 additions and 7 deletions

View File

@ -33,7 +33,7 @@ public class GlobalUserPreferences{
public static boolean relocatePublishButton; public static boolean relocatePublishButton;
public static boolean reduceMotion; public static boolean reduceMotion;
public static boolean keepOnlyLatestNotification; public static boolean keepOnlyLatestNotification;
public static boolean disableFab; public static boolean disableFabAutoHide;
public static String publishButtonText; public static String publishButtonText;
public static ThemePreference theme; public static ThemePreference theme;
public static ColorPreference color; public static ColorPreference color;
@ -73,7 +73,7 @@ public class GlobalUserPreferences{
enableDeleteNotifications=prefs.getBoolean("enableDeleteNotifications", true); enableDeleteNotifications=prefs.getBoolean("enableDeleteNotifications", true);
reduceMotion=prefs.getBoolean("reduceMotion", false); reduceMotion=prefs.getBoolean("reduceMotion", false);
keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false); keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false);
disableFab=prefs.getBoolean("disableFab", false); disableFabAutoHide=prefs.getBoolean("disableFabAutoHide", false);
theme=ThemePreference.values()[prefs.getInt("theme", 0)]; theme=ThemePreference.values()[prefs.getInt("theme", 0)];
recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>()); recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>());
recentEmojis=fromJson(prefs.getString("recentEmojis", "{}"), recentEmojisType, new HashMap<>()); recentEmojis=fromJson(prefs.getString("recentEmojis", "{}"), recentEmojisType, new HashMap<>());
@ -110,7 +110,7 @@ public class GlobalUserPreferences{
.putBoolean("enableDeleteNotifications", enableDeleteNotifications) .putBoolean("enableDeleteNotifications", enableDeleteNotifications)
.putBoolean("reduceMotion", reduceMotion) .putBoolean("reduceMotion", reduceMotion)
.putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification) .putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification)
.putBoolean("disableFab", disableFab) .putBoolean("disableFabAutoHide", disableFabAutoHide)
.putString("publishButtonText", publishButtonText) .putString("publishButtonText", publishButtonText)
.putInt("theme", theme.ordinal()) .putInt("theme", theme.ordinal())
.putString("color", color.name()) .putString("color", color.name())

View File

@ -13,7 +13,6 @@ import android.text.Layout;
import android.text.StaticLayout; import android.text.StaticLayout;
import android.text.TextPaint; import android.text.TextPaint;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowInsets; import android.view.WindowInsets;
@ -286,7 +285,7 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
if(currentPhotoViewer!=null) if(currentPhotoViewer!=null)
currentPhotoViewer.offsetView(-dx, -dy); currentPhotoViewer.offsetView(-dx, -dy);
if (fab!=null && !GlobalUserPreferences.disableFab) { if (fab!=null && GlobalUserPreferences.disableFabAutoHide) {
if (dy > 0 /*&& !isFirstLaunch*/) { if (dy > 0 /*&& !isFirstLaunch*/) {
if (isScrollingUp /*&& !isFirstLaunch*/) { if (isScrollingUp /*&& !isFirstLaunch*/) {
fab.setVisibility(View.INVISIBLE); fab.setVisibility(View.INVISIBLE);

View File

@ -210,8 +210,8 @@ public class SettingsFragment extends MastodonToolbarFragment{
GlobalUserPreferences.save(); GlobalUserPreferences.save();
needAppRestart=true; needAppRestart=true;
})); }));
items.add(new SwitchItem(R.string.mo_hide_compose_button_while_scrolling_setting, R.drawable.ic_fluent_edit_24_regular, GlobalUserPreferences.disableFab, i->{ items.add(new SwitchItem(R.string.mo_hide_compose_button_while_scrolling_setting, R.drawable.ic_fluent_edit_24_regular, GlobalUserPreferences.disableFabAutoHide, i->{
GlobalUserPreferences.disableFab=i.checked; GlobalUserPreferences.disableFabAutoHide =i.checked;
GlobalUserPreferences.save(); GlobalUserPreferences.save();
needAppRestart=true; needAppRestart=true;
})); }));