导航菜单

页面标题

页面副标题

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

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

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


package com.mrhabibi.autonomousdialog;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.app.c;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.l;
import com.mrhabibi.autonomousdialog.wrapper.DialogWrapper;
import defpackage.cc7;
import defpackage.hy1;
import defpackage.ir4;
import defpackage.pa7;
import defpackage.xx1;
import defpackage.zu2;
import java.util.HashSet;

public class DialogActivity extends c {
    protected String a;
    protected boolean b;
    protected String c;
    protected int d;
    protected Bundle e;
    protected boolean f;
    protected boolean g;
    protected Fragment h;
    protected androidx.appcompat.app.b i;
    private BroadcastReceiver j = new b();

    class b extends BroadcastReceiver {
        b() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent.getAction().equals("dismissAction") && intent.getStringExtra("identifier").equals(DialogActivity.this.c)) {
                hy1.a("Dismissing Remotely ", DialogActivity.this.c);
                DialogActivity.this.finish();
            }
        }
    }

    private void q(DialogWrapper dialogWrapper) {
        int i = this.d;
        if (i == 0) {
            i = bf7.a;
        }
        com.mrhabibi.autonomousdialog.b bVar = new com.mrhabibi.autonomousdialog.b(this, i);
        dialogWrapper.o0(bVar);
        Intent t = t();
        setResult(0, t);
        if (bVar.m() != null) {
            bVar.C(new c(this, t, dialogWrapper, bVar));
        }
        if (bVar.c() != null) {
            bVar.s(new d(this, t, dialogWrapper, bVar));
        }
        if (bVar.i() != null) {
            bVar.p(new e(this, t, dialogWrapper, bVar));
        }
        if (bVar.l() != null) {
            bVar.A(new f(this, t, dialogWrapper));
        }
        if (bVar.f() != null) {
            bVar.v(new g(this, t, dialogWrapper));
        }
        if (bVar.h() != null) {
            bVar.x(new h(this, t, dialogWrapper));
        }
        bVar.y(new i(this, t, bVar));
        androidx.appcompat.app.b a = bVar.a();
        this.i = a;
        a.setOnShowListener(new j(this, dialogWrapper, bVar));
        this.i.setOnCancelListener(new a(this, dialogWrapper));
        this.i.setOwnerActivity(this);
        this.i.setCancelable(this.b);
        this.i.show();
    }

    private void r(Bundle bundle) {
        if (bundle != null) {
            if (bundle.containsKey("fragmentGetterId")) {
                this.a = bundle.getString("fragmentGetterId");
            }
            if (bundle.containsKey("cancelable")) {
                this.b = bundle.getBoolean("cancelable");
            }
            if (bundle.containsKey("identifier")) {
                this.c = bundle.getString("identifier");
            }
            if (bundle.containsKey("themeRes")) {
                this.d = bundle.getInt("themeRes");
            }
            if (bundle.containsKey("params")) {
                this.e = bundle.getBundle("params");
            }
        }
    }

    public void v(Intent intent) {
        Fragment fragment = this.h;
        if (fragment == null || !(fragment instanceof xx1)) {
            return;
        }
        Bundle bundle = new Bundle();
        xx1 xx1Var = (xx1) this.h;
        xx1Var.p(bundle);
        intent.putExtra("responses", bundle);
        setResult(xx1Var.l0(), intent);
    }

    @Override
    public void finish() {
        if (!s()) {
            Intent t = t();
            setResult(0, t);
            v(t);
        }
        super.finish();
    }

    @Override
    protected void onActivityResult(int i, int i2, Intent intent) {
        super.onActivityResult(i, i2, intent);
        Fragment fragment = this.h;
        if (fragment != null) {
            fragment.onActivityResult(i, i2, intent);
        }
    }

    @Override
    public void onBackPressed() {
        if (this.b) {
            finish();
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        int i;
        this.g = bundle == null;
        r(getIntent().getExtras());
        if (!s() && (i = this.d) != 0) {
            setTheme(i);
        }
        super.onCreate(bundle);
        if (this.g) {
            this.h = zu2.a(this.a);
        } else {
            this.h = getSupportFragmentManager().j0("fragmentTag");
        }
        if (this.a != null && this.h == null) {
            hy1.a("Dismissing due to Expired Session ", this.c);
            finish();
            return;
        }
        if (this.g) {
            a.b.put(this.c, Boolean.TRUE);
            HashSet<String> hashSet = a.a;
            if (hashSet.contains(this.c)) {
                hy1.a("Dismissing due to Race Condition ", this.c);
                hashSet.remove(this.c);
                finish();
                return;
            }
        }
        if (!s()) {
            setContentView(cc7.a);
        } else if (this.h != null && s()) {
            if (this.g) {
                l supportFragmentManager = getSupportFragmentManager();
                supportFragmentManager.p().e(this.h, "fragmentTag").i();
                supportFragmentManager.f0();
            }
            q((DialogWrapper) this.h);
        }
        setFinishOnTouchOutside(this.b);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (isFinishing()) {
            String str = this.c;
            if (str != null && str.length() > 0) {
                a.b.remove(this.c);
            }
        } else if (this.i != null) {
            this.f = true;
        }
        androidx.appcompat.app.b bVar = this.i;
        if (bVar != null) {
            bVar.dismiss();
        }
    }

    @Override
    protected void onStart() {
        super.onStart();
        ir4.b(this).c(this.j, new IntentFilter("dismissAction"));
    }

    @Override
    protected void onStop() {
        super.onStop();
        ir4.b(this).e(this.j);
    }

    protected boolean s() {
        String str = this.a;
        return str != null && str.startsWith("AlertDialog_");
    }

    @Override
    public void setContentView(int i) {
        super.setContentView(i);
        u();
    }

    protected Intent t() {
        if (this.e == null) {
            this.e = new Bundle();
        }
        Intent intent = new Intent();
        intent.putExtra("id", this.c);
        intent.putExtra("params", this.e);
        return intent;
    }

    protected void u() {
        if (!this.g || this.h == null) {
            return;
        }
        if (findViewById(pa7.a) == null) {
            throw new IllegalStateException("Fragment container resource id not found, have you included FrameLayout with @id/fragment_container inside your activity content view?");
        }
        l supportFragmentManager = getSupportFragmentManager();
        supportFragmentManager.p().r(pa7.a, this.h, "fragmentTag").i();
        supportFragmentManager.f0();
    }

    @Override
    public void setContentView(View view) {
        super.setContentView(view);
        u();
    }

    @Override
    public void setContentView(View view, ViewGroup.LayoutParams layoutParams) {
        super.setContentView(view, layoutParams);
        u();
    }
}