fix for simple layout
This commit is contained in:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user