From 1fe612f63f64700cfa51bd716dc1e6da263d9cf9 Mon Sep 17 00:00:00 2001 From: serso Date: Wed, 23 Mar 2016 21:56:44 +0100 Subject: [PATCH] Avoid using layouts --- .../android/calculator/CalculatorActivity.java | 2 +- .../solovyev/android/calculator/Preferences.java | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java index 8560c886..9842e7d6 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java @@ -110,7 +110,7 @@ public class CalculatorActivity extends BaseActivity implements SharedPreference private void updateModeMenuItem() { final Menu menu = toolbar.getMenu(); final MenuItem modeMenuItem = menu.findItem(R.id.menu_mode); - modeMenuItem.setTitle(getString(R.string.cpp_mode_status, getString(getActivityMode().menuName))); + modeMenuItem.setTitle(getString(R.string.cpp_mode_status, getString(getActivityMode().name))); } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/Preferences.java b/app/src/main/java/org/solovyev/android/calculator/Preferences.java index ef335909..118bfb99 100644 --- a/app/src/main/java/org/solovyev/android/calculator/Preferences.java +++ b/app/src/main/java/org/solovyev/android/calculator/Preferences.java @@ -136,7 +136,6 @@ public final class Preferences { Gui.keepScreenOn.tryPutDefault(preferences, editor); Gui.language.tryPutDefault(preferences, editor); - Graph.plotImag.tryPutDefault(preferences, editor); Calculations.calculateOnFly.tryPutDefault(preferences, editor); Calculations.preferredAngleUnits.tryPutDefault(preferences, editor); Calculations.preferredNumeralBase.tryPutDefault(preferences, editor); @@ -381,17 +380,14 @@ public final class Preferences { } public enum Mode { - engineer(R.string.p_layout_calculator, R.string.cpp_wizard_mode_engineer), - simple(R.string.p_layout_simple, R.string.cpp_wizard_mode_simple); + engineer(R.string.cpp_wizard_mode_engineer), + simple(R.string.cpp_wizard_mode_simple); @StringRes public final int name; - @StringRes - public final int menuName; - Mode(@StringRes int name, @StringRes int menuName) { + Mode(@StringRes int name) { this.name = name; - this.menuName = menuName; } } @@ -406,10 +402,7 @@ public final class Preferences { } } - public static class Graph { - public static final Preference plotImag = BooleanPreference.of("graph_plot_imag", false); - } - + @SuppressWarnings("unused") static class Deleted { static final Preference appVersion = IntegerPreference.of("application.version", DEF_VALUE); static final Preference feedbackWindowShown = BooleanPreference.of("feedback_window_shown", false); @@ -424,5 +417,6 @@ public final class Preferences { static final Preference showEqualsButton = BooleanPreference.of("showEqualsButton", true); static final Preference autoOrientation = BooleanPreference.of("autoOrientation", true); static final Preference startOnBoot = BooleanPreference.of("onscreen_start_on_boot", false); + static final Preference plotImag = BooleanPreference.of("graph_plot_imag", false); } }