package com.google.android.material.appbar;

import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.animation.AnimationUtils;
import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout;
import androidx.annotation.ColorInt;
import androidx.annotation.DrawableRes;
import androidx.annotation.FloatRange;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.annotation.StyleRes;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.f3;
import androidx.core.view.s1;
import com.google.android.material.internal.q0;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.WeakHashMap;

/* JADX INFO: loaded from: classes2.dex */
public class CollapsingToolbarLayout extends FrameLayout {

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    public static final int f22156m0 = x8.l.Widget_Design_CollapsingToolbar;
    public boolean Q;
    public final int R;
    public int S;
    public boolean T;
    public ValueAnimator U;
    public long V;
    public final TimeInterpolator W;

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

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public final TimeInterpolator f22158a0;

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

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

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

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public n f22162c0;

    @Nullable
    private Drawable contentScrim;

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

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

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

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

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

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

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

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

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

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

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

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final com.google.android.material.internal.e f22175j;

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

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final com.google.android.material.internal.e f22177k;

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

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

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

    @Nullable
    f3 lastInsets;

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

    @Nullable
    Drawable statusBarScrim;

    @Nullable
    private ViewGroup toolbar;

    @Nullable
    private View toolbarDirectChild;

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

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

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

    public static s b(View view) {
        int i10 = x8.g.view_offset_helper;
        s sVar = (s) view.getTag(i10);
        if (sVar != null) {
            return sVar;
        }
        s sVar2 = new s(view);
        view.setTag(i10, sVar2);
        return sVar2;
    }

    @ColorInt
    private int getDefaultContentScrimColorForTitleCollapseFadeMode() {
        ColorStateList colorStateListOrNull = h9.a.getColorStateListOrNull(getContext(), x8.c.colorSurfaceContainer);
        if (colorStateListOrNull != null) {
            return colorStateListOrNull.getDefaultColor();
        }
        float dimension = getResources().getDimension(x8.e.design_appbar_elevation);
        k9.a aVar = this.f22179l;
        return aVar.a(dimension, aVar.f29085d);
    }

    @Nullable
    private static CharSequence getToolbarSubtitle(View view) {
        if (view instanceof Toolbar) {
            return ((Toolbar) view).getSubtitle();
        }
        if (view instanceof android.widget.Toolbar) {
            return ((android.widget.Toolbar) view).getSubtitle();
        }
        return null;
    }

    @Nullable
    private static CharSequence getToolbarTitle(View view) {
        if (view instanceof Toolbar) {
            return ((Toolbar) view).getTitle();
        }
        if (view instanceof android.widget.Toolbar) {
            return ((android.widget.Toolbar) view).getTitle();
        }
        return null;
    }

    private void updateContentScrimBounds(@NonNull Drawable drawable, @Nullable View view, int i10, int i11) {
        if (this.f22168f0 == 1 && view != null && this.f22181m) {
            i11 = view.getBottom();
        }
        drawable.setBounds(0, 0, i10, i11);
    }

    public final void a() {
        if (this.f22157a) {
            ViewGroup viewGroup = null;
            this.toolbar = null;
            this.toolbarDirectChild = null;
            int i10 = this.f22159b;
            if (i10 != -1) {
                ViewGroup viewGroup2 = (ViewGroup) findViewById(i10);
                this.toolbar = viewGroup2;
                if (viewGroup2 != null) {
                    ViewParent parent = viewGroup2.getParent();
                    View view = viewGroup2;
                    while (parent != this && parent != null) {
                        if (parent instanceof View) {
                            view = (View) parent;
                        }
                        parent = parent.getParent();
                        view = view;
                    }
                    this.toolbarDirectChild = view;
                }
            }
            if (this.toolbar == null) {
                int childCount = getChildCount();
                for (int i11 = 0; i11 < childCount; i11++) {
                    View childAt = getChildAt(i11);
                    if ((childAt instanceof Toolbar) || (childAt instanceof android.widget.Toolbar)) {
                        viewGroup = (ViewGroup) childAt;
                        break;
                    }
                }
                this.toolbar = viewGroup;
            }
            c();
            this.f22157a = false;
        }
    }

    public final void c() {
        View view;
        if (!this.f22181m && (view = this.f22161c) != null) {
            ViewParent parent = view.getParent();
            if (parent instanceof ViewGroup) {
                ((ViewGroup) parent).removeView(this.f22161c);
            }
        }
        if (!this.f22181m || this.toolbar == null) {
            return;
        }
        if (this.f22161c == null) {
            this.f22161c = new View(getContext());
        }
        if (this.f22161c.getParent() == null) {
            this.toolbar.addView(this.f22161c, -1, -1);
        }
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup
    public final boolean checkLayoutParams(ViewGroup.LayoutParams layoutParams) {
        return layoutParams instanceof m;
    }

    public final void d() {
        if (this.contentScrim == null && this.statusBarScrim == null) {
            return;
        }
        setScrimsShown(getHeight() + this.f22164d0 < getScrimVisibleHeightTrigger());
    }

    @Override // android.view.View
    public final void draw(Canvas canvas) {
        Drawable drawable;
        super.draw(canvas);
        a();
        if (this.toolbar == null && (drawable = this.contentScrim) != null && this.S > 0) {
            drawable.mutate().setAlpha(this.S);
            this.contentScrim.draw(canvas);
        }
        if (this.f22181m && this.Q) {
            ViewGroup viewGroup = this.toolbar;
            com.google.android.material.internal.e eVar = this.f22177k;
            com.google.android.material.internal.e eVar2 = this.f22175j;
            if (viewGroup == null || this.contentScrim == null || this.S <= 0 || this.f22168f0 != 1 || eVar2.f22720b >= eVar2.f22726e) {
                eVar2.f(canvas);
                eVar.f(canvas);
            } else {
                int iSave = canvas.save();
                canvas.clipRect(this.contentScrim.getBounds(), Region.Op.DIFFERENCE);
                eVar2.f(canvas);
                eVar.f(canvas);
                canvas.restoreToCount(iSave);
            }
        }
        if (this.statusBarScrim == null || this.S <= 0) {
            return;
        }
        f3 f3Var = this.lastInsets;
        int iD = f3Var != null ? f3Var.d() : 0;
        if (iD > 0) {
            this.statusBarScrim.setBounds(0, -this.f22164d0, getWidth(), iD - this.f22164d0);
            this.statusBarScrim.mutate().setAlpha(this.S);
            this.statusBarScrim.draw(canvas);
        }
    }

    @Override // android.view.ViewGroup
    public final boolean drawChild(Canvas canvas, View view, long j10) {
        boolean z10;
        View view2;
        Drawable drawable = this.contentScrim;
        if (drawable == null || this.S <= 0 || ((view2 = this.toolbarDirectChild) == null || view2 == this ? view != this.toolbar : view != view2)) {
            z10 = false;
        } else {
            updateContentScrimBounds(drawable, view, getWidth(), getHeight());
            this.contentScrim.mutate().setAlpha(this.S);
            this.contentScrim.draw(canvas);
            z10 = true;
        }
        return super.drawChild(canvas, view, j10) || z10;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void drawableStateChanged() {
        ColorStateList colorStateList;
        super.drawableStateChanged();
        int[] drawableState = getDrawableState();
        Drawable drawable = this.statusBarScrim;
        boolean z10 = false;
        boolean state = (drawable == null || !drawable.isStateful()) ? false : drawable.setState(drawableState);
        Drawable drawable2 = this.contentScrim;
        if (drawable2 != null && drawable2.isStateful()) {
            state |= drawable2.setState(drawableState);
        }
        com.google.android.material.internal.e eVar = this.f22175j;
        if (eVar != null) {
            eVar.P = drawableState;
            ColorStateList colorStateList2 = eVar.f22746o;
            if ((colorStateList2 != null && colorStateList2.isStateful()) || ((colorStateList = eVar.f22744n) != null && colorStateList.isStateful())) {
                eVar.l(false);
                z10 = true;
            }
            state |= z10;
        }
        if (state) {
            invalidate();
        }
    }

    public final void e(int i10, int i11, int i12, int i13, boolean z10) {
        View view;
        int titleMarginBottom;
        int titleMarginEnd;
        int titleMarginTop;
        if (!this.f22181m || (view = this.f22161c) == null) {
            return;
        }
        int titleMarginStart = 0;
        boolean z11 = view.isAttachedToWindow() && this.f22161c.getVisibility() == 0;
        this.Q = z11;
        if (z11 || z10) {
            boolean z12 = getLayoutDirection() == 1;
            View view2 = this.toolbarDirectChild;
            if (view2 == null) {
                view2 = this.toolbar;
            }
            int height = ((getHeight() - b(view2).f22220b) - view2.getHeight()) - ((FrameLayout.LayoutParams) ((m) view2.getLayoutParams())).bottomMargin;
            View view3 = this.f22161c;
            Rect rect = this.f22173i;
            com.google.android.material.internal.g.a(this, view3, rect);
            ViewGroup viewGroup = this.toolbar;
            if (viewGroup instanceof Toolbar) {
                Toolbar toolbar = (Toolbar) viewGroup;
                titleMarginStart = toolbar.getTitleMarginStart();
                titleMarginEnd = toolbar.getTitleMarginEnd();
                titleMarginTop = toolbar.getTitleMarginTop();
                titleMarginBottom = toolbar.getTitleMarginBottom();
            } else if (viewGroup instanceof android.widget.Toolbar) {
                android.widget.Toolbar toolbar2 = (android.widget.Toolbar) viewGroup;
                titleMarginStart = toolbar2.getTitleMarginStart();
                titleMarginEnd = toolbar2.getTitleMarginEnd();
                titleMarginTop = toolbar2.getTitleMarginTop();
                titleMarginBottom = toolbar2.getTitleMarginBottom();
            } else {
                titleMarginBottom = 0;
                titleMarginEnd = 0;
                titleMarginTop = 0;
            }
            int i14 = rect.left + (z12 ? titleMarginEnd : titleMarginStart);
            int i15 = rect.right - (z12 ? titleMarginStart : titleMarginEnd);
            int i16 = rect.top + height + titleMarginTop;
            int i17 = (rect.bottom + height) - titleMarginBottom;
            com.google.android.material.internal.e eVar = this.f22177k;
            TextPaint textPaint = eVar.S;
            textPaint.setTextSize(eVar.f22742m);
            textPaint.setTypeface(eVar.f22759w);
            textPaint.setLetterSpacing(eVar.f22725d0);
            int iDescent = (int) (i17 - (textPaint.descent() + (-textPaint.ascent())));
            com.google.android.material.internal.e eVar2 = this.f22175j;
            TextPaint textPaint2 = eVar2.S;
            textPaint2.setTextSize(eVar2.f22742m);
            textPaint2.setTypeface(eVar2.f22759w);
            textPaint2.setLetterSpacing(eVar2.f22725d0);
            int iDescent2 = (int) (textPaint2.descent() + (-textPaint2.ascent()) + i16);
            if (TextUtils.isEmpty(eVar.getText())) {
                eVar2.n(i14, i16, i15, i17);
            } else {
                eVar2.n(i14, i16, i15, iDescent);
                eVar.n(i14, iDescent2, i15, i17);
            }
            if (this.R == 0) {
                com.google.android.material.internal.g.a(this, this, rect);
                int i18 = rect.left + (z12 ? titleMarginEnd : titleMarginStart);
                int i19 = rect.right;
                if (!z12) {
                    titleMarginStart = titleMarginEnd;
                }
                int i20 = i19 - titleMarginStart;
                if (TextUtils.isEmpty(eVar.getText())) {
                    eVar2.o(i18, i16, i20, i17);
                } else {
                    eVar2.o(i18, i16, i20, iDescent);
                    eVar.o(i18, iDescent2, i20, i17);
                }
            }
            int i21 = z12 ? this.f22167f : this.f22163d;
            int i22 = rect.top + this.f22165e;
            int i23 = (i12 - i10) - (z12 ? this.f22163d : this.f22167f);
            int i24 = (i13 - i11) - this.f22169g;
            if (TextUtils.isEmpty(eVar.getText())) {
                this.f22175j.t(i21, i22, i23, i24, true);
                eVar2.l(z10);
                return;
            }
            int i25 = i21;
            this.f22175j.t(i25, i22, i23, (int) ((i24 - (eVar.j() + this.f22176j0)) - this.f22171h), false);
            this.f22177k.t(i25, (int) (eVar2.j() + this.f22174i0 + i22 + this.f22171h), i23, i24, false);
            eVar2.l(z10);
            eVar.l(z10);
        }
    }

    public final void f() {
        ViewGroup viewGroup = this.toolbar;
        if (viewGroup == null || !this.f22181m) {
            return;
        }
        CharSequence toolbarTitle = getToolbarTitle(viewGroup);
        if (TextUtils.isEmpty(this.f22175j.getText()) && !TextUtils.isEmpty(toolbarTitle)) {
            setTitle(toolbarTitle);
        }
        CharSequence toolbarSubtitle = getToolbarSubtitle(this.toolbar);
        if (!TextUtils.isEmpty(this.f22177k.getText()) || TextUtils.isEmpty(toolbarSubtitle)) {
            return;
        }
        setSubtitle(toolbarSubtitle);
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup
    public final ViewGroup.LayoutParams generateDefaultLayoutParams() {
        m mVar = new m(-1, -1);
        mVar.f22205a = 0;
        mVar.f22206b = 0.5f;
        return mVar;
    }

    public float getCollapsedSubtitleTextSize() {
        return this.f22177k.f22742m;
    }

    @NonNull
    public Typeface getCollapsedSubtitleTypeface() {
        Typeface typeface = this.f22177k.f22759w;
        return typeface != null ? typeface : Typeface.DEFAULT;
    }

    public int getCollapsedTitleGravity() {
        return this.f22175j.f22738k;
    }

    public float getCollapsedTitleTextSize() {
        return this.f22175j.f22742m;
    }

    @NonNull
    public Typeface getCollapsedTitleTypeface() {
        Typeface typeface = this.f22175j.f22759w;
        return typeface != null ? typeface : Typeface.DEFAULT;
    }

    @Nullable
    public Drawable getContentScrim() {
        return this.contentScrim;
    }

    public float getExpandedSubtitleTextSize() {
        return this.f22177k.f22740l;
    }

    @NonNull
    public Typeface getExpandedSubtitleTypeface() {
        Typeface typeface = this.f22177k.f22762z;
        return typeface != null ? typeface : Typeface.DEFAULT;
    }

    public int getExpandedTitleGravity() {
        return this.f22175j.f22736j;
    }

    public int getExpandedTitleMarginBottom() {
        return this.f22169g;
    }

    public int getExpandedTitleMarginEnd() {
        return this.f22167f;
    }

    public int getExpandedTitleMarginStart() {
        return this.f22163d;
    }

    public int getExpandedTitleMarginTop() {
        return this.f22165e;
    }

    public int getExpandedTitleSpacing() {
        return this.f22171h;
    }

    public float getExpandedTitleTextSize() {
        return this.f22175j.f22740l;
    }

    @NonNull
    public Typeface getExpandedTitleTypeface() {
        Typeface typeface = this.f22175j.f22762z;
        return typeface != null ? typeface : Typeface.DEFAULT;
    }

    @RequiresApi(23)
    @RestrictTo({RestrictTo.Scope.f556b})
    public int getHyphenationFrequency() {
        return this.f22175j.f22749p0;
    }

    @RestrictTo({RestrictTo.Scope.f556b})
    public int getLineCount() {
        StaticLayout staticLayout = this.f22175j.f22731g0;
        if (staticLayout != null) {
            return staticLayout.getLineCount();
        }
        return 0;
    }

    @RequiresApi(23)
    @RestrictTo({RestrictTo.Scope.f556b})
    public float getLineSpacingAdd() {
        return this.f22175j.f22731g0.getSpacingAdd();
    }

    @RequiresApi(23)
    @RestrictTo({RestrictTo.Scope.f556b})
    public float getLineSpacingMultiplier() {
        return this.f22175j.f22731g0.getSpacingMultiplier();
    }

    @RestrictTo({RestrictTo.Scope.f556b})
    public int getMaxLines() {
        return this.f22175j.f22741l0;
    }

    public int getScrimAlpha() {
        return this.S;
    }

    public long getScrimAnimationDuration() {
        return this.V;
    }

    public int getScrimVisibleHeightTrigger() {
        int i10 = this.f22160b0;
        if (i10 >= 0) {
            return i10 + this.f22170g0 + this.f22174i0 + this.f22176j0 + this.f22180l0;
        }
        f3 f3Var = this.lastInsets;
        int iD = f3Var != null ? f3Var.d() : 0;
        int minimumHeight = getMinimumHeight();
        return minimumHeight > 0 ? Math.min((minimumHeight * 2) + iD, getHeight()) : getHeight() / 3;
    }

    @Nullable
    public Drawable getStatusBarScrim() {
        return this.statusBarScrim;
    }

    @Nullable
    public CharSequence getSubtitle() {
        if (this.f22181m) {
            return this.f22177k.getText();
        }
        return null;
    }

    @Nullable
    public CharSequence getTitle() {
        if (this.f22181m) {
            return this.f22175j.getText();
        }
        return null;
    }

    public int getTitleCollapseMode() {
        return this.f22168f0;
    }

    @Nullable
    public TimeInterpolator getTitlePositionInterpolator() {
        return this.f22175j.getPositionInterpolator();
    }

    @NonNull
    public TextUtils.TruncateAt getTitleTextEllipsize() {
        return this.f22175j.F;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        ViewParent parent = getParent();
        if (parent instanceof AppBarLayout) {
            AppBarLayout appBarLayout = (AppBarLayout) parent;
            if (this.f22168f0 == 1) {
                appBarLayout.setLiftOnScroll(false);
            }
            setFitsSystemWindows(appBarLayout.getFitsSystemWindows());
            if (this.f22162c0 == null) {
                this.f22162c0 = new n(this);
            }
            appBarLayout.addOnOffsetChangedListener(this.f22162c0);
            requestApplyInsets();
        }
    }

    @Override // android.view.View
    public final void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        com.google.android.material.internal.e eVar = this.f22175j;
        eVar.k(configuration);
        if (this.f22166e0 != configuration.orientation && this.f22178k0 && eVar.f22720b == 1.0f) {
            ViewParent parent = getParent();
            if (parent instanceof AppBarLayout) {
                AppBarLayout appBarLayout = (AppBarLayout) parent;
                if (appBarLayout.getPendingAction() == 0) {
                    appBarLayout.setPendingAction(2);
                }
            }
        }
        this.f22166e0 = configuration.orientation;
    }

    @Override // android.view.ViewGroup, android.view.View
    public final void onDetachedFromWindow() {
        ViewParent parent = getParent();
        n nVar = this.f22162c0;
        if (nVar != null && (parent instanceof AppBarLayout)) {
            ((AppBarLayout) parent).removeOnOffsetChangedListener(nVar);
        }
        super.onDetachedFromWindow();
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup, android.view.View
    public final void onLayout(boolean z10, int i10, int i11, int i12, int i13) {
        super.onLayout(z10, i10, i11, i12, i13);
        f3 f3Var = this.lastInsets;
        if (f3Var != null) {
            int iD = f3Var.d();
            int childCount = getChildCount();
            for (int i14 = 0; i14 < childCount; i14++) {
                View childAt = getChildAt(i14);
                if (!childAt.getFitsSystemWindows() && childAt.getTop() < iD) {
                    WeakHashMap weakHashMap = s1.f1815a;
                    childAt.offsetTopAndBottom(iD);
                }
            }
        }
        int childCount2 = getChildCount();
        for (int i15 = 0; i15 < childCount2; i15++) {
            s sVarB = b(getChildAt(i15));
            View view = sVarB.f22219a;
            sVarB.f22220b = view.getTop();
            sVarB.f22221c = view.getLeft();
        }
        e(i10, i11, i12, i13, false);
        f();
        d();
        int childCount3 = getChildCount();
        for (int i16 = 0; i16 < childCount3; i16++) {
            b(getChildAt(i16)).a();
        }
    }

    @Override // android.widget.FrameLayout, android.view.View
    public final void onMeasure(int i10, int i11) {
        int measuredHeight;
        int measuredHeight2;
        a();
        super.onMeasure(i10, i11);
        int mode = View.MeasureSpec.getMode(i11);
        f3 f3Var = this.lastInsets;
        int iD = f3Var != null ? f3Var.d() : 0;
        if ((mode == 0 || this.f22172h0) && iD > 0) {
            this.f22170g0 = iD;
            super.onMeasure(i10, View.MeasureSpec.makeMeasureSpec(getMeasuredHeight() + iD, 1073741824));
        }
        f();
        if (this.f22181m) {
            com.google.android.material.internal.e eVar = this.f22175j;
            if (!TextUtils.isEmpty(eVar.getText())) {
                int measuredHeight3 = getMeasuredHeight();
                e(0, 0, getMeasuredWidth(), measuredHeight3, true);
                float fJ = eVar.j() + this.f22170g0 + this.f22165e;
                com.google.android.material.internal.e eVar2 = this.f22177k;
                int iJ = (int) (fJ + (TextUtils.isEmpty(eVar2.getText()) ? 0.0f : this.f22171h + eVar2.j()) + this.f22169g);
                if (iJ > measuredHeight3) {
                    this.f22180l0 = iJ - measuredHeight3;
                } else {
                    this.f22180l0 = 0;
                }
                if (this.f22178k0) {
                    if (eVar.f22741l0 > 1) {
                        int i12 = eVar.f22748p;
                        if (i12 > 1) {
                            this.f22174i0 = (i12 - 1) * Math.round(eVar.j());
                        } else {
                            this.f22174i0 = 0;
                        }
                    }
                    if (eVar2.f22741l0 > 1) {
                        int i13 = eVar2.f22748p;
                        if (i13 > 1) {
                            this.f22176j0 = (i13 - 1) * Math.round(eVar2.j());
                        } else {
                            this.f22176j0 = 0;
                        }
                    }
                }
                int i14 = this.f22180l0;
                int i15 = this.f22174i0;
                int i16 = this.f22176j0;
                if (i14 + i15 + i16 > 0) {
                    super.onMeasure(i10, View.MeasureSpec.makeMeasureSpec(measuredHeight3 + i14 + i15 + i16, 1073741824));
                }
            }
        }
        ViewGroup viewGroup = this.toolbar;
        if (viewGroup != null) {
            View view = this.toolbarDirectChild;
            if (view == null || view == this) {
                ViewGroup.LayoutParams layoutParams = viewGroup.getLayoutParams();
                if (layoutParams instanceof ViewGroup.MarginLayoutParams) {
                    ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) layoutParams;
                    measuredHeight = viewGroup.getMeasuredHeight() + marginLayoutParams.topMargin + marginLayoutParams.bottomMargin;
                } else {
                    measuredHeight = viewGroup.getMeasuredHeight();
                }
                setMinimumHeight(measuredHeight);
                return;
            }
            ViewGroup.LayoutParams layoutParams2 = view.getLayoutParams();
            if (layoutParams2 instanceof ViewGroup.MarginLayoutParams) {
                ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) layoutParams2;
                measuredHeight2 = view.getMeasuredHeight() + marginLayoutParams2.topMargin + marginLayoutParams2.bottomMargin;
            } else {
                measuredHeight2 = view.getMeasuredHeight();
            }
            setMinimumHeight(measuredHeight2);
        }
    }

    @Override // android.view.View
    public final void onSizeChanged(int i10, int i11, int i12, int i13) {
        super.onSizeChanged(i10, i11, i12, i13);
        Drawable drawable = this.contentScrim;
        if (drawable != null) {
            updateContentScrimBounds(drawable, this.toolbar, i10, i11);
        }
    }

    public void setCollapsedSubtitleTextAppearance(@StyleRes int i10) {
        this.f22177k.p(i10);
    }

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

    public void setCollapsedSubtitleTextSize(float f10) {
        com.google.android.material.internal.e eVar = this.f22177k;
        if (eVar.f22742m != f10) {
            eVar.f22742m = f10;
            eVar.l(false);
        }
    }

    public void setCollapsedSubtitleTypeface(@Nullable Typeface typeface) {
        com.google.android.material.internal.e eVar = this.f22177k;
        if (eVar.s(typeface)) {
            eVar.l(false);
        }
    }

    public void setCollapsedTitleGravity(int i10) {
        this.f22175j.r(i10);
        this.f22177k.r(i10);
    }

    public void setCollapsedTitleTextAppearance(@StyleRes int i10) {
        this.f22175j.p(i10);
    }

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

    public void setCollapsedTitleTextSize(float f10) {
        com.google.android.material.internal.e eVar = this.f22175j;
        if (eVar.f22742m != f10) {
            eVar.f22742m = f10;
            eVar.l(false);
        }
    }

    public void setCollapsedTitleTypeface(@Nullable Typeface typeface) {
        com.google.android.material.internal.e eVar = this.f22175j;
        if (eVar.s(typeface)) {
            eVar.l(false);
        }
    }

    public void setContentScrim(@Nullable Drawable drawable) {
        Drawable drawable2 = this.contentScrim;
        if (drawable2 != drawable) {
            if (drawable2 != null) {
                drawable2.setCallback(null);
            }
            Drawable drawableMutate = drawable != null ? drawable.mutate() : null;
            this.contentScrim = drawableMutate;
            if (drawableMutate != null) {
                updateContentScrimBounds(drawableMutate, this.toolbar, getWidth(), getHeight());
                this.contentScrim.setCallback(this);
                this.contentScrim.setAlpha(this.S);
            }
            postInvalidateOnAnimation();
        }
    }

    public void setContentScrimColor(@ColorInt int i10) {
        setContentScrim(new ColorDrawable(i10));
    }

    public void setContentScrimResource(@DrawableRes int i10) {
        setContentScrim(getContext().getDrawable(i10));
    }

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

    public void setExpandedSubtitleTextAppearance(@StyleRes int i10) {
        this.f22177k.v(i10);
    }

    public void setExpandedSubtitleTextColor(@NonNull ColorStateList colorStateList) {
        com.google.android.material.internal.e eVar = this.f22177k;
        if (eVar.f22744n != colorStateList) {
            eVar.f22744n = colorStateList;
            eVar.l(false);
        }
    }

    public void setExpandedSubtitleTextSize(float f10) {
        this.f22177k.x(f10);
    }

    public void setExpandedSubtitleTypeface(@Nullable Typeface typeface) {
        com.google.android.material.internal.e eVar = this.f22177k;
        if (eVar.y(typeface)) {
            eVar.l(false);
        }
    }

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

    public void setExpandedTitleGravity(int i10) {
        this.f22175j.w(i10);
        this.f22177k.w(i10);
    }

    public void setExpandedTitleMargin(int i10, int i11, int i12, int i13) {
        this.f22163d = i10;
        this.f22165e = i11;
        this.f22167f = i12;
        this.f22169g = i13;
        requestLayout();
    }

    public void setExpandedTitleMarginBottom(int i10) {
        this.f22169g = i10;
        requestLayout();
    }

    public void setExpandedTitleMarginEnd(int i10) {
        this.f22167f = i10;
        requestLayout();
    }

    public void setExpandedTitleMarginStart(int i10) {
        this.f22163d = i10;
        requestLayout();
    }

    public void setExpandedTitleMarginTop(int i10) {
        this.f22165e = i10;
        requestLayout();
    }

    public void setExpandedTitleSpacing(int i10) {
        this.f22171h = i10;
        requestLayout();
    }

    public void setExpandedTitleTextAppearance(@StyleRes int i10) {
        this.f22175j.v(i10);
    }

    public void setExpandedTitleTextColor(@NonNull ColorStateList colorStateList) {
        com.google.android.material.internal.e eVar = this.f22175j;
        if (eVar.f22744n != colorStateList) {
            eVar.f22744n = colorStateList;
            eVar.l(false);
        }
    }

    public void setExpandedTitleTextSize(float f10) {
        this.f22175j.x(f10);
    }

    public void setExpandedTitleTypeface(@Nullable Typeface typeface) {
        com.google.android.material.internal.e eVar = this.f22175j;
        if (eVar.y(typeface)) {
            eVar.l(false);
        }
    }

    @RestrictTo({RestrictTo.Scope.f556b})
    public void setExtraMultilineHeightEnabled(boolean z10) {
        this.f22178k0 = z10;
    }

    @RestrictTo({RestrictTo.Scope.f556b})
    public void setForceApplySystemWindowInsetTop(boolean z10) {
        this.f22172h0 = z10;
    }

    @RequiresApi(23)
    @RestrictTo({RestrictTo.Scope.f556b})
    public void setHyphenationFrequency(int i10) {
        this.f22175j.f22749p0 = i10;
    }

    @RequiresApi(23)
    @RestrictTo({RestrictTo.Scope.f556b})
    public void setLineSpacingAdd(float f10) {
        this.f22175j.f22745n0 = f10;
    }

    @RequiresApi(23)
    @RestrictTo({RestrictTo.Scope.f556b})
    public void setLineSpacingMultiplier(@FloatRange(from = 0.0d) float f10) {
        this.f22175j.f22747o0 = f10;
    }

    @RestrictTo({RestrictTo.Scope.f556b})
    public void setMaxLines(int i10) {
        this.f22175j.u(i10);
        this.f22177k.u(i10);
    }

    @RestrictTo({RestrictTo.Scope.f556b})
    public void setRtlTextDirectionHeuristicsEnabled(boolean z10) {
        this.f22175j.H = z10;
    }

    public void setScrimAlpha(int i10) {
        ViewGroup viewGroup;
        if (i10 != this.S) {
            if (this.contentScrim != null && (viewGroup = this.toolbar) != null) {
                viewGroup.postInvalidateOnAnimation();
            }
            this.S = i10;
            postInvalidateOnAnimation();
        }
    }

    public void setScrimAnimationDuration(@IntRange(from = 0) long j10) {
        this.V = j10;
    }

    public void setScrimVisibleHeightTrigger(@IntRange(from = 0) int i10) {
        if (this.f22160b0 != i10) {
            this.f22160b0 = i10;
            d();
        }
    }

    public void setScrimsShown(boolean z10) {
        setScrimsShown(z10, isLaidOut() && !isInEditMode());
    }

    @RequiresApi(23)
    @RestrictTo({RestrictTo.Scope.f556b})
    public void setStaticLayoutBuilderConfigurer(@Nullable o oVar) {
        this.f22175j.setStaticLayoutBuilderConfigurer(oVar);
    }

    public void setStatusBarScrim(@Nullable Drawable drawable) {
        Drawable drawable2 = this.statusBarScrim;
        if (drawable2 != drawable) {
            if (drawable2 != null) {
                drawable2.setCallback(null);
            }
            Drawable drawableMutate = drawable != null ? drawable.mutate() : null;
            this.statusBarScrim = drawableMutate;
            if (drawableMutate != null) {
                if (drawableMutate.isStateful()) {
                    this.statusBarScrim.setState(getDrawableState());
                }
                this.statusBarScrim.setLayoutDirection(getLayoutDirection());
                this.statusBarScrim.setVisible(getVisibility() == 0, false);
                this.statusBarScrim.setCallback(this);
                this.statusBarScrim.setAlpha(this.S);
            }
            postInvalidateOnAnimation();
        }
    }

    public void setStatusBarScrimColor(@ColorInt int i10) {
        setStatusBarScrim(new ColorDrawable(i10));
    }

    public void setStatusBarScrimResource(@DrawableRes int i10) {
        setStatusBarScrim(getContext().getDrawable(i10));
    }

    public void setSubtitle(@Nullable CharSequence charSequence) {
        this.f22177k.setText(charSequence);
    }

    public void setTitle(@Nullable CharSequence charSequence) {
        this.f22175j.setText(charSequence);
        setContentDescription(getTitle());
    }

    public void setTitleCollapseMode(int i10) {
        this.f22168f0 = i10;
        boolean z10 = i10 == 1;
        this.f22175j.f22722c = z10;
        this.f22177k.f22722c = z10;
        ViewParent parent = getParent();
        if (parent instanceof AppBarLayout) {
            AppBarLayout appBarLayout = (AppBarLayout) parent;
            if (this.f22168f0 == 1) {
                appBarLayout.setLiftOnScroll(false);
            }
        }
        if (z10 && this.contentScrim == null) {
            setContentScrimColor(getDefaultContentScrimColorForTitleCollapseFadeMode());
        }
    }

    public void setTitleEllipsize(@NonNull TextUtils.TruncateAt truncateAt) {
        com.google.android.material.internal.e eVar = this.f22175j;
        eVar.F = truncateAt;
        eVar.l(false);
    }

    public void setTitleEnabled(boolean z10) {
        if (z10 != this.f22181m) {
            this.f22181m = z10;
            setContentDescription(getTitle());
            c();
            requestLayout();
        }
    }

    public void setTitlePositionInterpolator(@Nullable TimeInterpolator timeInterpolator) {
        com.google.android.material.internal.e eVar = this.f22175j;
        eVar.T = timeInterpolator;
        eVar.l(false);
    }

    @Override // android.view.View
    public void setVisibility(int i10) {
        super.setVisibility(i10);
        boolean z10 = i10 == 0;
        Drawable drawable = this.statusBarScrim;
        if (drawable != null && drawable.isVisible() != z10) {
            this.statusBarScrim.setVisible(z10, false);
        }
        Drawable drawable2 = this.contentScrim;
        if (drawable2 == null || drawable2.isVisible() == z10) {
            return;
        }
        this.contentScrim.setVisible(z10, false);
    }

    @Override // android.view.View
    public final boolean verifyDrawable(Drawable drawable) {
        return super.verifyDrawable(drawable) || drawable == this.contentScrim || drawable == this.statusBarScrim;
    }

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

    @Override // android.widget.FrameLayout, android.view.ViewGroup
    public final FrameLayout.LayoutParams generateLayoutParams(AttributeSet attributeSet) {
        Context context = getContext();
        m mVar = new m(context, attributeSet);
        mVar.f22205a = 0;
        mVar.f22206b = 0.5f;
        TypedArray typedArrayObtainStyledAttributes = context.obtainStyledAttributes(attributeSet, x8.m.CollapsingToolbarLayout_Layout);
        mVar.f22205a = typedArrayObtainStyledAttributes.getInt(x8.m.CollapsingToolbarLayout_Layout_layout_collapseMode, 0);
        mVar.f22206b = typedArrayObtainStyledAttributes.getFloat(x8.m.CollapsingToolbarLayout_Layout_layout_collapseParallaxMultiplier, 0.5f);
        typedArrayObtainStyledAttributes.recycle();
        return mVar;
    }

    public void setCollapsedSubtitleTextColor(@NonNull ColorStateList colorStateList) {
        this.f22177k.q(colorStateList);
    }

    public void setCollapsedTitleTextColor(@NonNull ColorStateList colorStateList) {
        this.f22175j.q(colorStateList);
    }

    public void setScrimsShown(boolean z10, boolean z11) {
        if (this.T != z10) {
            if (z11) {
                int i10 = z10 ? 255 : 0;
                a();
                ValueAnimator valueAnimator = this.U;
                if (valueAnimator == null) {
                    ValueAnimator valueAnimator2 = new ValueAnimator();
                    this.U = valueAnimator2;
                    valueAnimator2.setInterpolator(i10 > this.S ? this.W : this.f22158a0);
                    this.U.addUpdateListener(new l(this));
                } else if (valueAnimator.isRunning()) {
                    this.U.cancel();
                }
                this.U.setDuration(this.V);
                this.U.setIntValues(this.S, i10);
                this.U.start();
            } else {
                setScrimAlpha(z10 ? 255 : 0);
            }
            this.T = z10;
        }
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public CollapsingToolbarLayout(@NonNull Context context, @Nullable AttributeSet attributeSet, int i10) {
        ColorStateList colorStateList;
        ColorStateList colorStateList2;
        TextUtils.TruncateAt truncateAt;
        int i11 = f22156m0;
        super(x9.a.wrap(context, attributeSet, i10, i11), attributeSet, i10);
        this.f22157a = true;
        this.f22173i = new Rect();
        this.f22160b0 = -1;
        this.f22170g0 = 0;
        this.f22174i0 = 0;
        this.f22176j0 = 0;
        this.f22180l0 = 0;
        Context context2 = getContext();
        this.f22166e0 = getResources().getConfiguration().orientation;
        com.google.android.material.internal.e eVar = new com.google.android.material.internal.e(this);
        this.f22175j = eVar;
        DecelerateInterpolator decelerateInterpolator = y8.a.f36868e;
        eVar.U = decelerateInterpolator;
        eVar.l(false);
        eVar.H = false;
        this.f22179l = new k9.a(context2);
        TypedArray typedArrayC = q0.c(context2, attributeSet, x8.m.CollapsingToolbarLayout, i10, i11, new int[0]);
        int i12 = typedArrayC.getInt(x8.m.CollapsingToolbarLayout_expandedTitleGravity, 8388691);
        int i13 = typedArrayC.getInt(x8.m.CollapsingToolbarLayout_collapsedTitleGravity, 8388627);
        this.R = typedArrayC.getInt(x8.m.CollapsingToolbarLayout_collapsedTitleGravityMode, 1);
        eVar.w(i12);
        eVar.r(i13);
        int dimensionPixelSize = typedArrayC.getDimensionPixelSize(x8.m.CollapsingToolbarLayout_expandedTitleMargin, 0);
        this.f22169g = dimensionPixelSize;
        this.f22167f = dimensionPixelSize;
        this.f22165e = dimensionPixelSize;
        this.f22163d = dimensionPixelSize;
        int i14 = x8.m.CollapsingToolbarLayout_expandedTitleMarginStart;
        if (typedArrayC.hasValue(i14)) {
            this.f22163d = typedArrayC.getDimensionPixelSize(i14, 0);
        }
        int i15 = x8.m.CollapsingToolbarLayout_expandedTitleMarginEnd;
        if (typedArrayC.hasValue(i15)) {
            this.f22167f = typedArrayC.getDimensionPixelSize(i15, 0);
        }
        int i16 = x8.m.CollapsingToolbarLayout_expandedTitleMarginTop;
        if (typedArrayC.hasValue(i16)) {
            this.f22165e = typedArrayC.getDimensionPixelSize(i16, 0);
        }
        int i17 = x8.m.CollapsingToolbarLayout_expandedTitleMarginBottom;
        if (typedArrayC.hasValue(i17)) {
            this.f22169g = typedArrayC.getDimensionPixelSize(i17, 0);
        }
        int i18 = x8.m.CollapsingToolbarLayout_expandedTitleSpacing;
        if (typedArrayC.hasValue(i18)) {
            this.f22171h = typedArrayC.getDimensionPixelSize(i18, 0);
        }
        this.f22181m = typedArrayC.getBoolean(x8.m.CollapsingToolbarLayout_titleEnabled, true);
        setTitle(typedArrayC.getText(x8.m.CollapsingToolbarLayout_title));
        eVar.v(x8.l.TextAppearance_Design_CollapsingToolbar_Expanded);
        eVar.p(d.i.TextAppearance_AppCompat_Widget_ActionBar_Title);
        int i19 = x8.m.CollapsingToolbarLayout_expandedTitleTextAppearance;
        if (typedArrayC.hasValue(i19)) {
            eVar.v(typedArrayC.getResourceId(i19, 0));
        }
        int i20 = x8.m.CollapsingToolbarLayout_collapsedTitleTextAppearance;
        if (typedArrayC.hasValue(i20)) {
            eVar.p(typedArrayC.getResourceId(i20, 0));
        }
        int i21 = x8.m.CollapsingToolbarLayout_titleTextEllipsize;
        if (typedArrayC.hasValue(i21)) {
            int i22 = typedArrayC.getInt(i21, -1);
            if (i22 == 0) {
                truncateAt = TextUtils.TruncateAt.START;
            } else if (i22 == 1) {
                truncateAt = TextUtils.TruncateAt.MIDDLE;
            } else if (i22 != 3) {
                truncateAt = TextUtils.TruncateAt.END;
            } else {
                truncateAt = TextUtils.TruncateAt.MARQUEE;
            }
            setTitleEllipsize(truncateAt);
        }
        int i23 = x8.m.CollapsingToolbarLayout_expandedTitleTextColor;
        if (typedArrayC.hasValue(i23) && eVar.f22744n != (colorStateList2 = q9.d.getColorStateList(context2, typedArrayC, i23))) {
            eVar.f22744n = colorStateList2;
            eVar.l(false);
        }
        int i24 = x8.m.CollapsingToolbarLayout_collapsedTitleTextColor;
        if (typedArrayC.hasValue(i24)) {
            eVar.q(q9.d.getColorStateList(context2, typedArrayC, i24));
        }
        this.f22160b0 = typedArrayC.getDimensionPixelSize(x8.m.CollapsingToolbarLayout_scrimVisibleHeightTrigger, -1);
        int i25 = x8.m.CollapsingToolbarLayout_titleMaxLines;
        if (typedArrayC.hasValue(i25)) {
            eVar.u(typedArrayC.getInt(i25, 1));
        } else {
            int i26 = x8.m.CollapsingToolbarLayout_maxLines;
            if (typedArrayC.hasValue(i26)) {
                eVar.u(typedArrayC.getInt(i26, 1));
            }
        }
        int i27 = x8.m.CollapsingToolbarLayout_titlePositionInterpolator;
        if (typedArrayC.hasValue(i27)) {
            eVar.T = AnimationUtils.loadInterpolator(context2, typedArrayC.getResourceId(i27, 0));
            eVar.l(false);
        }
        com.google.android.material.internal.e eVar2 = new com.google.android.material.internal.e(this);
        this.f22177k = eVar2;
        eVar2.U = decelerateInterpolator;
        eVar2.l(false);
        eVar2.H = false;
        int i28 = x8.m.CollapsingToolbarLayout_subtitle;
        if (typedArrayC.hasValue(i28)) {
            setSubtitle(typedArrayC.getText(i28));
        }
        eVar2.w(i12);
        eVar2.r(i13);
        eVar2.v(d.i.TextAppearance_AppCompat_Headline);
        eVar2.p(d.i.TextAppearance_AppCompat_Widget_ActionBar_Subtitle);
        int i29 = x8.m.CollapsingToolbarLayout_expandedSubtitleTextAppearance;
        if (typedArrayC.hasValue(i29)) {
            eVar2.v(typedArrayC.getResourceId(i29, 0));
        }
        int i30 = x8.m.CollapsingToolbarLayout_collapsedSubtitleTextAppearance;
        if (typedArrayC.hasValue(i30)) {
            eVar2.p(typedArrayC.getResourceId(i30, 0));
        }
        int i31 = x8.m.CollapsingToolbarLayout_expandedSubtitleTextColor;
        if (typedArrayC.hasValue(i31) && eVar2.f22744n != (colorStateList = q9.d.getColorStateList(context2, typedArrayC, i31))) {
            eVar2.f22744n = colorStateList;
            eVar2.l(false);
        }
        int i32 = x8.m.CollapsingToolbarLayout_collapsedSubtitleTextColor;
        if (typedArrayC.hasValue(i32)) {
            eVar2.q(q9.d.getColorStateList(context2, typedArrayC, i32));
        }
        int i33 = x8.m.CollapsingToolbarLayout_subtitleMaxLines;
        if (typedArrayC.hasValue(i33)) {
            eVar2.u(typedArrayC.getInt(i33, 1));
        }
        if (typedArrayC.hasValue(i27)) {
            eVar2.T = AnimationUtils.loadInterpolator(context2, typedArrayC.getResourceId(i27, 0));
            eVar2.l(false);
        }
        this.V = typedArrayC.getInt(x8.m.CollapsingToolbarLayout_scrimAnimationDuration, 600);
        int i34 = x8.c.motionEasingStandardInterpolator;
        this.W = com.bumptech.glide.f.p(context2, i34, y8.a.f36866c);
        this.f22158a0 = com.bumptech.glide.f.p(context2, i34, y8.a.f36867d);
        setContentScrim(typedArrayC.getDrawable(x8.m.CollapsingToolbarLayout_contentScrim));
        setStatusBarScrim(typedArrayC.getDrawable(x8.m.CollapsingToolbarLayout_statusBarScrim));
        setTitleCollapseMode(typedArrayC.getInt(x8.m.CollapsingToolbarLayout_titleCollapseMode, 0));
        this.f22159b = typedArrayC.getResourceId(x8.m.CollapsingToolbarLayout_toolbarId, -1);
        this.f22172h0 = typedArrayC.getBoolean(x8.m.CollapsingToolbarLayout_forceApplySystemWindowInsetTop, false);
        this.f22178k0 = typedArrayC.getBoolean(x8.m.CollapsingToolbarLayout_extraMultilineHeightEnabled, false);
        typedArrayC.recycle();
        setWillNotDraw(false);
        s1.setOnApplyWindowInsetsListener(this, new b(this, 1));
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup
    public final FrameLayout.LayoutParams generateDefaultLayoutParams() {
        m mVar = new m(-1, -1);
        mVar.f22205a = 0;
        mVar.f22206b = 0.5f;
        return mVar;
    }

    @Override // android.widget.FrameLayout, android.view.ViewGroup
    public final ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams layoutParams) {
        m mVar = new m(layoutParams);
        mVar.f22205a = 0;
        mVar.f22206b = 0.5f;
        return mVar;
    }
}
