Clean up redundant compat usages

This commit is contained in:
TacoTheDank 2022-04-07 16:49:35 -04:00
parent 4d873e59f0
commit a3b70aa061
21 changed files with 40 additions and 64 deletions

View file

@ -9,8 +9,6 @@ import android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
import android.view.WindowInsetsController
import android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
import androidx.annotation.ColorInt
import androidx.appcompat.widget.Toolbar
import androidx.core.view.WindowInsetsControllerCompat
import code.name.monkey.appthemehelper.util.ColorUtil
import code.name.monkey.appthemehelper.util.TintHelper
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper

View file

@ -8,8 +8,6 @@ import androidx.preference.PreferenceFragmentCompat;
import code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs.ATEListPreferenceDialogFragmentCompat;
import code.name.monkey.appthemehelper.common.prefs.supportv7.dialogs.ATEPreferenceDialogFragment;
import static androidx.preference.PreferenceFragmentCompat.*;
/**
* @author Karim Abou Zeid (kabouzeid)
*/

View file

@ -5,7 +5,6 @@ import android.text.Editable
import android.util.AttributeSet
import android.widget.SeekBar
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.core.graphics.BlendModeColorFilterCompat
import androidx.core.graphics.BlendModeCompat
import androidx.core.widget.doAfterTextChanged

View file

@ -96,8 +96,8 @@ public final class TintHelper {
return null;
}
drawable = DrawableCompat.wrap(drawable.mutate());
DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN);
DrawableCompat.setTint(drawable, color);
drawable.setTintMode(PorterDuff.Mode.SRC_IN);
drawable.setTint(color);
return drawable;
}
@ -109,7 +109,7 @@ public final class TintHelper {
return null;
}
Drawable temp = DrawableCompat.wrap(drawable.mutate());
DrawableCompat.setTintList(temp, sl);
temp.setTintList(sl);
return temp;
}

View file

@ -550,7 +550,7 @@ public final class ToolbarContentTintHelper {
if (toolbar != null && toolbar.getOverflowIcon() != null) {
Drawable bg = DrawableCompat.wrap(toolbar.getOverflowIcon());
DrawableCompat.setTint(bg, toolbarIconsColor);
bg.setTint(toolbarIconsColor);
}
removeOnGlobalLayoutListener(decorView, this);
}
@ -588,7 +588,7 @@ public final class ToolbarContentTintHelper {
if (drawable != null) {
final Drawable wrapped = DrawableCompat.wrap(drawable);
drawable.mutate();
DrawableCompat.setTint(wrapped, color);
wrapped.setTint(color);
item.setIcon(drawable);
}
}
@ -603,7 +603,7 @@ public final class ToolbarContentTintHelper {
final Drawable drawable = image.getDrawable();
final Drawable wrapped = DrawableCompat.wrap(drawable);
drawable.mutate();
DrawableCompat.setTint(wrapped, color);
wrapped.setTint(color);
image.setImageDrawable(drawable);
}
}