From c7133974bed868b581aef8ccf62066669f816860 Mon Sep 17 00:00:00 2001 From: Thonsi <10291398+thonsi@users.noreply.github.com> Date: Sat, 25 Mar 2023 17:51:29 +0530 Subject: [PATCH] Clean up some codes --- ...kgroundColorFixLayoutInflaterListener.java | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 app/src/main/java/com/topjohnwu/magisk/widget/Pre23CardViewBackgroundColorFixLayoutInflaterListener.java diff --git a/app/src/main/java/com/topjohnwu/magisk/widget/Pre23CardViewBackgroundColorFixLayoutInflaterListener.java b/app/src/main/java/com/topjohnwu/magisk/widget/Pre23CardViewBackgroundColorFixLayoutInflaterListener.java deleted file mode 100644 index 2d9b9d661..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/widget/Pre23CardViewBackgroundColorFixLayoutInflaterListener.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.topjohnwu.magisk.widget; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.content.res.ColorStateList; -import android.util.AttributeSet; -import android.view.View; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.appcompat.widget.TintTypedArray; -import androidx.cardview.widget.CardView; - -import rikka.layoutinflater.view.LayoutInflaterFactory; - -public class Pre23CardViewBackgroundColorFixLayoutInflaterListener implements LayoutInflaterFactory.OnViewCreatedListener { - - private final static Pre23CardViewBackgroundColorFixLayoutInflaterListener INSTANCE = new Pre23CardViewBackgroundColorFixLayoutInflaterListener(); - - public static Pre23CardViewBackgroundColorFixLayoutInflaterListener getInstance() { - return INSTANCE; - } - - @SuppressLint("RestrictedApi") - @Override - public void onViewCreated(@NonNull View view, @Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) { - if (!(view instanceof CardView)) { - return; - } - - TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs, androidx.cardview.R.styleable.CardView); - if (a.hasValue(androidx.cardview.R.styleable.CardView_cardBackgroundColor)) { - ColorStateList colorStateList = a.getColorStateList(androidx.cardview.R.styleable.CardView_cardBackgroundColor); - if (colorStateList != null) { - ((CardView) view).setCardBackgroundColor(colorStateList); - } - } - a.recycle(); - } -} -