From 870986c09be8a575fe10d349d2740aa0076ab882 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 30 Nov 2020 11:30:34 +0200 Subject: [PATCH 1/3] Fix colors text --- .../bottomsheets/ElevationDateBottomSheet.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java index 14b0e7eacd..b805442e50 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java @@ -3,6 +3,7 @@ package net.osmand.plus.settings.bottomsheets; import android.content.Context; import android.os.Bundle; import android.view.View; +import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; @@ -60,6 +61,8 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment { private String on; private String off; private int activeColor; + private int checkedColor; + private int uncheckedColor; private int disabledColor; private int appModeColor; @@ -95,6 +98,9 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment { appModeColor = appMode.getIconColorInfo().getColor(nightMode); activeColor = AndroidUtils.resolveAttribute(themedCtx, R.attr.active_color_basic); disabledColor = AndroidUtils.resolveAttribute(themedCtx, android.R.attr.textColorSecondary); + checkedColor = (nightMode ? app.getResources().getColor(R.color.text_color_primary_dark) : app.getResources().getColor(R.color.text_color_primary_light)); + uncheckedColor = (nightMode ? app.getResources().getColor(R.color.text_color_secondary_dark) : app.getResources().getColor(R.color.text_color_secondary_light)); + items.add(new TitleItem(getString(R.string.routing_attr_height_obstacles_name))); @@ -214,6 +220,12 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment { private void enableDisableReliefButtons(boolean enable) { for (BaseBottomSheetItem item : reliefFactorButtons) { item.getView().setEnabled(enable); + TextView titleField = (TextView) item.getView().findViewById(R.id.title); + if (enable) { + titleField.setTextColor(checkedColor); + } else { + titleField.setTextColor(uncheckedColor); + } item.getView().findViewById(R.id.compound_button).setEnabled(enable); } } From ab29ae240314a59c4857c54b3ef2f047fcd99c5d Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 30 Nov 2020 11:45:22 +0200 Subject: [PATCH 2/3] Colors grey --- OsmAnd/src/net/osmand/AndroidUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/AndroidUtils.java b/OsmAnd/src/net/osmand/AndroidUtils.java index 69b55a95f4..a3ca6b066b 100644 --- a/OsmAnd/src/net/osmand/AndroidUtils.java +++ b/OsmAnd/src/net/osmand/AndroidUtils.java @@ -328,9 +328,9 @@ public class AndroidUtils { new int[] {} }, new int[] { - Color.GRAY, + ContextCompat.getColor(ctx, night? R.color.text_color_secondary_dark : R.color.text_color_secondary_light), ContextCompat.getColor(ctx, night? R.color.active_color_primary_dark : R.color.active_color_primary_light), - Color.GRAY} + ContextCompat.getColor(ctx, night? R.color.text_color_secondary_dark : R.color.text_color_secondary_light)} ); } From 59132ccf6d5db208c92ab54da2cad7d48190d177 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 30 Nov 2020 11:55:18 +0200 Subject: [PATCH 3/3] Fix --- .../bottomsheets/ElevationDateBottomSheet.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java index b805442e50..10f8c283f9 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ElevationDateBottomSheet.java @@ -219,14 +219,12 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment { private void enableDisableReliefButtons(boolean enable) { for (BaseBottomSheetItem item : reliefFactorButtons) { - item.getView().setEnabled(enable); - TextView titleField = (TextView) item.getView().findViewById(R.id.title); - if (enable) { - titleField.setTextColor(checkedColor); - } else { - titleField.setTextColor(uncheckedColor); - } - item.getView().findViewById(R.id.compound_button).setEnabled(enable); + View view = item.getView(); + view.setEnabled(enable); + view.findViewById(R.id.compound_button).setEnabled(enable); + + TextView titleField = view.findViewById(R.id.title); + titleField.setTextColor(enable ? checkedColor : uncheckedColor); } }