316 lines
8.9 KiB
Java
316 lines
8.9 KiB
Java
package androidx.appcompat.widget;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.ColorStateList;
|
|
import android.graphics.PorterDuff;
|
|
import android.graphics.drawable.Drawable;
|
|
import android.text.InputFilter;
|
|
import android.util.AttributeSet;
|
|
import android.view.ActionMode;
|
|
import android.view.accessibility.AccessibilityEvent;
|
|
import android.view.accessibility.AccessibilityNodeInfo;
|
|
import android.widget.Button;
|
|
import o.KBh;
|
|
import o.SYO;
|
|
import o.URz;
|
|
import o.WpN;
|
|
import o.WvB;
|
|
import o.Yoi;
|
|
import o.ZzE;
|
|
import o.mxt;
|
|
import o.nKv;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class AppCompatButton extends Button implements KBh {
|
|
private WvB mAppCompatEmojiTextHelper;
|
|
private final WpN mBackgroundTintHelper;
|
|
private final Yoi mTextHelper;
|
|
|
|
public AppCompatButton(Context context) {
|
|
this(context, null);
|
|
}
|
|
|
|
public AppCompatButton(Context context, AttributeSet attributeSet) {
|
|
this(context, attributeSet, SYO.IeS.buttonStyle);
|
|
}
|
|
|
|
public AppCompatButton(Context context, AttributeSet attributeSet, int i) {
|
|
super(ZzE.b(context), attributeSet, i);
|
|
nKv.b(getContext());
|
|
WpN wpN = new WpN(this);
|
|
this.mBackgroundTintHelper = wpN;
|
|
wpN.fy_(attributeSet, i);
|
|
Yoi yoi = new Yoi(this);
|
|
this.mTextHelper = yoi;
|
|
yoi.he_(attributeSet, i);
|
|
yoi.a();
|
|
getEmojiTextViewHelper().gm_(attributeSet, i);
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackgroundResource(int i) {
|
|
super.setBackgroundResource(i);
|
|
WpN wpN = this.mBackgroundTintHelper;
|
|
if (wpN != null) {
|
|
wpN.c(i);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void setBackgroundDrawable(Drawable drawable) {
|
|
super.setBackgroundDrawable(drawable);
|
|
WpN wpN = this.mBackgroundTintHelper;
|
|
if (wpN != null) {
|
|
wpN.fz_(drawable);
|
|
}
|
|
}
|
|
|
|
public void setSupportBackgroundTintList(ColorStateList colorStateList) {
|
|
WpN wpN = this.mBackgroundTintHelper;
|
|
if (wpN != null) {
|
|
wpN.fB_(colorStateList);
|
|
}
|
|
}
|
|
|
|
public ColorStateList getSupportBackgroundTintList() {
|
|
WpN wpN = this.mBackgroundTintHelper;
|
|
if (wpN != null) {
|
|
return wpN.fw_();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
|
|
WpN wpN = this.mBackgroundTintHelper;
|
|
if (wpN != null) {
|
|
wpN.fC_(mode);
|
|
}
|
|
}
|
|
|
|
public PorterDuff.Mode getSupportBackgroundTintMode() {
|
|
WpN wpN = this.mBackgroundTintHelper;
|
|
if (wpN != null) {
|
|
return wpN.fx_();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override // android.widget.TextView, android.view.View
|
|
protected void drawableStateChanged() {
|
|
super.drawableStateChanged();
|
|
WpN wpN = this.mBackgroundTintHelper;
|
|
if (wpN != null) {
|
|
wpN.a();
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.a();
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public void setTextAppearance(Context context, int i) {
|
|
super.setTextAppearance(context, i);
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.d(context, i);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onInitializeAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
|
|
super.onInitializeAccessibilityEvent(accessibilityEvent);
|
|
accessibilityEvent.setClassName(Button.class.getName());
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
|
|
super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
|
|
accessibilityNodeInfo.setClassName(Button.class.getName());
|
|
}
|
|
|
|
@Override // android.widget.TextView, android.view.View
|
|
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
|
|
super.onLayout(z, i, i2, i3, i4);
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.b(z, i, i2, i3, i4);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public void setTextSize(int i, float f) {
|
|
if (mxt.a) {
|
|
super.setTextSize(i, f);
|
|
return;
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.e(i, f);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
|
super.onTextChanged(charSequence, i, i2, i3);
|
|
if (this.mTextHelper == null || mxt.a || !this.mTextHelper.i()) {
|
|
return;
|
|
}
|
|
this.mTextHelper.b();
|
|
}
|
|
|
|
@Override // android.widget.TextView, o.KBh
|
|
public void setAutoSizeTextTypeWithDefaults(int i) {
|
|
if (mxt.a) {
|
|
super.setAutoSizeTextTypeWithDefaults(i);
|
|
return;
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.c(i);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView, o.KBh
|
|
public void setAutoSizeTextTypeUniformWithConfiguration(int i, int i2, int i3, int i4) throws IllegalArgumentException {
|
|
if (mxt.a) {
|
|
super.setAutoSizeTextTypeUniformWithConfiguration(i, i2, i3, i4);
|
|
return;
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.b(i, i2, i3, i4);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public void setAutoSizeTextTypeUniformWithPresetSizes(int[] iArr, int i) throws IllegalArgumentException {
|
|
if (mxt.a) {
|
|
super.setAutoSizeTextTypeUniformWithPresetSizes(iArr, i);
|
|
return;
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.c(iArr, i);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public int getAutoSizeTextType() {
|
|
if (mxt.a) {
|
|
return super.getAutoSizeTextType() == 1 ? 1 : 0;
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
return yoi.j();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public int getAutoSizeStepGranularity() {
|
|
if (mxt.a) {
|
|
return super.getAutoSizeStepGranularity();
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
return yoi.d();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public int getAutoSizeMinTextSize() {
|
|
if (mxt.a) {
|
|
return super.getAutoSizeMinTextSize();
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
return yoi.e();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public int getAutoSizeMaxTextSize() {
|
|
if (mxt.a) {
|
|
return super.getAutoSizeMaxTextSize();
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
return yoi.c();
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public int[] getAutoSizeTextAvailableSizes() {
|
|
if (mxt.a) {
|
|
return super.getAutoSizeTextAvailableSizes();
|
|
}
|
|
Yoi yoi = this.mTextHelper;
|
|
return yoi != null ? yoi.f() : new int[0];
|
|
}
|
|
|
|
public void setSupportAllCaps(boolean z) {
|
|
Yoi yoi = this.mTextHelper;
|
|
if (yoi != null) {
|
|
yoi.a(z);
|
|
}
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
|
|
super.setCustomSelectionActionModeCallback(URz.wh_(this, callback));
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public ActionMode.Callback getCustomSelectionActionModeCallback() {
|
|
return URz.wg_(super.getCustomSelectionActionModeCallback());
|
|
}
|
|
|
|
public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
|
|
this.mTextHelper.hh_(colorStateList);
|
|
this.mTextHelper.a();
|
|
}
|
|
|
|
public ColorStateList getSupportCompoundDrawablesTintList() {
|
|
return this.mTextHelper.hc_();
|
|
}
|
|
|
|
public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
|
|
this.mTextHelper.hi_(mode);
|
|
this.mTextHelper.a();
|
|
}
|
|
|
|
public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
|
|
return this.mTextHelper.hd_();
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public void setFilters(InputFilter[] inputFilterArr) {
|
|
super.setFilters(getEmojiTextViewHelper().gl_(inputFilterArr));
|
|
}
|
|
|
|
private WvB getEmojiTextViewHelper() {
|
|
if (this.mAppCompatEmojiTextHelper == null) {
|
|
this.mAppCompatEmojiTextHelper = new WvB(this);
|
|
}
|
|
return this.mAppCompatEmojiTextHelper;
|
|
}
|
|
|
|
@Override // android.widget.TextView
|
|
public void setAllCaps(boolean z) {
|
|
super.setAllCaps(z);
|
|
getEmojiTextViewHelper().e(z);
|
|
}
|
|
|
|
public void setEmojiCompatEnabled(boolean z) {
|
|
getEmojiTextViewHelper().a(z);
|
|
}
|
|
|
|
public boolean isEmojiCompatEnabled() {
|
|
return getEmojiTextViewHelper().b();
|
|
}
|
|
}
|