导航菜单

页面标题

页面副标题

Oolka v2.4.42 - CTInboxActivity.java 源代码

正在查看: Oolka v2.4.42 应用的 CTInboxActivity.java JAVA 源代码文件

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


package com.clevertap.android.sdk.inbox;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.res.ResourcesCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager.widget.ViewPager;
import com.clevertap.android.sdk.CTInboxStyleConfig;
import com.clevertap.android.sdk.CleverTapInstanceConfig;
import com.clevertap.android.sdk.a2;
import com.clevertap.android.sdk.d2;
import com.clevertap.android.sdk.e1;
import com.clevertap.android.sdk.e2;
import com.clevertap.android.sdk.f2;
import com.clevertap.android.sdk.g2;
import com.clevertap.android.sdk.inbox.CTInboxListViewFragment;
import com.clevertap.android.sdk.n0;
import com.clevertap.android.sdk.w1;
import com.google.android.material.tabs.TabLayout;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;

public class CTInboxActivity extends FragmentActivity implements CTInboxListViewFragment.b, e1 {
    public static int y1;
    public CleverTapInstanceConfig A0;
    public WeakReference<b> C0;
    public s G;
    public CTInboxStyleConfig H;
    public TabLayout I;
    public ViewPager c0;
    public n0 c1;
    public com.clevertap.android.sdk.i p1 = null;
    public a2 x1;

    public class a implements View.OnClickListener {
        public a() {
        }

        @Override
        public void onClick(View view) {
            CTInboxActivity.this.finish();
        }
    }

    public interface b {
        void a(CTInboxActivity cTInboxActivity, CTInboxMessage cTInboxMessage, Bundle bundle);

        void b(CTInboxActivity cTInboxActivity, int i, CTInboxMessage cTInboxMessage, Bundle bundle, HashMap<String, String> hashMap, int i2);
    }

    @Override
    public void D(boolean z) {
        a2 a2Var = this.x1;
        if (a2Var != null) {
            a2Var.g(this, z);
        }
    }

    public void O(Bundle bundle, int i, CTInboxMessage cTInboxMessage, HashMap<String, String> hashMap, int i2) {
        b o0 = o0();
        if (o0 != null) {
            o0.b(this, i, cTInboxMessage, bundle, hashMap, i2);
        }
    }

    public void P(Bundle bundle, CTInboxMessage cTInboxMessage) {
        w1.r("CTInboxActivity:didShow() called with: data = [" + bundle + "], inboxMessage = [" + cTInboxMessage.f() + "]");
        b o0 = o0();
        if (o0 != null) {
            o0.a(this, cTInboxMessage, bundle);
        }
    }

    @Override
    public void g(Context context, CTInboxMessage cTInboxMessage, Bundle bundle) {
        w1.r("CTInboxActivity:messageDidShow() called with: data = [" + bundle + "], inboxMessage = [" + cTInboxMessage.f() + "]");
        P(bundle, cTInboxMessage);
    }

    @Override
    public void k(Context context, int i, CTInboxMessage cTInboxMessage, Bundle bundle, HashMap<String, String> hashMap, int i2) {
        O(bundle, i, cTInboxMessage, hashMap, i2);
    }

    public final String n0() {
        return this.A0.g() + ":CT_INBOX_LIST_VIEW_FRAGMENT";
    }

    public b o0() {
        b bVar;
        try {
            bVar = this.C0.get();
        } catch (Throwable unused) {
            bVar = null;
        }
        if (bVar == null) {
            this.A0.q().b(this.A0.g(), "InboxActivityListener is null for notification inbox ");
        }
        return bVar;
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        try {
            Bundle extras = getIntent().getExtras();
            if (extras == null) {
                throw new IllegalArgumentException();
            }
            this.H = (CTInboxStyleConfig) extras.getParcelable("styleConfig");
            Bundle bundle2 = extras.getBundle("configBundle");
            if (bundle2 != null) {
                this.A0 = (CleverTapInstanceConfig) bundle2.getParcelable("config");
            }
            n0 R0 = n0.R0(getApplicationContext(), this.A0);
            this.c1 = R0;
            if (R0 != null) {
                p0(R0);
                this.x1 = new a2(this.A0, this.c1.m0().f().q());
            }
            y1 = getResources().getConfiguration().orientation;
            setContentView(f2.l);
            this.c1.m0().i().K(this);
            Toolbar findViewById = findViewById(e2.I0);
            findViewById.setTitle(this.H.e());
            findViewById.setTitleTextColor(Color.parseColor(this.H.f()));
            findViewById.setBackgroundColor(Color.parseColor(this.H.d()));
            Drawable f = ResourcesCompat.f(getResources(), d2.b, (Resources.Theme) null);
            if (f != null) {
                f.setColorFilter(Color.parseColor(this.H.a()), PorterDuff.Mode.SRC_IN);
            }
            findViewById.setNavigationIcon(f);
            findViewById.setNavigationContentDescription(getString(g2.c));
            findViewById.setNavigationOnClickListener(new a());
            LinearLayout linearLayout = (LinearLayout) findViewById(e2.h0);
            linearLayout.setBackgroundColor(Color.parseColor(this.H.c()));
            this.I = linearLayout.findViewById(e2.G0);
            this.c0 = linearLayout.findViewById(e2.K0);
            TextView textView = (TextView) findViewById(e2.y0);
            Bundle bundle3 = new Bundle();
            bundle3.putParcelable("config", this.A0);
            bundle3.putParcelable("styleConfig", this.H);
            int i = 0;
            if (!this.H.n()) {
                this.c0.setVisibility(8);
                this.I.setVisibility(8);
                n0 n0Var = this.c1;
                if (n0Var != null && n0Var.z0() == 0) {
                    textView.setBackgroundColor(Color.parseColor(this.H.c()));
                    textView.setVisibility(0);
                    textView.setText(this.H.g());
                    textView.setTextColor(Color.parseColor(this.H.h()));
                    return;
                }
                ((FrameLayout) findViewById(e2.q0)).setVisibility(0);
                textView.setVisibility(8);
                for (Fragment fragment : getSupportFragmentManager().v0()) {
                    if (fragment.getTag() != null && !fragment.getTag().equalsIgnoreCase(n0())) {
                        i = 1;
                    }
                }
                if (i == 0) {
                    CTInboxListViewFragment cTInboxListViewFragment = new CTInboxListViewFragment();
                    cTInboxListViewFragment.setArguments(bundle3);
                    getSupportFragmentManager().p().c(e2.q0, cTInboxListViewFragment, n0()).i();
                    return;
                }
                return;
            }
            this.c0.setVisibility(0);
            ArrayList<String> l = this.H.l();
            this.G = new s(getSupportFragmentManager(), l.size() + 1);
            this.I.setVisibility(0);
            this.I.setTabGravity(0);
            this.I.setTabMode(1);
            this.I.setSelectedTabIndicatorColor(Color.parseColor(this.H.j()));
            this.I.P(Color.parseColor(this.H.m()), Color.parseColor(this.H.i()));
            this.I.setBackgroundColor(Color.parseColor(this.H.k()));
            Bundle bundle4 = (Bundle) bundle3.clone();
            bundle4.putInt("position", 0);
            CTInboxListViewFragment cTInboxListViewFragment2 = new CTInboxListViewFragment();
            cTInboxListViewFragment2.setArguments(bundle4);
            this.G.y(cTInboxListViewFragment2, this.H.b(), 0);
            while (i < l.size()) {
                String str = l.get(i);
                i++;
                Bundle bundle5 = (Bundle) bundle3.clone();
                bundle5.putInt("position", i);
                bundle5.putString("filter", str);
                CTInboxListViewFragment cTInboxListViewFragment3 = new CTInboxListViewFragment();
                cTInboxListViewFragment3.setArguments(bundle5);
                this.G.y(cTInboxListViewFragment3, str, i);
                this.c0.setOffscreenPageLimit(i);
            }
            this.c0.setAdapter(this.G);
            this.G.l();
            this.c0.c(new TabLayout.g(this.I));
            this.I.setupWithViewPager(this.c0);
        } catch (Throwable th) {
            w1.u("Cannot find a valid notification inbox bundle to show!", th);
        }
    }

    public void onDestroy() {
        this.c1.m0().i().K(null);
        if (this.H.n()) {
            for (Fragment fragment : getSupportFragmentManager().v0()) {
                if (fragment instanceof CTInboxListViewFragment) {
                    w1.r("Removing fragment - " + fragment.toString());
                    getSupportFragmentManager().v0().remove(fragment);
                }
            }
        }
        super.onDestroy();
    }

    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        a2 a2Var = this.x1;
        if (a2Var != null) {
            a2Var.f(this, i, iArr);
        }
    }

    public void onResume() {
        super.onResume();
        a2 a2Var = this.x1;
        if (a2Var != null) {
            a2Var.e(this);
        }
    }

    public void p0(b bVar) {
        this.C0 = new WeakReference<>(bVar);
    }
}