From 870986c09be8a575fe10d349d2740aa0076ab882 Mon Sep 17 00:00:00 2001 From: androiddevkkotlin Date: Mon, 30 Nov 2020 11:30:34 +0200 Subject: [PATCH] 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); } }