From 5ba8937f0649cfd902120722ba52d182e768c3ed Mon Sep 17 00:00:00 2001 From: serso Date: Thu, 7 Jan 2016 20:29:04 +0100 Subject: [PATCH] Method removed --- .../calculator/AndroidCalculatorEditorView.java | 2 +- .../org/solovyev/android/calculator/Preferences.java | 12 ++---------- .../calculator/about/CalculatorAboutFragment.java | 2 +- .../plot/AbstractCalculatorPlotFragment.java | 4 ++-- .../android/calculator/wizard/FinalWizardStep.java | 2 +- .../wizard/OnScreenCalculatorWizardStep.java | 2 +- .../android/calculator/wizard/WelcomeWizardStep.java | 2 +- 7 files changed, 9 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java b/app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java index ad5c345d..956398bb 100644 --- a/app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java +++ b/app/src/main/java/org/solovyev/android/calculator/AndroidCalculatorEditorView.java @@ -119,7 +119,7 @@ public class AndroidCalculatorEditorView extends EditText implements CalculatorE try { editorView.viewStateChange = true; editorView.viewState = viewState; - if (App.getTheme().isLight() && getContext() instanceof CalculatorOnscreenService) { + if (App.getTheme().light && getContext() instanceof CalculatorOnscreenService) { // don't need formatting editorView.setText(viewState.getText()); } else { 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 dfa766ce..2024b568 100644 --- a/app/src/main/java/org/solovyev/android/calculator/Preferences.java +++ b/app/src/main/java/org/solovyev/android/calculator/Preferences.java @@ -303,7 +303,7 @@ public final class Preferences { metro_purple_theme(R.style.cpp_metro_purple_theme), metro_green_theme(R.style.cpp_metro_green_theme), material_theme(R.style.Cpp_Theme_Material), - material_light_theme(R.style.Cpp_Theme_Material_Light, R.style.Cpp_Theme_Wizard_Light, R.style.Cpp_Theme_Dialog_Material_Light, true),; + material_light_theme(R.style.Cpp_Theme_Material_Light, R.style.Cpp_Theme_Wizard_Light, R.style.Cpp_Theme_Dialog_Material_Light); private static final SparseArray textColors = new SparseArray<>(); @@ -317,14 +317,10 @@ public final class Preferences { } Theme(@StyleRes int themeId, @StyleRes int wizardThemeId, int dialogThemeId) { - this(themeId, wizardThemeId, dialogThemeId, false); - } - - Theme(@StyleRes int themeId, @StyleRes int wizardThemeId, int dialogThemeId, boolean light) { this.themeId = themeId; this.wizardThemeId = wizardThemeId; this.dialogThemeId = dialogThemeId; - this.light = light; + this.light = themeId == R.style.Cpp_Theme_Material_Light; } public int getThemeId() { @@ -356,10 +352,6 @@ public final class Preferences { } return textColor; } - - public boolean isLight() { - return themeId == R.style.Cpp_Theme_Material_Light; - } } public enum Layout { diff --git a/app/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutFragment.java b/app/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutFragment.java index d985dd62..9d3432c0 100644 --- a/app/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/about/CalculatorAboutFragment.java @@ -51,7 +51,7 @@ public class CalculatorAboutFragment extends CalculatorFragment { public void onViewCreated(View root, Bundle savedInstanceState) { super.onViewCreated(root, savedInstanceState); - if (App.getTheme().isLight()) { + if (App.getTheme().light) { final ImageView image = (ImageView) root.findViewById(R.id.about_image); image.setImageResource(R.drawable.logo_wizard_light); } diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java index f8936455..e3cef31f 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/AbstractCalculatorPlotFragment.java @@ -117,9 +117,9 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment public void onCreate(@Nullable Bundle in) { super.onCreate(in); if (isPaneFragment()) { - bgColor = getResources().getColor(App.getTheme().isLight() ? R.color.cpp_pane_bg_light : R.color.cpp_pane_bg); + bgColor = getResources().getColor(App.getTheme().light ? R.color.cpp_pane_bg_light : R.color.cpp_pane_bg); } else { - bgColor = getResources().getColor(App.getTheme().isLight() ? R.color.cpp_main_bg_light : R.color.cpp_main_bg); + bgColor = getResources().getColor(App.getTheme().light ? R.color.cpp_main_bg_light : R.color.cpp_main_bg); } setHasOptionsMenu(true); } diff --git a/app/src/main/java/org/solovyev/android/calculator/wizard/FinalWizardStep.java b/app/src/main/java/org/solovyev/android/calculator/wizard/FinalWizardStep.java index 8e835eb5..700f539d 100644 --- a/app/src/main/java/org/solovyev/android/calculator/wizard/FinalWizardStep.java +++ b/app/src/main/java/org/solovyev/android/calculator/wizard/FinalWizardStep.java @@ -17,7 +17,7 @@ public class FinalWizardStep extends WizardFragment { @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - if (App.getTheme().isLight()) { + if (App.getTheme().light) { final TextView message = (TextView) view.findViewById(R.id.wizard_final_message); message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_action_done_light, 0, 0); } diff --git a/app/src/main/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStep.java b/app/src/main/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStep.java index 75dad526..bdfb1598 100644 --- a/app/src/main/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStep.java +++ b/app/src/main/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStep.java @@ -55,7 +55,7 @@ public class OnScreenCalculatorWizardStep extends WizardFragment implements Comp checkbox.setChecked(enabled); checkbox.setOnCheckedChangeListener(this); - if (App.getTheme().isLight()) { + if (App.getTheme().light) { final TextView message = (TextView) root.findViewById(R.id.wizard_onscreen_message); message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.logo_wizard_window_light, 0, 0); } diff --git a/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java b/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java index 2f223249..98987ebd 100644 --- a/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java +++ b/app/src/main/java/org/solovyev/android/calculator/wizard/WelcomeWizardStep.java @@ -41,7 +41,7 @@ public final class WelcomeWizardStep extends WizardFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = super.onCreateView(inflater, container, savedInstanceState); - if (App.getTheme().isLight()) { + if (App.getTheme().light) { final TextView message = (TextView) view.findViewById(R.id.wizard_welcome_message); message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.logo_wizard_light, 0, 0); }