Address @mauriciocolli suggestions in #2960

Simplify code to enable history button
This commit is contained in:
Stypox 2020-02-22 11:34:08 +01:00
parent 6968dd266a
commit d65b8d7d18
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
2 changed files with 3 additions and 11 deletions

View file

@ -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