diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginsFragment.java b/OsmAnd/src/net/osmand/plus/activities/PluginsFragment.java index d3429f02a5..ec863540cf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/PluginsFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/PluginsFragment.java @@ -6,7 +6,6 @@ import android.content.DialogInterface; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Bundle; -import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; @@ -23,7 +22,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.PopupMenu; -import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; @@ -228,7 +226,6 @@ public class PluginsFragment extends BaseOsmAndFragment implements PluginStateLi int color = AndroidUtils.getColorFromAttr(context, R.attr.list_background_color); Drawable pluginIcon = plugin.getLogoResource(); - pluginIcon.clearColorFilter(); pluginLogo.setImageDrawable(UiUtilities.tintDrawable(pluginIcon, color)); pluginLogo.setOnClickListener(new View.OnClickListener() { @Override @@ -253,7 +250,7 @@ public class PluginsFragment extends BaseOsmAndFragment implements PluginStateLi if (active) { pluginLogo.setBackgroundResource(nightMode ? R.drawable.bg_plugin_logo_enabled_dark : R.drawable.bg_plugin_logo_enabled_light); } else { - TypedArray attributes = context.getTheme().obtainStyledAttributes(new int[] {R.attr.bg_plugin_logo_disabled}); + TypedArray attributes = context.getTheme().obtainStyledAttributes(new int[]{R.attr.bg_plugin_logo_disabled}); pluginLogo.setBackgroundDrawable(attributes.getDrawable(0)); attributes.recycle(); } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java index a31c74f680..4cd675805b 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/PluginInstalledBottomSheetDialog.java @@ -2,7 +2,6 @@ package net.osmand.plus.dialogs; import android.app.Activity; import android.content.Context; -import android.graphics.PorterDuff; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -91,8 +90,11 @@ public class PluginInstalledBottomSheetDialog extends MenuBottomSheetDialogFragm SpannableString pluginTitleSpan = new SpannableString(plugin.getName()); pluginTitleSpan.setSpan(new CustomTypefaceSpan(typeface), 0, pluginTitleSpan.length(), 0); Drawable pluginIcon = plugin.getLogoResource(); - pluginIcon.setColorFilter(ContextCompat.getColor( - context, nightMode ? R.color.icon_color_default_light : R.color.icon_color_default_dark), PorterDuff.Mode.MULTIPLY); + if (pluginIcon.getConstantState() != null) { + pluginIcon = pluginIcon.getConstantState().newDrawable().mutate(); + } + pluginIcon = UiUtilities.tintDrawable(pluginIcon, ContextCompat.getColor( + context, nightMode ? R.color.icon_color_default_light : R.color.icon_color_default_dark)); BaseBottomSheetItem pluginTitle = new SimpleBottomSheetItem.Builder() .setTitle(pluginTitleSpan)