Fix UI for 12

This commit is contained in:
Victor Shcherb 2015-05-06 23:51:00 +02:00
parent 9e6dd31795
commit 656995826d
5 changed files with 7 additions and 4 deletions

View file

@ -90,9 +90,9 @@ public class OsmAndFormatter {
if (meters >= 100 * mainUnitInMeters) { if (meters >= 100 * mainUnitInMeters) {
return (int) (meters / mainUnitInMeters + 0.5) + " " + ctx.getString(mainUnitStr); //$NON-NLS-1$ return (int) (meters / mainUnitInMeters + 0.5) + " " + ctx.getString(mainUnitStr); //$NON-NLS-1$
} else if (meters > 9.99f * mainUnitInMeters) { } else if (meters > 9.99f * mainUnitInMeters) {
return MessageFormat.format("{0,number,#.#} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$ return MessageFormat.format("{0,number,#.#} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters).replace('\n', ' '); //$NON-NLS-1$
} else if (meters > 0.999f * mainUnitInMeters) { } else if (meters > 0.999f * mainUnitInMeters) {
return MessageFormat.format("{0,number,#.##} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$ return MessageFormat.format("{0,number,#.##} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters).replace('\n', ' '); //$NON-NLS-1$
} else { } else {
if (mc == MetricsConstants.KILOMETERS_AND_METERS) { if (mc == MetricsConstants.KILOMETERS_AND_METERS) {
return ((int) (meters + 0.5)) + " " + ctx.getString(R.string.m); //$NON-NLS-1$ return ((int) (meters + 0.5)) + " " + ctx.getString(R.string.m); //$NON-NLS-1$

View file

@ -23,7 +23,7 @@
android:insetBottom="@dimen/abc_button_inset_vertical_material"> android:insetBottom="@dimen/abc_button_inset_vertical_material">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="@dimen/abc_control_corner_material" /> <corners android:radius="@dimen/abc_control_corner_material" />
<solid android:color="@android:color/white" /> <solid android:color="@android:color/darker_gray" />
<padding android:left="@dimen/abc_button_padding_horizontal_material" <padding android:left="@dimen/abc_button_padding_horizontal_material"
android:top="@dimen/abc_button_padding_vertical_material" android:top="@dimen/abc_button_padding_vertical_material"
android:right="@dimen/abc_button_padding_horizontal_material" android:right="@dimen/abc_button_padding_horizontal_material"

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="checkbox_padding">0dp</dimen> <dimen name="checkbox_padding">0dp</dimen>
<dimen name="radio_padding">0dp</dimen>
</resources> </resources>

View file

@ -84,4 +84,5 @@
<!-- Dialog button bar height --> <!-- Dialog button bar height -->
<dimen name="abc_alert_dialog_button_bar_height">48dp</dimen> <dimen name="abc_alert_dialog_button_bar_height">48dp</dimen>
<dimen name="checkbox_padding">12dp</dimen> <dimen name="checkbox_padding">12dp</dimen>
<dimen name="radio_padding">30dp</dimen>
</resources> </resources>

View file

@ -379,6 +379,7 @@
<style name="Base.Widget.AppCompat.CompoundButton.RadioButton" parent="android:Widget.CompoundButton.RadioButton"> <style name="Base.Widget.AppCompat.CompoundButton.RadioButton" parent="android:Widget.CompoundButton.RadioButton">
<item name="android:button">?android:attr/listChoiceIndicatorSingle</item> <item name="android:button">?android:attr/listChoiceIndicatorSingle</item>
<item name="android:background">?attr/selectableItemBackgroundBorderless</item> <item name="android:background">?attr/selectableItemBackgroundBorderless</item>
<item name="android:paddingLeft">@dimen/radio_padding</item>
</style> </style>
<style name="Base.Widget.AppCompat.CompoundButton.Switch" parent="android:Widget.CompoundButton"> <style name="Base.Widget.AppCompat.CompoundButton.Switch" parent="android:Widget.CompoundButton">