Skip to content

Commit

Permalink
Merge pull request #21593 from osmandapp/fix_#18357
Browse files Browse the repository at this point in the history
UI fixes for #18357
  • Loading branch information
Chumva authored Dec 19, 2024
2 parents 9a7c0bd + fdde676 commit eda6649
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions OsmAnd/src/net/osmand/plus/quickaction/SliderButtonsCard.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ protected void updateColors(boolean nightMode) {
}

protected void updateContent() {
updateIcon();
updateSize();
updateIcon();
updateBackground();
updateShadow();
}
Expand Down

0 comments on commit eda6649

Please sign in to comment.