Browse Source

Revert "Get tabOrderString always from settings, so that it's not stale if preferences were updated"

This reverts commit b1dd0e6e3c.
renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
e2c15e76b8
  1. 4
      app/src/main/java/awais/instagrabber/utils/Utils.java

4
app/src/main/java/awais/instagrabber/utils/Utils.java

@ -80,6 +80,7 @@ public final class Utils {
private static int actionBarHeight; private static int actionBarHeight;
public static Handler applicationHandler; public static Handler applicationHandler;
public static String cacheDir; public static String cacheDir;
public static String tabOrderString;
private static int defaultStatusBarColor; private static int defaultStatusBarColor;
public static int convertDpToPx(final float dp) { public static int convertDpToPx(final float dp) {
@ -468,7 +469,7 @@ public final class Utils {
@NonNull @NonNull
private static List<String> getCurrentOrderOfGraphNamesFromPref(@NonNull final String[] navGraphNames) { private static List<String> getCurrentOrderOfGraphNamesFromPref(@NonNull final String[] navGraphNames) {
final String tabOrderString = settingsHelper.getString(PreferenceKeys.PREF_TAB_ORDER);
tabOrderString = settingsHelper.getString(PreferenceKeys.PREF_TAB_ORDER);
final List<String> navGraphNameList = Arrays.asList(navGraphNames); final List<String> navGraphNameList = Arrays.asList(navGraphNames);
if (TextUtils.isEmpty(tabOrderString)) { if (TextUtils.isEmpty(tabOrderString)) {
// Use top 5 entries for default list // Use top 5 entries for default list
@ -490,7 +491,6 @@ public final class Utils {
} }
public static boolean isNavRootInCurrentTabs(final String navRootString) { public static boolean isNavRootInCurrentTabs(final String navRootString) {
final String tabOrderString = settingsHelper.getString(PreferenceKeys.PREF_TAB_ORDER);
if (navRootString == null || tabOrderString == null) return false; if (navRootString == null || tabOrderString == null) return false;
return tabOrderString.contains(navRootString); return tabOrderString.contains(navRootString);
} }

Loading…
Cancel
Save