Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-09-29 00:55:30 +02:00
commit deb7c4ddd2
4 changed files with 32 additions and 15 deletions

View file

@ -1410,7 +1410,7 @@
<string name="download_using_mobile_internet">Derzeit besteht keine WLAN-Verbindung. Soll das Herunterladen mit der aktuellen Datenverbindung erfolgen?</string>
<string name="clear_destination">Ziel löschen</string>
<string name="other_location">Andere</string>
<string name="files_limit">%1$d Dateien fehlen noch</string>
<string name="files_limit">In dieser kostenlosen Version können noch %1$d Dateien heruntergeladen werden.</string>
<string name="available_downloads_left">Es stehen %1$d Dateien zum Herunterladen bereit</string>
<string name="install_paid">Vollversion</string>
<string name="cancel_navigation">Navigation stoppen</string>

View file

@ -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];

View file

@ -702,7 +702,7 @@ public class OsmandSettings {
public final CommonPreference<Float> 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<Float> MAP_ZOOM_SCALE_BY_DENSITY = new FloatPreference("map_zoom_scale_wo_density", 0f).makeProfile().cache();

View file

@ -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);