Address @mauriciocolli suggestions in #2960

Simplify code to enable history button
pull/3128/head
Stypox 2020-02-22 11:34:08 +01:00
rodzic 6968dd266a
commit d65b8d7d18
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
2 zmienionych plików z 3 dodań i 11 usunięć

Wyświetl plik

@ -453,15 +453,9 @@ public class MainActivity extends AppCompatActivity {
NavigationHelper.openMainActivity(this);
}
if (sharedPreferences.getBoolean(Constants.KEY_ENABLE_WATCH_HISTORY, true)) {
if (DEBUG) Log.d(TAG, "do not show History-menu as its disabled in settings");
drawerItems.getMenu().findItem(ITEM_ID_HISTORY).setVisible(true);
}
if (!sharedPreferences.getBoolean(Constants.KEY_ENABLE_WATCH_HISTORY, true)) {
if (DEBUG) Log.d(TAG, "show History-menu as its enabled in settings");
drawerItems.getMenu().findItem(ITEM_ID_HISTORY).setVisible(false);
}
final boolean isHistoryEnabled = sharedPreferences.getBoolean(
getString(R.string.enable_watch_history_key), true);
drawerItems.getMenu().findItem(ITEM_ID_HISTORY).setVisible(isHistoryEnabled);
}
@Override

Wyświetl plik

@ -11,7 +11,5 @@ public class Constants {
public static final String KEY_THEME_CHANGE = "key_theme_change";
public static final String KEY_MAIN_PAGE_CHANGE = "key_main_page_change";
public static final String KEY_ENABLE_WATCH_HISTORY = "enable_watch_history";
public static final int NO_SERVICE_ID = -1;
}