package com.google.android.material.snackbar;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.view.y;
import l0.f;

/* JADX INFO: loaded from: classes.dex */
public class SnackbarContentLayout extends LinearLayout implements a {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private TextView f4175e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private Button f4176f;

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

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

    private static void c(View view, int i3, int i4) {
        if (y.X(view)) {
            y.E0(view, y.J(view), i3, y.I(view), i4);
        } else {
            view.setPadding(view.getPaddingLeft(), i3, view.getPaddingRight(), i4);
        }
    }

    private boolean d(int i3, int i4, int i5) {
        boolean z2;
        if (i3 != getOrientation()) {
            setOrientation(i3);
            z2 = true;
        } else {
            z2 = false;
        }
        if (this.f4175e.getPaddingTop() == i4 && this.f4175e.getPaddingBottom() == i5) {
            return z2;
        }
        c(this.f4175e, i4, i5);
        return true;
    }

    @Override // com.google.android.material.snackbar.a
    public void a(int i3, int i4) {
        this.f4175e.setAlpha(1.0f);
        long j3 = i4;
        long j4 = i3;
        this.f4175e.animate().alpha(0.0f).setDuration(j3).setStartDelay(j4).start();
        if (this.f4176f.getVisibility() == 0) {
            this.f4176f.setAlpha(1.0f);
            this.f4176f.animate().alpha(0.0f).setDuration(j3).setStartDelay(j4).start();
        }
    }

    @Override // com.google.android.material.snackbar.a
    public void b(int i3, int i4) {
        this.f4175e.setAlpha(0.0f);
        long j3 = i4;
        long j4 = i3;
        this.f4175e.animate().alpha(1.0f).setDuration(j3).setStartDelay(j4).start();
        if (this.f4176f.getVisibility() == 0) {
            this.f4176f.setAlpha(0.0f);
            this.f4176f.animate().alpha(1.0f).setDuration(j3).setStartDelay(j4).start();
        }
    }

    public Button getActionView() {
        return this.f4176f;
    }

    public TextView getMessageView() {
        return this.f4175e;
    }

    @Override // android.view.View
    protected void onFinishInflate() {
        super.onFinishInflate();
        this.f4175e = (TextView) findViewById(f.I);
        this.f4176f = (Button) findViewById(f.H);
    }

    /* JADX WARN: Removed duplicated region for block: B:23:0x0053  */
    @Override // android.widget.LinearLayout, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    protected void onMeasure(int r8, int r9) {
        /*
            r7 = this;
            super.onMeasure(r8, r9)
            int r0 = r7.getOrientation()
            r1 = 1
            if (r0 != r1) goto Lb
            return
        Lb:
            android.content.res.Resources r0 = r7.getResources()
            int r2 = l0.d.f5356g
            int r0 = r0.getDimensionPixelSize(r2)
            android.content.res.Resources r2 = r7.getResources()
            int r3 = l0.d.f5355f
            int r2 = r2.getDimensionPixelSize(r3)
            android.widget.TextView r3 = r7.f4175e
            android.text.Layout r3 = r3.getLayout()
            int r3 = r3.getLineCount()
            r4 = 0
            if (r3 <= r1) goto L2e
            r3 = r1
            goto L2f
        L2e:
            r3 = r4
        L2f:
            if (r3 == 0) goto L48
            int r5 = r7.f4177g
            if (r5 <= 0) goto L48
            android.widget.Button r5 = r7.f4176f
            int r5 = r5.getMeasuredWidth()
            int r6 = r7.f4177g
            if (r5 <= r6) goto L48
            int r2 = r0 - r2
            boolean r0 = r7.d(r1, r0, r2)
            if (r0 == 0) goto L53
            goto L54
        L48:
            if (r3 == 0) goto L4b
            goto L4c
        L4b:
            r0 = r2
        L4c:
            boolean r0 = r7.d(r4, r0, r0)
            if (r0 == 0) goto L53
            goto L54
        L53:
            r1 = r4
        L54:
            if (r1 == 0) goto L59
            super.onMeasure(r8, r9)
        L59:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.android.material.snackbar.SnackbarContentLayout.onMeasure(int, int):void");
    }

    public void setMaxInlineActionWidth(int i3) {
        this.f4177g = i3;
    }
}
