diff --git a/app/src/full/java/com/topjohnwu/magisk/SettingsActivity.java b/app/src/full/java/com/topjohnwu/magisk/SettingsActivity.java index 4958db0db..67d79f284 100644 --- a/app/src/full/java/com/topjohnwu/magisk/SettingsActivity.java +++ b/app/src/full/java/com/topjohnwu/magisk/SettingsActivity.java @@ -2,6 +2,8 @@ package com.topjohnwu.magisk; import android.content.Context; import android.content.SharedPreferences; +import android.content.res.Resources; +import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.hardware.fingerprint.FingerprintManager; @@ -17,7 +19,6 @@ import android.support.v7.preference.PreferenceCategory; import android.support.v7.preference.PreferenceFragmentCompat; import android.support.v7.preference.PreferenceScreen; import android.support.v7.widget.Toolbar; -import android.util.TypedValue; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; @@ -319,9 +320,10 @@ public class SettingsActivity extends BaseActivity implements Topic.Subscriber { CustomAlertDialog.ViewHolder vh = dialog.getViewHolder(); Drawable fingerprint = getResources().getDrawable(R.drawable.ic_fingerprint); fingerprint.setBounds(0, 0, Utils.dpInPx(50), Utils.dpInPx(50)); - TypedValue tint = new TypedValue(); - requireActivity().getTheme().resolveAttribute(R.attr.imageColorTint, tint, true); - fingerprint.setTint(tint.data); + Resources.Theme theme = requireActivity().getTheme(); + TypedArray ta = theme.obtainStyledAttributes(new int[] {R.attr.imageColorTint}); + fingerprint.setTint(ta.getColor(0, Color.GRAY)); + ta.recycle(); vh.messageView.setCompoundDrawables(null, null, null, fingerprint); vh.messageView.setCompoundDrawablePadding(Utils.dpInPx(20)); vh.messageView.setGravity(Gravity.CENTER);