Method removed

This commit is contained in:
serso 2016-01-07 20:29:04 +01:00
parent 781f3d5648
commit 5ba8937f06
7 changed files with 9 additions and 17 deletions

View File

@ -119,7 +119,7 @@ public class AndroidCalculatorEditorView extends EditText implements CalculatorE
try { try {
editorView.viewStateChange = true; editorView.viewStateChange = true;
editorView.viewState = viewState; editorView.viewState = viewState;
if (App.getTheme().isLight() && getContext() instanceof CalculatorOnscreenService) { if (App.getTheme().light && getContext() instanceof CalculatorOnscreenService) {
// don't need formatting // don't need formatting
editorView.setText(viewState.getText()); editorView.setText(viewState.getText());
} else { } else {

View File

@ -303,7 +303,7 @@ public final class Preferences {
metro_purple_theme(R.style.cpp_metro_purple_theme), metro_purple_theme(R.style.cpp_metro_purple_theme),
metro_green_theme(R.style.cpp_metro_green_theme), metro_green_theme(R.style.cpp_metro_green_theme),
material_theme(R.style.Cpp_Theme_Material), 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<TextColor> textColors = new SparseArray<>(); private static final SparseArray<TextColor> textColors = new SparseArray<>();
@ -317,14 +317,10 @@ public final class Preferences {
} }
Theme(@StyleRes int themeId, @StyleRes int wizardThemeId, int dialogThemeId) { 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.themeId = themeId;
this.wizardThemeId = wizardThemeId; this.wizardThemeId = wizardThemeId;
this.dialogThemeId = dialogThemeId; this.dialogThemeId = dialogThemeId;
this.light = light; this.light = themeId == R.style.Cpp_Theme_Material_Light;
} }
public int getThemeId() { public int getThemeId() {
@ -356,10 +352,6 @@ public final class Preferences {
} }
return textColor; return textColor;
} }
public boolean isLight() {
return themeId == R.style.Cpp_Theme_Material_Light;
}
} }
public enum Layout { public enum Layout {

View File

@ -51,7 +51,7 @@ public class CalculatorAboutFragment extends CalculatorFragment {
public void onViewCreated(View root, Bundle savedInstanceState) { public void onViewCreated(View root, Bundle savedInstanceState) {
super.onViewCreated(root, savedInstanceState); super.onViewCreated(root, savedInstanceState);
if (App.getTheme().isLight()) { if (App.getTheme().light) {
final ImageView image = (ImageView) root.findViewById(R.id.about_image); final ImageView image = (ImageView) root.findViewById(R.id.about_image);
image.setImageResource(R.drawable.logo_wizard_light); image.setImageResource(R.drawable.logo_wizard_light);
} }

View File

@ -117,9 +117,9 @@ public abstract class AbstractCalculatorPlotFragment extends CalculatorFragment
public void onCreate(@Nullable Bundle in) { public void onCreate(@Nullable Bundle in) {
super.onCreate(in); super.onCreate(in);
if (isPaneFragment()) { 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 { } 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); setHasOptionsMenu(true);
} }

View File

@ -17,7 +17,7 @@ public class FinalWizardStep extends WizardFragment {
@Override @Override
public void onViewCreated(View view, Bundle savedInstanceState) { public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
if (App.getTheme().isLight()) { if (App.getTheme().light) {
final TextView message = (TextView) view.findViewById(R.id.wizard_final_message); final TextView message = (TextView) view.findViewById(R.id.wizard_final_message);
message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_action_done_light, 0, 0); message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_action_done_light, 0, 0);
} }

View File

@ -55,7 +55,7 @@ public class OnScreenCalculatorWizardStep extends WizardFragment implements Comp
checkbox.setChecked(enabled); checkbox.setChecked(enabled);
checkbox.setOnCheckedChangeListener(this); checkbox.setOnCheckedChangeListener(this);
if (App.getTheme().isLight()) { if (App.getTheme().light) {
final TextView message = (TextView) root.findViewById(R.id.wizard_onscreen_message); final TextView message = (TextView) root.findViewById(R.id.wizard_onscreen_message);
message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.logo_wizard_window_light, 0, 0); message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.logo_wizard_window_light, 0, 0);
} }

View File

@ -41,7 +41,7 @@ public final class WelcomeWizardStep extends WizardFragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = super.onCreateView(inflater, container, 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); final TextView message = (TextView) view.findViewById(R.id.wizard_welcome_message);
message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.logo_wizard_light, 0, 0); message.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.logo_wizard_light, 0, 0);
} }