From 0ff4b8701197603ea3c63952b8eb738a5f4a6c49 Mon Sep 17 00:00:00 2001 From: androiddevkotlin <64539346+androiddevkotlin@users.noreply.github.com> Date: Mon, 1 Feb 2021 12:37:56 +0200 Subject: [PATCH] Fix altitude --- OsmAnd/res/layout/center_button_container.xml | 7 ++++--- OsmAnd/res/layout/left_button_container.xml | 7 ++++--- OsmAnd/res/layout/right_button_container.xml | 7 ++++--- OsmAnd/src/net/osmand/plus/UiUtilities.java | 15 ++++++++++++--- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/OsmAnd/res/layout/center_button_container.xml b/OsmAnd/res/layout/center_button_container.xml index 531b6b97e8..99858650dc 100644 --- a/OsmAnd/res/layout/center_button_container.xml +++ b/OsmAnd/res/layout/center_button_container.xml @@ -1,19 +1,20 @@ + osmand:typeface="@string/font_roboto_medium" + tools:text="@string/altitude" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/left_button_container.xml b/OsmAnd/res/layout/left_button_container.xml index e56ec7b06a..3370e554aa 100644 --- a/OsmAnd/res/layout/left_button_container.xml +++ b/OsmAnd/res/layout/left_button_container.xml @@ -1,19 +1,20 @@ + osmand:typeface="@string/font_roboto_medium" + tools:text="@string/shared_string_overview" /> \ No newline at end of file diff --git a/OsmAnd/res/layout/right_button_container.xml b/OsmAnd/res/layout/right_button_container.xml index 02b237d6c0..ab24bdfcc9 100644 --- a/OsmAnd/res/layout/right_button_container.xml +++ b/OsmAnd/res/layout/right_button_container.xml @@ -1,19 +1,20 @@ + osmand:typeface="@string/font_roboto_medium" + tools:text="@string/map_widget_speed" /> \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java index 47f3842711..5e5dc0db1e 100644 --- a/OsmAnd/src/net/osmand/plus/UiUtilities.java +++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java @@ -455,12 +455,10 @@ public class UiUtilities { int radius = AndroidUtils.dpToPx(app, 4); boolean isLayoutRtl = AndroidUtils.isLayoutRtl(app); - TextView startButtonText = buttonsView.findViewById(R.id.left_button); View startButtonContainer = buttonsView.findViewById(R.id.left_button_container); - TextView centerButtonText = buttonsView.findViewById(R.id.center_button); View centerButtonContainer = buttonsView.findViewById(R.id.center_button_container); - TextView endButtonText = buttonsView.findViewById(R.id.right_button); View endButtonContainer = buttonsView.findViewById(R.id.right_button_container); + GradientDrawable background = new GradientDrawable(); background.setColor(UiUtilities.getColorWithAlpha(activeColor, 0.1f)); background.setStroke(AndroidUtils.dpToPx(app, 1), UiUtilities.getColorWithAlpha(activeColor, 0.5f)); @@ -470,25 +468,32 @@ public class UiUtilities { } else { background.setCornerRadii(new float[]{radius, radius, 0, 0, 0, 0, radius, radius}); } + TextView startButtonText = startButtonContainer.findViewById(R.id.tab_title); + TextView endButtonText = endButtonContainer.findViewById(R.id.tab_title); + endButtonContainer.setBackgroundColor(Color.TRANSPARENT); endButtonText.setTextColor(activeColor); startButtonContainer.setBackgroundDrawable(background); startButtonText.setTextColor(textColor); if (centerButtonContainer != null) { + TextView centerButtonText = centerButtonContainer.findViewById(R.id.tab_title); centerButtonText.setTextColor(activeColor); centerButtonContainer.setBackgroundColor(Color.TRANSPARENT); } } else if (buttonType == CustomRadioButtonType.CENTER) { background.setCornerRadii(new float[] {0, 0, 0, 0, 0, 0, 0, 0}); centerButtonContainer.setBackgroundDrawable(background); + TextView centerButtonText = centerButtonContainer.findViewById(R.id.tab_title); centerButtonText.setTextColor(textColor); if (endButtonContainer != null) { + TextView endButtonText = endButtonContainer.findViewById(R.id.tab_title); endButtonText.setTextColor(activeColor); endButtonContainer.setBackgroundColor(Color.TRANSPARENT); } if (startButtonContainer != null) { + TextView startButtonText = startButtonContainer.findViewById(R.id.tab_title); startButtonText.setTextColor(activeColor); startButtonContainer.setBackgroundColor(Color.TRANSPARENT); } @@ -498,12 +503,16 @@ public class UiUtilities { } else { background.setCornerRadii(new float[]{0, 0, radius, radius, radius, radius, 0, 0}); } + TextView startButtonText = startButtonContainer.findViewById(R.id.tab_title); + TextView endButtonText = endButtonContainer.findViewById(R.id.tab_title); + endButtonContainer.setBackgroundDrawable(background); endButtonText.setTextColor(textColor); startButtonContainer.setBackgroundColor(Color.TRANSPARENT); startButtonText.setTextColor(activeColor); if (centerButtonContainer != null) { + TextView centerButtonText = centerButtonContainer.findViewById(R.id.tab_title); centerButtonText.setTextColor(activeColor); centerButtonContainer.setBackgroundColor(Color.TRANSPARENT); }