diff --git a/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java b/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java index b3be541fe9..5e0be90a36 100644 --- a/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java +++ b/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java @@ -42,7 +42,6 @@ public class SettingsAccessibilityActivity extends SettingsBaseActivity { return true; } }); - addTextScale(grp); addSpeechRateSetting(grp); grp.addPreference(accessibilityModePreference); @@ -86,18 +85,6 @@ public class SettingsAccessibilityActivity extends SettingsBaseActivity { } - - protected void addTextScale(PreferenceGroup grp) { - Float[] txtValues = new Float[] {0.75f, 1f, 1.25f, 1.5f, 2f, 3f} ; - String[] txtNames = new String[txtValues.length]; - for(int i = 0; i < txtNames.length; i++) { - txtNames[i] = (int)(txtValues[i] * 100) + " %"; - } - grp.addPreference(createListPreference(settings.TEXT_SCALE, txtNames, txtValues, R.string.text_size, R.string.text_size_descr)); - } - - - protected void addSpeechRateSetting(PreferenceGroup grp) { Float[] sprValues = new Float[] {0.5f, 0.75f, 1f, 1.25f, 1.5f, 2f} ; String[] sprNames = new String[sprValues.length]; diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 04c161b956..0497115601 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -702,7 +702,7 @@ public class OsmandSettings { public final CommonPreference TEXT_SCALE = new FloatPreference("text_scale", 1f).makeProfile().cache(); { - TEXT_SCALE.setModeDefaultValue(ApplicationMode.CAR, 1.5f); + TEXT_SCALE.setModeDefaultValue(ApplicationMode.CAR, 1.25f); } public final CommonPreference MAP_ZOOM_SCALE_BY_DENSITY = new FloatPreference("map_zoom_scale_wo_density", 0f).makeProfile().cache(); diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java index 32c6c15beb..efe7d8a5bc 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/AppearanceWidgetsFactory.java @@ -18,6 +18,7 @@ import net.osmand.render.RenderingRulesStorage; import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.content.DialogInterface; +import android.preference.PreferenceGroup; import android.widget.Toast; public class AppearanceWidgetsFactory { @@ -53,6 +54,35 @@ public class AppearanceWidgetsFactory { view.refreshMap(); } }); + MapWidgetRegistry.MapWidgetRegInfo w = mapInfoControls.registerAppearanceWidget(R.drawable.widget_no_icon, + R.string.text_size, "text_size", view.getSettings().TEXT_SCALE); + w.setStateChangeListener(new Runnable() { + @Override + public void run() { + AlertDialog.Builder b = new AlertDialog.Builder(view.getContext()); + //test old descr as title + b.setTitle(R.string.text_size); + final Float[] txtValues = new Float[] {0.75f, 1f, 1.25f, 1.5f, 2f, 3f} ; + int selected = -1; + final String[] txtNames = new String[txtValues.length]; + for (int i = 0; i < txtNames.length; i++) { + txtNames[i] = (int) (txtValues[i] * 100) + " %"; + if (view.getSettings().TEXT_SCALE.get() == txtValues[i]) { + selected = i; + } + } + b.setSingleChoiceItems(txtNames, selected, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + view.getSettings().TEXT_SCALE.set(txtValues[which]); + view.getApplication().getResourceManager().getRenderer().clearCache(); + view.refreshMap(true); + dialog.dismiss(); + } + }); + b.show(); + } + }); final MapWidgetRegistry.MapWidgetRegInfo showDestinationArrow = mapInfoControls.registerAppearanceWidget(R.drawable.widget_show_destination_arrow, R.string.map_widget_show_destination_arrow, "show_destination_arrow", view.getSettings().SHOW_DESTINATION_ARROW);