导航菜单

页面标题

页面副标题

Mitra Bukalapak v2.55.0 - SheetActivity.java 源代码

正在查看: Mitra Bukalapak v2.55.0 应用的 SheetActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bukalapak.android.lib.bazaar.component.pattern.sheet;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.bukalapak.android.lib.api4.tungku.data.SingleKycIdentity;
import com.bukalapak.android.lib.bazaar.component.pattern.sheet.SheetActivity;
import com.bukalapak.android.lib.bazaar.widget.viewgroup.SheetLayout;
import com.bukalapak.android.lib.component.widget.viewgroup.SheetLayoutBase;
import com.mrhabibi.autonomousdialog.DialogActivity;
import defpackage.C0145ka0;
import defpackage.C0215xl4;
import defpackage.SheetState;
import defpackage.b51;
import defpackage.cc3;
import defpackage.dc7;
import defpackage.dk4;
import defpackage.du9;
import defpackage.dv0;
import defpackage.ep8;
import defpackage.es1;
import defpackage.ex2;
import defpackage.fv0;
import defpackage.g87;
import defpackage.gx2;
import defpackage.h88;
import defpackage.hb4;
import defpackage.i88;
import defpackage.k95;
import defpackage.ks1;
import defpackage.la0;
import defpackage.lg8;
import defpackage.lm9;
import defpackage.og8;
import defpackage.ot7;
import defpackage.ou2;
import defpackage.p21;
import defpackage.p64;
import defpackage.pg8;
import defpackage.q41;
import defpackage.q44;
import defpackage.r31;
import defpackage.rg8;
import defpackage.s64;
import defpackage.sw8;
import defpackage.t39;
import defpackage.tg8;
import defpackage.ux2;
import defpackage.vg8;
import defpackage.wg8;
import defpackage.xk4;
import defpackage.xl9;
import defpackage.z10;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.Metadata;

@Metadata(d1 = {"\u0000v\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u0007\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0015\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u000b\u0018\u0000 ]2\u00020\u0001:\u0001^B\t\b\u0000¢\u0006\u0004\b[\u0010\\J\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0002J\b\u0010\u0006\u001a\u00020\u0004H\u0002J\b\u0010\u0007\u001a\u00020\u0004H\u0002J\b\u0010\b\u001a\u00020\u0004H\u0002J\b\u0010\t\u001a\u00020\u0004H\u0002J\b\u0010\n\u001a\u00020\u0004H\u0002J\b\u0010\u000b\u001a\u00020\u0004H\u0002J\u0018\u0010\u0010\u001a\u00020\u000f2\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\fH\u0002J\b\u0010\u0011\u001a\u00020\u0004H\u0002J\u0010\u0010\u0014\u001a\u00020\u00042\u0006\u0010\u0013\u001a\u00020\u0012H\u0002J\b\u0010\u0015\u001a\u00020\u0004H\u0002J\b\u0010\u0016\u001a\u00020\u0004H\u0002J\u0012\u0010\u0019\u001a\u00020\u00042\b\u0010\u0018\u001a\u0004\u0018\u00010\u0017H\u0014J\u0012\u0010\u001b\u001a\u00020\u00042\b\u0010\u001a\u001a\u0004\u0018\u00010\u0002H\u0014J\u0010\u0010\u001d\u001a\u00020\u00042\u0006\u0010\u001c\u001a\u00020\u0002H\u0014J\b\u0010\u001e\u001a\u00020\u0004H\u0014J\b\u0010\u001f\u001a\u00020\u0004H\u0016J\b\u0010 \u001a\u00020\u0004H\u0016J!\u0010#\u001a\u00020\u00042\u0010\b\u0002\u0010\"\u001a\n\u0012\u0004\u0012\u00020\u0004\u0018\u00010!H\u0000¢\u0006\u0004\b#\u0010$J\u0017\u0010'\u001a\u00020\u00042\u0006\u0010&\u001a\u00020%H\u0000¢\u0006\u0004\b'\u0010(J#\u0010+\u001a\u00020\u00042\u0012\u0010*\u001a\u000e\u0012\u0004\u0012\u00020\u000f\u0012\u0004\u0012\u00020\u00040)H\u0000¢\u0006\u0004\b+\u0010,J\b\u0010-\u001a\u00020\u0004H\u0014R\u0014\u00101\u001a\u00020.8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b/\u00100R\u0014\u00105\u001a\u0002028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b3\u00104R\"\u0010;\u001a\u00020\f8\u0000@\u0000X\u0080\u000e¢\u0006\u0012\n\u0004\b6\u0010\u0016\u001a\u0004\b7\u00108\"\u0004\b9\u0010:R\"\u0010A\u001a\u00020\u00128\u0000@\u0000X\u0080\u000e¢\u0006\u0012\n\u0004\b<\u0010+\u001a\u0004\b=\u0010>\"\u0004\b?\u0010@R0\u0010G\u001a\u0010\u0012\u0004\u0012\u00020\f\u0012\u0004\u0012\u00020\u0004\u0018\u00010)8\u0000@\u0000X\u0080\u000e¢\u0006\u0012\n\u0004\bB\u0010C\u001a\u0004\bD\u0010E\"\u0004\bF\u0010,R\u0018\u0010K\u001a\u0004\u0018\u00010H8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bI\u0010JR\u0018\u0010M\u001a\u0004\u0018\u00010H8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\bL\u0010JR\u001b\u0010S\u001a\u00020N8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bO\u0010P\u001a\u0004\bQ\u0010RR\u001b\u0010X\u001a\u00020T8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bU\u0010P\u001a\u0004\bV\u0010WR\u0014\u0010Z\u001a\u00020\u00128@X\u0080\u0004¢\u0006\u0006\u001a\u0004\bY\u0010>¨\u0006_"}, d2 = {"Lcom/bukalapak/android/lib/bazaar/component/pattern/sheet/SheetActivity;", "Lcom/mrhabibi/autonomousdialog/DialogActivity;", "Landroid/os/Bundle;", "extras", "Llm9;", "Q", "P", "U", "W", "S", "R", "V", SingleKycIdentity.EMPTY, "offset", "alpha", SingleKycIdentity.EMPTY, "O", "I", SingleKycIdentity.EMPTY, "forceLightStatusBar", "f0", "H", "F", "Landroid/content/Context;", "newBase", "attachBaseContext", "savedInstanceState", "onCreate", "outState", "onSaveInstanceState", "onDestroy", "onBackPressed", "finish", "Lkotlin/Function0;", "validator", "X", "(Lex2;)V", "Lrg8;", "sheetHeader", "d0", "(Lrg8;)V", "Lkotlin/Function1;", "action", "Z", "(Lgx2;)V", "onStop", "Lyg8;", "k", "Lyg8;", "state", "Lwg8;", "l", "Lwg8;", "sheetInvalidator", "m", "J", "()F", "b0", "(F)V", "footerHeight", "n", "L", "()Z", "c0", "(Z)V", "sheetAnimatingShow", SingleKycIdentity.O, "Lgx2;", "N", "()Lgx2;", "e0", "sheetScrollListener", "Lhb4;", "p", "Lhb4;", "sheetShow", "q", "sheetHide", "Ltg8;", "r", "Lxk4;", "M", "()Ltg8;", "sheetHeaderMV", "Lh88;", "s", "K", "()Lh88;", "separatorLineAV", "Y", "isSheetReady", "<init>", "()V", "u", SingleKycIdentity.A, "bazaar_release"}, k = 1, mv = {1, 7, 1})
public final class SheetActivity extends DialogActivity {

    private float footerHeight;

    private boolean sheetAnimatingShow;

    private gx2<? super Float, lm9> sheetScrollListener;

    private hb4 sheetShow;

    private hb4 sheetHide;

    private final xk4 sheetHeaderMV;

    private final xk4 separatorLineAV;
    public Map<Integer, View> t = new LinkedHashMap();

    private final SheetState state = new SheetState(false, false, 1, -1, false, 0, -110, false);

    private final wg8 sheetInvalidator = new wg8();

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0001\u001a\u00020\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/view/View;", "<anonymous parameter 0>", SingleKycIdentity.EMPTY, "slideOffset", "Llm9;", SingleKycIdentity.A, "(Landroid/view/View;F)V"}, k = 3, mv = {1, 7, 1})
    static final class c extends dk4 implements ux2<View, Float, lm9> {
        final SheetLayout $it;

        c(SheetLayout sheetLayout) {
            super(2);
            this.$it = sheetLayout;
        }

        public final void a(View view, float f) {
            p64.h(view, "<anonymous parameter 0>");
            gx2<Float, lm9> N = SheetActivity.this.N();
            if (N != null) {
                N.invoke(Float.valueOf(f));
            }
            if (f < 0.0f) {
                View y = SheetActivity.this.y(g87.s3);
                if (y != null) {
                    y.setAlpha(1.0f - Math.abs(f));
                }
                RecyclerView recyclerView = (RecyclerView) SheetActivity.this.y(g87.r3);
                if (recyclerView != null) {
                    recyclerView.setTranslationY(Math.abs(f) * SheetActivity.this.getFooterHeight());
                }
            } else {
                View y2 = SheetActivity.this.y(g87.s3);
                if (y2 != null) {
                    y2.setAlpha(1.0f);
                }
                RecyclerView recyclerView2 = (RecyclerView) SheetActivity.this.y(g87.r3);
                if (recyclerView2 != null) {
                    recyclerView2.setTranslationY(0.0f);
                }
            }
            float max = Math.max(0.0f, (1.0f - Math.abs(f)) * 0.5f);
            if (SheetActivity.this.state.getPeekHeight() != pg8.INSTANCE.b()) {
                if (Build.VERSION.SDK_INT >= 23) {
                    boolean z = f < 0.0f;
                    Float valueOf = Float.valueOf(max);
                    if (Float.isNaN(valueOf.floatValue()) || !z) {
                        valueOf = null;
                    }
                    float floatValue = valueOf != null ? valueOf.floatValue() : 0.5f;
                    SheetActivity.this.f0(false);
                    xl9.d(SheetActivity.this, xl9.a(dv0.a.Q(), floatValue));
                    return;
                }
                return;
            }
            float abs = Math.abs(f);
            this.$it.setCornerRadius((int) (q41.radius16 * abs));
            if (Build.VERSION.SDK_INT >= 23) {
                float f2 = 1.0f - (3.0f * abs);
                if (!Float.isNaN(f2) && f2 > 0.0f) {
                    SheetActivity.this.f0(true);
                    SheetActivity sheetActivity = SheetActivity.this;
                    xl9.d(sheetActivity, sheetActivity.O(abs, f2));
                } else if (Float.isNaN(f2)) {
                    wd5.e.a(SheetActivity.this, this.$it.getSheetBackgroundColor());
                } else {
                    SheetActivity.this.f0(false);
                    xl9.d(SheetActivity.this, xl9.a(dv0.a.Q(), max));
                }
            }
        }

        @Override
        public lm9 invoke(View view, Float f) {
            a(view, f.floatValue());
            return lm9.a;
        }
    }

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0001\u001a\u00020\u00002\u0006\u0010\u0003\u001a\u00020\u0002H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Landroid/view/View;", "<anonymous parameter 0>", "Lcom/bukalapak/android/lib/component/widget/viewgroup/SheetLayoutBase$b;", "newState", "Llm9;", SingleKycIdentity.A, "(Landroid/view/View;Lcom/bukalapak/android/lib/component/widget/viewgroup/SheetLayoutBase$b;)V"}, k = 3, mv = {1, 7, 1})
    static final class d extends dk4 implements ux2<View, SheetLayoutBase.b, lm9> {
        d() {
            super(2);
        }

        public final void a(View view, SheetLayoutBase.b bVar) {
            p64.h(view, "<anonymous parameter 0>");
            p64.h(bVar, "newState");
            if (bVar == SheetLayoutBase.b.HIDDEN && !SheetActivity.this.state.getCollapsed()) {
                SheetActivity.this.finish();
            }
            if (bVar == SheetLayoutBase.b.EXPANDED && SheetActivity.this.getSheetAnimatingShow()) {
                SheetActivity.this.c0(false);
                wg8 wg8Var = SheetActivity.this.sheetInvalidator;
                SheetLayout sheetLayout = (SheetLayout) SheetActivity.this.y(g87.y3);
                p64.g(sheetLayout, "sheetLayout");
                wg8Var.c(sheetLayout);
            }
        }

        @Override
        public lm9 invoke(View view, SheetLayoutBase.b bVar) {
            a(view, bVar);
            return lm9.a;
        }
    }

    @Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lb51;", "Llm9;", "<anonymous>"}, k = 3, mv = {1, 7, 1})
    @eo1(c = "com.bukalapak.android.lib.bazaar.component.pattern.sheet.SheetActivity$initSheetDraggable$2", f = "SheetActivity.kt", l = {227}, m = "invokeSuspend")
    static final class e extends sw8 implements ux2<b51, r31<? super lm9>, Object> {
        int label;

        e(r31<? super e> r31Var) {
            super(2, r31Var);
        }

        @Override
        public final r31<lm9> create(Object obj, r31<?> r31Var) {
            return SheetActivity.this.new e(r31Var);
        }

        @Override
        public final Object invoke(b51 b51Var, r31<? super lm9> r31Var) {
            return ((e) create(b51Var, r31Var)).invokeSuspend(lm9.a);
        }

        @Override
        public final Object invokeSuspend(Object obj) {
            Object d;
            d = s64.d();
            int i = this.label;
            if (i == 0) {
                ot7.b(obj);
                this.label = 1;
                if (ks1.a(300L, this) == d) {
                    return d;
                }
            } else {
                if (i != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                ot7.b(obj);
            }
            SheetLayout sheetLayout = (SheetLayout) SheetActivity.this.y(g87.y3);
            SheetActivity sheetActivity = SheetActivity.this;
            sheetLayout.getSheetContainer().requestLayout();
            sheetLayout.setSkipSheetPeek(sheetActivity.state.getSkipPeek());
            sheetLayout.setPeekHeight(sheetActivity.state.getPeekHeight());
            sheetLayout.setState((sheetActivity.state.getPeekHeight() == -2 || sheetActivity.state.getPeekHeight() == -3) ? SheetLayoutBase.b.EXPANDED : SheetLayoutBase.b.COLLAPSED);
            sheetLayout.setSwipeToDismiss(sheetActivity.state.getSwipeToDismiss());
            SheetActivity.this.sheetShow = null;
            return lm9.a;
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lh88;", SingleKycIdentity.A, "()Lh88;"}, k = 3, mv = {1, 7, 1})
    static final class g extends dk4 implements ex2<h88> {
        g() {
            super(0);
        }

        @Override
        public final h88 invoke() {
            return new h88(SheetActivity.this);
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Li88$c;", "Llm9;", SingleKycIdentity.A, "(Li88$c;)V"}, k = 3, mv = {1, 7, 1})
    static final class h extends dk4 implements gx2<i88.c, lm9> {
        public static final h g = new h();

        h() {
            super(1);
        }

        public final void a(i88.c cVar) {
            p64.h(cVar, "$this$bind");
            cVar.d(dv0.a.m0());
        }

        @Override
        public lm9 invoke(i88.c cVar) {
            a(cVar);
            return lm9.a;
        }
    }

    @Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Ltg8$b;", "Llm9;", SingleKycIdentity.A, "(Ltg8$b;)V"}, k = 3, mv = {1, 7, 1})
    static final class i extends dk4 implements gx2<tg8.b, lm9> {
        final rg8 $sheetHeader;

        i(rg8 rg8Var) {
            super(1);
            this.$sheetHeader = rg8Var;
        }

        public final void a(tg8.b bVar) {
            p64.h(bVar, "$this$bind");
            bVar.k(this.$sheetHeader.getTitle());
            bVar.j(this.$sheetHeader.c());
            bVar.i(this.$sheetHeader.getActionText());
            bVar.h(this.$sheetHeader.e());
        }

        @Override
        public lm9 invoke(tg8.b bVar) {
            a(bVar);
            return lm9.a;
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Ltg8;", SingleKycIdentity.A, "()Ltg8;"}, k = 3, mv = {1, 7, 1})
    static final class j extends dk4 implements ex2<tg8> {
        j() {
            super(0);
        }

        @Override
        public final tg8 invoke() {
            return new tg8(SheetActivity.this);
        }
    }

    public SheetActivity() {
        xk4 a;
        xk4 a2;
        a = C0215xl4.a(new j());
        this.sheetHeaderMV = a;
        a2 = C0215xl4.a(new g());
        this.separatorLineAV = a2;
    }

    private final void F() {
        hb4 hb4Var = this.sheetHide;
        if (hb4Var != null) {
            if (hb4Var != null) {
                hb4.a.a(hb4Var, null, 1, null);
            }
            this.sheetHide = null;
        }
    }

    private final void H() {
        hb4 hb4Var = this.sheetShow;
        if (hb4Var != null) {
            if (hb4Var != null) {
                hb4.a.a(hb4Var, null, 1, null);
            }
            this.sheetShow = null;
        }
    }

    private final void I() {
        es1 b;
        if (this.state.getType() != 1) {
            if (this.sheetHide != null) {
                return;
            }
            View y = y(g87.s3);
            if (p64.b(y != null ? Float.valueOf(y.getAlpha()) : null, 0.0f)) {
                super.finish();
                overridePendingTransition(0, 0);
                return;
            } else {
                b = la0.b(cc3.a, t39.a.a(), null, new b(this, (r31) null), 2, null);
                this.sheetHide = b;
                return;
            }
        }
        SheetLayout sheetLayout = (SheetLayout) y(g87.y3);
        SheetLayoutBase.b state = sheetLayout != null ? sheetLayout.getState() : null;
        SheetLayoutBase.b bVar = SheetLayoutBase.b.HIDDEN;
        if (state == bVar) {
            super.finish();
            overridePendingTransition(0, 0);
            return;
        }
        SheetLayout sheetLayout2 = (SheetLayout) y(g87.y3);
        if (sheetLayout2 != null) {
            sheetLayout2.setHideable(true);
            sheetLayout2.setState(bVar);
        }
    }

    private final h88 K() {
        return (h88) this.separatorLineAV.getValue();
    }

    private final tg8 M() {
        return (tg8) this.sheetHeaderMV.getValue();
    }

    public final int O(float offset, float alpha) {
        float max = Math.max(0.0f, (1.0f - Math.abs(offset)) * 0.5f);
        float max2 = Math.max(0.0f, alpha);
        return max2 > 0.0f ? fv0.c(xl9.a(dv0.a.Q(), max), ((SheetLayout) y(g87.y3)).getSheetBackgroundColor(), max2) : xl9.a(dv0.a.Q(), max);
    }

    private final void P() {
        TextView textView = (TextView) findViewById(g87.J0);
        if (!z10.a.c()) {
            if (textView == null) {
                return;
            }
            textView.setVisibility(8);
        } else if (textView != null) {
            GradientDrawable gradientDrawable = new GradientDrawable();
            dv0 dv0Var = dv0.a;
            gradientDrawable.setColor(dv0Var.Q());
            gradientDrawable.setCornerRadius(q41.radius4);
            textView.setBackground(gradientDrawable);
            textView.setTextColor(dv0Var.P0());
            textView.setVisibility(0);
            textView.setText(ou2.a(this.h));
        }
    }

    private final void Q(Bundle bundle) {
        if (bundle != null) {
            Serializable serializable = bundle.getSerializable("state");
            SheetState sheetState = serializable instanceof SheetState ? (SheetState) serializable : null;
            if (sheetState != null) {
                this.state.a(sheetState);
            }
        }
    }

    private final void R() {
        ((SheetLayout) y(g87.y3)).setCornerRadius((int) q41.radius16);
        SheetLayout sheetLayout = (SheetLayout) y(g87.y3);
        p64.g(sheetLayout, "sheetLayout");
        p21.b(sheetLayout, K(), 0, null, 4, null);
        SheetLayout sheetLayout2 = (SheetLayout) y(g87.y3);
        p64.g(sheetLayout2, "sheetLayout");
        p21.b(sheetLayout2, M(), 0, null, 4, null);
        K().L(8);
        M().L(8);
        V();
        int i2 = Build.VERSION.SDK_INT;
        if (i2 < 26) {
            int orientation = this.state.getOrientation();
            setRequestedOrientation(orientation != 1 ? orientation != 2 ? -1 : 0 : 1);
        }
        if (i2 >= 23) {
            f0(false);
        } else {
            wd5.e.a(this, dv0.a.X0());
        }
    }

    private final void S() {
        View y = y(g87.s3);
        y.setBackground(new ColorDrawable(dv0.a.Q()));
        y.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                SheetActivity.T(SheetActivity.this, view);
            }
        });
    }

    public static final void T(SheetActivity sheetActivity, View view) {
        p64.h(sheetActivity, "this$0");
        sheetActivity.onBackPressed();
    }

    private final void U() {
        es1 b;
        this.sheetAnimatingShow = true;
        SheetLayout sheetLayout = (SheetLayout) y(g87.y3);
        sheetLayout.setHideable(true);
        sheetLayout.setSwipeToDismiss(true);
        sheetLayout.setSkipSheetPeek(false);
        sheetLayout.setState(SheetLayoutBase.b.HIDDEN);
        sheetLayout.d0(new c(sheetLayout));
        sheetLayout.e0(new d());
        H();
        b = la0.b(cc3.a, t39.a.a(), null, new e(null), 2, null);
        this.sheetShow = b;
    }

    private final void V() {
        if ((getSupportFragmentManager().j0("fragmentTag") instanceof pg8) && this.state.getSwipeToDismiss()) {
            ((SheetLayout) y(g87.y3)).setIndicator(((vg8) k95.Companion.b(k95.INSTANCE, new vg8(this), null, 2, null)).t());
        } else {
            ((SheetLayout) y(g87.y3)).setIndicator(null);
        }
    }

    private final void W() {
        og8.a(((SheetLayout) y(g87.y3)).getSheetContainer(), null);
        ViewGroup.LayoutParams layoutParams = ((SheetLayout) y(g87.y3)).getSheetContainer().getLayoutParams();
        if (layoutParams instanceof CoordinatorLayout.f) {
            ((CoordinatorLayout.f) layoutParams).c = 80;
        }
        ((SheetLayout) y(g87.y3)).getSheetContainer().setAlpha(0.0f);
        H();
        C0145ka0.b(null, new f(this, (r31) null), 1, null);
    }

    public static final void a0(SheetActivity sheetActivity, gx2 gx2Var) {
        p64.h(sheetActivity, "this$0");
        p64.h(gx2Var, "$action");
        RecyclerView recyclerView = (RecyclerView) sheetActivity.y(g87.r3);
        if (recyclerView != null) {
            sheetActivity.footerHeight = recyclerView.getHeight();
            gx2Var.invoke(Integer.valueOf(recyclerView.getHeight()));
        }
    }

    public final void f0(boolean z) {
        boolean a;
        int Y0;
        Boolean valueOf = Boolean.valueOf(z);
        if (!valueOf.booleanValue()) {
            valueOf = null;
        }
        if (valueOf == null) {
            if (this.state.getSystemUiVisibility() != -110) {
                a = q44.a(this.state.getSystemUiVisibility(), 8192);
            }
            Y0 = dv0.a.Y0();
            xl9.e(this, Y0);
        }
        a = valueOf.booleanValue();
        if (a) {
            Y0 = dv0.a.X0();
            xl9.e(this, Y0);
        }
        Y0 = dv0.a.Y0();
        xl9.e(this, Y0);
    }

    public final float getFooterHeight() {
        return this.footerHeight;
    }

    public final boolean getSheetAnimatingShow() {
        return this.sheetAnimatingShow;
    }

    public final gx2<Float, lm9> N() {
        return this.sheetScrollListener;
    }

    public final void X(ex2<lm9> validator) {
        if (this.sheetAnimatingShow) {
            this.sheetInvalidator.b(validator);
        } else {
            ((SheetLayout) y(g87.y3)).getSheetContainer().requestLayout();
            ((SheetLayout) y(g87.y3)).c0();
        }
    }

    public final boolean Y() {
        return this.sheetShow == null;
    }

    public final void Z(gx2<? super Integer, lm9> action) {
        p64.h(action, "action");
        float f = this.footerHeight;
        if (f > 0.0f) {
            action.invoke(Integer.valueOf((int) f));
        } else if (!du9.K((RecyclerView) y(g87.r3)) || ((RecyclerView) y(g87.r3)).getHeight() <= 0) {
            ((RecyclerView) y(g87.r3)).post(new ng8(this, action));
        } else {
            this.footerHeight = ((RecyclerView) y(g87.r3)).getHeight();
            action.invoke(Integer.valueOf(((RecyclerView) y(g87.r3)).getHeight()));
        }
    }

    @Override
    protected void attachBaseContext(Context context) {
        super.attachBaseContext(context);
        ep8.b(this);
    }

    public final void b0(float f) {
        this.footerHeight = f;
    }

    public final void c0(boolean z) {
        this.sheetAnimatingShow = z;
    }

    public final void d0(rg8 sheetHeader) {
        p64.h(sheetHeader, "sheetHeader");
        if (sheetHeader.f()) {
            K().L(0);
            K().O(h.g);
        } else {
            K().L(8);
        }
        if (sheetHeader.d()) {
            M().L(0);
            M().Q(new i(sheetHeader));
        } else {
            M().L(8);
            K().L(8);
        }
    }

    public final void e0(gx2<? super Float, lm9> gx2Var) {
        this.sheetScrollListener = gx2Var;
    }

    @Override
    public void finish() {
        I();
    }

    @Override
    public void onBackPressed() {
        if (this.state.getCancelable()) {
            androidx.lifecycle.h j0 = getSupportFragmentManager().j0("fragmentTag");
            lg8 lg8Var = j0 instanceof lg8 ? (lg8) j0 : null;
            if (lg8Var != null) {
                lg8Var.d();
            }
            I();
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Q(getIntent().getExtras());
        setContentView(this.state.getPeekHeight() == -3 ? dc7.a : dc7.b);
        if (bundle != null) {
            Q(bundle);
        }
        S();
        R();
        P();
        if (this.state.getType() == 1) {
            U();
        } else {
            W();
        }
    }

    @Override
    protected void onDestroy() {
        H();
        F();
        super.onDestroy();
    }

    @Override
    protected void onSaveInstanceState(Bundle bundle) {
        p64.h(bundle, "outState");
        bundle.putSerializable("state", this.state);
        super.onSaveInstanceState(bundle);
    }

    @Override
    protected void onStop() {
        try {
            super.onStop();
        } catch (Exception unused) {
        }
    }

    public View y(int i2) {
        Map<Integer, View> map = this.t;
        View view = map.get(Integer.valueOf(i2));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i2);
        if (findViewById == null) {
            return null;
        }
        map.put(Integer.valueOf(i2), findViewById);
        return findViewById;
    }
}