package androidx.appcompat.widget; import android.R; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.text.method.KeyListener; import android.util.AttributeSet; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.view.inspector.PropertyMapper; import android.view.inspector.PropertyReader; import android.widget.MultiAutoCompleteTextView; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; import androidx.annotation.RestrictTo; import androidx.appcompat.content.res.AppCompatResources; import androidx.core.view.TintableBackgroundView; import androidx.core.widget.TintableCompoundDrawablesView; /* loaded from: classes.dex */ public class AppCompatMultiAutoCompleteTextView extends MultiAutoCompleteTextView implements TintableBackgroundView, EmojiCompatConfigurationView, TintableCompoundDrawablesView { private static final int[] TINT_ATTRS = {R.attr.popupBackground}; @NonNull private final AppCompatEmojiEditTextHelper mAppCompatEmojiEditTextHelper; private final AppCompatBackgroundHelper mBackgroundTintHelper; private final AppCompatTextHelper mTextHelper; @RequiresApi(29) @RestrictTo({RestrictTo.Scope.LIBRARY}) public final class InspectionCompanion implements android.view.inspector.InspectionCompanion { private int mBackgroundTintId; private int mBackgroundTintModeId; private int mDrawableTintId; private int mDrawableTintModeId; private boolean mPropertiesMapped = false; public void mapProperties(@NonNull PropertyMapper propertyMapper) { int mapObject; int mapObject2; int mapObject3; int mapObject4; mapObject = propertyMapper.mapObject("backgroundTint", androidx.appcompat.R.attr.backgroundTint); this.mBackgroundTintId = mapObject; mapObject2 = propertyMapper.mapObject("backgroundTintMode", androidx.appcompat.R.attr.backgroundTintMode); this.mBackgroundTintModeId = mapObject2; mapObject3 = propertyMapper.mapObject("drawableTint", androidx.appcompat.R.attr.drawableTint); this.mDrawableTintId = mapObject3; mapObject4 = propertyMapper.mapObject("drawableTintMode", androidx.appcompat.R.attr.drawableTintMode); this.mDrawableTintModeId = mapObject4; this.mPropertiesMapped = true; } public void readProperties(@NonNull AppCompatMultiAutoCompleteTextView appCompatMultiAutoCompleteTextView, @NonNull PropertyReader propertyReader) { if (!this.mPropertiesMapped) { throw AppCompatAutoCompleteTextView$InspectionCompanion$$ExternalSyntheticApiModelOutline2.m(); } propertyReader.readObject(this.mBackgroundTintId, appCompatMultiAutoCompleteTextView.getBackgroundTintList()); propertyReader.readObject(this.mBackgroundTintModeId, appCompatMultiAutoCompleteTextView.getBackgroundTintMode()); propertyReader.readObject(this.mDrawableTintId, appCompatMultiAutoCompleteTextView.getCompoundDrawableTintList()); propertyReader.readObject(this.mDrawableTintModeId, appCompatMultiAutoCompleteTextView.getCompoundDrawableTintMode()); } } public AppCompatMultiAutoCompleteTextView(@NonNull Context context) { this(context, null); } public AppCompatMultiAutoCompleteTextView(@NonNull Context context, @Nullable AttributeSet attributeSet) { this(context, attributeSet, androidx.appcompat.R.attr.autoCompleteTextViewStyle); } public AppCompatMultiAutoCompleteTextView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) { super(TintContextWrapper.wrap(context), attributeSet, i); ThemeUtils.checkAppCompatTheme(this, getContext()); TintTypedArray obtainStyledAttributes = TintTypedArray.obtainStyledAttributes(getContext(), attributeSet, TINT_ATTRS, i, 0); if (obtainStyledAttributes.hasValue(0)) { setDropDownBackgroundDrawable(obtainStyledAttributes.getDrawable(0)); } obtainStyledAttributes.recycle(); AppCompatBackgroundHelper appCompatBackgroundHelper = new AppCompatBackgroundHelper(this); this.mBackgroundTintHelper = appCompatBackgroundHelper; appCompatBackgroundHelper.loadFromAttributes(attributeSet, i); AppCompatTextHelper appCompatTextHelper = new AppCompatTextHelper(this); this.mTextHelper = appCompatTextHelper; appCompatTextHelper.loadFromAttributes(attributeSet, i); appCompatTextHelper.applyCompoundDrawablesTints(); AppCompatEmojiEditTextHelper appCompatEmojiEditTextHelper = new AppCompatEmojiEditTextHelper(this); this.mAppCompatEmojiEditTextHelper = appCompatEmojiEditTextHelper; appCompatEmojiEditTextHelper.loadFromAttributes(attributeSet, i); initEmojiKeyListener(appCompatEmojiEditTextHelper); } public void initEmojiKeyListener(AppCompatEmojiEditTextHelper appCompatEmojiEditTextHelper) { KeyListener keyListener = getKeyListener(); if (appCompatEmojiEditTextHelper.isEmojiCapableKeyListener(keyListener)) { boolean isFocusable = super.isFocusable(); boolean isClickable = super.isClickable(); boolean isLongClickable = super.isLongClickable(); int inputType = super.getInputType(); KeyListener keyListener2 = appCompatEmojiEditTextHelper.getKeyListener(keyListener); if (keyListener2 == keyListener) { return; } super.setKeyListener(keyListener2); super.setRawInputType(inputType); super.setFocusable(isFocusable); super.setClickable(isClickable); super.setLongClickable(isLongClickable); } } @Override // android.widget.AutoCompleteTextView public void setDropDownBackgroundResource(@DrawableRes int i) { setDropDownBackgroundDrawable(AppCompatResources.getDrawable(getContext(), i)); } @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.view.View public void setBackgroundDrawable(@Nullable Drawable drawable) { super.setBackgroundDrawable(drawable); AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper; if (appCompatBackgroundHelper != null) { appCompatBackgroundHelper.onSetBackgroundDrawable(drawable); } } @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 @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 @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.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 // android.widget.TextView, android.view.View public void drawableStateChanged() { super.drawableStateChanged(); AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper; if (appCompatBackgroundHelper != null) { appCompatBackgroundHelper.applySupportBackgroundTint(); } AppCompatTextHelper appCompatTextHelper = this.mTextHelper; if (appCompatTextHelper != null) { appCompatTextHelper.applyCompoundDrawablesTints(); } } @Override // android.widget.TextView public void setTextAppearance(Context context, int i) { super.setTextAppearance(context, i); AppCompatTextHelper appCompatTextHelper = this.mTextHelper; if (appCompatTextHelper != null) { appCompatTextHelper.onSetTextAppearance(context, i); } } @Override // android.widget.TextView, android.view.View public InputConnection onCreateInputConnection(EditorInfo editorInfo) { return this.mAppCompatEmojiEditTextHelper.onCreateInputConnection(AppCompatHintHelper.onCreateInputConnection(super.onCreateInputConnection(editorInfo), editorInfo, this), editorInfo); } @Override // android.widget.TextView public void setKeyListener(@Nullable KeyListener keyListener) { super.setKeyListener(this.mAppCompatEmojiEditTextHelper.getKeyListener(keyListener)); } @Override // androidx.appcompat.widget.EmojiCompatConfigurationView public void setEmojiCompatEnabled(boolean z) { this.mAppCompatEmojiEditTextHelper.setEnabled(z); } @Override // androidx.appcompat.widget.EmojiCompatConfigurationView public boolean isEmojiCompatEnabled() { return this.mAppCompatEmojiEditTextHelper.isEnabled(); } @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 // androidx.core.widget.TintableCompoundDrawablesView @Nullable @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX}) public ColorStateList getSupportCompoundDrawablesTintList() { return this.mTextHelper.getCompoundDrawableTintList(); } @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 @Nullable @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX}) public PorterDuff.Mode getSupportCompoundDrawablesTintMode() { return this.mTextHelper.getCompoundDrawableTintMode(); } @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(); } }