fix for simple layout

This commit is contained in:
Sergey Solovyev
2013-06-25 13:26:45 +04:00
parent 334470bce4
commit 9399172ff1
6 changed files with 10 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ public class CalculatorDisplayFragment extends SherlockFragment {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getActivity());
final CalculatorPreferences.Gui.Layout layout = CalculatorPreferences.Gui.getLayout(prefs);
if (layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile) {
if (!layout.isOptimized()) {
fragmentHelper = CalculatorApplication.getInstance().createFragmentHelper(R.layout.cpp_app_display_mobile, R.string.result);
} else {
fragmentHelper = CalculatorApplication.getInstance().createFragmentHelper(R.layout.cpp_app_display, R.string.result);

View File

@@ -52,7 +52,7 @@ public class CalculatorEditorFragment extends SherlockFragment {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.getActivity());
final CalculatorPreferences.Gui.Layout layout = CalculatorPreferences.Gui.getLayout(prefs);
if (layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile) {
if (!layout.isOptimized()) {
fragmentHelper = CalculatorApplication.getInstance().createFragmentHelper(R.layout.cpp_app_editor_mobile, R.string.editor);
} else {
fragmentHelper = CalculatorApplication.getInstance().createFragmentHelper(R.layout.cpp_app_editor, R.string.editor);

View File

@@ -31,7 +31,7 @@ public class CalculatorKeyboardFragment extends SherlockFragment implements Shar
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this.getActivity());
final CalculatorPreferences.Gui.Layout layout = CalculatorPreferences.Gui.getLayout(preferences);
if (layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile) {
if (!layout.isOptimized()) {
fragmentHelper = CalculatorApplication.getInstance().createFragmentHelper(R.layout.cpp_app_keyboard_mobile);
} else {
fragmentHelper = CalculatorApplication.getInstance().createFragmentHelper(R.layout.cpp_app_keyboard);

View File

@@ -49,16 +49,10 @@ enum CalculatorLayout {
@Nonnull
static CalculatorLayout fromGuiLayout(@Nonnull CalculatorPreferences.Gui.Layout layout) {
switch (layout) {
case main_calculator:
case main_cellphone:
case simple:
return optimized;
case main_calculator_mobile:
case simple_mobile:
return big_buttons;
default:
return getDefaultLayout();
if(layout.isOptimized()) {
return optimized;
} else {
return big_buttons;
}
}
}