From b1dd0e6e3c37cbdfa7737fd6a90f1cdc57393f6d Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Sat, 3 Apr 2021 20:41:35 +0900 Subject: [PATCH] Get tabOrderString always from settings, so that it's not stale if preferences were updated --- app/src/main/java/awais/instagrabber/utils/Utils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/utils/Utils.java b/app/src/main/java/awais/instagrabber/utils/Utils.java index e6824d84..ff79f67f 100644 --- a/app/src/main/java/awais/instagrabber/utils/Utils.java +++ b/app/src/main/java/awais/instagrabber/utils/Utils.java @@ -80,7 +80,6 @@ public final class Utils { private static int actionBarHeight; public static Handler applicationHandler; public static String cacheDir; - public static String tabOrderString; private static int defaultStatusBarColor; public static int convertDpToPx(final float dp) { @@ -469,7 +468,7 @@ public final class Utils { @NonNull private static List getCurrentOrderOfGraphNamesFromPref(@NonNull final String[] navGraphNames) { - tabOrderString = settingsHelper.getString(PreferenceKeys.PREF_TAB_ORDER); + final String tabOrderString = settingsHelper.getString(PreferenceKeys.PREF_TAB_ORDER); final List navGraphNameList = Arrays.asList(navGraphNames); if (TextUtils.isEmpty(tabOrderString)) { // Use top 5 entries for default list @@ -491,6 +490,7 @@ public final class Utils { } public static boolean isNavRootInCurrentTabs(final String navRootString) { + final String tabOrderString = settingsHelper.getString(PreferenceKeys.PREF_TAB_ORDER); if (navRootString == null || tabOrderString == null) return false; return tabOrderString.contains(navRootString); }