content: 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.widget.ToggleButton;
  import androidx.core.view.TintableBackgroundView;
  import androidx.core.widget.TintableCompoundDrawablesView;
  
  public class AppCompatToggleButton extends ToggleButton implements TintableBackgroundView, EmojiCompatConfigurationView, TintableCompoundDrawablesView {
      private AppCompatEmojiTextHelper mAppCompatEmojiTextHelper;
      private final AppCompatBackgroundHelper mBackgroundTintHelper;
      private final AppCompatTextHelper mTextHelper;
  
      public AppCompatToggleButton(Context context) {
          this(context, (AttributeSet) null);
      }
  
      public AppCompatToggleButton(Context context, AttributeSet attrs) {
          this(context, attrs, 16842827);
      }
  
      public AppCompatToggleButton(Context context, AttributeSet attrs, int defStyleAttr) {
          super(context, attrs, defStyleAttr);
          ThemeUtils.checkAppCompatTheme(this, getContext());
          AppCompatBackgroundHelper appCompatBackgroundHelper = new AppCompatBackgroundHelper(this);
          this.mBackgroundTintHelper = appCompatBackgroundHelper;
          appCompatBackgroundHelper.loadFromAttributes(attrs, defStyleAttr);
          AppCompatTextHelper appCompatTextHelper = new AppCompatTextHelper(this);
          this.mTextHelper = appCompatTextHelper;
          appCompatTextHelper.loadFromAttributes(attrs, defStyleAttr);
          getEmojiTextViewHelper().loadFromAttributes(attrs, defStyleAttr);
      }
  
      private AppCompatEmojiTextHelper getEmojiTextViewHelper() {
          if (this.mAppCompatEmojiTextHelper == null) {
              this.mAppCompatEmojiTextHelper = new AppCompatEmojiTextHelper(this);
          }
          return this.mAppCompatEmojiTextHelper;
      }
  
      /* access modifiers changed from: protected */
      public void drawableStateChanged() {
          super.drawableStateChanged();
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.applySupportBackgroundTint();
          }
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.applyCompoundDrawablesTints();
          }
      }
  
      public ColorStateList getSupportBackgroundTintList() {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              return appCompatBackgroundHelper.getSupportBackgroundTintList();
          }
          return null;
      }
  
      public PorterDuff.Mode getSupportBackgroundTintMode() {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              return appCompatBackgroundHelper.getSupportBackgroundTintMode();
          }
          return null;
      }
  
      public ColorStateList getSupportCompoundDrawablesTintList() {
          return this.mTextHelper.getCompoundDrawableTintList();
      }
  
      public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
          return this.mTextHelper.getCompoundDrawableTintMode();
      }
  
      public boolean isEmojiCompatEnabled() {
          return getEmojiTextViewHelper().isEnabled();
      }
  
      public void setAllCaps(boolean allCaps) {
          super.setAllCaps(allCaps);
          getEmojiTextViewHelper().setAllCaps(allCaps);
      }
  
      public void setBackgroundDrawable(Drawable background) {
          super.setBackgroundDrawable(background);
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.onSetBackgroundDrawable(background);
          }
      }
  
      public void setBackgroundResource(int resId) {
          super.setBackgroundResource(resId);
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.onSetBackgroundResource(resId);
          }
      }
  
      public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {
          super.setCompoundDrawables(left, top, right, bottom);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetCompoundDrawables();
          }
      }
  
      public void setCompoundDrawablesRelative(Drawable start, Drawable top, Drawable end, Drawable bottom) {
          super.setCompoundDrawablesRelative(start, top, end, bottom);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetCompoundDrawables();
          }
      }
  
      public void setEmojiCompatEnabled(boolean enabled) {
          getEmojiTextViewHelper().setEnabled(enabled);
      }
  
      public void setFilters(InputFilter[] filters) {
          super.setFilters(getEmojiTextViewHelper().getFilters(filters));
      }
  
      public void setSupportBackgroundTintList(ColorStateList tint) {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.setSupportBackgroundTintList(tint);
          }
      }
  
      public void setSupportBackgroundTintMode(PorterDuff.Mode tintMode) {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.setSupportBackgroundTintMode(tintMode);
          }
      }
  
      public void setSupportCompoundDrawablesTintList(ColorStateList tintList) {
          this.mTextHelper.setCompoundDrawableTintList(tintList);
          this.mTextHelper.applyCompoundDrawablesTints();
      }
  
      public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode tintMode) {
          this.mTextHelper.setCompoundDrawableTintMode(tintMode);
          this.mTextHelper.applyCompoundDrawablesTints();
      }
  }
  