From fdde6764c957326f484c96e58fe8e6f0d0bfaca5 Mon Sep 17 00:00:00 2001 From: chumv Date: Thu, 19 Dec 2024 23:37:45 +0200 Subject: [PATCH] UI fixes for #18357 --- .../net/osmand/plus/quickaction/SliderButtonsCard.java | 9 +++++++-- .../plus/views/controls/maphudbuttons/MapButton.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/quickaction/SliderButtonsCard.java b/OsmAnd/src/net/osmand/plus/quickaction/SliderButtonsCard.java index 6d896a875f5..0c2508a1ec7 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/SliderButtonsCard.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/SliderButtonsCard.java @@ -1,5 +1,7 @@ package net.osmand.plus.quickaction; +import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; + import android.graphics.drawable.Drawable; import android.view.View; import android.widget.ImageButton; @@ -17,6 +19,7 @@ import net.osmand.plus.routepreparationmenu.cards.MapBaseCard; import net.osmand.plus.utils.AndroidUtils; import net.osmand.plus.utils.ColorUtilities; +import net.osmand.plus.utils.UiUtilities; import net.osmand.plus.widgets.popup.PopUpMenu; import net.osmand.plus.widgets.popup.PopUpMenuDisplayData; import net.osmand.plus.widgets.popup.PopUpMenuItem; @@ -61,6 +64,8 @@ protected void setupHeader(@NonNull View view) { View selector = view.findViewById(R.id.card_selector); if (showOriginal) { selector.setOnClickListener(v -> showMenu(selector)); + } else { + container.findViewById(R.id.header).getLayoutParams().height = WRAP_CONTENT; } AndroidUiHelper.updateVisibility(selector.findViewById(R.id.drop_down_icon), showOriginal); } @@ -139,8 +144,8 @@ public void showMenu(@NonNull View view) { @NonNull protected Drawable getPersistentPrefIcon(@DrawableRes int iconId) { - Drawable enabled = getColoredIcon(iconId, ColorUtilities.getActiveColorId(nightMode)); - Drawable disabled = getColoredIcon(iconId, ColorUtilities.getSecondaryIconColorId(nightMode)); + Drawable enabled = UiUtilities.createTintedDrawable(app, iconId, ColorUtilities.getActiveColor(app, nightMode)); + Drawable disabled = UiUtilities.createTintedDrawable(app, iconId, ColorUtilities.getSecondaryIconColor(app, nightMode)); return AndroidUtils.createEnabledStateListDrawable(disabled, enabled); } diff --git a/OsmAnd/src/net/osmand/plus/views/controls/maphudbuttons/MapButton.java b/OsmAnd/src/net/osmand/plus/views/controls/maphudbuttons/MapButton.java index e07cd1194bc..9bc48e2e76a 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/maphudbuttons/MapButton.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/maphudbuttons/MapButton.java @@ -293,8 +293,8 @@ protected void updateColors(boolean nightMode) { } protected void updateContent() { - updateIcon(); updateSize(); + updateIcon(); updateBackground(); updateShadow(); }