From 63cdb2737eac8abc927a1c74340e8d180b88fa7a Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 12 Nov 2014 10:43:42 +0200 Subject: [PATCH] Updated solution for map modes does not fit in drawer --- .../net/osmand/plus/activities/actions/AppModeDialog.java | 8 ++++---- .../plus/development/SettingsDevelopmentActivity.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java index 7dfd4ae0dd..531044218e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java @@ -28,7 +28,7 @@ public class AppModeDialog { if (showDefault || settings.getApplicationMode() != ApplicationMode.DEFAULT) { selected.add(settings.getApplicationMode()); } - return prepareAppModeView(a, values, selected, parent, singleSelection, onClickListener); + return prepareAppModeView(a, values, selected, parent, singleSelection, false, onClickListener); } //special method for drawer menu @@ -41,7 +41,7 @@ public class AppModeDialog { if (values.size() > 4) { return createDrawerView(a, visible, values, selected, allModes, onClickListener); } else { - return prepareAppModeView(a, values, selected, null, true, onClickListener); + return prepareAppModeView(a, values, selected, null, true, true, onClickListener); } } @@ -168,9 +168,9 @@ public class AppModeDialog { } public static View prepareAppModeView(Activity a, final List values , final Set selected, - ViewGroup parent, final boolean singleSelection, final View.OnClickListener onClickListener) { + ViewGroup parent, final boolean singleSelection,boolean drawer, final View.OnClickListener onClickListener) { LinearLayout ll = (LinearLayout) a.getLayoutInflater().inflate(R.layout.mode_toggles, parent); - final ToggleButton[] buttons = createToggles(values, ll, a, false); + final ToggleButton[] buttons = createToggles(values, ll, a, drawer); for (int i = 0; i < buttons.length; i++) { setButtonListener(values, selected, onClickListener, buttons, i, singleSelection); } diff --git a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java index 15684c5d9f..b80aadabaa 100644 --- a/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/SettingsDevelopmentActivity.java @@ -126,7 +126,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity { modes.remove(ApplicationMode.DEFAULT); final Set selected = new LinkedHashSet(ApplicationMode.values(settings)); selected.remove(ApplicationMode.DEFAULT); - View v = AppModeDialog.prepareAppModeView(this, modes, selected, null, false, + View v = AppModeDialog.prepareAppModeView(this, modes, selected, null, false, false, new View.OnClickListener() { @Override