CrackMe.apk
Download file
package com.google.android.material.textfield;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStructure;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.widget.AppCompatDrawableManager;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.DrawableUtils;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.view.AccessibilityDelegateCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
import androidx.core.widget.TextViewCompat;
import androidx.customview.view.AbsSavedState;
import com.google.android.material.R;
import com.google.android.material.animation.AnimationUtils;
import com.google.android.material.color.MaterialColors;
import com.google.android.material.internal.CheckableImageButton;
import com.google.android.material.internal.CollapsingTextHelper;
import com.google.android.material.internal.DescendantOffsetUtils;
import com.google.android.material.shape.MaterialShapeDrawable;
import com.google.android.material.shape.ShapeAppearanceModel;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Iterator;
import java.util.LinkedHashSet;
public class TextInputLayout extends LinearLayout {
public static final int BOX_BACKGROUND_FILLED = 1;
public static final int BOX_BACKGROUND_NONE = 0;
public static final int BOX_BACKGROUND_OUTLINE = 2;
private static final int DEF_STYLE_RES = R.style.Widget_Design_TextInputLayout;
public static final int END_ICON_CLEAR_TEXT = 2;
public static final int END_ICON_CUSTOM = -1;
public static final int END_ICON_DROPDOWN_MENU = 3;
public static final int END_ICON_NONE = 0;
public static final int END_ICON_PASSWORD_TOGGLE = 1;
private static final int INVALID_MAX_LENGTH = -1;
private static final int LABEL_SCALE_ANIMATION_DURATION = 167;
private static final String LOG_TAG = "TextInputLayout";
private ValueAnimator animator;
private MaterialShapeDrawable boxBackground;
private int boxBackgroundColor;
private int boxBackgroundMode;
private final int boxCollapsedPaddingTopPx;
private final int boxLabelCutoutPaddingPx;
private int boxStrokeColor;
private final int boxStrokeWidthDefaultPx;
private final int boxStrokeWidthFocusedPx;
private int boxStrokeWidthPx;
private MaterialShapeDrawable boxUnderline;
final CollapsingTextHelper collapsingTextHelper;
boolean counterEnabled;
private int counterMaxLength;
private int counterOverflowTextAppearance;
private ColorStateList counterOverflowTextColor;
private boolean counterOverflowed;
private int counterTextAppearance;
private ColorStateList counterTextColor;
private TextView counterView;
private int defaultFilledBackgroundColor;
private ColorStateList defaultHintTextColor;
private final int defaultStrokeColor;
private final int disabledColor;
private final int disabledFilledBackgroundColor;
EditText editText;
private final LinkedHashSet<OnEditTextAttachedListener> editTextAttachedListeners;
private final LinkedHashSet<OnEndIconChangedListener> endIconChangedListeners;
private final SparseArray<EndIconDelegate> endIconDelegates;
private Drawable endIconDummyDrawable;
private final FrameLayout endIconFrame;
private int endIconMode;
private View.OnLongClickListener endIconOnLongClickListener;
private ColorStateList endIconTintList;
private PorterDuff.Mode endIconTintMode;
/* access modifiers changed from: private */
public final CheckableImageButton endIconView;
private final CheckableImageButton errorIconView;
private int focusedStrokeColor;
private ColorStateList focusedTextColor;
private boolean hasEndIconTintList;
private boolean hasEndIconTintMode;
private boolean hasStartIconTintList;
private boolean hasStartIconTintMode;
private CharSequence hint;
private boolean hintAnimationEnabled;
private boolean hintEnabled;
private boolean hintExpanded;
private final int hoveredFilledBackgroundColor;
private final int hoveredStrokeColor;
private boolean inDrawableStateChanged;
private final IndicatorViewController indicatorViewController;
private final FrameLayout inputFrame;
private boolean isProvidingHint;
private Drawable originalEditTextEndDrawable;
private CharSequence originalHint;
/* access modifiers changed from: private */
public boolean restoringSavedState;
private ShapeAppearanceModel shapeAppearanceModel;
private Drawable startIconDummyDrawable;
private View.OnLongClickListener startIconOnLongClickListener;
private ColorStateList startIconTintList;
private PorterDuff.Mode startIconTintMode;
private final CheckableImageButton startIconView;
private final Rect tmpBoundsRect;
private final Rect tmpRect;
private final RectF tmpRectF;
private Typeface typeface;
@Retention(RetentionPolicy.SOURCE)
public @interface BoxBackgroundMode {
}
@Retention(RetentionPolicy.SOURCE)
public @interface EndIconMode {
}
public interface OnEditTextAttachedListener {
void onEditTextAttached(TextInputLayout textInputLayout);
}
public interface OnEndIconChangedListener {
void onEndIconChanged(TextInputLayout textInputLayout, int i);
}
public TextInputLayout(Context context) {
this(context, (AttributeSet) null);
}
public TextInputLayout(Context context, AttributeSet attributeSet) {
this(context, attributeSet, R.attr.textInputStyle);
}
/* JADX WARNING: Illegal instructions before constructor call */
/* Code decompiled incorrectly, please refer to instructions dump. */
public TextInputLayout(android.content.Context r17, android.util.AttributeSet r18, int r19) {
/*
r16 = this;
r0 = r16
r7 = r18
r8 = r19
int r9 = DEF_STYLE_RES
r1 = r17
android.content.Context r1 = com.google.android.material.internal.ThemeEnforcement.createThemedContext(r1, r7, r8, r9)
r0.<init>(r1, r7, r8)
com.google.android.material.textfield.IndicatorViewController r1 = new com.google.android.material.textfield.IndicatorViewController
r1.<init>(r0)
r0.indicatorViewController = r1
android.graphics.Rect r1 = new android.graphics.Rect
r1.<init>()
r0.tmpRect = r1
android.graphics.Rect r1 = new android.graphics.Rect
r1.<init>()
r0.tmpBoundsRect = r1
android.graphics.RectF r1 = new android.graphics.RectF
r1.<init>()
r0.tmpRectF = r1
java.util.LinkedHashSet r1 = new java.util.LinkedHashSet
r1.<init>()
r0.editTextAttachedListeners = r1
r10 = 0
r0.endIconMode = r10
android.util.SparseArray r11 = new android.util.SparseArray
r11.<init>()
r0.endIconDelegates = r11
java.util.LinkedHashSet r1 = new java.util.LinkedHashSet
r1.<init>()
r0.endIconChangedListeners = r1
com.google.android.material.internal.CollapsingTextHelper r1 = new com.google.android.material.internal.CollapsingTextHelper
r1.<init>(r0)
r0.collapsingTextHelper = r1
android.content.Context r12 = r16.getContext()
r13 = 1
r0.setOrientation(r13)
r0.setWillNotDraw(r10)
r0.setAddStatesFromChildren(r13)
android.widget.FrameLayout r14 = new android.widget.FrameLayout
r14.<init>(r12)
r0.inputFrame = r14
r14.setAddStatesFromChildren(r13)
r0.addView(r14)
android.widget.FrameLayout r15 = new android.widget.FrameLayout
r15.<init>(r12)
r0.endIconFrame = r15
android.widget.FrameLayout$LayoutParams r2 = new android.widget.FrameLayout$LayoutParams
r3 = -2
r4 = 8388629(0x800015, float:1.1754973E-38)
r2.<init>(r3, r3, r4)
r15.setLayoutParams(r2)
r14.addView(r15)
android.animation.TimeInterpolator r2 = com.google.android.material.animation.AnimationUtils.LINEAR_INTERPOLATOR
r1.setTextSizeInterpolator(r2)
android.animation.TimeInterpolator r2 = com.google.android.material.animation.AnimationUtils.LINEAR_INTERPOLATOR
r1.setPositionInterpolator(r2)
r2 = 8388659(0x800033, float:1.1755015E-38)
r1.setCollapsedTextGravity(r2)
int[] r3 = com.google.android.material.R.styleable.TextInputLayout
r1 = 5
int[] r6 = new int[r1]
int r1 = com.google.android.material.R.styleable.TextInputLayout_counterTextAppearance
r6[r10] = r1
int r1 = com.google.android.material.R.styleable.TextInputLayout_counterOverflowTextAppearance
r6[r13] = r1
int r1 = com.google.android.material.R.styleable.TextInputLayout_errorTextAppearance
r5 = 2
r6[r5] = r1
int r1 = com.google.android.material.R.styleable.TextInputLayout_helperTextTextAppearance
r4 = 3
r6[r4] = r1
int r1 = com.google.android.material.R.styleable.TextInputLayout_hintTextAppearance
r2 = 4
r6[r2] = r1
r1 = r12
r2 = r18
r4 = r19
r5 = r9
androidx.appcompat.widget.TintTypedArray r1 = com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(r1, r2, r3, r4, r5, r6)
int r2 = com.google.android.material.R.styleable.TextInputLayout_hintEnabled
boolean r2 = r1.getBoolean(r2, r13)
r0.hintEnabled = r2
int r2 = com.google.android.material.R.styleable.TextInputLayout_android_hint
java.lang.CharSequence r2 = r1.getText(r2)
r0.setHint(r2)
int r2 = com.google.android.material.R.styleable.TextInputLayout_hintAnimationEnabled
boolean r2 = r1.getBoolean(r2, r13)
r0.hintAnimationEnabled = r2
com.google.android.material.shape.ShapeAppearanceModel$Builder r2 = com.google.android.material.shape.ShapeAppearanceModel.builder((android.content.Context) r12, (android.util.AttributeSet) r7, (int) r8, (int) r9)
com.google.android.material.shape.ShapeAppearanceModel r2 = r2.build()
r0.shapeAppearanceModel = r2
android.content.res.Resources r2 = r12.getResources()
int r3 = com.google.android.material.R.dimen.mtrl_textinput_box_label_cutout_padding
int r2 = r2.getDimensionPixelOffset(r3)
r0.boxLabelCutoutPaddingPx = r2
int r2 = com.google.android.material.R.styleable.TextInputLayout_boxCollapsedPaddingTop
int r2 = r1.getDimensionPixelOffset(r2, r10)
r0.boxCollapsedPaddingTopPx = r2
int r2 = com.google.android.material.R.styleable.TextInputLayout_boxStrokeWidth
android.content.res.Resources r3 = r12.getResources()
int r4 = com.google.android.material.R.dimen.mtrl_textinput_box_stroke_width_default
int r3 = r3.getDimensionPixelSize(r4)
int r2 = r1.getDimensionPixelSize(r2, r3)
r0.boxStrokeWidthDefaultPx = r2
int r3 = com.google.android.material.R.styleable.TextInputLayout_boxStrokeWidthFocused
android.content.res.Resources r4 = r12.getResources()
int r5 = com.google.android.material.R.dimen.mtrl_textinput_box_stroke_width_focused
int r4 = r4.getDimensionPixelSize(r5)
int r3 = r1.getDimensionPixelSize(r3, r4)
r0.boxStrokeWidthFocusedPx = r3
r0.boxStrokeWidthPx = r2
int r2 = com.google.android.material.R.styleable.TextInputLayout_boxCornerRadiusTopStart
r3 = -1082130432(0xffffffffbf800000, float:-1.0)
float r2 = r1.getDimension(r2, r3)
int r4 = com.google.android.material.R.styleable.TextInputLayout_boxCornerRadiusTopEnd
float r4 = r1.getDimension(r4, r3)
int r5 = com.google.android.material.R.styleable.TextInputLayout_boxCornerRadiusBottomEnd
float r5 = r1.getDimension(r5, r3)
int r6 = com.google.android.material.R.styleable.TextInputLayout_boxCornerRadiusBottomStart
float r3 = r1.getDimension(r6, r3)
com.google.android.material.shape.ShapeAppearanceModel r6 = r0.shapeAppearanceModel
com.google.android.material.shape.ShapeAppearanceModel$Builder r6 = r6.toBuilder()
r7 = 0
int r8 = (r2 > r7 ? 1 : (r2 == r7 ? 0 : -1))
if (r8 < 0) goto L_0x0138
r6.setTopLeftCornerSize((float) r2)
L_0x0138:
int r2 = (r4 > r7 ? 1 : (r4 == r7 ? 0 : -1))
if (r2 < 0) goto L_0x013f
r6.setTopRightCornerSize((float) r4)
L_0x013f:
int r2 = (r5 > r7 ? 1 : (r5 == r7 ? 0 : -1))
if (r2 < 0) goto L_0x0146
r6.setBottomRightCornerSize((float) r5)
L_0x0146:
int r2 = (r3 > r7 ? 1 : (r3 == r7 ? 0 : -1))
if (r2 < 0) goto L_0x014d
r6.setBottomLeftCornerSize((float) r3)
L_0x014d:
com.google.android.material.shape.ShapeAppearanceModel r2 = r6.build()
r0.shapeAppearanceModel = r2
int r2 = com.google.android.material.R.styleable.TextInputLayout_boxBackgroundColor
android.content.res.ColorStateList r2 = com.google.android.material.resources.MaterialResources.getColorStateList((android.content.Context) r12, (androidx.appcompat.widget.TintTypedArray) r1, (int) r2)
r3 = 16843623(0x1010367, float:2.3696E-38)
r4 = -16842910(0xfffffffffefeff62, float:-1.6947497E38)
r5 = -1
if (r2 == 0) goto L_0x01a0
int r6 = r2.getDefaultColor()
r0.defaultFilledBackgroundColor = r6
r0.boxBackgroundColor = r6
boolean r6 = r2.isStateful()
if (r6 == 0) goto L_0x0185
int[] r6 = new int[r13]
r6[r10] = r4
int r6 = r2.getColorForState(r6, r5)
r0.disabledFilledBackgroundColor = r6
int[] r6 = new int[r13]
r6[r10] = r3
int r2 = r2.getColorForState(r6, r5)
r0.hoveredFilledBackgroundColor = r2
goto L_0x01a8
L_0x0185:
int r2 = com.google.android.material.R.color.mtrl_filled_background_color
android.content.res.ColorStateList r2 = androidx.appcompat.content.res.AppCompatResources.getColorStateList(r12, r2)
int[] r6 = new int[r13]
r6[r10] = r4
int r6 = r2.getColorForState(r6, r5)
r0.disabledFilledBackgroundColor = r6
int[] r6 = new int[r13]
r6[r10] = r3
int r2 = r2.getColorForState(r6, r5)
r0.hoveredFilledBackgroundColor = r2
goto L_0x01a8
L_0x01a0:
r0.boxBackgroundColor = r10
r0.defaultFilledBackgroundColor = r10
r0.disabledFilledBackgroundColor = r10
r0.hoveredFilledBackgroundColor = r10
L_0x01a8:
int r2 = com.google.android.material.R.styleable.TextInputLayout_android_textColorHint
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x01ba
int r2 = com.google.android.material.R.styleable.TextInputLayout_android_textColorHint
android.content.res.ColorStateList r2 = r1.getColorStateList(r2)
r0.focusedTextColor = r2
r0.defaultHintTextColor = r2
L_0x01ba:
int r2 = com.google.android.material.R.styleable.TextInputLayout_boxStrokeColor
android.content.res.ColorStateList r2 = com.google.android.material.resources.MaterialResources.getColorStateList((android.content.Context) r12, (androidx.appcompat.widget.TintTypedArray) r1, (int) r2)
if (r2 == 0) goto L_0x01f0
boolean r6 = r2.isStateful()
if (r6 == 0) goto L_0x01f0
int r6 = r2.getDefaultColor()
r0.defaultStrokeColor = r6
int[] r6 = new int[r13]
r6[r10] = r4
int r4 = r2.getColorForState(r6, r5)
r0.disabledColor = r4
int[] r4 = new int[r13]
r4[r10] = r3
int r3 = r2.getColorForState(r4, r5)
r0.hoveredStrokeColor = r3
int[] r3 = new int[r13]
r4 = 16842908(0x101009c, float:2.3693995E-38)
r3[r10] = r4
int r2 = r2.getColorForState(r3, r5)
r0.focusedStrokeColor = r2
goto L_0x0210
L_0x01f0:
int r2 = com.google.android.material.R.styleable.TextInputLayout_boxStrokeColor
int r2 = r1.getColor(r2, r10)
r0.focusedStrokeColor = r2
int r2 = com.google.android.material.R.color.mtrl_textinput_default_box_stroke_color
int r2 = androidx.core.content.ContextCompat.getColor(r12, r2)
r0.defaultStrokeColor = r2
int r2 = com.google.android.material.R.color.mtrl_textinput_disabled_color
int r2 = androidx.core.content.ContextCompat.getColor(r12, r2)
r0.disabledColor = r2
int r2 = com.google.android.material.R.color.mtrl_textinput_hovered_box_stroke_color
int r2 = androidx.core.content.ContextCompat.getColor(r12, r2)
r0.hoveredStrokeColor = r2
L_0x0210:
int r2 = com.google.android.material.R.styleable.TextInputLayout_hintTextAppearance
int r2 = r1.getResourceId(r2, r5)
if (r2 == r5) goto L_0x0221
int r2 = com.google.android.material.R.styleable.TextInputLayout_hintTextAppearance
int r2 = r1.getResourceId(r2, r10)
r0.setHintTextAppearance(r2)
L_0x0221:
int r2 = com.google.android.material.R.styleable.TextInputLayout_errorTextAppearance
int r2 = r1.getResourceId(r2, r10)
int r3 = com.google.android.material.R.styleable.TextInputLayout_errorEnabled
boolean r3 = r1.getBoolean(r3, r10)
android.content.Context r4 = r16.getContext()
android.view.LayoutInflater r4 = android.view.LayoutInflater.from(r4)
int r6 = com.google.android.material.R.layout.design_text_input_end_icon
android.view.View r4 = r4.inflate(r6, r14, r10)
com.google.android.material.internal.CheckableImageButton r4 = (com.google.android.material.internal.CheckableImageButton) r4
r0.errorIconView = r4
r14.addView(r4)
r6 = 8
r4.setVisibility(r6)
int r7 = com.google.android.material.R.styleable.TextInputLayout_errorIconDrawable
boolean r7 = r1.hasValue(r7)
if (r7 == 0) goto L_0x0258
int r7 = com.google.android.material.R.styleable.TextInputLayout_errorIconDrawable
android.graphics.drawable.Drawable r7 = r1.getDrawable(r7)
r0.setErrorIconDrawable((android.graphics.drawable.Drawable) r7)
L_0x0258:
int r7 = com.google.android.material.R.styleable.TextInputLayout_errorIconTint
boolean r7 = r1.hasValue(r7)
if (r7 == 0) goto L_0x0269
int r7 = com.google.android.material.R.styleable.TextInputLayout_errorIconTint
android.content.res.ColorStateList r7 = com.google.android.material.resources.MaterialResources.getColorStateList((android.content.Context) r12, (androidx.appcompat.widget.TintTypedArray) r1, (int) r7)
r0.setErrorIconTintList(r7)
L_0x0269:
int r7 = com.google.android.material.R.styleable.TextInputLayout_errorIconTintMode
boolean r7 = r1.hasValue(r7)
r8 = 0
if (r7 == 0) goto L_0x027f
int r7 = com.google.android.material.R.styleable.TextInputLayout_errorIconTintMode
int r7 = r1.getInt(r7, r5)
android.graphics.PorterDuff$Mode r7 = com.google.android.material.internal.ViewUtils.parseTintMode(r7, r8)
r0.setErrorIconTintMode(r7)
L_0x027f:
android.content.res.Resources r7 = r16.getResources()
int r9 = com.google.android.material.R.string.error_icon_content_description
java.lang.CharSequence r7 = r7.getText(r9)
r4.setContentDescription(r7)
r7 = 2
androidx.core.view.ViewCompat.setImportantForAccessibility(r4, r7)
r4.setClickable(r10)
r4.setPressable(r10)
r4.setFocusable(r10)
int r4 = com.google.android.material.R.styleable.TextInputLayout_helperTextTextAppearance
int r4 = r1.getResourceId(r4, r10)
int r9 = com.google.android.material.R.styleable.TextInputLayout_helperTextEnabled
boolean r9 = r1.getBoolean(r9, r10)
int r7 = com.google.android.material.R.styleable.TextInputLayout_helperText
java.lang.CharSequence r7 = r1.getText(r7)
int r13 = com.google.android.material.R.styleable.TextInputLayout_counterEnabled
boolean r13 = r1.getBoolean(r13, r10)
int r8 = com.google.android.material.R.styleable.TextInputLayout_counterMaxLength
int r8 = r1.getInt(r8, r5)
r0.setCounterMaxLength(r8)
int r8 = com.google.android.material.R.styleable.TextInputLayout_counterTextAppearance
int r8 = r1.getResourceId(r8, r10)
r0.counterTextAppearance = r8
int r8 = com.google.android.material.R.styleable.TextInputLayout_counterOverflowTextAppearance
int r8 = r1.getResourceId(r8, r10)
r0.counterOverflowTextAppearance = r8
android.content.Context r8 = r16.getContext()
android.view.LayoutInflater r8 = android.view.LayoutInflater.from(r8)
int r5 = com.google.android.material.R.layout.design_text_input_start_icon
android.view.View r5 = r8.inflate(r5, r14, r10)
com.google.android.material.internal.CheckableImageButton r5 = (com.google.android.material.internal.CheckableImageButton) r5
r0.startIconView = r5
r14.addView(r5)
r5.setVisibility(r6)
r5 = 0
r0.setStartIconOnClickListener(r5)
r0.setStartIconOnLongClickListener(r5)
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconDrawable
boolean r5 = r1.hasValue(r5)
if (r5 == 0) goto L_0x0315
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconDrawable
android.graphics.drawable.Drawable r5 = r1.getDrawable(r5)
r0.setStartIconDrawable((android.graphics.drawable.Drawable) r5)
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconContentDescription
boolean r5 = r1.hasValue(r5)
if (r5 == 0) goto L_0x030b
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconContentDescription
java.lang.CharSequence r5 = r1.getText(r5)
r0.setStartIconContentDescription((java.lang.CharSequence) r5)
L_0x030b:
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconCheckable
r8 = 1
boolean r5 = r1.getBoolean(r5, r8)
r0.setStartIconCheckable(r5)
L_0x0315:
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconTint
boolean r5 = r1.hasValue(r5)
if (r5 == 0) goto L_0x0326
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconTint
android.content.res.ColorStateList r5 = com.google.android.material.resources.MaterialResources.getColorStateList((android.content.Context) r12, (androidx.appcompat.widget.TintTypedArray) r1, (int) r5)
r0.setStartIconTintList(r5)
L_0x0326:
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconTintMode
boolean r5 = r1.hasValue(r5)
if (r5 == 0) goto L_0x033d
int r5 = com.google.android.material.R.styleable.TextInputLayout_startIconTintMode
r8 = -1
int r5 = r1.getInt(r5, r8)
r8 = 0
android.graphics.PorterDuff$Mode r5 = com.google.android.material.internal.ViewUtils.parseTintMode(r5, r8)
r0.setStartIconTintMode(r5)
L_0x033d:
r0.setHelperTextEnabled(r9)
r0.setHelperText(r7)
r0.setHelperTextTextAppearance(r4)
r0.setErrorEnabled(r3)
r0.setErrorTextAppearance(r2)
int r2 = r0.counterTextAppearance
r0.setCounterTextAppearance(r2)
int r2 = r0.counterOverflowTextAppearance
r0.setCounterOverflowTextAppearance(r2)
int r2 = com.google.android.material.R.styleable.TextInputLayout_errorTextColor
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x0367
int r2 = com.google.android.material.R.styleable.TextInputLayout_errorTextColor
android.content.res.ColorStateList r2 = r1.getColorStateList(r2)
r0.setErrorTextColor(r2)
L_0x0367:
int r2 = com.google.android.material.R.styleable.TextInputLayout_helperTextTextColor
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x0378
int r2 = com.google.android.material.R.styleable.TextInputLayout_helperTextTextColor
android.content.res.ColorStateList r2 = r1.getColorStateList(r2)
r0.setHelperTextColor(r2)
L_0x0378:
int r2 = com.google.android.material.R.styleable.TextInputLayout_hintTextColor
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x0389
int r2 = com.google.android.material.R.styleable.TextInputLayout_hintTextColor
android.content.res.ColorStateList r2 = r1.getColorStateList(r2)
r0.setHintTextColor(r2)
L_0x0389:
int r2 = com.google.android.material.R.styleable.TextInputLayout_counterTextColor
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x039a
int r2 = com.google.android.material.R.styleable.TextInputLayout_counterTextColor
android.content.res.ColorStateList r2 = r1.getColorStateList(r2)
r0.setCounterTextColor(r2)
L_0x039a:
int r2 = com.google.android.material.R.styleable.TextInputLayout_counterOverflowTextColor
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x03ab
int r2 = com.google.android.material.R.styleable.TextInputLayout_counterOverflowTextColor
android.content.res.ColorStateList r2 = r1.getColorStateList(r2)
r0.setCounterOverflowTextColor(r2)
L_0x03ab:
r0.setCounterEnabled(r13)
int r2 = com.google.android.material.R.styleable.TextInputLayout_boxBackgroundMode
int r2 = r1.getInt(r2, r10)
r0.setBoxBackgroundMode(r2)
android.content.Context r2 = r16.getContext()
android.view.LayoutInflater r2 = android.view.LayoutInflater.from(r2)
int r3 = com.google.android.material.R.layout.design_text_input_end_icon
android.view.View r2 = r2.inflate(r3, r15, r10)
com.google.android.material.internal.CheckableImageButton r2 = (com.google.android.material.internal.CheckableImageButton) r2
r0.endIconView = r2
r15.addView(r2)
r2.setVisibility(r6)
com.google.android.material.textfield.CustomEndIconDelegate r2 = new com.google.android.material.textfield.CustomEndIconDelegate
r2.<init>(r0)
r3 = -1
r11.append(r3, r2)
com.google.android.material.textfield.NoEndIconDelegate r2 = new com.google.android.material.textfield.NoEndIconDelegate
r2.<init>(r0)
r11.append(r10, r2)
com.google.android.material.textfield.PasswordToggleEndIconDelegate r2 = new com.google.android.material.textfield.PasswordToggleEndIconDelegate
r2.<init>(r0)
r3 = 1
r11.append(r3, r2)
com.google.android.material.textfield.ClearTextEndIconDelegate r2 = new com.google.android.material.textfield.ClearTextEndIconDelegate
r2.<init>(r0)
r3 = 2
r11.append(r3, r2)
com.google.android.material.textfield.DropdownMenuEndIconDelegate r2 = new com.google.android.material.textfield.DropdownMenuEndIconDelegate
r2.<init>(r0)
r3 = 3
r11.append(r3, r2)
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconMode
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x0439
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconMode
int r2 = r1.getInt(r2, r10)
r0.setEndIconMode(r2)
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconDrawable
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x041d
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconDrawable
android.graphics.drawable.Drawable r2 = r1.getDrawable(r2)
r0.setEndIconDrawable((android.graphics.drawable.Drawable) r2)
L_0x041d:
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconContentDescription
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x042e
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconContentDescription
java.lang.CharSequence r2 = r1.getText(r2)
r0.setEndIconContentDescription((java.lang.CharSequence) r2)
L_0x042e:
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconCheckable
r3 = 1
boolean r2 = r1.getBoolean(r2, r3)
r0.setEndIconCheckable(r2)
goto L_0x0484
L_0x0439:
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleEnabled
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x0484
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleEnabled
boolean r2 = r1.getBoolean(r2, r10)
r0.setEndIconMode(r2)
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleDrawable
android.graphics.drawable.Drawable r2 = r1.getDrawable(r2)
r0.setEndIconDrawable((android.graphics.drawable.Drawable) r2)
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleContentDescription
java.lang.CharSequence r2 = r1.getText(r2)
r0.setEndIconContentDescription((java.lang.CharSequence) r2)
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleTint
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x046d
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleTint
android.content.res.ColorStateList r2 = com.google.android.material.resources.MaterialResources.getColorStateList((android.content.Context) r12, (androidx.appcompat.widget.TintTypedArray) r1, (int) r2)
r0.setEndIconTintList(r2)
L_0x046d:
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleTintMode
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x0484
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleTintMode
r3 = -1
int r2 = r1.getInt(r2, r3)
r3 = 0
android.graphics.PorterDuff$Mode r2 = com.google.android.material.internal.ViewUtils.parseTintMode(r2, r3)
r0.setEndIconTintMode(r2)
L_0x0484:
int r2 = com.google.android.material.R.styleable.TextInputLayout_passwordToggleEnabled
boolean r2 = r1.hasValue(r2)
if (r2 != 0) goto L_0x04b4
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconTint
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x049d
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconTint
android.content.res.ColorStateList r2 = com.google.android.material.resources.MaterialResources.getColorStateList((android.content.Context) r12, (androidx.appcompat.widget.TintTypedArray) r1, (int) r2)
r0.setEndIconTintList(r2)
L_0x049d:
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconTintMode
boolean r2 = r1.hasValue(r2)
if (r2 == 0) goto L_0x04b4
int r2 = com.google.android.material.R.styleable.TextInputLayout_endIconTintMode
r3 = -1
int r2 = r1.getInt(r2, r3)
r3 = 0
android.graphics.PorterDuff$Mode r2 = com.google.android.material.internal.ViewUtils.parseTintMode(r2, r3)
r0.setEndIconTintMode(r2)
L_0x04b4:
r1.recycle()
r1 = 2
androidx.core.view.ViewCompat.setImportantForAccessibility(r0, r1)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.textfield.TextInputLayout.<init>(android.content.Context, android.util.AttributeSet, int):void");
}
public void addView(View view, int i, ViewGroup.LayoutParams layoutParams) {
if (view instanceof EditText) {
FrameLayout.LayoutParams layoutParams2 = new FrameLayout.LayoutParams(layoutParams);
layoutParams2.gravity = (layoutParams2.gravity & -113) | 16;
this.inputFrame.addView(view, layoutParams2);
this.inputFrame.setLayoutParams(layoutParams);
updateInputLayoutMargins();
setEditText((EditText) view);
return;
}
super.addView(view, i, layoutParams);
}
/* access modifiers changed from: package-private */
public MaterialShapeDrawable getBoxBackground() {
int i = this.boxBackgroundMode;
if (i == 1 || i == 2) {
return this.boxBackground;
}
throw new IllegalStateException();
}
public void setBoxBackgroundMode(int i) {
if (i != this.boxBackgroundMode) {
this.boxBackgroundMode = i;
if (this.editText != null) {
onApplyBoxBackgroundMode();
}
}
}
public int getBoxBackgroundMode() {
return this.boxBackgroundMode;
}
private void onApplyBoxBackgroundMode() {
assignBoxBackgroundByMode();
setEditTextBoxBackground();
updateTextInputBoxState();
if (this.boxBackgroundMode != 0) {
updateInputLayoutMargins();
}
}
private void assignBoxBackgroundByMode() {
int i = this.boxBackgroundMode;
if (i == 0) {
this.boxBackground = null;
this.boxUnderline = null;
} else if (i == 1) {
this.boxBackground = new MaterialShapeDrawable(this.shapeAppearanceModel);
this.boxUnderline = new MaterialShapeDrawable();
} else if (i == 2) {
if (!this.hintEnabled || (this.boxBackground instanceof CutoutDrawable)) {
this.boxBackground = new MaterialShapeDrawable(this.shapeAppearanceModel);
} else {
this.boxBackground = new CutoutDrawable(this.shapeAppearanceModel);
}
this.boxUnderline = null;
} else {
throw new IllegalArgumentException(this.boxBackgroundMode + " is illegal; only @BoxBackgroundMode constants are supported.");
}
}
private void setEditTextBoxBackground() {
if (shouldUseEditTextBackgroundForBoxBackground()) {
ViewCompat.setBackground(this.editText, this.boxBackground);
}
}
private boolean shouldUseEditTextBackgroundForBoxBackground() {
EditText editText2 = this.editText;
return (editText2 == null || this.boxBackground == null || editText2.getBackground() != null || this.boxBackgroundMode == 0) ? false : true;
}
public void setBoxStrokeColor(int i) {
if (this.focusedStrokeColor != i) {
this.focusedStrokeColor = i;
updateTextInputBoxState();
}
}
public int getBoxStrokeColor() {
return this.focusedStrokeColor;
}
public void setBoxBackgroundColorResource(int i) {
setBoxBackgroundColor(ContextCompat.getColor(getContext(), i));
}
public void setBoxBackgroundColor(int i) {
if (this.boxBackgroundColor != i) {
this.boxBackgroundColor = i;
this.defaultFilledBackgroundColor = i;
applyBoxAttributes();
}
}
public int getBoxBackgroundColor() {
return this.boxBackgroundColor;
}
public void setBoxCornerRadiiResources(int i, int i2, int i3, int i4) {
setBoxCornerRadii(getContext().getResources().getDimension(i), getContext().getResources().getDimension(i2), getContext().getResources().getDimension(i4), getContext().getResources().getDimension(i3));
}
public void setBoxCornerRadii(float f, float f2, float f3, float f4) {
if (this.boxBackground.getTopLeftCornerResolvedSize() != f || this.boxBackground.getTopRightCornerResolvedSize() != f2 || this.boxBackground.getBottomRightCornerResolvedSize() != f4 || this.boxBackground.getBottomLeftCornerResolvedSize() != f3) {
this.shapeAppearanceModel = this.shapeAppearanceModel.toBuilder().setTopLeftCornerSize(f).setTopRightCornerSize(f2).setBottomRightCornerSize(f4).setBottomLeftCornerSize(f3).build();
applyBoxAttributes();
}
}
public float getBoxCornerRadiusTopStart() {
return this.boxBackground.getTopLeftCornerResolvedSize();
}
public float getBoxCornerRadiusTopEnd() {
return this.boxBackground.getTopRightCornerResolvedSize();
}
public float getBoxCornerRadiusBottomEnd() {
return this.boxBackground.getBottomLeftCornerResolvedSize();
}
public float getBoxCornerRadiusBottomStart() {
return this.boxBackground.getBottomRightCornerResolvedSize();
}
public void setTypeface(Typeface typeface2) {
if (typeface2 != this.typeface) {
this.typeface = typeface2;
this.collapsingTextHelper.setTypefaces(typeface2);
this.indicatorViewController.setTypefaces(typeface2);
TextView textView = this.counterView;
if (textView != null) {
textView.setTypeface(typeface2);
}
}
}
public Typeface getTypeface() {
return this.typeface;
}
public void dispatchProvideAutofillStructure(ViewStructure viewStructure, int i) {
EditText editText2;
if (this.originalHint == null || (editText2 = this.editText) == null) {
super.dispatchProvideAutofillStructure(viewStructure, i);
return;
}
boolean z = this.isProvidingHint;
this.isProvidingHint = false;
CharSequence hint2 = editText2.getHint();
this.editText.setHint(this.originalHint);
try {
super.dispatchProvideAutofillStructure(viewStructure, i);
} finally {
this.editText.setHint(hint2);
this.isProvidingHint = z;
}
}
private void setEditText(EditText editText2) {
if (this.editText == null) {
if (this.endIconMode != 3 && !(editText2 instanceof TextInputEditText)) {
Log.i(LOG_TAG, "EditText added is not a TextInputEditText. Please switch to using that class instead.");
}
this.editText = editText2;
onApplyBoxBackgroundMode();
setTextInputAccessibilityDelegate(new AccessibilityDelegate(this));
this.collapsingTextHelper.setTypefaces(this.editText.getTypeface());
this.collapsingTextHelper.setExpandedTextSize(this.editText.getTextSize());
int gravity = this.editText.getGravity();
this.collapsingTextHelper.setCollapsedTextGravity((gravity & -113) | 48);
this.collapsingTextHelper.setExpandedTextGravity(gravity);
this.editText.addTextChangedListener(new TextWatcher() {
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
public void afterTextChanged(Editable editable) {
TextInputLayout textInputLayout = TextInputLayout.this;
textInputLayout.updateLabelState(!textInputLayout.restoringSavedState);
if (TextInputLayout.this.counterEnabled) {
TextInputLayout.this.updateCounter(editable.length());
}
}
});
if (this.defaultHintTextColor == null) {
this.defaultHintTextColor = this.editText.getHintTextColors();
}
if (this.hintEnabled) {
if (TextUtils.isEmpty(this.hint)) {
CharSequence hint2 = this.editText.getHint();
this.originalHint = hint2;
setHint(hint2);
this.editText.setHint((CharSequence) null);
}
this.isProvidingHint = true;
}
if (this.counterView != null) {
updateCounter(this.editText.getText().length());
}
updateEditTextBackground();
this.indicatorViewController.adjustIndicatorPadding();
this.startIconView.bringToFront();
this.endIconFrame.bringToFront();
this.errorIconView.bringToFront();
dispatchOnEditTextAttached();
updateLabelState(false, true);
return;
}
throw new IllegalArgumentException("We already have an EditText, can only have one");
}
private void updateInputLayoutMargins() {
if (this.boxBackgroundMode != 1) {
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.inputFrame.getLayoutParams();
int calculateLabelMarginTop = calculateLabelMarginTop();
if (calculateLabelMarginTop != layoutParams.topMargin) {
layoutParams.topMargin = calculateLabelMarginTop;
this.inputFrame.requestLayout();
}
}
}
public int getBaseline() {
EditText editText2 = this.editText;
if (editText2 != null) {
return editText2.getBaseline() + getPaddingTop() + calculateLabelMarginTop();
}
return super.getBaseline();
}
/* access modifiers changed from: package-private */
public void updateLabelState(boolean z) {
updateLabelState(z, false);
}
private void updateLabelState(boolean z, boolean z2) {
ColorStateList colorStateList;
TextView textView;
boolean isEnabled = isEnabled();
EditText editText2 = this.editText;
boolean z3 = true;
boolean z4 = editText2 != null && !TextUtils.isEmpty(editText2.getText());
EditText editText3 = this.editText;
if (editText3 == null || !editText3.hasFocus()) {
z3 = false;
}
boolean errorShouldBeShown = this.indicatorViewController.errorShouldBeShown();
ColorStateList colorStateList2 = this.defaultHintTextColor;
if (colorStateList2 != null) {
this.collapsingTextHelper.setCollapsedTextColor(colorStateList2);
this.collapsingTextHelper.setExpandedTextColor(this.defaultHintTextColor);
}
if (!isEnabled) {
this.collapsingTextHelper.setCollapsedTextColor(ColorStateList.valueOf(this.disabledColor));
this.collapsingTextHelper.setExpandedTextColor(ColorStateList.valueOf(this.disabledColor));
} else if (errorShouldBeShown) {
this.collapsingTextHelper.setCollapsedTextColor(this.indicatorViewController.getErrorViewTextColors());
} else if (this.counterOverflowed && (textView = this.counterView) != null) {
this.collapsingTextHelper.setCollapsedTextColor(textView.getTextColors());
} else if (z3 && (colorStateList = this.focusedTextColor) != null) {
this.collapsingTextHelper.setCollapsedTextColor(colorStateList);
}
if (z4 || (isEnabled() && (z3 || errorShouldBeShown))) {
if (z2 || this.hintExpanded) {
collapseHint(z);
}
} else if (z2 || !this.hintExpanded) {
expandHint(z);
}
}
public EditText getEditText() {
return this.editText;
}
public void setHint(CharSequence charSequence) {
if (this.hintEnabled) {
setHintInternal(charSequence);
sendAccessibilityEvent(2048);
}
}
private void setHintInternal(CharSequence charSequence) {
if (!TextUtils.equals(charSequence, this.hint)) {
this.hint = charSequence;
this.collapsingTextHelper.setText(charSequence);
if (!this.hintExpanded) {
openCutout();
}
}
}
public CharSequence getHint() {
if (this.hintEnabled) {
return this.hint;
}
return null;
}
public void setHintEnabled(boolean z) {
if (z != this.hintEnabled) {
this.hintEnabled = z;
if (!z) {
this.isProvidingHint = false;
if (!TextUtils.isEmpty(this.hint) && TextUtils.isEmpty(this.editText.getHint())) {
this.editText.setHint(this.hint);
}
setHintInternal((CharSequence) null);
} else {
CharSequence hint2 = this.editText.getHint();
if (!TextUtils.isEmpty(hint2)) {
if (TextUtils.isEmpty(this.hint)) {
setHint(hint2);
}
this.editText.setHint((CharSequence) null);
}
this.isProvidingHint = true;
}
if (this.editText != null) {
updateInputLayoutMargins();
}
}
}
public boolean isHintEnabled() {
return this.hintEnabled;
}
/* access modifiers changed from: package-private */
public boolean isProvidingHint() {
return this.isProvidingHint;
}
public void setHintTextAppearance(int i) {
this.collapsingTextHelper.setCollapsedTextAppearance(i);
this.focusedTextColor = this.collapsingTextHelper.getCollapsedTextColor();
if (this.editText != null) {
updateLabelState(false);
updateInputLayoutMargins();
}
}
public void setHintTextColor(ColorStateList colorStateList) {
if (this.focusedTextColor != colorStateList) {
if (this.defaultHintTextColor == null) {
this.collapsingTextHelper.setCollapsedTextColor(colorStateList);
}
this.focusedTextColor = colorStateList;
if (this.editText != null) {
updateLabelState(false);
}
}
}
public ColorStateList getHintTextColor() {
return this.focusedTextColor;
}
public void setDefaultHintTextColor(ColorStateList colorStateList) {
this.defaultHintTextColor = colorStateList;
this.focusedTextColor = colorStateList;
if (this.editText != null) {
updateLabelState(false);
}
}
public ColorStateList getDefaultHintTextColor() {
return this.defaultHintTextColor;
}
public void setErrorEnabled(boolean z) {
this.indicatorViewController.setErrorEnabled(z);
}
public void setErrorTextAppearance(int i) {
this.indicatorViewController.setErrorTextAppearance(i);
}
public void setErrorTextColor(ColorStateList colorStateList) {
this.indicatorViewController.setErrorViewTextColor(colorStateList);
}
public int getErrorCurrentTextColors() {
return this.indicatorViewController.getErrorViewCurrentTextColor();
}
public void setHelperTextTextAppearance(int i) {
this.indicatorViewController.setHelperTextAppearance(i);
}
public void setHelperTextColor(ColorStateList colorStateList) {
this.indicatorViewController.setHelperTextViewTextColor(colorStateList);
}
public boolean isErrorEnabled() {
return this.indicatorViewController.isErrorEnabled();
}
public void setHelperTextEnabled(boolean z) {
this.indicatorViewController.setHelperTextEnabled(z);
}
public void setHelperText(CharSequence charSequence) {
if (!TextUtils.isEmpty(charSequence)) {
if (!isHelperTextEnabled()) {
setHelperTextEnabled(true);
}
this.indicatorViewController.showHelper(charSequence);
} else if (isHelperTextEnabled()) {
setHelperTextEnabled(false);
}
}
public boolean isHelperTextEnabled() {
return this.indicatorViewController.isHelperTextEnabled();
}
public int getHelperTextCurrentTextColor() {
return this.indicatorViewController.getHelperTextViewCurrentTextColor();
}
public void setError(CharSequence charSequence) {
if (!this.indicatorViewController.isErrorEnabled()) {
if (!TextUtils.isEmpty(charSequence)) {
setErrorEnabled(true);
} else {
return;
}
}
if (!TextUtils.isEmpty(charSequence)) {
this.indicatorViewController.showError(charSequence);
} else {
this.indicatorViewController.hideError();
}
}
public void setErrorIconDrawable(int i) {
setErrorIconDrawable(i != 0 ? AppCompatResources.getDrawable(getContext(), i) : null);
}
public void setErrorIconDrawable(Drawable drawable) {
this.errorIconView.setImageDrawable(drawable);
setErrorIconVisible(drawable != null && this.indicatorViewController.isErrorEnabled());
}
public Drawable getErrorIconDrawable() {
return this.errorIconView.getDrawable();
}
public void setErrorIconTintList(ColorStateList colorStateList) {
Drawable drawable = this.errorIconView.getDrawable();
if (drawable != null) {
drawable = DrawableCompat.wrap(drawable).mutate();
DrawableCompat.setTintList(drawable, colorStateList);
}
if (this.errorIconView.getDrawable() != drawable) {
this.errorIconView.setImageDrawable(drawable);
}
}
public void setErrorIconTintMode(PorterDuff.Mode mode) {
Drawable drawable = this.errorIconView.getDrawable();
if (drawable != null) {
drawable = DrawableCompat.wrap(drawable).mutate();
DrawableCompat.setTintMode(drawable, mode);
}
if (this.errorIconView.getDrawable() != drawable) {
this.errorIconView.setImageDrawable(drawable);
}
}
public void setCounterEnabled(boolean z) {
if (this.counterEnabled != z) {
if (z) {
AppCompatTextView appCompatTextView = new AppCompatTextView(getContext());
this.counterView = appCompatTextView;
appCompatTextView.setId(R.id.textinput_counter);
Typeface typeface2 = this.typeface;
if (typeface2 != null) {
this.counterView.setTypeface(typeface2);
}
this.counterView.setMaxLines(1);
this.indicatorViewController.addIndicator(this.counterView, 2);
updateCounterTextAppearanceAndColor();
updateCounter();
} else {
this.indicatorViewController.removeIndicator(this.counterView, 2);
this.counterView = null;
}
this.counterEnabled = z;
}
}
public void setCounterTextAppearance(int i) {
if (this.counterTextAppearance != i) {
this.counterTextAppearance = i;
updateCounterTextAppearanceAndColor();
}
}
public void setCounterTextColor(ColorStateList colorStateList) {
if (this.counterTextColor != colorStateList) {
this.counterTextColor = colorStateList;
updateCounterTextAppearanceAndColor();
}
}
public ColorStateList getCounterTextColor() {
return this.counterTextColor;
}
public void setCounterOverflowTextAppearance(int i) {
if (this.counterOverflowTextAppearance != i) {
this.counterOverflowTextAppearance = i;
updateCounterTextAppearanceAndColor();
}
}
public void setCounterOverflowTextColor(ColorStateList colorStateList) {
if (this.counterOverflowTextColor != colorStateList) {
this.counterOverflowTextColor = colorStateList;
updateCounterTextAppearanceAndColor();
}
}
public ColorStateList getCounterOverflowTextColor() {
return this.counterTextColor;
}
public boolean isCounterEnabled() {
return this.counterEnabled;
}
public void setCounterMaxLength(int i) {
if (this.counterMaxLength != i) {
if (i > 0) {
this.counterMaxLength = i;
} else {
this.counterMaxLength = -1;
}
if (this.counterEnabled) {
updateCounter();
}
}
}
private void updateCounter() {
if (this.counterView != null) {
EditText editText2 = this.editText;
updateCounter(editText2 == null ? 0 : editText2.getText().length());
}
}
/* access modifiers changed from: package-private */
public void updateCounter(int i) {
boolean z = this.counterOverflowed;
if (this.counterMaxLength == -1) {
this.counterView.setText(String.valueOf(i));
this.counterView.setContentDescription((CharSequence) null);
this.counterOverflowed = false;
} else {
if (ViewCompat.getAccessibilityLiveRegion(this.counterView) == 1) {
ViewCompat.setAccessibilityLiveRegion(this.counterView, 0);
}
this.counterOverflowed = i > this.counterMaxLength;
updateCounterContentDescription(getContext(), this.counterView, i, this.counterMaxLength, this.counterOverflowed);
if (z != this.counterOverflowed) {
updateCounterTextAppearanceAndColor();
if (this.counterOverflowed) {
ViewCompat.setAccessibilityLiveRegion(this.counterView, 1);
}
}
this.counterView.setText(getContext().getString(R.string.character_counter_pattern, new Object[]{Integer.valueOf(i), Integer.valueOf(this.counterMaxLength)}));
}
if (this.editText != null && z != this.counterOverflowed) {
updateLabelState(false);
updateTextInputBoxState();
updateEditTextBackground();
}
}
private static void updateCounterContentDescription(Context context, TextView textView, int i, int i2, boolean z) {
textView.setContentDescription(context.getString(z ? R.string.character_counter_overflowed_content_description : R.string.character_counter_content_description, new Object[]{Integer.valueOf(i), Integer.valueOf(i2)}));
}
public void setEnabled(boolean z) {
recursiveSetEnabled(this, z);
super.setEnabled(z);
}
private static void recursiveSetEnabled(ViewGroup viewGroup, boolean z) {
int childCount = viewGroup.getChildCount();
for (int i = 0; i < childCount; i++) {
View childAt = viewGroup.getChildAt(i);
childAt.setEnabled(z);
if (childAt instanceof ViewGroup) {
recursiveSetEnabled((ViewGroup) childAt, z);
}
}
}
public int getCounterMaxLength() {
return this.counterMaxLength;
}
/* access modifiers changed from: package-private */
public CharSequence getCounterOverflowDescription() {
TextView textView;
if (!this.counterEnabled || !this.counterOverflowed || (textView = this.counterView) == null) {
return null;
}
return textView.getContentDescription();
}
private void updateCounterTextAppearanceAndColor() {
ColorStateList colorStateList;
ColorStateList colorStateList2;
TextView textView = this.counterView;
if (textView != null) {
setTextAppearanceCompatWithErrorFallback(textView, this.counterOverflowed ? this.counterOverflowTextAppearance : this.counterTextAppearance);
if (!this.counterOverflowed && (colorStateList2 = this.counterTextColor) != null) {
this.counterView.setTextColor(colorStateList2);
}
if (this.counterOverflowed && (colorStateList = this.counterOverflowTextColor) != null) {
this.counterView.setTextColor(colorStateList);
}
}
}
/* access modifiers changed from: package-private */
public void setTextAppearanceCompatWithErrorFallback(TextView textView, int i) {
boolean z = true;
try {
TextViewCompat.setTextAppearance(textView, i);
if (Build.VERSION.SDK_INT < 23 || textView.getTextColors().getDefaultColor() != -65281) {
z = false;
}
} catch (Exception unused) {
}
if (z) {
TextViewCompat.setTextAppearance(textView, R.style.TextAppearance_AppCompat_Caption);
textView.setTextColor(ContextCompat.getColor(getContext(), R.color.design_error));
}
}
private int calculateLabelMarginTop() {
float collapsedTextHeight;
if (!this.hintEnabled) {
return 0;
}
int i = this.boxBackgroundMode;
if (i == 0 || i == 1) {
collapsedTextHeight = this.collapsingTextHelper.getCollapsedTextHeight();
} else if (i != 2) {
return 0;
} else {
collapsedTextHeight = this.collapsingTextHelper.getCollapsedTextHeight() / 2.0f;
}
return (int) collapsedTextHeight;
}
private Rect calculateCollapsedTextBounds(Rect rect) {
if (this.editText != null) {
Rect rect2 = this.tmpBoundsRect;
rect2.bottom = rect.bottom;
int i = this.boxBackgroundMode;
if (i == 1) {
rect2.left = rect.left + this.editText.getCompoundPaddingLeft();
rect2.top = rect.top + this.boxCollapsedPaddingTopPx;
rect2.right = rect.right - this.editText.getCompoundPaddingRight();
return rect2;
} else if (i != 2) {
rect2.left = rect.left + this.editText.getCompoundPaddingLeft();
rect2.top = getPaddingTop();
rect2.right = rect.right - this.editText.getCompoundPaddingRight();
return rect2;
} else {
rect2.left = rect.left + this.editText.getPaddingLeft();
rect2.top = rect.top - calculateLabelMarginTop();
rect2.right = rect.right - this.editText.getPaddingRight();
return rect2;
}
} else {
throw new IllegalStateException();
}
}
private Rect calculateExpandedTextBounds(Rect rect) {
if (this.editText != null) {
Rect rect2 = this.tmpBoundsRect;
float expandedTextHeight = this.collapsingTextHelper.getExpandedTextHeight();
rect2.left = rect.left + this.editText.getCompoundPaddingLeft();
rect2.top = calculateExpandedLabelTop(rect, expandedTextHeight);
rect2.right = rect.right - this.editText.getCompoundPaddingRight();
rect2.bottom = calculateExpandedLabelBottom(rect, rect2, expandedTextHeight);
return rect2;
}
throw new IllegalStateException();
}
private int calculateExpandedLabelTop(Rect rect, float f) {
if (isSingleLineFilledTextField()) {
return (int) (((float) rect.centerY()) - (f / 2.0f));
}
return rect.top + this.editText.getCompoundPaddingTop();
}
private int calculateExpandedLabelBottom(Rect rect, Rect rect2, float f) {
if (this.boxBackgroundMode == 1) {
return (int) (((float) rect2.top) + f);
}
return rect.bottom - this.editText.getCompoundPaddingBottom();
}
private boolean isSingleLineFilledTextField() {
if (this.boxBackgroundMode != 1 || (Build.VERSION.SDK_INT >= 16 && this.editText.getMinLines() > 1)) {
return false;
}
return true;
}
private int calculateBoxBackgroundColor() {
return this.boxBackgroundMode == 1 ? MaterialColors.layer(MaterialColors.getColor((View) this, R.attr.colorSurface, 0), this.boxBackgroundColor) : this.boxBackgroundColor;
}
private void applyBoxAttributes() {
MaterialShapeDrawable materialShapeDrawable = this.boxBackground;
if (materialShapeDrawable != null) {
materialShapeDrawable.setShapeAppearanceModel(this.shapeAppearanceModel);
if (canDrawOutlineStroke()) {
this.boxBackground.setStroke((float) this.boxStrokeWidthPx, this.boxStrokeColor);
}
int calculateBoxBackgroundColor = calculateBoxBackgroundColor();
this.boxBackgroundColor = calculateBoxBackgroundColor;
this.boxBackground.setFillColor(ColorStateList.valueOf(calculateBoxBackgroundColor));
if (this.endIconMode == 3) {
this.editText.getBackground().invalidateSelf();
}
applyBoxUnderlineAttributes();
invalidate();
}
}
private void applyBoxUnderlineAttributes() {
if (this.boxUnderline != null) {
if (canDrawStroke()) {
this.boxUnderline.setFillColor(ColorStateList.valueOf(this.boxStrokeColor));
}
invalidate();
}
}
private boolean canDrawOutlineStroke() {
return this.boxBackgroundMode == 2 && canDrawStroke();
}
private boolean canDrawStroke() {
return this.boxStrokeWidthPx > -1 && this.boxStrokeColor != 0;
}
/* access modifiers changed from: package-private */
public void updateEditTextBackground() {
Drawable background;
TextView textView;
EditText editText2 = this.editText;
if (editText2 != null && this.boxBackgroundMode == 0 && (background = editText2.getBackground()) != null) {
if (DrawableUtils.canSafelyMutateDrawable(background)) {
background = background.mutate();
}
if (this.indicatorViewController.errorShouldBeShown()) {
background.setColorFilter(AppCompatDrawableManager.getPorterDuffColorFilter(this.indicatorViewController.getErrorViewCurrentTextColor(), PorterDuff.Mode.SRC_IN));
} else if (!this.counterOverflowed || (textView = this.counterView) == null) {
DrawableCompat.clearColorFilter(background);
this.editText.refreshDrawableState();
} else {
background.setColorFilter(AppCompatDrawableManager.getPorterDuffColorFilter(textView.getCurrentTextColor(), PorterDuff.Mode.SRC_IN));
}
}
}
static class SavedState extends AbsSavedState {
public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.ClassLoaderCreator<SavedState>() {
public SavedState createFromParcel(Parcel parcel, ClassLoader classLoader) {
return new SavedState(parcel, classLoader);
}
public SavedState createFromParcel(Parcel parcel) {
return new SavedState(parcel, (ClassLoader) null);
}
public SavedState[] newArray(int i) {
return new SavedState[i];
}
};
CharSequence error;
boolean isEndIconChecked;
SavedState(Parcelable parcelable) {
super(parcelable);
}
SavedState(Parcel parcel, ClassLoader classLoader) {
super(parcel, classLoader);
this.error = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
this.isEndIconChecked = parcel.readInt() != 1 ? false : true;
}
public void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
TextUtils.writeToParcel(this.error, parcel, i);
parcel.writeInt(this.isEndIconChecked ? 1 : 0);
}
public String toString() {
return "TextInputLayout.SavedState{" + Integer.toHexString(System.identityHashCode(this)) + " error=" + this.error + "}";
}
}
public Parcelable onSaveInstanceState() {
SavedState savedState = new SavedState(super.onSaveInstanceState());
if (this.indicatorViewController.errorShouldBeShown()) {
savedState.error = getError();
}
savedState.isEndIconChecked = hasEndIcon() && this.endIconView.isChecked();
return savedState;
}
/* access modifiers changed from: protected */
public void onRestoreInstanceState(Parcelable parcelable) {
if (!(parcelable instanceof SavedState)) {
super.onRestoreInstanceState(parcelable);
return;
}
SavedState savedState = (SavedState) parcelable;
super.onRestoreInstanceState(savedState.getSuperState());
setError(savedState.error);
if (savedState.isEndIconChecked) {
this.endIconView.post(new Runnable() {
public void run() {
TextInputLayout.this.endIconView.performClick();
TextInputLayout.this.endIconView.jumpDrawablesToCurrentState();
}
});
}
requestLayout();
}
/* access modifiers changed from: protected */
public void dispatchRestoreInstanceState(SparseArray<Parcelable> sparseArray) {
this.restoringSavedState = true;
super.dispatchRestoreInstanceState(sparseArray);
this.restoringSavedState = false;
}
public CharSequence getError() {
if (this.indicatorViewController.isErrorEnabled()) {
return this.indicatorViewController.getErrorText();
}
return null;
}
public CharSequence getHelperText() {
if (this.indicatorViewController.isHelperTextEnabled()) {
return this.indicatorViewController.getHelperText();
}
return null;
}
public boolean isHintAnimationEnabled() {
return this.hintAnimationEnabled;
}
public void setHintAnimationEnabled(boolean z) {
this.hintAnimationEnabled = z;
}
/* access modifiers changed from: protected */
public void onMeasure(int i, int i2) {
super.onMeasure(i, i2);
boolean updateEditTextHeightBasedOnIcon = updateEditTextHeightBasedOnIcon();
boolean updateIconDummyDrawables = updateIconDummyDrawables();
if (updateEditTextHeightBasedOnIcon || updateIconDummyDrawables) {
this.editText.post(new Runnable() {
public void run() {
TextInputLayout.this.editText.requestLayout();
}
});
}
}
private boolean updateEditTextHeightBasedOnIcon() {
int max;
if (this.editText == null || this.editText.getMeasuredHeight() >= (max = Math.max(this.endIconView.getMeasuredHeight(), this.startIconView.getMeasuredHeight()))) {
return false;
}
this.editText.setMinimumHeight(max);
return true;
}
public void setStartIconDrawable(int i) {
setStartIconDrawable(i != 0 ? AppCompatResources.getDrawable(getContext(), i) : null);
}
public void setStartIconDrawable(Drawable drawable) {
this.startIconView.setImageDrawable(drawable);
if (drawable != null) {
setStartIconVisible(true);
applyStartIconTint();
return;
}
setStartIconVisible(false);
setStartIconOnClickListener((View.OnClickListener) null);
setStartIconOnLongClickListener((View.OnLongClickListener) null);
setStartIconContentDescription((CharSequence) null);
}
public Drawable getStartIconDrawable() {
return this.startIconView.getDrawable();
}
public void setStartIconOnClickListener(View.OnClickListener onClickListener) {
setIconOnClickListener(this.startIconView, onClickListener, this.startIconOnLongClickListener);
}
public void setStartIconOnLongClickListener(View.OnLongClickListener onLongClickListener) {
this.startIconOnLongClickListener = onLongClickListener;
setIconOnLongClickListener(this.startIconView, onLongClickListener);
}
public void setStartIconVisible(boolean z) {
if (isStartIconVisible() != z) {
this.startIconView.setVisibility(z ? 0 : 8);
updateIconDummyDrawables();
}
}
public boolean isStartIconVisible() {
return this.startIconView.getVisibility() == 0;
}
public void setStartIconCheckable(boolean z) {
this.startIconView.setCheckable(z);
}
public boolean isStartIconCheckable() {
return this.startIconView.isCheckable();
}
public void setStartIconContentDescription(int i) {
setStartIconContentDescription(i != 0 ? getResources().getText(i) : null);
}
public void setStartIconContentDescription(CharSequence charSequence) {
if (getStartIconContentDescription() != charSequence) {
this.startIconView.setContentDescription(charSequence);
}
}
public CharSequence getStartIconContentDescription() {
return this.startIconView.getContentDescription();
}
public void setStartIconTintList(ColorStateList colorStateList) {
if (this.startIconTintList != colorStateList) {
this.startIconTintList = colorStateList;
this.hasStartIconTintList = true;
applyStartIconTint();
}
}
public void setStartIconTintMode(PorterDuff.Mode mode) {
if (this.startIconTintMode != mode) {
this.startIconTintMode = mode;
this.hasStartIconTintMode = true;
applyStartIconTint();
}
}
public void setEndIconMode(int i) {
int i2 = this.endIconMode;
this.endIconMode = i;
setEndIconVisible(i != 0);
if (getEndIconDelegate().isBoxBackgroundModeSupported(this.boxBackgroundMode)) {
getEndIconDelegate().initialize();
applyEndIconTint();
dispatchOnEndIconChanged(i2);
return;
}
throw new IllegalStateException("The current box background mode " + this.boxBackgroundMode + " is not supported by the end icon mode " + i);
}
public int getEndIconMode() {
return this.endIconMode;
}
public void setEndIconOnClickListener(View.OnClickListener onClickListener) {
setIconOnClickListener(this.endIconView, onClickListener, this.endIconOnLongClickListener);
}
public void setEndIconOnLongClickListener(View.OnLongClickListener onLongClickListener) {
this.endIconOnLongClickListener = onLongClickListener;
setIconOnLongClickListener(this.endIconView, onLongClickListener);
}
public void setEndIconVisible(boolean z) {
if (isEndIconVisible() != z) {
this.endIconView.setVisibility(z ? 0 : 4);
updateIconDummyDrawables();
}
}
public boolean isEndIconVisible() {
return this.endIconFrame.getVisibility() == 0 && this.endIconView.getVisibility() == 0;
}
public void setEndIconActivated(boolean z) {
this.endIconView.setActivated(z);
}
public void setEndIconCheckable(boolean z) {
this.endIconView.setCheckable(z);
}
public boolean isEndIconCheckable() {
return this.endIconView.isCheckable();
}
public void setEndIconDrawable(int i) {
setEndIconDrawable(i != 0 ? AppCompatResources.getDrawable(getContext(), i) : null);
}
public void setEndIconDrawable(Drawable drawable) {
this.endIconView.setImageDrawable(drawable);
}
public Drawable getEndIconDrawable() {
return this.endIconView.getDrawable();
}
public void setEndIconContentDescription(int i) {
setEndIconContentDescription(i != 0 ? getResources().getText(i) : null);
}
public void setEndIconContentDescription(CharSequence charSequence) {
if (getEndIconContentDescription() != charSequence) {
this.endIconView.setContentDescription(charSequence);
}
}
public CharSequence getEndIconContentDescription() {
return this.endIconView.getContentDescription();
}
public void setEndIconTintList(ColorStateList colorStateList) {
if (this.endIconTintList != colorStateList) {
this.endIconTintList = colorStateList;
this.hasEndIconTintList = true;
applyEndIconTint();
}
}
public void setEndIconTintMode(PorterDuff.Mode mode) {
if (this.endIconTintMode != mode) {
this.endIconTintMode = mode;
this.hasEndIconTintMode = true;
applyEndIconTint();
}
}
public void addOnEndIconChangedListener(OnEndIconChangedListener onEndIconChangedListener) {
this.endIconChangedListeners.add(onEndIconChangedListener);
}
public void removeOnEndIconChangedListener(OnEndIconChangedListener onEndIconChangedListener) {
this.endIconChangedListeners.remove(onEndIconChangedListener);
}
public void clearOnEndIconChangedListeners() {
this.endIconChangedListeners.clear();
}
public void addOnEditTextAttachedListener(OnEditTextAttachedListener onEditTextAttachedListener) {
this.editTextAttachedListeners.add(onEditTextAttachedListener);
if (this.editText != null) {
onEditTextAttachedListener.onEditTextAttached(this);
}
}
public void removeOnEditTextAttachedListener(OnEditTextAttachedListener onEditTextAttachedListener) {
this.editTextAttachedListeners.remove(onEditTextAttachedListener);
}
public void clearOnEditTextAttachedListeners() {
this.editTextAttachedListeners.clear();
}
@Deprecated
public void setPasswordVisibilityToggleDrawable(int i) {
setPasswordVisibilityToggleDrawable(i != 0 ? AppCompatResources.getDrawable(getContext(), i) : null);
}
@Deprecated
public void setPasswordVisibilityToggleDrawable(Drawable drawable) {
this.endIconView.setImageDrawable(drawable);
}
@Deprecated
public void setPasswordVisibilityToggleContentDescription(int i) {
setPasswordVisibilityToggleContentDescription(i != 0 ? getResources().getText(i) : null);
}
@Deprecated
public void setPasswordVisibilityToggleContentDescription(CharSequence charSequence) {
this.endIconView.setContentDescription(charSequence);
}
@Deprecated
public Drawable getPasswordVisibilityToggleDrawable() {
return this.endIconView.getDrawable();
}
@Deprecated
public CharSequence getPasswordVisibilityToggleContentDescription() {
return this.endIconView.getContentDescription();
}
@Deprecated
public boolean isPasswordVisibilityToggleEnabled() {
return this.endIconMode == 1;
}
@Deprecated
public void setPasswordVisibilityToggleEnabled(boolean z) {
if (z && this.endIconMode != 1) {
setEndIconMode(1);
} else if (!z) {
setEndIconMode(0);
}
}
@Deprecated
public void setPasswordVisibilityToggleTintList(ColorStateList colorStateList) {
this.endIconTintList = colorStateList;
this.hasEndIconTintList = true;
applyEndIconTint();
}
@Deprecated
public void setPasswordVisibilityToggleTintMode(PorterDuff.Mode mode) {
this.endIconTintMode = mode;
this.hasEndIconTintMode = true;
applyEndIconTint();
}
@Deprecated
public void passwordVisibilityToggleRequested(boolean z) {
if (this.endIconMode == 1) {
this.endIconView.performClick();
if (z) {
this.endIconView.jumpDrawablesToCurrentState();
}
}
}
public void setTextInputAccessibilityDelegate(AccessibilityDelegate accessibilityDelegate) {
EditText editText2 = this.editText;
if (editText2 != null) {
ViewCompat.setAccessibilityDelegate(editText2, accessibilityDelegate);
}
}
/* access modifiers changed from: package-private */
public CheckableImageButton getEndIconView() {
return this.endIconView;
}
private EndIconDelegate getEndIconDelegate() {
EndIconDelegate endIconDelegate = this.endIconDelegates.get(this.endIconMode);
return endIconDelegate != null ? endIconDelegate : this.endIconDelegates.get(0);
}
private void dispatchOnEditTextAttached() {
Iterator it = this.editTextAttachedListeners.iterator();
while (it.hasNext()) {
((OnEditTextAttachedListener) it.next()).onEditTextAttached(this);
}
}
private boolean hasStartIcon() {
return getStartIconDrawable() != null;
}
private void applyStartIconTint() {
applyIconTint(this.startIconView, this.hasStartIconTintList, this.startIconTintList, this.hasStartIconTintMode, this.startIconTintMode);
}
private boolean hasEndIcon() {
return this.endIconMode != 0;
}
private void dispatchOnEndIconChanged(int i) {
Iterator it = this.endIconChangedListeners.iterator();
while (it.hasNext()) {
((OnEndIconChangedListener) it.next()).onEndIconChanged(this, i);
}
}
private void tintEndIconOnError(boolean z) {
if (!z || getEndIconDrawable() == null) {
applyEndIconTint();
return;
}
Drawable mutate = DrawableCompat.wrap(getEndIconDrawable()).mutate();
DrawableCompat.setTint(mutate, this.indicatorViewController.getErrorViewCurrentTextColor());
this.endIconView.setImageDrawable(mutate);
}
private void applyEndIconTint() {
applyIconTint(this.endIconView, this.hasEndIconTintList, this.endIconTintList, this.hasEndIconTintMode, this.endIconTintMode);
}
/* JADX WARNING: Removed duplicated region for block: B:24:0x0086 */
/* JADX WARNING: Removed duplicated region for block: B:31:0x00ca */
/* Code decompiled incorrectly, please refer to instructions dump. */
private boolean updateIconDummyDrawables() {
/*
r10 = this;
android.widget.EditText r0 = r10.editText
r1 = 0
if (r0 != 0) goto L_0x0006
return r1
L_0x0006:
boolean r0 = r10.hasStartIcon()
r2 = 0
r3 = 3
r4 = 2
r5 = 1
if (r0 == 0) goto L_0x0060
boolean r0 = r10.isStartIconVisible()
if (r0 == 0) goto L_0x0060
com.google.android.material.internal.CheckableImageButton r0 = r10.startIconView
int r0 = r0.getMeasuredWidth()
if (r0 <= 0) goto L_0x0060
android.graphics.drawable.Drawable r0 = r10.startIconDummyDrawable
if (r0 != 0) goto L_0x0048
android.graphics.drawable.ColorDrawable r0 = new android.graphics.drawable.ColorDrawable
r0.<init>()
r10.startIconDummyDrawable = r0
com.google.android.material.internal.CheckableImageButton r0 = r10.startIconView
int r0 = r0.getMeasuredWidth()
android.widget.EditText r6 = r10.editText
int r6 = r6.getPaddingLeft()
int r0 = r0 - r6
com.google.android.material.internal.CheckableImageButton r6 = r10.startIconView
android.view.ViewGroup$LayoutParams r6 = r6.getLayoutParams()
android.view.ViewGroup$MarginLayoutParams r6 = (android.view.ViewGroup.MarginLayoutParams) r6
int r6 = androidx.core.view.MarginLayoutParamsCompat.getMarginEnd(r6)
int r0 = r0 + r6
android.graphics.drawable.Drawable r6 = r10.startIconDummyDrawable
r6.setBounds(r1, r1, r0, r5)
L_0x0048:
android.widget.EditText r0 = r10.editText
android.graphics.drawable.Drawable[] r0 = androidx.core.widget.TextViewCompat.getCompoundDrawablesRelative(r0)
r6 = r0[r1]
android.graphics.drawable.Drawable r7 = r10.startIconDummyDrawable
if (r6 == r7) goto L_0x0079
android.widget.EditText r6 = r10.editText
r8 = r0[r5]
r9 = r0[r4]
r0 = r0[r3]
androidx.core.widget.TextViewCompat.setCompoundDrawablesRelative(r6, r7, r8, r9, r0)
goto L_0x0077
L_0x0060:
android.graphics.drawable.Drawable r0 = r10.startIconDummyDrawable
if (r0 == 0) goto L_0x0079
android.widget.EditText r0 = r10.editText
android.graphics.drawable.Drawable[] r0 = androidx.core.widget.TextViewCompat.getCompoundDrawablesRelative(r0)
android.widget.EditText r6 = r10.editText
r7 = r0[r5]
r8 = r0[r4]
r0 = r0[r3]
androidx.core.widget.TextViewCompat.setCompoundDrawablesRelative(r6, r2, r7, r8, r0)
r10.startIconDummyDrawable = r2
L_0x0077:
r0 = 1
goto L_0x007a
L_0x0079:
r0 = 0
L_0x007a:
com.google.android.material.internal.CheckableImageButton r6 = r10.getEndIconToUpdateDummyDrawable()
if (r6 == 0) goto L_0x00ca
int r7 = r6.getMeasuredWidth()
if (r7 <= 0) goto L_0x00ca
android.graphics.drawable.Drawable r2 = r10.endIconDummyDrawable
if (r2 != 0) goto L_0x00ac
android.graphics.drawable.ColorDrawable r2 = new android.graphics.drawable.ColorDrawable
r2.<init>()
r10.endIconDummyDrawable = r2
int r2 = r6.getMeasuredWidth()
android.widget.EditText r7 = r10.editText
int r7 = r7.getPaddingRight()
int r2 = r2 - r7
android.view.ViewGroup$LayoutParams r6 = r6.getLayoutParams()
android.view.ViewGroup$MarginLayoutParams r6 = (android.view.ViewGroup.MarginLayoutParams) r6
int r6 = androidx.core.view.MarginLayoutParamsCompat.getMarginStart(r6)
int r2 = r2 + r6
android.graphics.drawable.Drawable r6 = r10.endIconDummyDrawable
r6.setBounds(r1, r1, r2, r5)
L_0x00ac:
android.widget.EditText r2 = r10.editText
android.graphics.drawable.Drawable[] r2 = androidx.core.widget.TextViewCompat.getCompoundDrawablesRelative(r2)
r6 = r2[r4]
android.graphics.drawable.Drawable r7 = r10.endIconDummyDrawable
if (r6 == r7) goto L_0x00c8
r0 = r2[r4]
r10.originalEditTextEndDrawable = r0
android.widget.EditText r0 = r10.editText
r1 = r2[r1]
r4 = r2[r5]
r2 = r2[r3]
androidx.core.widget.TextViewCompat.setCompoundDrawablesRelative(r0, r1, r4, r7, r2)
goto L_0x00eb
L_0x00c8:
r5 = r0
goto L_0x00eb
L_0x00ca:
android.graphics.drawable.Drawable r6 = r10.endIconDummyDrawable
if (r6 == 0) goto L_0x00ec
android.widget.EditText r6 = r10.editText
android.graphics.drawable.Drawable[] r6 = androidx.core.widget.TextViewCompat.getCompoundDrawablesRelative(r6)
r4 = r6[r4]
android.graphics.drawable.Drawable r7 = r10.endIconDummyDrawable
if (r4 != r7) goto L_0x00e8
android.widget.EditText r0 = r10.editText
r1 = r6[r1]
r4 = r6[r5]
android.graphics.drawable.Drawable r7 = r10.originalEditTextEndDrawable
r3 = r6[r3]
androidx.core.widget.TextViewCompat.setCompoundDrawablesRelative(r0, r1, r4, r7, r3)
goto L_0x00e9
L_0x00e8:
r5 = r0
L_0x00e9:
r10.endIconDummyDrawable = r2
L_0x00eb:
r0 = r5
L_0x00ec:
return r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.textfield.TextInputLayout.updateIconDummyDrawables():boolean");
}
private CheckableImageButton getEndIconToUpdateDummyDrawable() {
if (this.errorIconView.getVisibility() == 0) {
return this.errorIconView;
}
if (!hasEndIcon() || !isEndIconVisible()) {
return null;
}
return this.endIconView;
}
private void applyIconTint(CheckableImageButton checkableImageButton, boolean z, ColorStateList colorStateList, boolean z2, PorterDuff.Mode mode) {
Drawable drawable = checkableImageButton.getDrawable();
if (drawable != null && (z || z2)) {
drawable = DrawableCompat.wrap(drawable).mutate();
if (z) {
DrawableCompat.setTintList(drawable, colorStateList);
}
if (z2) {
DrawableCompat.setTintMode(drawable, mode);
}
}
if (checkableImageButton.getDrawable() != drawable) {
checkableImageButton.setImageDrawable(drawable);
}
}
private static void setIconOnClickListener(CheckableImageButton checkableImageButton, View.OnClickListener onClickListener, View.OnLongClickListener onLongClickListener) {
checkableImageButton.setOnClickListener(onClickListener);
setIconClickable(checkableImageButton, onLongClickListener);
}
private static void setIconOnLongClickListener(CheckableImageButton checkableImageButton, View.OnLongClickListener onLongClickListener) {
checkableImageButton.setOnLongClickListener(onLongClickListener);
setIconClickable(checkableImageButton, onLongClickListener);
}
private static void setIconClickable(CheckableImageButton checkableImageButton, View.OnLongClickListener onLongClickListener) {
boolean hasOnClickListeners = ViewCompat.hasOnClickListeners(checkableImageButton);
boolean z = false;
int i = 1;
boolean z2 = onLongClickListener != null;
if (hasOnClickListeners || z2) {
z = true;
}
checkableImageButton.setFocusable(z);
checkableImageButton.setClickable(hasOnClickListeners);
checkableImageButton.setPressable(hasOnClickListeners);
checkableImageButton.setLongClickable(z2);
if (!z) {
i = 2;
}
ViewCompat.setImportantForAccessibility(checkableImageButton, i);
}
/* access modifiers changed from: protected */
public void onLayout(boolean z, int i, int i2, int i3, int i4) {
super.onLayout(z, i, i2, i3, i4);
EditText editText2 = this.editText;
if (editText2 != null) {
Rect rect = this.tmpRect;
DescendantOffsetUtils.getDescendantRect(this, editText2, rect);
updateBoxUnderlineBounds(rect);
if (this.hintEnabled) {
this.collapsingTextHelper.setCollapsedBounds(calculateCollapsedTextBounds(rect));
this.collapsingTextHelper.setExpandedBounds(calculateExpandedTextBounds(rect));
this.collapsingTextHelper.recalculate();
if (cutoutEnabled() && !this.hintExpanded) {
openCutout();
}
}
}
}
private void updateBoxUnderlineBounds(Rect rect) {
if (this.boxUnderline != null) {
this.boxUnderline.setBounds(rect.left, rect.bottom - this.boxStrokeWidthFocusedPx, rect.right, rect.bottom);
}
}
public void draw(Canvas canvas) {
super.draw(canvas);
drawHint(canvas);
drawBoxUnderline(canvas);
}
private void drawHint(Canvas canvas) {
if (this.hintEnabled) {
this.collapsingTextHelper.draw(canvas);
}
}
private void drawBoxUnderline(Canvas canvas) {
MaterialShapeDrawable materialShapeDrawable = this.boxUnderline;
if (materialShapeDrawable != null) {
Rect bounds = materialShapeDrawable.getBounds();
bounds.top = bounds.bottom - this.boxStrokeWidthPx;
this.boxUnderline.draw(canvas);
}
}
private void collapseHint(boolean z) {
ValueAnimator valueAnimator = this.animator;
if (valueAnimator != null && valueAnimator.isRunning()) {
this.animator.cancel();
}
if (!z || !this.hintAnimationEnabled) {
this.collapsingTextHelper.setExpansionFraction(1.0f);
} else {
animateToExpansionFraction(1.0f);
}
this.hintExpanded = false;
if (cutoutEnabled()) {
openCutout();
}
}
private boolean cutoutEnabled() {
return this.hintEnabled && !TextUtils.isEmpty(this.hint) && (this.boxBackground instanceof CutoutDrawable);
}
private void openCutout() {
if (cutoutEnabled()) {
RectF rectF = this.tmpRectF;
this.collapsingTextHelper.getCollapsedTextActualBounds(rectF);
applyCutoutPadding(rectF);
rectF.offset((float) (-getPaddingLeft()), 0.0f);
((CutoutDrawable) this.boxBackground).setCutout(rectF);
}
}
private void closeCutout() {
if (cutoutEnabled()) {
((CutoutDrawable) this.boxBackground).removeCutout();
}
}
private void applyCutoutPadding(RectF rectF) {
rectF.left -= (float) this.boxLabelCutoutPaddingPx;
rectF.top -= (float) this.boxLabelCutoutPaddingPx;
rectF.right += (float) this.boxLabelCutoutPaddingPx;
rectF.bottom += (float) this.boxLabelCutoutPaddingPx;
}
/* access modifiers changed from: package-private */
public boolean cutoutIsOpen() {
return cutoutEnabled() && ((CutoutDrawable) this.boxBackground).hasCutout();
}
/* access modifiers changed from: protected */
public void drawableStateChanged() {
if (!this.inDrawableStateChanged) {
boolean z = true;
this.inDrawableStateChanged = true;
super.drawableStateChanged();
int[] drawableState = getDrawableState();
CollapsingTextHelper collapsingTextHelper2 = this.collapsingTextHelper;
boolean state = collapsingTextHelper2 != null ? collapsingTextHelper2.setState(drawableState) | false : false;
if (!ViewCompat.isLaidOut(this) || !isEnabled()) {
z = false;
}
updateLabelState(z);
updateEditTextBackground();
updateTextInputBoxState();
if (state) {
invalidate();
}
this.inDrawableStateChanged = false;
}
}
/* access modifiers changed from: package-private */
/* JADX WARNING: Code restructure failed: missing block: B:6:0x0012, code lost:
r0 = r5.editText;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
public void updateTextInputBoxState() {
/*
r5 = this;
com.google.android.material.shape.MaterialShapeDrawable r0 = r5.boxBackground
if (r0 == 0) goto L_0x00d3
int r0 = r5.boxBackgroundMode
if (r0 != 0) goto L_0x000a
goto L_0x00d3
L_0x000a:
boolean r0 = r5.isFocused()
r1 = 0
r2 = 1
if (r0 != 0) goto L_0x001f
android.widget.EditText r0 = r5.editText
if (r0 == 0) goto L_0x001d
boolean r0 = r0.hasFocus()
if (r0 == 0) goto L_0x001d
goto L_0x001f
L_0x001d:
r0 = 0
goto L_0x0020
L_0x001f:
r0 = 1
L_0x0020:
boolean r3 = r5.isHovered()
if (r3 != 0) goto L_0x0033
android.widget.EditText r3 = r5.editText
if (r3 == 0) goto L_0x0031
boolean r3 = r3.isHovered()
if (r3 == 0) goto L_0x0031
goto L_0x0033
L_0x0031:
r3 = 0
goto L_0x0034
L_0x0033:
r3 = 1
L_0x0034:
boolean r4 = r5.isEnabled()
if (r4 != 0) goto L_0x003f
int r4 = r5.disabledColor
r5.boxStrokeColor = r4
goto L_0x0071
L_0x003f:
com.google.android.material.textfield.IndicatorViewController r4 = r5.indicatorViewController
boolean r4 = r4.errorShouldBeShown()
if (r4 == 0) goto L_0x0050
com.google.android.material.textfield.IndicatorViewController r4 = r5.indicatorViewController
int r4 = r4.getErrorViewCurrentTextColor()
r5.boxStrokeColor = r4
goto L_0x0071
L_0x0050:
boolean r4 = r5.counterOverflowed
if (r4 == 0) goto L_0x005f
android.widget.TextView r4 = r5.counterView
if (r4 == 0) goto L_0x005f
int r4 = r4.getCurrentTextColor()
r5.boxStrokeColor = r4
goto L_0x0071
L_0x005f:
if (r0 == 0) goto L_0x0066
int r4 = r5.focusedStrokeColor
r5.boxStrokeColor = r4
goto L_0x0071
L_0x0066:
if (r3 == 0) goto L_0x006d
int r4 = r5.hoveredStrokeColor
r5.boxStrokeColor = r4
goto L_0x0071
L_0x006d:
int r4 = r5.defaultStrokeColor
r5.boxStrokeColor = r4
L_0x0071:
com.google.android.material.textfield.IndicatorViewController r4 = r5.indicatorViewController
boolean r4 = r4.errorShouldBeShown()
if (r4 == 0) goto L_0x0085
com.google.android.material.textfield.EndIconDelegate r4 = r5.getEndIconDelegate()
boolean r4 = r4.shouldTintIconOnError()
if (r4 == 0) goto L_0x0085
r4 = 1
goto L_0x0086
L_0x0085:
r4 = 0
L_0x0086:
r5.tintEndIconOnError(r4)
android.graphics.drawable.Drawable r4 = r5.getErrorIconDrawable()
if (r4 == 0) goto L_0x00a0
com.google.android.material.textfield.IndicatorViewController r4 = r5.indicatorViewController
boolean r4 = r4.isErrorEnabled()
if (r4 == 0) goto L_0x00a0
com.google.android.material.textfield.IndicatorViewController r4 = r5.indicatorViewController
boolean r4 = r4.errorShouldBeShown()
if (r4 == 0) goto L_0x00a0
r1 = 1
L_0x00a0:
r5.setErrorIconVisible(r1)
if (r3 != 0) goto L_0x00a7
if (r0 == 0) goto L_0x00b2
L_0x00a7:
boolean r0 = r5.isEnabled()
if (r0 == 0) goto L_0x00b2
int r0 = r5.boxStrokeWidthFocusedPx
r5.boxStrokeWidthPx = r0
goto L_0x00b6
L_0x00b2:
int r0 = r5.boxStrokeWidthDefaultPx
r5.boxStrokeWidthPx = r0
L_0x00b6:
int r0 = r5.boxBackgroundMode
if (r0 != r2) goto L_0x00d0
boolean r0 = r5.isEnabled()
if (r0 != 0) goto L_0x00c5
int r0 = r5.disabledFilledBackgroundColor
r5.boxBackgroundColor = r0
goto L_0x00d0
L_0x00c5:
if (r3 == 0) goto L_0x00cc
int r0 = r5.hoveredFilledBackgroundColor
r5.boxBackgroundColor = r0
goto L_0x00d0
L_0x00cc:
int r0 = r5.defaultFilledBackgroundColor
r5.boxBackgroundColor = r0
L_0x00d0:
r5.applyBoxAttributes()
L_0x00d3:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.textfield.TextInputLayout.updateTextInputBoxState():void");
}
private void setErrorIconVisible(boolean z) {
int i = 0;
this.errorIconView.setVisibility(z ? 0 : 8);
FrameLayout frameLayout = this.endIconFrame;
if (z) {
i = 8;
}
frameLayout.setVisibility(i);
if (!hasEndIcon()) {
updateIconDummyDrawables();
}
}
private void expandHint(boolean z) {
ValueAnimator valueAnimator = this.animator;
if (valueAnimator != null && valueAnimator.isRunning()) {
this.animator.cancel();
}
if (!z || !this.hintAnimationEnabled) {
this.collapsingTextHelper.setExpansionFraction(0.0f);
} else {
animateToExpansionFraction(0.0f);
}
if (cutoutEnabled() && ((CutoutDrawable) this.boxBackground).hasCutout()) {
closeCutout();
}
this.hintExpanded = true;
}
/* access modifiers changed from: package-private */
public void animateToExpansionFraction(float f) {
if (this.collapsingTextHelper.getExpansionFraction() != f) {
if (this.animator == null) {
ValueAnimator valueAnimator = new ValueAnimator();
this.animator = valueAnimator;
valueAnimator.setInterpolator(AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR);
this.animator.setDuration(167);
this.animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator valueAnimator) {
TextInputLayout.this.collapsingTextHelper.setExpansionFraction(((Float) valueAnimator.getAnimatedValue()).floatValue());
}
});
}
this.animator.setFloatValues(new float[]{this.collapsingTextHelper.getExpansionFraction(), f});
this.animator.start();
}
}
/* access modifiers changed from: package-private */
public final boolean isHintExpanded() {
return this.hintExpanded;
}
/* access modifiers changed from: package-private */
public final boolean isHelperTextDisplayed() {
return this.indicatorViewController.helperTextIsDisplayed();
}
/* access modifiers changed from: package-private */
public final int getHintCurrentCollapsedTextColor() {
return this.collapsingTextHelper.getCurrentCollapsedTextColor();
}
/* access modifiers changed from: package-private */
public final float getHintCollapsedTextHeight() {
return this.collapsingTextHelper.getCollapsedTextHeight();
}
/* access modifiers changed from: package-private */
public final int getErrorTextCurrentColor() {
return this.indicatorViewController.getErrorViewCurrentTextColor();
}
public static class AccessibilityDelegate extends AccessibilityDelegateCompat {
private final TextInputLayout layout;
public AccessibilityDelegate(TextInputLayout textInputLayout) {
this.layout = textInputLayout;
}
public void onInitializeAccessibilityNodeInfo(View view, AccessibilityNodeInfoCompat accessibilityNodeInfoCompat) {
super.onInitializeAccessibilityNodeInfo(view, accessibilityNodeInfoCompat);
EditText editText = this.layout.getEditText();
Editable text = editText != null ? editText.getText() : null;
CharSequence hint = this.layout.getHint();
CharSequence error = this.layout.getError();
CharSequence counterOverflowDescription = this.layout.getCounterOverflowDescription();
boolean z = !TextUtils.isEmpty(text);
boolean z2 = !TextUtils.isEmpty(hint);
boolean z3 = !TextUtils.isEmpty(error);
boolean z4 = false;
boolean z5 = z3 || !TextUtils.isEmpty(counterOverflowDescription);
if (z) {
accessibilityNodeInfoCompat.setText(text);
} else if (z2) {
accessibilityNodeInfoCompat.setText(hint);
}
if (z2) {
accessibilityNodeInfoCompat.setHintText(hint);
if (!z && z2) {
z4 = true;
}
accessibilityNodeInfoCompat.setShowingHintText(z4);
}
if (z5) {
if (!z3) {
error = counterOverflowDescription;
}
accessibilityNodeInfoCompat.setError(error);
accessibilityNodeInfoCompat.setContentInvalid(true);
}
}
}
}
Download file