Fix status bar updates

This commit is contained in:
Chumva 2019-09-24 10:19:12 +03:00
parent 41e6b9e0b2
commit 9de8fe59a7
23 changed files with 57 additions and 80 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -338,6 +338,8 @@
<dimen name="wikilink_bottom_sheet_padding">14dp</dimen>
<dimen name="text_button_letter_spacing" format="float">0.01</dimen>
<dimen name="description_letter_spacing" format="float">0.02</dimen>
<dimen name="title_letter_spacing" format="float">0.03</dimen>
<dimen name="text_button_line_spacing_multiplier" format="float">1.2</dimen>
<dimen name="pages_item_size">4dp</dimen>

View file

@ -74,18 +74,14 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@ColorRes
protected int getBackgroundColorRes() {
return isNightMode() ? R.color.activity_background_color_dark : R.color.activity_background_color_light;

View file

@ -63,18 +63,14 @@ public class CoordinatesFormatFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
Preference generalSettings = findPreference("coordinates_format_info");

View file

@ -59,18 +59,14 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
setupAppThemePref();

View file

@ -36,18 +36,14 @@ public class MapDuringNavigationFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
Preference mapDuringNavigationInfo = findPreference("map_during_navigation_info");

View file

@ -33,18 +33,14 @@ public class NavigationFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
Preference routeParameters = findPreference("route_parameters");

View file

@ -69,18 +69,14 @@ public class RouteParametersFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
setupRouteParametersImage();

View file

@ -41,18 +41,14 @@ public class ScreenAlertsFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
Preference showRoutingAlarmsInfo = findPreference(SHOW_ROUTING_ALARMS_INFO);

View file

@ -39,18 +39,14 @@ public class TurnScreenOnFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
Preference turnScreenOnInfo = findPreference("turn_screen_on_info");

View file

@ -45,18 +45,14 @@ public class VehicleParametersFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
OsmandApplication app = getMyApplication();

View file

@ -54,18 +54,14 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment {
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null) {
boolean nightMode = isNightMode();
if (Build.VERSION.SDK_INT >= 23 && !nightMode) {
View view = getView();
if (view != null && 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;
}
return -1;
}
@Override
protected void setupPreferences() {
Preference voiceAnnouncesInfo = findPreference("voice_announces_info");