Fix preferences toolbar size and icons color

This commit is contained in:
Chumva 2019-10-28 16:02:14 +02:00
parent 11e10634c1
commit db4dec3c56
9 changed files with 24 additions and 27 deletions

View file

@ -4,14 +4,16 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/toolbar_height" android:layout_height="wrap_content"
android:background="?attr/actionModeBackground" android:background="?attr/actionModeBackground"
android:minHeight="@dimen/toolbar_height"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"> app:contentInsetStart="0dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:gravity="center_vertical">
<ImageButton <ImageButton
android:id="@+id/close_button" android:id="@+id/close_button"
@ -24,8 +26,7 @@
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"
android:textColor="?attr/app_bar_primary_item_color" android:textColor="?attr/app_bar_primary_item_color"

View file

@ -32,8 +32,7 @@
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"
android:textColor="?attr/app_bar_primary_item_color" android:textColor="?attr/app_bar_primary_item_color"

View file

@ -28,9 +28,8 @@
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical"
android:letterSpacing="@dimen/text_button_letter_spacing" android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"

View file

@ -33,9 +33,8 @@
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical"
android:letterSpacing="@dimen/text_button_letter_spacing" android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"

View file

@ -33,9 +33,8 @@
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical"
android:letterSpacing="@dimen/text_button_letter_spacing" android:letterSpacing="@dimen/text_button_letter_spacing"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"

View file

@ -123,7 +123,7 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
} }
private Drawable getOsmandThemeIcon() { private Drawable getOsmandThemeIcon() {
return getIcon(settings.isLightContent() ? R.drawable.ic_action_sun : R.drawable.ic_action_moon); return getContentIcon(settings.isLightContent() ? R.drawable.ic_action_sun : R.drawable.ic_action_moon);
} }
private void setupRotateMapPref() { private void setupRotateMapPref() {
@ -136,11 +136,11 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
private Drawable getRotateMapIcon() { private Drawable getRotateMapIcon() {
switch (settings.ROTATE_MAP.get()) { switch (settings.ROTATE_MAP.get()) {
case OsmandSettings.ROTATE_MAP_NONE: case OsmandSettings.ROTATE_MAP_NONE:
return getIcon(R.drawable.ic_action_direction_north); return getContentIcon(R.drawable.ic_action_direction_north);
case OsmandSettings.ROTATE_MAP_BEARING: case OsmandSettings.ROTATE_MAP_BEARING:
return getIcon(R.drawable.ic_action_direction_movement); return getContentIcon(R.drawable.ic_action_direction_movement);
default: default:
return getIcon(R.drawable.ic_action_direction_compass); return getContentIcon(R.drawable.ic_action_direction_compass);
} }
} }
@ -164,11 +164,11 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
private Drawable getMapScreenOrientationIcon() { private Drawable getMapScreenOrientationIcon() {
switch (settings.MAP_SCREEN_ORIENTATION.get()) { switch (settings.MAP_SCREEN_ORIENTATION.get()) {
case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT: case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:
return getIcon(R.drawable.ic_action_phone_portrait_orientation); return getContentIcon(R.drawable.ic_action_phone_portrait_orientation);
case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE: case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE:
return getIcon(R.drawable.ic_action_phone_landscape_orientation); return getContentIcon(R.drawable.ic_action_phone_landscape_orientation);
default: default:
return getIcon(R.drawable.ic_action_phone_device_orientation); return getContentIcon(R.drawable.ic_action_phone_device_orientation);
} }
} }
@ -191,7 +191,7 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
ListPreferenceEx unitsOfLength = (ListPreferenceEx) findPreference(settings.METRIC_SYSTEM.getId()); ListPreferenceEx unitsOfLength = (ListPreferenceEx) findPreference(settings.METRIC_SYSTEM.getId());
unitsOfLength.setEntries(entries); unitsOfLength.setEntries(entries);
unitsOfLength.setEntryValues(entryValues); unitsOfLength.setEntryValues(entryValues);
unitsOfLength.setIcon(getIcon(R.drawable.ic_action_ruler_unit)); unitsOfLength.setIcon(getContentIcon(R.drawable.ic_action_ruler_unit));
} }
private void setupCoordinatesFormatPref() { private void setupCoordinatesFormatPref() {
@ -221,7 +221,7 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
ListPreferenceEx angularUnits = (ListPreferenceEx) findPreference(settings.ANGULAR_UNITS.getId()); ListPreferenceEx angularUnits = (ListPreferenceEx) findPreference(settings.ANGULAR_UNITS.getId());
angularUnits.setEntries(entries); angularUnits.setEntries(entries);
angularUnits.setEntryValues(entryValues); angularUnits.setEntryValues(entryValues);
angularUnits.setIcon(getIcon(R.drawable.ic_action_angular_unit)); angularUnits.setIcon(getContentIcon(R.drawable.ic_action_angular_unit));
} }
private void setupSpeedSystemPref() { private void setupSpeedSystemPref() {

View file

@ -62,7 +62,7 @@ public class MainSettingsFragment extends BaseSettingsFragment {
private void setupManageProfilesPref() { private void setupManageProfilesPref() {
Preference manageProfiles = findPreference("manage_profiles"); Preference manageProfiles = findPreference("manage_profiles");
manageProfiles.setIcon(getIcon(R.drawable.ic_action_manage_profiles)); manageProfiles.setIcon(getContentIcon(R.drawable.ic_action_manage_profiles));
manageProfiles.setFragment(SettingsProfileFragment.class.getName()); manageProfiles.setFragment(SettingsProfileFragment.class.getName());
} }

View file

@ -284,7 +284,7 @@ public class RouteParametersFragment extends BaseSettingsFragment {
private Drawable getRoutingPrefIcon(String prefId) { private Drawable getRoutingPrefIcon(String prefId) {
switch (prefId) { switch (prefId) {
case GeneralRouter.ALLOW_PRIVATE: case GeneralRouter.ALLOW_PRIVATE:
return getIcon(R.drawable.ic_action_private_access); return getContentIcon(R.drawable.ic_action_private_access);
case GeneralRouter.USE_SHORTEST_WAY: case GeneralRouter.USE_SHORTEST_WAY:
return getContentIcon(R.drawable.ic_action_fuel); return getContentIcon(R.drawable.ic_action_fuel);
case AVOID_ROUTING_PARAMETER_PREFIX: case AVOID_ROUTING_PARAMETER_PREFIX:
@ -292,7 +292,7 @@ public class RouteParametersFragment extends BaseSettingsFragment {
case DRIVING_STYLE: case DRIVING_STYLE:
return getContentIcon(R.drawable.ic_action_bicycle_dark); return getContentIcon(R.drawable.ic_action_bicycle_dark);
case "fast_route_mode": case "fast_route_mode":
return getIcon(R.drawable.ic_action_fastest_route); return getContentIcon(R.drawable.ic_action_fastest_route);
case "enable_time_conditional_routing": case "enable_time_conditional_routing":
return getContentIcon(R.drawable.ic_action_road_works_dark); return getContentIcon(R.drawable.ic_action_road_works_dark);
default: default:

View file

@ -112,11 +112,11 @@ public class VehicleParametersFragment extends BaseSettingsFragment {
case GeneralRouter.DEFAULT_SPEED: case GeneralRouter.DEFAULT_SPEED:
return getContentIcon(R.drawable.ic_action_speed); return getContentIcon(R.drawable.ic_action_speed);
case GeneralRouter.VEHICLE_HEIGHT: case GeneralRouter.VEHICLE_HEIGHT:
return getIcon(R.drawable.ic_action_height_limit); return getContentIcon(R.drawable.ic_action_height_limit);
case GeneralRouter.VEHICLE_WEIGHT: case GeneralRouter.VEHICLE_WEIGHT:
return getIcon(R.drawable.ic_action_weight_limit); return getContentIcon(R.drawable.ic_action_weight_limit);
case GeneralRouter.VEHICLE_WIDTH: case GeneralRouter.VEHICLE_WIDTH:
return getIcon(R.drawable.ic_action_width_limit); return getContentIcon(R.drawable.ic_action_width_limit);
default: default:
return null; return null;
} }