fix for simple layout
This commit is contained in:
parent
334470bce4
commit
9399172ff1
@ -180,7 +180,7 @@ public class AndroidCalculatorDisplayView extends AutoResizeTextView implements
|
||||
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
final CalculatorPreferences.Gui.Layout layout = CalculatorPreferences.Gui.getLayout(preferences);
|
||||
|
||||
if (layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile) {
|
||||
if (!layout.isOptimized()) {
|
||||
setTextSize(TypedValue.COMPLEX_UNIT_SP, getResources().getDimension(R.dimen.cpp_display_text_size_mobile));
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public final class CalculatorButtons {
|
||||
public static void processButtons(@Nonnull CalculatorPreferences.Gui.Theme theme,
|
||||
@Nonnull CalculatorPreferences.Gui.Layout layout,
|
||||
@Nonnull View root) {
|
||||
if (layout == CalculatorPreferences.Gui.Layout.main_calculator_mobile) {
|
||||
if (!layout.isOptimized()) {
|
||||
|
||||
final float textSize = root.getContext().getResources().getDimension(R.dimen.cpp_keyboard_button_text_size_mobile);
|
||||
|
||||
@ -70,7 +70,7 @@ public final class CalculatorButtons {
|
||||
preferences = preferences == null ? PreferenceManager.getDefaultSharedPreferences(activity) : preferences;
|
||||
|
||||
final boolean large = Views.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE, activity.getResources().getConfiguration()) &&
|
||||
CalculatorPreferences.Gui.getLayout(preferences) != CalculatorPreferences.Gui.Layout.main_calculator_mobile;
|
||||
CalculatorPreferences.Gui.getLayout(preferences).isOptimized();
|
||||
|
||||
if (!large) {
|
||||
if (Views.getScreenOrientation(activity) == Configuration.ORIENTATION_PORTRAIT
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user