package com.google.android.material.floatingactionbutton;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Matrix;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.ImageView;
import androidx.annotation.AnimatorRes;
import androidx.annotation.ColorInt;
import androidx.annotation.DimenRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.view.s1;
import androidx.core.view.x0;
import com.google.android.gms.internal.atv_ads_framework.d1;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.internal.VisibilityAwareImageButton;
import com.google.android.material.internal.q0;
import com.google.android.material.internal.w0;
import com.google.android.material.shape.g0;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.WeakHashMap;
import l.c0;
import xyz.stream.utils.j0;

/* JADX INFO: loaded from: classes2.dex */
public class FloatingActionButton extends VisibilityAwareImageButton implements x0, u0.u, l9.a, g0, d0.a {

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public static final int f22548l = x8.l.Widget_Design_FloatingActionButton;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f22549b;

    @Nullable
    private ColorStateList backgroundTint;

    @Nullable
    private PorterDuff.Mode backgroundTintMode;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f22550c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f22551d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f22552e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f22553f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final Rect f22554g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final Rect f22555h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final l.g0 f22556i;

    @Nullable
    private PorterDuff.Mode imageMode;

    @Nullable
    private ColorStateList imageTint;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final l.a f22557j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public t f22558k;

    @Nullable
    private ColorStateList rippleColor;

    public static class BaseBehavior<T extends FloatingActionButton> extends d0.b {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public Rect f22559a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final boolean f22560b;

        public BaseBehavior() {
            this.f22560b = true;
        }

        @Override // d0.b
        public final boolean e(View view, Rect rect) {
            FloatingActionButton floatingActionButton = (FloatingActionButton) view;
            int left = floatingActionButton.getLeft();
            Rect rect2 = floatingActionButton.f22554g;
            rect.set(left + rect2.left, floatingActionButton.getTop() + rect2.top, floatingActionButton.getRight() - rect2.right, floatingActionButton.getBottom() - rect2.bottom);
            return true;
        }

        @Override // d0.b
        public final void g(d0.d dVar) {
            if (dVar.f24891h == 0) {
                dVar.f24891h = 80;
            }
        }

        @Override // d0.b
        public final boolean h(CoordinatorLayout coordinatorLayout, View view, View view2) {
            FloatingActionButton floatingActionButton = (FloatingActionButton) view;
            if (view2 instanceof AppBarLayout) {
                w(coordinatorLayout, (AppBarLayout) view2, floatingActionButton);
                return false;
            }
            ViewGroup.LayoutParams layoutParams = view2.getLayoutParams();
            if (!(layoutParams instanceof d0.d) || !(((d0.d) layoutParams).f24884a instanceof BottomSheetBehavior)) {
                return false;
            }
            x(view2, floatingActionButton);
            return false;
        }

        @Override // d0.b
        public final boolean l(CoordinatorLayout coordinatorLayout, View view, int i10) {
            FloatingActionButton floatingActionButton = (FloatingActionButton) view;
            List listI = coordinatorLayout.i(floatingActionButton);
            int size = listI.size();
            int i11 = 0;
            for (int i12 = 0; i12 < size; i12++) {
                View view2 = (View) listI.get(i12);
                if (!(view2 instanceof AppBarLayout)) {
                    ViewGroup.LayoutParams layoutParams = view2.getLayoutParams();
                    if ((layoutParams instanceof d0.d) && (((d0.d) layoutParams).f24884a instanceof BottomSheetBehavior) && x(view2, floatingActionButton)) {
                        break;
                    }
                } else {
                    if (w(coordinatorLayout, (AppBarLayout) view2, floatingActionButton)) {
                        break;
                    }
                }
            }
            coordinatorLayout.p(i10, floatingActionButton);
            Rect rect = floatingActionButton.f22554g;
            if (rect.centerX() <= 0 || rect.centerY() <= 0) {
                return true;
            }
            d0.d dVar = (d0.d) floatingActionButton.getLayoutParams();
            int i13 = floatingActionButton.getRight() >= coordinatorLayout.getWidth() - ((ViewGroup.MarginLayoutParams) dVar).rightMargin ? rect.right : floatingActionButton.getLeft() <= ((ViewGroup.MarginLayoutParams) dVar).leftMargin ? -rect.left : 0;
            if (floatingActionButton.getBottom() >= coordinatorLayout.getHeight() - ((ViewGroup.MarginLayoutParams) dVar).bottomMargin) {
                i11 = rect.bottom;
            } else if (floatingActionButton.getTop() <= ((ViewGroup.MarginLayoutParams) dVar).topMargin) {
                i11 = -rect.top;
            }
            if (i11 != 0) {
                WeakHashMap weakHashMap = s1.f1815a;
                floatingActionButton.offsetTopAndBottom(i11);
            }
            if (i13 == 0) {
                return true;
            }
            WeakHashMap weakHashMap2 = s1.f1815a;
            floatingActionButton.offsetLeftAndRight(i13);
            return true;
        }

        public final boolean w(CoordinatorLayout coordinatorLayout, AppBarLayout appBarLayout, FloatingActionButton floatingActionButton) {
            if ((this.f22560b && ((d0.d) floatingActionButton.getLayoutParams()).f24889f == appBarLayout.getId() && floatingActionButton.getUserSetVisibility() == 0) ? false : true) {
                return false;
            }
            if (this.f22559a == null) {
                this.f22559a = new Rect();
            }
            Rect rect = this.f22559a;
            com.google.android.material.internal.g.a(coordinatorLayout, appBarLayout, rect);
            if (rect.bottom <= appBarLayout.getMinimumHeightForVisibleOverlappingContent()) {
                floatingActionButton.hide(null, false);
            } else {
                floatingActionButton.show(null, false);
            }
            return true;
        }

        public final boolean x(View view, FloatingActionButton floatingActionButton) {
            if ((this.f22560b && ((d0.d) floatingActionButton.getLayoutParams()).f24889f == view.getId() && floatingActionButton.getUserSetVisibility() == 0) ? false : true) {
                return false;
            }
            if (view.getTop() < (floatingActionButton.getHeight() / 2) + ((ViewGroup.MarginLayoutParams) ((d0.d) floatingActionButton.getLayoutParams())).topMargin) {
                floatingActionButton.hide(null, false);
            } else {
                floatingActionButton.show(null, false);
            }
            return true;
        }

        public BaseBehavior(Context context, AttributeSet attributeSet) {
            TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, x8.m.FloatingActionButton_Behavior_Layout);
            this.f22560b = typedArrayObtainStyledAttributes.getBoolean(x8.m.FloatingActionButton_Behavior_Layout_behavior_autoHide, true);
            typedArrayObtainStyledAttributes.recycle();
        }
    }

    public static class Behavior extends BaseBehavior<FloatingActionButton> {
        public Behavior() {
        }

        public Behavior(Context context, AttributeSet attributeSet) {
            super(context, attributeSet);
        }
    }

    @Retention(RetentionPolicy.SOURCE)
    @RestrictTo({RestrictTo.Scope.f556b})
    public @interface Size {
    }

    public FloatingActionButton(@NonNull Context context) {
        this(context, null);
    }

    private t getImpl() {
        if (this.f22558k == null) {
            this.f22558k = new t(this, new k(this));
        }
        return this.f22558k;
    }

    @Nullable
    private s wrapOnVisibilityChangedListener(@Nullable j jVar) {
        if (jVar == null) {
            return null;
        }
        return new d1(this, jVar, 13, 0);
    }

    public final void c(b9.a aVar) {
        t impl = getImpl();
        if (impl.f22633k == null) {
            impl.f22633k = new ArrayList();
        }
        impl.f22633k.add(aVar);
    }

    public final void d(b9.a aVar) {
        t impl = getImpl();
        if (impl.f22632j == null) {
            impl.f22632j = new ArrayList();
        }
        impl.f22632j.add(aVar);
    }

    @Override // android.widget.ImageView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
    }

    public final void e(j0 j0Var) {
        t impl = getImpl();
        l lVar = new l(this, j0Var);
        if (impl.f22634l == null) {
            impl.f22634l = new ArrayList();
        }
        impl.f22634l.add(lVar);
    }

    public final void f(Rect rect) {
        rect.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
        int i10 = rect.left;
        Rect rect2 = this.f22554g;
        rect.left = i10 + rect2.left;
        rect.top += rect2.top;
        rect.right -= rect2.right;
        rect.bottom -= rect2.bottom;
    }

    public final int g(int i10) {
        int i11 = this.f22550c;
        if (i11 != 0) {
            return i11;
        }
        Resources resources = getResources();
        return i10 != -1 ? i10 != 1 ? resources.getDimensionPixelSize(x8.e.design_fab_size_normal) : resources.getDimensionPixelSize(x8.e.design_fab_size_mini) : Math.max(resources.getConfiguration().screenWidthDp, resources.getConfiguration().screenHeightDp) < 470 ? g(1) : g(0);
    }

    @Override // android.widget.ImageButton, android.widget.ImageView, android.view.View
    public CharSequence getAccessibilityClassName() {
        return "com.google.android.material.floatingactionbutton.FloatingActionButton";
    }

    @Override // android.view.View
    @Nullable
    public ColorStateList getBackgroundTintList() {
        return this.backgroundTint;
    }

    @Override // android.view.View
    @Nullable
    public PorterDuff.Mode getBackgroundTintMode() {
        return this.backgroundTintMode;
    }

    @Override // d0.a
    @NonNull
    public d0.b getBehavior() {
        return new Behavior();
    }

    public float getCompatElevation() {
        return getImpl().f22635m.getElevation();
    }

    public float getCompatHoveredFocusedTranslationZ() {
        return getImpl().f22626d;
    }

    public float getCompatPressedTranslationZ() {
        return getImpl().f22627e;
    }

    @Nullable
    public Drawable getContentBackground() {
        return getImpl().getContentBackground();
    }

    @Px
    public int getCustomSize() {
        return this.f22550c;
    }

    public int getExpandedComponentIdHint() {
        return this.f22557j.f29596b;
    }

    @Nullable
    public y8.g getHideMotionSpec() {
        return getImpl().getHideMotionSpec();
    }

    @ColorInt
    @Deprecated
    public int getRippleColor() {
        ColorStateList colorStateList = this.rippleColor;
        if (colorStateList != null) {
            return colorStateList.getDefaultColor();
        }
        return 0;
    }

    @Nullable
    public ColorStateList getRippleColorStateList() {
        return this.rippleColor;
    }

    @NonNull
    public com.google.android.material.shape.s getShapeAppearanceModel() {
        return (com.google.android.material.shape.s) p0.g.checkNotNull(getImpl().getShapeAppearance());
    }

    @Nullable
    public y8.g getShowMotionSpec() {
        return getImpl().getShowMotionSpec();
    }

    public int getSize() {
        return this.f22549b;
    }

    public int getSizeDimension() {
        return g(this.f22549b);
    }

    @Override // androidx.core.view.x0
    @Nullable
    public ColorStateList getSupportBackgroundTintList() {
        return getBackgroundTintList();
    }

    @Override // androidx.core.view.x0
    @Nullable
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        return getBackgroundTintMode();
    }

    @Override // u0.u
    @Nullable
    public ColorStateList getSupportImageTintList() {
        return this.imageTint;
    }

    @Override // u0.u
    @Nullable
    public PorterDuff.Mode getSupportImageTintMode() {
        return this.imageMode;
    }

    public boolean getUseCompatPadding() {
        return this.f22553f;
    }

    public final boolean h() {
        t impl = getImpl();
        if (impl.f22635m.getVisibility() == 0) {
            if (impl.f22631i != 1) {
                return false;
            }
        } else if (impl.f22631i == 2) {
            return false;
        }
        return true;
    }

    public void hide(@Nullable j jVar) {
        hide(jVar, true);
    }

    public final boolean i() {
        t impl = getImpl();
        if (impl.f22635m.getVisibility() != 0) {
            if (impl.f22631i != 2) {
                return false;
            }
        } else if (impl.f22631i == 1) {
            return false;
        }
        return true;
    }

    public final void j() {
        Drawable drawable = getDrawable();
        if (drawable == null) {
            return;
        }
        ColorStateList colorStateList = this.imageTint;
        if (colorStateList == null) {
            drawable.clearColorFilter();
            return;
        }
        int colorForState = colorStateList.getColorForState(getDrawableState(), 0);
        PorterDuff.Mode mode = this.imageMode;
        if (mode == null) {
            mode = PorterDuff.Mode.SRC_IN;
        }
        drawable.mutate().setColorFilter(c0.c(colorForState, mode));
    }

    @Override // android.widget.ImageView, android.view.View
    public final void jumpDrawablesToCurrentState() {
        super.jumpDrawablesToCurrentState();
    }

    @Override // android.widget.ImageView, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        t impl = getImpl();
        com.google.android.material.shape.k kVar = impl.shapeDrawable;
        if (kVar != null) {
            com.bumptech.glide.f.v(impl.f22635m, kVar);
        }
    }

    @Override // android.widget.ImageView, android.view.View
    public final void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        getImpl().f();
    }

    @Override // android.widget.ImageView, android.view.View
    public final void onMeasure(int i10, int i11) {
        int sizeDimension = getSizeDimension();
        this.f22551d = (sizeDimension - this.f22552e) / 2;
        getImpl().k();
        int iMin = Math.min(View.resolveSize(sizeDimension, i10), View.resolveSize(sizeDimension, i11));
        Rect rect = this.f22554g;
        setMeasuredDimension(rect.left + iMin + rect.right, iMin + rect.top + rect.bottom);
    }

    @Override // android.view.View
    public final void onRestoreInstanceState(Parcelable parcelable) {
        if (!(parcelable instanceof w9.b)) {
            super.onRestoreInstanceState(parcelable);
            return;
        }
        w9.b bVar = (w9.b) parcelable;
        super.onRestoreInstanceState(bVar.getSuperState());
        Bundle bundle = (Bundle) p0.g.checkNotNull((Bundle) bVar.f34255c.get("expandableWidgetHelper"));
        l.a aVar = this.f22557j;
        aVar.getClass();
        aVar.f29595a = bundle.getBoolean("expanded", false);
        aVar.f29596b = bundle.getInt("expandedComponentIdHint", 0);
        if (aVar.f29595a) {
            ViewParent parent = ((View) aVar.f29597c).getParent();
            if (parent instanceof CoordinatorLayout) {
                ((CoordinatorLayout) parent).g((View) aVar.f29597c);
            }
        }
    }

    @Override // android.view.View
    public final Parcelable onSaveInstanceState() {
        Parcelable parcelableOnSaveInstanceState = super.onSaveInstanceState();
        if (parcelableOnSaveInstanceState == null) {
            parcelableOnSaveInstanceState = new Bundle();
        }
        w9.b bVar = new w9.b(parcelableOnSaveInstanceState);
        androidx.collection.s sVar = bVar.f34255c;
        l.a aVar = this.f22557j;
        aVar.getClass();
        Bundle bundle = new Bundle();
        bundle.putBoolean("expanded", aVar.f29595a);
        bundle.putInt("expandedComponentIdHint", aVar.f29596b);
        sVar.put("expandableWidgetHelper", bundle);
        return bVar;
    }

    @Override // android.view.View
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        if (motionEvent.getAction() == 0) {
            Rect rect = this.f22555h;
            f(rect);
            t tVar = this.f22558k;
            int i10 = -(tVar.f22623a ? Math.max((tVar.f22628f - tVar.f22635m.getSizeDimension()) / 2, 0) : 0);
            rect.inset(i10, i10);
            if (!rect.contains((int) motionEvent.getX(), (int) motionEvent.getY())) {
                return false;
            }
        }
        return super.onTouchEvent(motionEvent);
    }

    @Override // android.view.View
    public void setBackgroundColor(int i10) {
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
    }

    @Override // android.view.View
    public void setBackgroundResource(int i10) {
    }

    @Override // android.view.View
    public void setBackgroundTintList(@Nullable ColorStateList colorStateList) {
        if (this.backgroundTint != colorStateList) {
            this.backgroundTint = colorStateList;
            getImpl().setBackgroundTintList(colorStateList);
        }
    }

    @Override // android.view.View
    public void setBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
        if (this.backgroundTintMode != mode) {
            this.backgroundTintMode = mode;
            getImpl().setBackgroundTintMode(mode);
        }
    }

    public void setCompatElevation(float f10) {
        t impl = getImpl();
        if (impl.f22625c != f10) {
            impl.f22625c = f10;
            impl.g(f10, impl.f22626d, impl.f22627e);
        }
    }

    public void setCompatElevationResource(@DimenRes int i10) {
        setCompatElevation(getResources().getDimension(i10));
    }

    public void setCompatHoveredFocusedTranslationZ(float f10) {
        t impl = getImpl();
        if (impl.f22626d != f10) {
            impl.f22626d = f10;
            impl.g(impl.f22625c, f10, impl.f22627e);
        }
    }

    public void setCompatHoveredFocusedTranslationZResource(@DimenRes int i10) {
        setCompatHoveredFocusedTranslationZ(getResources().getDimension(i10));
    }

    public void setCompatPressedTranslationZ(float f10) {
        t impl = getImpl();
        if (impl.f22627e != f10) {
            impl.f22627e = f10;
            impl.g(impl.f22625c, impl.f22626d, f10);
        }
    }

    public void setCompatPressedTranslationZResource(@DimenRes int i10) {
        setCompatPressedTranslationZ(getResources().getDimension(i10));
    }

    public void setCustomSize(@Px int i10) {
        if (i10 < 0) {
            throw new IllegalArgumentException("Custom size must be non-negative");
        }
        if (i10 != this.f22550c) {
            this.f22550c = i10;
            requestLayout();
        }
    }

    @Override // android.view.View
    public void setElevation(float f10) {
        super.setElevation(f10);
        com.google.android.material.shape.k kVar = getImpl().shapeDrawable;
        if (kVar != null) {
            kVar.w(f10);
        }
    }

    public void setEnsureMinTouchTargetSize(boolean z10) {
        if (z10 != getImpl().f22623a) {
            getImpl().f22623a = z10;
            requestLayout();
        }
    }

    public void setExpandedComponentIdHint(@IdRes int i10) {
        this.f22557j.f29596b = i10;
    }

    public void setHideMotionSpec(@Nullable y8.g gVar) {
        getImpl().setHideMotionSpec(gVar);
    }

    public void setHideMotionSpecResource(@AnimatorRes int i10) {
        setHideMotionSpec(y8.g.createFromResource(getContext(), i10));
    }

    @Override // android.widget.ImageView
    public void setImageDrawable(@Nullable Drawable drawable) {
        if (getDrawable() != drawable) {
            super.setImageDrawable(drawable);
            t impl = getImpl();
            float f10 = impl.f22629g;
            impl.f22629g = f10;
            Matrix matrix = impl.f22640r;
            impl.b(f10, matrix);
            impl.f22635m.setImageMatrix(matrix);
            if (this.imageTint != null) {
                j();
            }
        }
    }

    @Override // android.widget.ImageView
    public void setImageResource(@DrawableRes int i10) {
        this.f22556i.c(i10);
        j();
    }

    public void setMaxImageSize(int i10) {
        this.f22552e = i10;
        t impl = getImpl();
        if (impl.f22630h != i10) {
            impl.f22630h = i10;
            float f10 = impl.f22629g;
            impl.f22629g = f10;
            Matrix matrix = impl.f22640r;
            impl.b(f10, matrix);
            impl.f22635m.setImageMatrix(matrix);
        }
    }

    public void setRippleColor(@ColorInt int i10) {
        setRippleColor(ColorStateList.valueOf(i10));
    }

    @Override // android.view.View
    public void setScaleX(float f10) {
        super.setScaleX(f10);
        getImpl().h();
    }

    @Override // android.view.View
    public void setScaleY(float f10) {
        super.setScaleY(f10);
        getImpl().h();
    }

    @RestrictTo({RestrictTo.Scope.f556b})
    @VisibleForTesting
    public void setShadowPaddingEnabled(boolean z10) {
        t impl = getImpl();
        impl.f22624b = z10;
        impl.k();
    }

    @Override // com.google.android.material.shape.g0
    public void setShapeAppearanceModel(@NonNull com.google.android.material.shape.s sVar) {
        getImpl().j(sVar);
    }

    public void setShowMotionSpec(@Nullable y8.g gVar) {
        getImpl().setShowMotionSpec(gVar);
    }

    public void setShowMotionSpecResource(@AnimatorRes int i10) {
        setShowMotionSpec(y8.g.createFromResource(getContext(), i10));
    }

    public void setSize(int i10) {
        this.f22550c = 0;
        if (i10 != this.f22549b) {
            this.f22549b = i10;
            requestLayout();
        }
    }

    @Override // androidx.core.view.x0
    public void setSupportBackgroundTintList(@Nullable ColorStateList colorStateList) {
        setBackgroundTintList(colorStateList);
    }

    @Override // androidx.core.view.x0
    public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
        setBackgroundTintMode(mode);
    }

    @Override // u0.u
    public void setSupportImageTintList(@Nullable ColorStateList colorStateList) {
        if (this.imageTint != colorStateList) {
            this.imageTint = colorStateList;
            j();
        }
    }

    @Override // u0.u
    public void setSupportImageTintMode(@Nullable PorterDuff.Mode mode) {
        if (this.imageMode != mode) {
            this.imageMode = mode;
            j();
        }
    }

    @Override // android.view.View
    public void setTranslationX(float f10) {
        super.setTranslationX(f10);
        getImpl().i();
    }

    @Override // android.view.View
    public void setTranslationY(float f10) {
        super.setTranslationY(f10);
        getImpl().i();
    }

    @Override // android.view.View
    public void setTranslationZ(float f10) {
        super.setTranslationZ(f10);
        getImpl().i();
    }

    public void setUseCompatPadding(boolean z10) {
        if (this.f22553f != z10) {
            this.f22553f = z10;
            getImpl().k();
        }
    }

    @Override // com.google.android.material.internal.VisibilityAwareImageButton, android.widget.ImageView, android.view.View
    public void setVisibility(int i10) {
        super.setVisibility(i10);
    }

    public void show(@Nullable j jVar) {
        show(jVar, true);
    }

    public FloatingActionButton(@NonNull Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, x8.c.floatingActionButtonStyle);
    }

    public void hide(@Nullable j jVar, boolean z10) {
        getImpl().hide(wrapOnVisibilityChangedListener(jVar), z10);
    }

    public void setRippleColor(@Nullable ColorStateList colorStateList) {
        if (this.rippleColor != colorStateList) {
            this.rippleColor = colorStateList;
            getImpl().setRippleColor(this.rippleColor);
        }
    }

    public void show(@Nullable j jVar, boolean z10) {
        getImpl().show(wrapOnVisibilityChangedListener(jVar), z10);
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public FloatingActionButton(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        int i11 = f22548l;
        super(x9.a.wrap(context, attributeSet, i10, i11), attributeSet, i10);
        this.f22554g = new Rect();
        this.f22555h = new Rect();
        Context context2 = getContext();
        TypedArray typedArrayC = q0.c(context2, attributeSet, x8.m.FloatingActionButton, i10, i11, new int[0]);
        this.backgroundTint = q9.d.getColorStateList(context2, typedArrayC, x8.m.FloatingActionButton_backgroundTint);
        this.backgroundTintMode = w0.f(typedArrayC.getInt(x8.m.FloatingActionButton_backgroundTintMode, -1), null);
        this.rippleColor = q9.d.getColorStateList(context2, typedArrayC, x8.m.FloatingActionButton_rippleColor);
        this.f22549b = typedArrayC.getInt(x8.m.FloatingActionButton_fabSize, -1);
        this.f22550c = typedArrayC.getDimensionPixelSize(x8.m.FloatingActionButton_fabCustomSize, 0);
        int dimensionPixelSize = typedArrayC.getDimensionPixelSize(x8.m.FloatingActionButton_borderWidth, 0);
        float dimension = typedArrayC.getDimension(x8.m.FloatingActionButton_elevation, 0.0f);
        float dimension2 = typedArrayC.getDimension(x8.m.FloatingActionButton_hoveredFocusedTranslationZ, 0.0f);
        float dimension3 = typedArrayC.getDimension(x8.m.FloatingActionButton_pressedTranslationZ, 0.0f);
        this.f22553f = typedArrayC.getBoolean(x8.m.FloatingActionButton_useCompatPadding, false);
        int dimensionPixelSize2 = getResources().getDimensionPixelSize(x8.e.mtrl_fab_min_touch_target);
        setMaxImageSize(typedArrayC.getDimensionPixelSize(x8.m.FloatingActionButton_maxImageSize, 0));
        y8.g gVarCreateFromAttribute = y8.g.createFromAttribute(context2, typedArrayC, x8.m.FloatingActionButton_showMotionSpec);
        y8.g gVarCreateFromAttribute2 = y8.g.createFromAttribute(context2, typedArrayC, x8.m.FloatingActionButton_hideMotionSpec);
        com.google.android.material.shape.s sVarA = com.google.android.material.shape.s.d(context2, attributeSet, i10, i11, com.google.android.material.shape.s.f23150m).a();
        boolean z10 = typedArrayC.getBoolean(x8.m.FloatingActionButton_ensureMinTouchTargetSize, false);
        setEnabled(typedArrayC.getBoolean(x8.m.FloatingActionButton_android_enabled, true));
        typedArrayC.recycle();
        l.g0 g0Var = new l.g0(this);
        this.f22556i = g0Var;
        g0Var.b(attributeSet, i10);
        l.a aVar = new l.a();
        aVar.f29595a = false;
        aVar.f29596b = 0;
        aVar.f29597c = this;
        this.f22557j = aVar;
        getImpl().j(sVarA);
        getImpl().initializeBackgroundDrawable(this.backgroundTint, this.backgroundTintMode, this.rippleColor, dimensionPixelSize);
        getImpl().f22628f = dimensionPixelSize2;
        t impl = getImpl();
        if (impl.f22625c != dimension) {
            impl.f22625c = dimension;
            impl.g(dimension, impl.f22626d, impl.f22627e);
        }
        t impl2 = getImpl();
        if (impl2.f22626d != dimension2) {
            impl2.f22626d = dimension2;
            impl2.g(impl2.f22625c, dimension2, impl2.f22627e);
        }
        t impl3 = getImpl();
        if (impl3.f22627e != dimension3) {
            impl3.f22627e = dimension3;
            impl3.g(impl3.f22625c, impl3.f22626d, dimension3);
        }
        getImpl().setShowMotionSpec(gVarCreateFromAttribute);
        getImpl().setHideMotionSpec(gVarCreateFromAttribute2);
        getImpl().f22623a = z10;
        setScaleType(ImageView.ScaleType.MATRIX);
    }
}
