494 lines
15 KiB
Java
494 lines
15 KiB
Java
|
package com.google.android.material.card;
|
||
|
|
||
|
import android.R;
|
||
|
import android.content.Context;
|
||
|
import android.content.res.ColorStateList;
|
||
|
import android.graphics.Rect;
|
||
|
import android.graphics.RectF;
|
||
|
import android.graphics.drawable.Drawable;
|
||
|
import android.graphics.drawable.InsetDrawable;
|
||
|
import android.os.Build;
|
||
|
import android.util.AttributeSet;
|
||
|
import android.view.accessibility.AccessibilityEvent;
|
||
|
import android.view.accessibility.AccessibilityNodeInfo;
|
||
|
import android.widget.Checkable;
|
||
|
import androidx.cardview.widget.CardView;
|
||
|
import o.AgY;
|
||
|
import o.C17052tZT;
|
||
|
import o.C2753akZ;
|
||
|
import o.C4363bXv;
|
||
|
import o.FLD;
|
||
|
import o.Jaq;
|
||
|
import o.Lot;
|
||
|
import o.Tlu;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public class MaterialCardView extends CardView implements Checkable, Jaq {
|
||
|
private boolean k;
|
||
|
private boolean m;
|
||
|
private final C2753akZ n;
|
||
|
private boolean p;
|
||
|
private LWm r;
|
||
|
private static final int[] g = {R.attr.state_checkable};
|
||
|
private static final int[] f = {R.attr.state_checked};
|
||
|
|
||
|
/* renamed from: o, reason: collision with root package name */
|
||
|
private static final int[] f6470o = {C17052tZT.IeS.state_dragged};
|
||
|
private static final int l = C17052tZT.NHB.Widget_MaterialComponents_CardView;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public interface LWm {
|
||
|
}
|
||
|
|
||
|
public MaterialCardView(Context context) {
|
||
|
this(context, null);
|
||
|
}
|
||
|
|
||
|
public MaterialCardView(Context context, AttributeSet attributeSet) {
|
||
|
this(context, attributeSet, C17052tZT.IeS.materialCardViewStyle);
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Illegal instructions before constructor call */
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
public MaterialCardView(android.content.Context r10, android.util.AttributeSet r11, int r12) {
|
||
|
/*
|
||
|
Method dump skipped, instructions count: 380
|
||
|
To view this dump add '--comments-level debug' option
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.card.MaterialCardView.<init>(android.content.Context, android.util.AttributeSet, int):void");
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
|
||
|
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
|
||
|
accessibilityNodeInfo.setClassName("androidx.cardview.widget.CardView");
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
accessibilityNodeInfo.setCheckable(c2753akZ != null && c2753akZ.b);
|
||
|
accessibilityNodeInfo.setClickable(isClickable());
|
||
|
accessibilityNodeInfo.setChecked(isChecked());
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
||
|
super.onInitializeAccessibilityEvent(accessibilityEvent);
|
||
|
accessibilityEvent.setClassName("androidx.cardview.widget.CardView");
|
||
|
accessibilityEvent.setChecked(isChecked());
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView, android.widget.FrameLayout, android.view.View
|
||
|
public void onMeasure(int i, int i2) {
|
||
|
super.onMeasure(i, i2);
|
||
|
this.n.a(getMeasuredWidth(), getMeasuredHeight());
|
||
|
}
|
||
|
|
||
|
public void setStrokeColor(int i) {
|
||
|
setStrokeColor(ColorStateList.valueOf(i));
|
||
|
}
|
||
|
|
||
|
public void setStrokeColor(ColorStateList colorStateList) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
if (c2753akZ.s != colorStateList) {
|
||
|
c2753akZ.s = colorStateList;
|
||
|
C4363bXv c4363bXv = c2753akZ.f;
|
||
|
float f2 = c2753akZ.p;
|
||
|
ColorStateList colorStateList2 = c2753akZ.s;
|
||
|
c4363bXv.B.p = f2;
|
||
|
c4363bXv.invalidateSelf();
|
||
|
if (c4363bXv.B.r != colorStateList2) {
|
||
|
c4363bXv.B.r = colorStateList2;
|
||
|
c4363bXv.onStateChange(c4363bXv.getState());
|
||
|
}
|
||
|
}
|
||
|
invalidate();
|
||
|
}
|
||
|
|
||
|
public void setStrokeWidth(int i) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
if (i != c2753akZ.p) {
|
||
|
c2753akZ.p = i;
|
||
|
C4363bXv c4363bXv = c2753akZ.f;
|
||
|
float f2 = c2753akZ.p;
|
||
|
ColorStateList colorStateList = c2753akZ.s;
|
||
|
c4363bXv.B.p = f2;
|
||
|
c4363bXv.invalidateSelf();
|
||
|
if (c4363bXv.B.r != colorStateList) {
|
||
|
c4363bXv.B.r = colorStateList;
|
||
|
c4363bXv.onStateChange(c4363bXv.getState());
|
||
|
}
|
||
|
}
|
||
|
invalidate();
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Code restructure failed: missing block: B:6:0x0057, code lost:
|
||
|
|
||
|
if (r1.Ln_(r5.F) == false) goto L8;
|
||
|
*/
|
||
|
/* JADX WARN: Removed duplicated region for block: B:12:? A[RETURN, SYNTHETIC] */
|
||
|
/* JADX WARN: Removed duplicated region for block: B:9:0x0062 */
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
/*
|
||
|
Code decompiled incorrectly, please refer to instructions dump.
|
||
|
To view partially-correct add '--show-bad-code' argument
|
||
|
*/
|
||
|
public void setRadius(float r5) {
|
||
|
/*
|
||
|
r4 = this;
|
||
|
super.setRadius(r5)
|
||
|
o.akZ r0 = r4.n
|
||
|
o.FLD r1 = r0.t
|
||
|
o.FLD$RVV r2 = new o.FLD$RVV
|
||
|
r2.<init>(r1)
|
||
|
o.xWe r1 = new o.xWe
|
||
|
r1.<init>(r5)
|
||
|
r2.f = r1
|
||
|
o.xWe r1 = new o.xWe
|
||
|
r1.<init>(r5)
|
||
|
r2.k = r1
|
||
|
o.xWe r1 = new o.xWe
|
||
|
r1.<init>(r5)
|
||
|
r2.d = r1
|
||
|
o.xWe r1 = new o.xWe
|
||
|
r1.<init>(r5)
|
||
|
r2.e = r1
|
||
|
o.FLD r5 = new o.FLD
|
||
|
r1 = 0
|
||
|
r5.<init>(r2, r1)
|
||
|
r0.a(r5)
|
||
|
android.graphics.drawable.Drawable r5 = r0.j
|
||
|
r5.invalidateSelf()
|
||
|
boolean r5 = r0.e()
|
||
|
if (r5 != 0) goto L59
|
||
|
com.google.android.material.card.MaterialCardView r5 = r0.k
|
||
|
boolean r5 = r5.d
|
||
|
if (r5 == 0) goto L5c
|
||
|
o.bXv r5 = r0.c
|
||
|
o.bXv$LWm r1 = r5.B
|
||
|
o.FLD r1 = r1.l
|
||
|
android.graphics.RectF r2 = r5.F
|
||
|
android.graphics.Rect r3 = r5.getBounds()
|
||
|
r2.set(r3)
|
||
|
android.graphics.RectF r5 = r5.F
|
||
|
boolean r5 = r1.Ln_(r5)
|
||
|
if (r5 != 0) goto L5c
|
||
|
L59:
|
||
|
r0.a()
|
||
|
L5c:
|
||
|
boolean r5 = r0.e()
|
||
|
if (r5 == 0) goto L65
|
||
|
r0.c()
|
||
|
L65:
|
||
|
return
|
||
|
*/
|
||
|
throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.card.MaterialCardView.setRadius(float):void");
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public final float f() {
|
||
|
return this.n.c.h();
|
||
|
}
|
||
|
|
||
|
public void setProgress(float f2) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
C4363bXv c4363bXv = c2753akZ.c;
|
||
|
if (c4363bXv.B.h != f2) {
|
||
|
c4363bXv.B.h = f2;
|
||
|
c4363bXv.H = true;
|
||
|
c4363bXv.invalidateSelf();
|
||
|
}
|
||
|
C4363bXv c4363bXv2 = c2753akZ.f;
|
||
|
if (c4363bXv2 != null && c4363bXv2.B.h != f2) {
|
||
|
c4363bXv2.B.h = f2;
|
||
|
c4363bXv2.H = true;
|
||
|
c4363bXv2.invalidateSelf();
|
||
|
}
|
||
|
C4363bXv c4363bXv3 = c2753akZ.m;
|
||
|
if (c4363bXv3 == null || c4363bXv3.B.h == f2) {
|
||
|
return;
|
||
|
}
|
||
|
c4363bXv3.B.h = f2;
|
||
|
c4363bXv3.H = true;
|
||
|
c4363bXv3.invalidateSelf();
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public void setContentPadding(int i, int i2, int i3, int i4) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
c2753akZ.q.set(i, i2, i3, i4);
|
||
|
c2753akZ.a();
|
||
|
}
|
||
|
|
||
|
public final void e(int i, int i2, int i3, int i4) {
|
||
|
super.setContentPadding(i, i2, i3, i4);
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public void setCardBackgroundColor(int i) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
ColorStateList valueOf = ColorStateList.valueOf(i);
|
||
|
C4363bXv c4363bXv = c2753akZ.c;
|
||
|
if (c4363bXv.B.d != valueOf) {
|
||
|
c4363bXv.B.d = valueOf;
|
||
|
c4363bXv.onStateChange(c4363bXv.getState());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public void setCardBackgroundColor(ColorStateList colorStateList) {
|
||
|
C4363bXv c4363bXv = this.n.c;
|
||
|
if (c4363bXv.B.d != colorStateList) {
|
||
|
c4363bXv.B.d = colorStateList;
|
||
|
c4363bXv.onStateChange(c4363bXv.getState());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public final ColorStateList In_() {
|
||
|
return this.n.c.B.d;
|
||
|
}
|
||
|
|
||
|
public void setCardForegroundColor(ColorStateList colorStateList) {
|
||
|
C4363bXv c4363bXv = this.n.f;
|
||
|
if (colorStateList == null) {
|
||
|
colorStateList = ColorStateList.valueOf(0);
|
||
|
}
|
||
|
if (c4363bXv.B.d != colorStateList) {
|
||
|
c4363bXv.B.d = colorStateList;
|
||
|
c4363bXv.onStateChange(c4363bXv.getState());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public void setClickable(boolean z) {
|
||
|
super.setClickable(z);
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
if (c2753akZ != null) {
|
||
|
Drawable drawable = c2753akZ.j;
|
||
|
Drawable Iq_ = c2753akZ.k.isClickable() ? c2753akZ.Iq_() : c2753akZ.f;
|
||
|
c2753akZ.j = Iq_;
|
||
|
if (drawable != Iq_) {
|
||
|
if (c2753akZ.k.getForeground() instanceof InsetDrawable) {
|
||
|
((InsetDrawable) c2753akZ.k.getForeground()).setDrawable(Iq_);
|
||
|
} else {
|
||
|
c2753akZ.k.setForeground(c2753akZ.Ir_(Iq_));
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.view.ViewGroup, android.view.View
|
||
|
protected void onAttachedToWindow() {
|
||
|
super.onAttachedToWindow();
|
||
|
C4363bXv c4363bXv = this.n.c;
|
||
|
if (c4363bXv.B.c == null || !c4363bXv.B.c.a) {
|
||
|
return;
|
||
|
}
|
||
|
c4363bXv.k(Lot.e(this));
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public void setCardElevation(float f2) {
|
||
|
super.setCardElevation(f2);
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
c2753akZ.c.n(CardView.e.c(c2753akZ.k.a));
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public void setMaxCardElevation(float f2) {
|
||
|
super.setMaxCardElevation(f2);
|
||
|
this.n.c();
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public void setUseCompatPadding(boolean z) {
|
||
|
super.setUseCompatPadding(z);
|
||
|
this.n.c();
|
||
|
this.n.a();
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public void setPreventCornerOverlap(boolean z) {
|
||
|
super.setPreventCornerOverlap(z);
|
||
|
this.n.c();
|
||
|
this.n.a();
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public void setBackground(Drawable drawable) {
|
||
|
setBackgroundDrawable(drawable);
|
||
|
}
|
||
|
|
||
|
public final void Io_(Drawable drawable) {
|
||
|
super.setBackgroundDrawable(drawable);
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.Checkable
|
||
|
public void setChecked(boolean z) {
|
||
|
if (this.k != z) {
|
||
|
toggle();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setDragged(boolean z) {
|
||
|
if (this.m != z) {
|
||
|
this.m = z;
|
||
|
refreshDrawableState();
|
||
|
j();
|
||
|
invalidate();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.Checkable
|
||
|
public void toggle() {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
if (c2753akZ != null && c2753akZ.b && isEnabled()) {
|
||
|
this.k = !this.k;
|
||
|
refreshDrawableState();
|
||
|
j();
|
||
|
this.n.c(this.k, true);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // android.view.ViewGroup, android.view.View
|
||
|
protected int[] onCreateDrawableState(int i) {
|
||
|
int[] onCreateDrawableState = super.onCreateDrawableState(i + 3);
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
if (c2753akZ != null && c2753akZ.b) {
|
||
|
mergeDrawableStates(onCreateDrawableState, g);
|
||
|
}
|
||
|
if (isChecked()) {
|
||
|
mergeDrawableStates(onCreateDrawableState, f);
|
||
|
}
|
||
|
if (this.m) {
|
||
|
mergeDrawableStates(onCreateDrawableState, f6470o);
|
||
|
}
|
||
|
return onCreateDrawableState;
|
||
|
}
|
||
|
|
||
|
public void setRippleColor(ColorStateList colorStateList) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
c2753akZ.l = colorStateList;
|
||
|
c2753akZ.d();
|
||
|
}
|
||
|
|
||
|
public void setRippleColorResource(int i) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
c2753akZ.l = AgY.dS_(getContext(), i);
|
||
|
c2753akZ.d();
|
||
|
}
|
||
|
|
||
|
public void setCheckedIconResource(int i) {
|
||
|
this.n.Is_(AgY.dT_(getContext(), i));
|
||
|
}
|
||
|
|
||
|
public void setCheckedIcon(Drawable drawable) {
|
||
|
this.n.Is_(drawable);
|
||
|
}
|
||
|
|
||
|
public void setCheckedIconTint(ColorStateList colorStateList) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
c2753akZ.i = colorStateList;
|
||
|
Drawable drawable = c2753akZ.e;
|
||
|
if (drawable != null) {
|
||
|
Tlu.pF_(drawable, colorStateList);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setCheckedIconSizeResource(int i) {
|
||
|
if (i != 0) {
|
||
|
this.n.g = getResources().getDimensionPixelSize(i);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setCheckedIconMarginResource(int i) {
|
||
|
if (i != -1) {
|
||
|
this.n.h = getResources().getDimensionPixelSize(i);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void j() {
|
||
|
C2753akZ c2753akZ;
|
||
|
Drawable drawable;
|
||
|
if (Build.VERSION.SDK_INT <= 26 || (drawable = (c2753akZ = this.n).f8522o) == null) {
|
||
|
return;
|
||
|
}
|
||
|
Rect bounds = drawable.getBounds();
|
||
|
int i = bounds.bottom;
|
||
|
c2753akZ.f8522o.setBounds(bounds.left, bounds.top, bounds.right, i - 1);
|
||
|
c2753akZ.f8522o.setBounds(bounds.left, bounds.top, bounds.right, i);
|
||
|
}
|
||
|
|
||
|
public final float h() {
|
||
|
return super.f();
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public final int q_() {
|
||
|
return this.n.q.bottom;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public final int r_() {
|
||
|
return this.n.q.left;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public final int s_() {
|
||
|
return this.n.q.right;
|
||
|
}
|
||
|
|
||
|
@Override // androidx.cardview.widget.CardView
|
||
|
public final int t_() {
|
||
|
return this.n.q.top;
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View
|
||
|
public void setBackgroundDrawable(Drawable drawable) {
|
||
|
if (this.p) {
|
||
|
if (!this.n.n) {
|
||
|
this.n.n = true;
|
||
|
}
|
||
|
super.setBackgroundDrawable(drawable);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setCheckable(boolean z) {
|
||
|
this.n.b = z;
|
||
|
}
|
||
|
|
||
|
public void setCheckedIconGravity(int i) {
|
||
|
if (this.n.d != i) {
|
||
|
C2753akZ c2753akZ = this.n;
|
||
|
c2753akZ.d = i;
|
||
|
c2753akZ.a(c2753akZ.k.getMeasuredWidth(), c2753akZ.k.getMeasuredHeight());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void setCheckedIconMargin(int i) {
|
||
|
this.n.h = i;
|
||
|
}
|
||
|
|
||
|
public void setCheckedIconSize(int i) {
|
||
|
this.n.g = i;
|
||
|
}
|
||
|
|
||
|
@Override // o.Jaq
|
||
|
public void setShapeAppearanceModel(FLD fld) {
|
||
|
RectF rectF = new RectF();
|
||
|
rectF.set(this.n.c.getBounds());
|
||
|
setClipToOutline(fld.Ln_(rectF));
|
||
|
this.n.a(fld);
|
||
|
}
|
||
|
|
||
|
public void setOnCheckedChangeListener(LWm lWm) {
|
||
|
this.r = lWm;
|
||
|
}
|
||
|
|
||
|
@Override // android.widget.Checkable
|
||
|
public boolean isChecked() {
|
||
|
return this.k;
|
||
|
}
|
||
|
}
|