package com.google.android.material.floatingactionbutton; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.PropertyValuesHolder; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.Rect; import android.text.TextUtils; import android.util.AttributeSet; import android.util.Property; import android.view.View; import android.view.ViewGroup; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.view.ViewCompat; import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.bottomsheet.BottomSheetBehavior; import com.google.android.material.button.MaterialButton; import com.kofax.mobile.sdk._internal.impl.extraction.rtti.RttiJsonExactionHelper; import java.util.Iterator; import java.util.List; import o.C17052tZT; import o.C2327acX; import o.CEQ; import o.Ctt; import o.qXa; import o.rip; /* loaded from: classes2.dex */ public class ExtendedFloatingActionButton extends MaterialButton implements CoordinatorLayout.IeS { private final rip B; private final rip D; int j; boolean k; boolean l; int m; final int n; /* renamed from: o, reason: collision with root package name */ int f6475o; int p; private boolean q; int r; public ColorStateList s; private final CoordinatorLayout.Sts u; private final rip v; private final int w; private final C2327acX x; private final rip y; private static final int t = C17052tZT.NHB.Widget_MaterialComponents_ExtendedFloatingActionButton_Icon; public static final Property h = new Property(Float.class, RttiJsonExactionHelper.WIDTH) { // from class: com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.9 @Override // android.util.Property public final /* synthetic */ Float get(View view) { return Float.valueOf(view.getLayoutParams().width); } @Override // android.util.Property public final /* synthetic */ void set(View view, Float f2) { View view2 = view; view2.getLayoutParams().width = f2.intValue(); view2.requestLayout(); } }; public static final Property f = new Property(Float.class, RttiJsonExactionHelper.HEIGHT) { // from class: com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.10 @Override // android.util.Property public final /* synthetic */ Float get(View view) { return Float.valueOf(view.getLayoutParams().height); } @Override // android.util.Property public final /* synthetic */ void set(View view, Float f2) { View view2 = view; view2.getLayoutParams().height = f2.intValue(); view2.requestLayout(); } }; public static final Property i = new Property(Float.class, "paddingStart") { // from class: com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.8 @Override // android.util.Property public final /* synthetic */ Float get(View view) { return Float.valueOf(ViewCompat.q(view)); } @Override // android.util.Property public final /* synthetic */ void set(View view, Float f2) { View view2 = view; ViewCompat.a(view2, f2.intValue(), view2.getPaddingTop(), ViewCompat.r(view2), view2.getPaddingBottom()); } }; public static final Property g = new Property(Float.class, "paddingEnd") { // from class: com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.6 @Override // android.util.Property public final /* synthetic */ Float get(View view) { return Float.valueOf(ViewCompat.r(view)); } @Override // android.util.Property public final /* synthetic */ void set(View view, Float f2) { View view2 = view; ViewCompat.a(view2, ViewCompat.q(view2), view2.getPaddingTop(), f2.intValue(), view2.getPaddingBottom()); } }; /* loaded from: classes2.dex */ interface IeS { ViewGroup.LayoutParams Jm_(); int a(); int b(); int d(); int e(); } /* loaded from: classes2.dex */ public static abstract class Sts { } static /* synthetic */ void b(ExtendedFloatingActionButton extendedFloatingActionButton, int i2) { rip ripVar; if (i2 == 0) { ripVar = extendedFloatingActionButton.B; } else if (i2 == 1) { ripVar = extendedFloatingActionButton.y; } else if (i2 == 2) { ripVar = extendedFloatingActionButton.D; } else if (i2 == 3) { ripVar = extendedFloatingActionButton.v; } else { throw new IllegalStateException("Unknown strategy type: ".concat(String.valueOf(i2))); } if (ripVar.i()) { return; } if ((!ViewCompat.G(extendedFloatingActionButton) && (extendedFloatingActionButton.b() || !extendedFloatingActionButton.q)) || extendedFloatingActionButton.isInEditMode()) { ripVar.f(); return; } if (i2 == 2) { ViewGroup.LayoutParams layoutParams = extendedFloatingActionButton.getLayoutParams(); if (layoutParams != null) { extendedFloatingActionButton.r = layoutParams.width; extendedFloatingActionButton.p = layoutParams.height; } else { extendedFloatingActionButton.r = extendedFloatingActionButton.getWidth(); extendedFloatingActionButton.p = extendedFloatingActionButton.getHeight(); } } extendedFloatingActionButton.measure(0, 0); AnimatorSet JG_ = ripVar.JG_(); JG_.addListener(new AnimatorListenerAdapter(extendedFloatingActionButton, ripVar, null) { // from class: com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.3 private rip a; private boolean b; private Sts c = null; private ExtendedFloatingActionButton e; { this.e = extendedFloatingActionButton; this.a = ripVar; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public final void onAnimationStart(Animator animator) { this.a.JH_(animator); this.b = false; } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public final void onAnimationCancel(Animator animator) { this.b = true; this.a.c(); } @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener public final void onAnimationEnd(Animator animator) { this.a.a(); } }); Iterator it = ripVar.d().iterator(); while (it.hasNext()) { JG_.addListener(it.next()); } JG_.start(); } public ExtendedFloatingActionButton(Context context) { this(context, null); } public ExtendedFloatingActionButton(Context context, AttributeSet attributeSet) { this(context, attributeSet, C17052tZT.IeS.extendedFloatingActionButtonStyle); } /* JADX WARN: Illegal instructions before constructor call */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public ExtendedFloatingActionButton(android.content.Context r18, android.util.AttributeSet r19, int r20) { /* Method dump skipped, instructions count: 280 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.(android.content.Context, android.util.AttributeSet, int):void"); } @Override // android.widget.TextView public void setTextColor(int i2) { super.setTextColor(i2); this.s = getTextColors(); } @Override // android.widget.TextView public void setTextColor(ColorStateList colorStateList) { super.setTextColor(colorStateList); this.s = getTextColors(); } public final void Jc_(ColorStateList colorStateList) { super.setTextColor(colorStateList); } @Override // com.google.android.material.button.MaterialButton, android.widget.TextView, android.view.View public void onAttachedToWindow() { super.onAttachedToWindow(); if (this.l && TextUtils.isEmpty(getText()) && this.e != null) { this.l = false; this.D.f(); } } public void setExtended(boolean z) { if (this.l == z) { return; } rip ripVar = z ? this.v : this.D; if (ripVar.i()) { return; } ripVar.f(); } @Override // android.widget.TextView, android.view.View public void setPaddingRelative(int i2, int i3, int i4, int i5) { super.setPaddingRelative(i2, i3, i4, i5); if (!this.l || this.k) { return; } this.m = i2; this.f6475o = i4; } @Override // android.widget.TextView, android.view.View public void setPadding(int i2, int i3, int i4, int i5) { super.setPadding(i2, i3, i4, i5); if (!this.l || this.k) { return; } this.m = ViewCompat.q(this); this.f6475o = ViewCompat.r(this); } public void setShowMotionSpec(qXa qxa) { this.B.b(qxa); } public void setShowMotionSpecResource(int i2) { setShowMotionSpec(qXa.b(getContext(), i2)); } public void setHideMotionSpec(qXa qxa) { this.y.b(qxa); } public void setHideMotionSpecResource(int i2) { setHideMotionSpec(qXa.b(getContext(), i2)); } public void setExtendMotionSpec(qXa qxa) { this.v.b(qxa); } public void setExtendMotionSpecResource(int i2) { setExtendMotionSpec(qXa.b(getContext(), i2)); } public void setShrinkMotionSpec(qXa qxa) { this.D.b(qxa); } public void setShrinkMotionSpecResource(int i2) { setShrinkMotionSpec(qXa.b(getContext(), i2)); } final boolean b() { return getVisibility() != 0 ? this.j == 2 : this.j != 1; } final int d() { int i2 = this.n; if (i2 < 0) { i2 = (Math.min(ViewCompat.q(this), ViewCompat.r(this)) << 1) + this.c; } return (i2 - this.c) / 2; } /* loaded from: classes2.dex */ protected static class ExtendedFloatingActionButtonBehavior extends CoordinatorLayout.Sts { private Sts a; private Sts b; private Rect c; private boolean d; private boolean e; @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final /* bridge */ /* synthetic */ boolean Jp_(CoordinatorLayout coordinatorLayout, View view, Rect rect) { return super.Jp_(coordinatorLayout, (ExtendedFloatingActionButton) view, rect); } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final /* synthetic */ boolean c(CoordinatorLayout coordinatorLayout, View view, int i) { ExtendedFloatingActionButton extendedFloatingActionButton = (ExtendedFloatingActionButton) view; List c = coordinatorLayout.c(extendedFloatingActionButton); int size = c.size(); for (int i2 = 0; i2 < size; i2++) { View view2 = c.get(i2); if (view2 instanceof AppBarLayout) { if (d(coordinatorLayout, (AppBarLayout) view2, extendedFloatingActionButton)) { break; } } else { ViewGroup.LayoutParams layoutParams = view2.getLayoutParams(); if ((layoutParams instanceof CoordinatorLayout.RVV) && (((CoordinatorLayout.RVV) layoutParams).h instanceof BottomSheetBehavior) && b(view2, extendedFloatingActionButton)) { break; } } } coordinatorLayout.c(extendedFloatingActionButton, i); return true; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final /* synthetic */ boolean e(CoordinatorLayout coordinatorLayout, View view, View view2) { ExtendedFloatingActionButton extendedFloatingActionButton = (ExtendedFloatingActionButton) view; if (view2 instanceof AppBarLayout) { d(coordinatorLayout, (AppBarLayout) view2, extendedFloatingActionButton); return false; } ViewGroup.LayoutParams layoutParams = view2.getLayoutParams(); if (!(layoutParams instanceof CoordinatorLayout.RVV) || !(((CoordinatorLayout.RVV) layoutParams).h instanceof BottomSheetBehavior)) { return false; } b(view2, extendedFloatingActionButton); return false; } public ExtendedFloatingActionButtonBehavior() { this.d = false; this.e = true; } public ExtendedFloatingActionButtonBehavior(Context context, AttributeSet attributeSet) { super(context, attributeSet); TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, C17052tZT.jNh.ExtendedFloatingActionButton_Behavior_Layout); this.d = obtainStyledAttributes.getBoolean(C17052tZT.jNh.ExtendedFloatingActionButton_Behavior_Layout_behavior_autoHide, false); this.e = obtainStyledAttributes.getBoolean(C17052tZT.jNh.ExtendedFloatingActionButton_Behavior_Layout_behavior_autoShrink, true); obtainStyledAttributes.recycle(); } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Sts public final void a(CoordinatorLayout.RVV rvv) { if (rvv.b == 0) { rvv.b = 80; } } private boolean d(View view, ExtendedFloatingActionButton extendedFloatingActionButton) { return (this.d || this.e) && ((CoordinatorLayout.RVV) extendedFloatingActionButton.getLayoutParams()).j == view.getId(); } private boolean d(CoordinatorLayout coordinatorLayout, AppBarLayout appBarLayout, ExtendedFloatingActionButton extendedFloatingActionButton) { if (!d(appBarLayout, extendedFloatingActionButton)) { return false; } if (this.c == null) { this.c = new Rect(); } Rect rect = this.c; rect.set(0, 0, appBarLayout.getWidth(), appBarLayout.getHeight()); CEQ.JT_(coordinatorLayout, appBarLayout, rect); if (rect.bottom <= appBarLayout.d()) { b(extendedFloatingActionButton); return true; } c(extendedFloatingActionButton); return true; } private boolean b(View view, ExtendedFloatingActionButton extendedFloatingActionButton) { if (!d(view, extendedFloatingActionButton)) { return false; } if (view.getTop() < (extendedFloatingActionButton.getHeight() / 2) + ((ViewGroup.MarginLayoutParams) ((CoordinatorLayout.RVV) extendedFloatingActionButton.getLayoutParams())).topMargin) { b(extendedFloatingActionButton); return true; } c(extendedFloatingActionButton); return true; } private void b(ExtendedFloatingActionButton extendedFloatingActionButton) { ExtendedFloatingActionButton.b(extendedFloatingActionButton, this.e ? 2 : 1); } private void c(ExtendedFloatingActionButton extendedFloatingActionButton) { ExtendedFloatingActionButton.b(extendedFloatingActionButton, this.e ? 3 : 0); } } /* loaded from: classes2.dex */ class HBt extends Ctt { private final boolean a; private final IeS d; private ExtendedFloatingActionButton e; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ HBt(ExtendedFloatingActionButton extendedFloatingActionButton, C2327acX c2327acX, IeS ieS, boolean z) { super(extendedFloatingActionButton, c2327acX); this.e = extendedFloatingActionButton; this.d = ieS; this.a = z; } @Override // o.rip public final int h() { if (this.a) { return C17052tZT.RVV.mtrl_extended_fab_change_size_expand_motion_spec; } return C17052tZT.RVV.mtrl_extended_fab_change_size_collapse_motion_spec; } @Override // o.Ctt, o.rip public final AnimatorSet JG_() { qXa b = b(); if (b.e.get(RttiJsonExactionHelper.WIDTH) != null) { PropertyValuesHolder[] HG_ = b.HG_(RttiJsonExactionHelper.WIDTH); HG_[0].setFloatValues(this.e.getWidth(), this.d.b()); b.e.put(RttiJsonExactionHelper.WIDTH, HG_); } if (b.e.get(RttiJsonExactionHelper.HEIGHT) != null) { PropertyValuesHolder[] HG_2 = b.HG_(RttiJsonExactionHelper.HEIGHT); HG_2[0].setFloatValues(this.e.getHeight(), this.d.e()); b.e.put(RttiJsonExactionHelper.HEIGHT, HG_2); } if (b.e.get("paddingStart") != null) { PropertyValuesHolder[] HG_3 = b.HG_("paddingStart"); HG_3[0].setFloatValues(ViewCompat.q(this.e), this.d.a()); b.e.put("paddingStart", HG_3); } if (b.e.get("paddingEnd") != null) { PropertyValuesHolder[] HG_4 = b.HG_("paddingEnd"); HG_4[0].setFloatValues(ViewCompat.r(this.e), this.d.d()); b.e.put("paddingEnd", HG_4); } if (b.e.get("labelOpacity") != null) { PropertyValuesHolder[] HG_5 = b.HG_("labelOpacity"); boolean z = this.a; HG_5[0].setFloatValues(z ? 0.0f : 1.0f, z ? 1.0f : 0.0f); b.e.put("labelOpacity", HG_5); } return super.IZ_(b); } @Override // o.Ctt, o.rip public final void JH_(Animator animator) { super.JH_(animator); this.e.l = this.a; this.e.k = true; this.e.setHorizontallyScrolling(true); } @Override // o.Ctt, o.rip public final void a() { super.a(); this.e.k = false; this.e.setHorizontallyScrolling(false); ViewGroup.LayoutParams layoutParams = this.e.getLayoutParams(); if (layoutParams == null) { return; } layoutParams.width = this.d.Jm_().width; layoutParams.height = this.d.Jm_().height; } @Override // o.rip public final void f() { this.e.l = this.a; ViewGroup.LayoutParams layoutParams = this.e.getLayoutParams(); if (layoutParams == null) { return; } if (!this.a) { this.e.r = layoutParams.width; this.e.p = layoutParams.height; } layoutParams.width = this.d.Jm_().width; layoutParams.height = this.d.Jm_().height; ViewCompat.a(this.e, this.d.a(), this.e.getPaddingTop(), this.d.d(), this.e.getPaddingBottom()); this.e.requestLayout(); } @Override // o.rip public final boolean i() { return this.a == this.e.l || this.e.e == null || TextUtils.isEmpty(this.e.getText()); } } /* loaded from: classes2.dex */ class RVV extends Ctt { private ExtendedFloatingActionButton d; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public RVV(ExtendedFloatingActionButton extendedFloatingActionButton, C2327acX c2327acX) { super(extendedFloatingActionButton, c2327acX); this.d = extendedFloatingActionButton; } @Override // o.rip public final void f() { this.d.setVisibility(0); this.d.setAlpha(1.0f); this.d.setScaleY(1.0f); this.d.setScaleX(1.0f); } @Override // o.rip public final int h() { return C17052tZT.RVV.mtrl_extended_fab_show_motion_spec; } @Override // o.Ctt, o.rip public final void JH_(Animator animator) { super.JH_(animator); this.d.setVisibility(0); this.d.j = 2; } @Override // o.Ctt, o.rip public final void a() { super.a(); this.d.j = 0; } @Override // o.rip public final boolean i() { return this.d.b(); } } /* loaded from: classes2.dex */ class LWm extends Ctt { private boolean a; private ExtendedFloatingActionButton d; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public LWm(ExtendedFloatingActionButton extendedFloatingActionButton, C2327acX c2327acX) { super(extendedFloatingActionButton, c2327acX); this.d = extendedFloatingActionButton; } @Override // o.rip public final void f() { this.d.setVisibility(8); } @Override // o.rip public final int h() { return C17052tZT.RVV.mtrl_extended_fab_hide_motion_spec; } @Override // o.Ctt, o.rip public final void JH_(Animator animator) { super.JH_(animator); this.a = false; this.d.setVisibility(0); this.d.j = 1; } @Override // o.Ctt, o.rip public final void c() { super.c(); this.a = true; } @Override // o.Ctt, o.rip public final void a() { super.a(); this.d.j = 0; if (this.a) { return; } this.d.setVisibility(8); } @Override // o.rip public final boolean i() { ExtendedFloatingActionButton extendedFloatingActionButton = this.d; int visibility = extendedFloatingActionButton.getVisibility(); int i = extendedFloatingActionButton.j; return visibility == 0 ? i == 1 : i != 2; } } public void setAnimateShowBeforeLayout(boolean z) { this.q = z; } @Override // androidx.coordinatorlayout.widget.CoordinatorLayout.IeS public final CoordinatorLayout.Sts a() { return this.u; } }