From 9de8fe59a78030eccab5d0542048e98dcde7623c Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 24 Sep 2019 10:19:12 +0300 Subject: [PATCH] Fix status bar updates --- .../layout/bottom_sheet_item_preference_descr.xml | 1 + .../layout/bottom_sheet_item_preference_switch.xml | 1 + OsmAnd/res/layout/preference_category_with_descr.xml | 2 ++ OsmAnd/res/layout/preference_info.xml | 1 + OsmAnd/res/layout/preference_info_descr.xml | 1 + OsmAnd/res/layout/preference_radio_button.xml | 1 + OsmAnd/res/layout/preference_switch.xml | 1 + OsmAnd/res/layout/preference_top_switch.xml | 1 + OsmAnd/res/layout/preference_with_descr.xml | 1 + .../preference_with_descr_dialog_and_switch.xml | 1 + OsmAnd/res/layout/profile_preference_toolbar.xml | 1 + OsmAnd/res/layout/profile_preference_toolbar_big.xml | 3 +++ OsmAnd/res/values/sizes.xml | 2 ++ .../plus/settings/ConfigureProfileFragment.java | 12 ++++-------- .../plus/settings/CoordinatesFormatFragment.java | 12 ++++-------- .../settings/GeneralProfileSettingsFragment.java | 12 ++++-------- .../plus/settings/MapDuringNavigationFragment.java | 12 ++++-------- .../net/osmand/plus/settings/NavigationFragment.java | 12 ++++-------- .../plus/settings/RouteParametersFragment.java | 12 ++++-------- .../osmand/plus/settings/ScreenAlertsFragment.java | 12 ++++-------- .../osmand/plus/settings/TurnScreenOnFragment.java | 12 ++++-------- .../plus/settings/VehicleParametersFragment.java | 12 ++++-------- .../osmand/plus/settings/VoiceAnnouncesFragment.java | 12 ++++-------- 23 files changed, 57 insertions(+), 80 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml b/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml index 09e6f386ff..b66a1ec2f7 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml @@ -5,6 +5,7 @@ android:id="@+id/description" android:layout_width="match_parent" android:layout_height="wrap_content" + android:letterSpacing="@dimen/description_letter_spacing" android:minHeight="@dimen/bottom_sheet_list_item_height" android:paddingLeft="@dimen/content_padding" android:paddingTop="@dimen/bottom_sheet_image_text_margin_start" diff --git a/OsmAnd/res/layout/bottom_sheet_item_preference_switch.xml b/OsmAnd/res/layout/bottom_sheet_item_preference_switch.xml index 3e336b3212..e46dddd086 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_preference_switch.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_preference_switch.xml @@ -24,6 +24,7 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:ellipsize="end" + android:letterSpacing="@dimen/title_letter_spacing" android:maxLines="1" android:textAppearance="@style/TextAppearance.ListItemTitle" android:textColor="?attr/active_color_basic" diff --git a/OsmAnd/res/layout/preference_category_with_descr.xml b/OsmAnd/res/layout/preference_category_with_descr.xml index 8cef082e56..9f1d02989f 100644 --- a/OsmAnd/res/layout/preference_category_with_descr.xml +++ b/OsmAnd/res/layout/preference_category_with_descr.xml @@ -29,6 +29,7 @@ android:id="@android:id/title" android:layout_width="match_parent" android:layout_height="match_parent" + android:letterSpacing="@dimen/description_letter_spacing" android:paddingTop="@dimen/list_header_settings_top_margin" android:singleLine="true" android:textColor="@color/preference_category_title" @@ -40,6 +41,7 @@ android:id="@android:id/summary" android:layout_width="match_parent" android:layout_height="wrap_content" + android:letterSpacing="@dimen/description_letter_spacing" android:paddingBottom="@dimen/list_header_settings_top_margin" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" diff --git a/OsmAnd/res/layout/preference_info.xml b/OsmAnd/res/layout/preference_info.xml index 075e94d733..69717fdf48 100644 --- a/OsmAnd/res/layout/preference_info.xml +++ b/OsmAnd/res/layout/preference_info.xml @@ -22,6 +22,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_vertical" + android:letterSpacing="@dimen/description_letter_spacing" android:paddingLeft="@dimen/content_padding" android:paddingTop="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding" diff --git a/OsmAnd/res/layout/preference_info_descr.xml b/OsmAnd/res/layout/preference_info_descr.xml index 9fba9c6e36..27cf7ac368 100644 --- a/OsmAnd/res/layout/preference_info_descr.xml +++ b/OsmAnd/res/layout/preference_info_descr.xml @@ -11,6 +11,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="@dimen/content_padding" android:layout_marginRight="@dimen/content_padding" + android:letterSpacing="@dimen/text_button_letter_spacing" android:paddingTop="@dimen/content_padding_small" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_sub_text_size" diff --git a/OsmAnd/res/layout/preference_radio_button.xml b/OsmAnd/res/layout/preference_radio_button.xml index 6dfa5a942b..2dfe84989f 100644 --- a/OsmAnd/res/layout/preference_radio_button.xml +++ b/OsmAnd/res/layout/preference_radio_button.xml @@ -51,6 +51,7 @@ android:id="@android:id/summary" android:layout_width="match_parent" android:layout_height="wrap_content" + android:letterSpacing="@dimen/description_letter_spacing" android:maxLines="4" android:paddingBottom="@dimen/gpx_small_text_margin" android:textColor="?android:textColorSecondary" diff --git a/OsmAnd/res/layout/preference_switch.xml b/OsmAnd/res/layout/preference_switch.xml index 5280e7cabd..aee1090b1e 100644 --- a/OsmAnd/res/layout/preference_switch.xml +++ b/OsmAnd/res/layout/preference_switch.xml @@ -46,6 +46,7 @@ android:id="@android:id/summary" android:layout_width="match_parent" android:layout_height="wrap_content" + android:letterSpacing="@dimen/description_letter_spacing" android:maxLines="4" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" diff --git a/OsmAnd/res/layout/preference_top_switch.xml b/OsmAnd/res/layout/preference_top_switch.xml index cb9848a093..7ed3484d41 100644 --- a/OsmAnd/res/layout/preference_top_switch.xml +++ b/OsmAnd/res/layout/preference_top_switch.xml @@ -26,6 +26,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" + android:letterSpacing="@dimen/title_letter_spacing" android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" android:textColor="?attr/text_color_tab_active" diff --git a/OsmAnd/res/layout/preference_with_descr.xml b/OsmAnd/res/layout/preference_with_descr.xml index 1cb71ed180..e85638b8fd 100644 --- a/OsmAnd/res/layout/preference_with_descr.xml +++ b/OsmAnd/res/layout/preference_with_descr.xml @@ -48,6 +48,7 @@ android:id="@android:id/summary" android:layout_width="match_parent" android:layout_height="wrap_content" + android:letterSpacing="@dimen/description_letter_spacing" android:maxLines="4" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" diff --git a/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml b/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml index a65c33a940..e60132841a 100644 --- a/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml +++ b/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml @@ -47,6 +47,7 @@ android:id="@android:id/summary" android:layout_width="match_parent" android:layout_height="wrap_content" + android:letterSpacing="@dimen/description_letter_spacing" android:maxLines="4" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" diff --git a/OsmAnd/res/layout/profile_preference_toolbar.xml b/OsmAnd/res/layout/profile_preference_toolbar.xml index 29d91c3dd0..a52f68d653 100644 --- a/OsmAnd/res/layout/profile_preference_toolbar.xml +++ b/OsmAnd/res/layout/profile_preference_toolbar.xml @@ -31,6 +31,7 @@ android:layout_height="match_parent" android:layout_weight="1" android:gravity="center_vertical" + android:letterSpacing="@dimen/text_button_letter_spacing" android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" android:textColor="?android:textColorPrimary" diff --git a/OsmAnd/res/layout/profile_preference_toolbar_big.xml b/OsmAnd/res/layout/profile_preference_toolbar_big.xml index d878c085a8..399ffa5cdf 100644 --- a/OsmAnd/res/layout/profile_preference_toolbar_big.xml +++ b/OsmAnd/res/layout/profile_preference_toolbar_big.xml @@ -36,6 +36,7 @@ android:layout_height="match_parent" android:layout_weight="1" android:gravity="center_vertical" + android:letterSpacing="@dimen/text_button_letter_spacing" android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" android:textColor="?android:textColorPrimary" @@ -83,6 +84,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="end" + android:letterSpacing="@dimen/title_letter_spacing" android:maxLines="1" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" @@ -94,6 +96,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="end" + android:letterSpacing="@dimen/description_letter_spacing" android:maxLines="1" android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index 185b9c7878..5ec78f9bce 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -338,6 +338,8 @@ 14dp 0.01 + 0.02 + 0.03 1.2 4dp diff --git a/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java index 4b279aeb2b..2cf8dca976 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java @@ -74,16 +74,12 @@ public class ConfigureProfileFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @ColorRes diff --git a/OsmAnd/src/net/osmand/plus/settings/CoordinatesFormatFragment.java b/OsmAnd/src/net/osmand/plus/settings/CoordinatesFormatFragment.java index f2d2c51936..3bf16bc3fd 100644 --- a/OsmAnd/src/net/osmand/plus/settings/CoordinatesFormatFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/CoordinatesFormatFragment.java @@ -63,16 +63,12 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/GeneralProfileSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/GeneralProfileSettingsFragment.java index 2055c58777..2cd9e1a3d8 100644 --- a/OsmAnd/src/net/osmand/plus/settings/GeneralProfileSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/GeneralProfileSettingsFragment.java @@ -59,16 +59,12 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/MapDuringNavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/MapDuringNavigationFragment.java index d1970c3733..5c33b070a2 100644 --- a/OsmAnd/src/net/osmand/plus/settings/MapDuringNavigationFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/MapDuringNavigationFragment.java @@ -36,16 +36,12 @@ public class MapDuringNavigationFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java index 55f3e94b1e..26832ff785 100644 --- a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java @@ -33,16 +33,12 @@ public class NavigationFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java index 9b40f11a64..6ee2960d89 100644 --- a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java @@ -69,16 +69,12 @@ public class RouteParametersFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/ScreenAlertsFragment.java b/OsmAnd/src/net/osmand/plus/settings/ScreenAlertsFragment.java index 3a8136892d..3ff4cc083f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/ScreenAlertsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/ScreenAlertsFragment.java @@ -41,16 +41,12 @@ public class ScreenAlertsFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/TurnScreenOnFragment.java b/OsmAnd/src/net/osmand/plus/settings/TurnScreenOnFragment.java index c31eaabea8..8af482983a 100644 --- a/OsmAnd/src/net/osmand/plus/settings/TurnScreenOnFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/TurnScreenOnFragment.java @@ -39,16 +39,12 @@ public class TurnScreenOnFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java index 1359deea84..f0806907e6 100644 --- a/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/VehicleParametersFragment.java @@ -45,16 +45,12 @@ public class VehicleParametersFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override diff --git a/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java b/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java index 758f326b31..15c77fe8c9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java @@ -54,16 +54,12 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment { @Override public int getStatusBarColorId() { + boolean nightMode = isNightMode(); View view = getView(); - if (view != null) { - boolean nightMode = isNightMode(); - if (Build.VERSION.SDK_INT >= 23 && !nightMode) { - view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; + if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) { + view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } - - return -1; + return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light; } @Override