alexandroid/decompiled/jadx/sources/androidx/appcompat/widget/AppCompatCheckedTextView.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

322 lines
15 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.util.AttributeSet;
import android.view.ActionMode;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inspector.InspectionCompanion;
import android.view.inspector.PropertyMapper;
import android.view.inspector.PropertyReader;
import android.widget.CheckedTextView;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.appcompat.R;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.view.TintableBackgroundView;
import androidx.core.widget.TextViewCompat;
import androidx.core.widget.TintableCheckedTextView;
import androidx.core.widget.TintableCompoundDrawablesView;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes.dex */
public class AppCompatCheckedTextView extends CheckedTextView implements TintableCheckedTextView, TintableBackgroundView, EmojiCompatConfigurationView, TintableCompoundDrawablesView {
@NonNull
private AppCompatEmojiTextHelper mAppCompatEmojiTextHelper;
private final AppCompatBackgroundHelper mBackgroundTintHelper;
private final AppCompatCheckedTextViewHelper mCheckedHelper;
private final AppCompatTextHelper mTextHelper;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@RequiresApi(29)
@RestrictTo({RestrictTo.Scope.LIBRARY})
public final class InspectionCompanion implements android.view.inspector.InspectionCompanion<AppCompatCheckedTextView> {
private int mBackgroundTintId;
private int mBackgroundTintModeId;
private int mCheckMarkTintId;
private int mCheckMarkTintModeId;
private int mDrawableTintId;
private int mDrawableTintModeId;
private boolean mPropertiesMapped = false;
@Override // android.view.inspector.InspectionCompanion
public void mapProperties(@NonNull PropertyMapper propertyMapper) {
this.mBackgroundTintId = propertyMapper.mapObject("backgroundTint", R.attr.backgroundTint);
this.mBackgroundTintModeId = propertyMapper.mapObject("backgroundTintMode", R.attr.backgroundTintMode);
this.mCheckMarkTintId = propertyMapper.mapObject("checkMarkTint", R.attr.checkMarkTint);
this.mCheckMarkTintModeId = propertyMapper.mapObject("checkMarkTintMode", R.attr.checkMarkTintMode);
this.mDrawableTintId = propertyMapper.mapObject("drawableTint", R.attr.drawableTint);
this.mDrawableTintModeId = propertyMapper.mapObject("drawableTintMode", R.attr.drawableTintMode);
this.mPropertiesMapped = true;
}
@Override // android.view.inspector.InspectionCompanion
public void readProperties(@NonNull AppCompatCheckedTextView appCompatCheckedTextView, @NonNull PropertyReader propertyReader) {
if (!this.mPropertiesMapped) {
throw new InspectionCompanion.UninitializedPropertyMapException();
}
propertyReader.readObject(this.mBackgroundTintId, appCompatCheckedTextView.getBackgroundTintList());
propertyReader.readObject(this.mBackgroundTintModeId, appCompatCheckedTextView.getBackgroundTintMode());
propertyReader.readObject(this.mCheckMarkTintId, appCompatCheckedTextView.getCheckMarkTintList());
propertyReader.readObject(this.mCheckMarkTintModeId, appCompatCheckedTextView.getCheckMarkTintMode());
propertyReader.readObject(this.mDrawableTintId, appCompatCheckedTextView.getCompoundDrawableTintList());
propertyReader.readObject(this.mDrawableTintModeId, appCompatCheckedTextView.getCompoundDrawableTintMode());
}
}
public AppCompatCheckedTextView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(TintContextWrapper.wrap(context), attributeSet, i);
ThemeUtils.checkAppCompatTheme(this, getContext());
AppCompatTextHelper appCompatTextHelper = new AppCompatTextHelper(this);
this.mTextHelper = appCompatTextHelper;
appCompatTextHelper.loadFromAttributes(attributeSet, i);
appCompatTextHelper.applyCompoundDrawablesTints();
AppCompatBackgroundHelper appCompatBackgroundHelper = new AppCompatBackgroundHelper(this);
this.mBackgroundTintHelper = appCompatBackgroundHelper;
appCompatBackgroundHelper.loadFromAttributes(attributeSet, i);
AppCompatCheckedTextViewHelper appCompatCheckedTextViewHelper = new AppCompatCheckedTextViewHelper(this);
this.mCheckedHelper = appCompatCheckedTextViewHelper;
appCompatCheckedTextViewHelper.loadFromAttributes(attributeSet, i);
getEmojiTextViewHelper().loadFromAttributes(attributeSet, i);
}
@NonNull
private AppCompatEmojiTextHelper getEmojiTextViewHelper() {
if (this.mAppCompatEmojiTextHelper == null) {
this.mAppCompatEmojiTextHelper = new AppCompatEmojiTextHelper(this);
}
return this.mAppCompatEmojiTextHelper;
}
@Override // android.widget.CheckedTextView, android.widget.TextView, android.view.View
public void drawableStateChanged() {
super.drawableStateChanged();
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.applyCompoundDrawablesTints();
}
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.applySupportBackgroundTint();
}
AppCompatCheckedTextViewHelper appCompatCheckedTextViewHelper = this.mCheckedHelper;
if (appCompatCheckedTextViewHelper != null) {
appCompatCheckedTextViewHelper.applyCheckMarkTint();
}
}
@Override // android.widget.TextView
@Nullable
public ActionMode.Callback getCustomSelectionActionModeCallback() {
return TextViewCompat.unwrapCustomSelectionActionModeCallback(super.getCustomSelectionActionModeCallback());
}
@Override // androidx.core.view.TintableBackgroundView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public ColorStateList getSupportBackgroundTintList() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.getSupportBackgroundTintList();
}
return null;
}
@Override // androidx.core.view.TintableBackgroundView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public PorterDuff.Mode getSupportBackgroundTintMode() {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
return appCompatBackgroundHelper.getSupportBackgroundTintMode();
}
return null;
}
@Override // androidx.core.widget.TintableCheckedTextView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public ColorStateList getSupportCheckMarkTintList() {
AppCompatCheckedTextViewHelper appCompatCheckedTextViewHelper = this.mCheckedHelper;
if (appCompatCheckedTextViewHelper != null) {
return appCompatCheckedTextViewHelper.getSupportCheckMarkTintList();
}
return null;
}
@Override // androidx.core.widget.TintableCheckedTextView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public PorterDuff.Mode getSupportCheckMarkTintMode() {
AppCompatCheckedTextViewHelper appCompatCheckedTextViewHelper = this.mCheckedHelper;
if (appCompatCheckedTextViewHelper != null) {
return appCompatCheckedTextViewHelper.getSupportCheckMarkTintMode();
}
return null;
}
@Override // androidx.core.widget.TintableCompoundDrawablesView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public ColorStateList getSupportCompoundDrawablesTintList() {
return this.mTextHelper.getCompoundDrawableTintList();
}
@Override // androidx.core.widget.TintableCompoundDrawablesView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
return this.mTextHelper.getCompoundDrawableTintMode();
}
@Override // androidx.appcompat.widget.EmojiCompatConfigurationView
public boolean isEmojiCompatEnabled() {
return getEmojiTextViewHelper().isEnabled();
}
@Override // android.widget.TextView, android.view.View
@Nullable
public InputConnection onCreateInputConnection(@NonNull EditorInfo editorInfo) {
return AppCompatHintHelper.onCreateInputConnection(super.onCreateInputConnection(editorInfo), editorInfo, this);
}
@Override // android.widget.TextView
public void setAllCaps(boolean z) {
super.setAllCaps(z);
getEmojiTextViewHelper().setAllCaps(z);
}
@Override // android.view.View
public void setBackgroundDrawable(@Nullable Drawable drawable) {
super.setBackgroundDrawable(drawable);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.onSetBackgroundDrawable(drawable);
}
}
@Override // android.view.View
public void setBackgroundResource(@DrawableRes int i) {
super.setBackgroundResource(i);
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.onSetBackgroundResource(i);
}
}
@Override // android.widget.CheckedTextView
public void setCheckMarkDrawable(@DrawableRes int i) {
setCheckMarkDrawable(AppCompatResources.getDrawable(getContext(), i));
}
@Override // android.widget.TextView
public void setCompoundDrawables(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
@Override // android.widget.TextView
public void setCompoundDrawablesRelative(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetCompoundDrawables();
}
}
@Override // android.widget.TextView
public void setCustomSelectionActionModeCallback(@Nullable ActionMode.Callback callback) {
super.setCustomSelectionActionModeCallback(TextViewCompat.wrapCustomSelectionActionModeCallback(this, callback));
}
@Override // androidx.appcompat.widget.EmojiCompatConfigurationView
public void setEmojiCompatEnabled(boolean z) {
getEmojiTextViewHelper().setEnabled(z);
}
@Override // androidx.core.view.TintableBackgroundView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportBackgroundTintList(@Nullable ColorStateList colorStateList) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.setSupportBackgroundTintList(colorStateList);
}
}
@Override // androidx.core.view.TintableBackgroundView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
if (appCompatBackgroundHelper != null) {
appCompatBackgroundHelper.setSupportBackgroundTintMode(mode);
}
}
@Override // androidx.core.widget.TintableCheckedTextView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportCheckMarkTintList(@Nullable ColorStateList colorStateList) {
AppCompatCheckedTextViewHelper appCompatCheckedTextViewHelper = this.mCheckedHelper;
if (appCompatCheckedTextViewHelper != null) {
appCompatCheckedTextViewHelper.setSupportCheckMarkTintList(colorStateList);
}
}
@Override // androidx.core.widget.TintableCheckedTextView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportCheckMarkTintMode(@Nullable PorterDuff.Mode mode) {
AppCompatCheckedTextViewHelper appCompatCheckedTextViewHelper = this.mCheckedHelper;
if (appCompatCheckedTextViewHelper != null) {
appCompatCheckedTextViewHelper.setSupportCheckMarkTintMode(mode);
}
}
@Override // androidx.core.widget.TintableCompoundDrawablesView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportCompoundDrawablesTintList(@Nullable ColorStateList colorStateList) {
this.mTextHelper.setCompoundDrawableTintList(colorStateList);
this.mTextHelper.applyCompoundDrawablesTints();
}
@Override // androidx.core.widget.TintableCompoundDrawablesView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode mode) {
this.mTextHelper.setCompoundDrawableTintMode(mode);
this.mTextHelper.applyCompoundDrawablesTints();
}
@Override // android.widget.TextView
public void setTextAppearance(@NonNull Context context, int i) {
super.setTextAppearance(context, i);
AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
if (appCompatTextHelper != null) {
appCompatTextHelper.onSetTextAppearance(context, i);
}
}
@Override // android.widget.CheckedTextView
public void setCheckMarkDrawable(@Nullable Drawable drawable) {
super.setCheckMarkDrawable(drawable);
AppCompatCheckedTextViewHelper appCompatCheckedTextViewHelper = this.mCheckedHelper;
if (appCompatCheckedTextViewHelper != null) {
appCompatCheckedTextViewHelper.onSetCheckMarkDrawable();
}
}
public AppCompatCheckedTextView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, R.attr.checkedTextViewStyle);
}
public AppCompatCheckedTextView(@NonNull Context context) {
this(context, null);
}
}