导航菜单

页面标题

页面副标题

OLX India v19.42.007 - CTInboxActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 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.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.r;
import androidx.viewpager.widget.ViewPager;
import com.clevertap.android.sdk.CTInboxStyleConfig;
import com.clevertap.android.sdk.CleverTapInstanceConfig;
import com.clevertap.android.sdk.InAppNotificationActivity;
import com.clevertap.android.sdk.b0;
import com.clevertap.android.sdk.e1;
import com.clevertap.android.sdk.inbox.CTInboxListViewFragment;
import com.clevertap.android.sdk.j1;
import com.clevertap.android.sdk.l1;
import com.clevertap.android.sdk.m1;
import com.clevertap.android.sdk.n1;
import com.clevertap.android.sdk.r0;
import com.google.android.material.tabs.TabLayout;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;

public class CTInboxActivity extends r implements CTInboxListViewFragment.a, r0 {
    public static int Z;
    n Q;
    CTInboxStyleConfig R;
    TabLayout S;
    ViewPager T;
    private CleverTapInstanceConfig U;
    private WeakReference V;
    private b0 W;
    private j1 X;
    private WeakReference Y;

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

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

    public interface b {
        void a(CTInboxActivity cTInboxActivity, int i, CTInboxMessage cTInboxMessage, Bundle bundle, HashMap hashMap, int i2);

        void b(CTInboxActivity cTInboxActivity, CTInboxMessage cTInboxMessage, Bundle bundle);
    }

    private String g2() {
        return this.U.c() + ":CT_INBOX_LIST_VIEW_FRAGMENT";
    }

    @Override
    public void P(Context context, int i, CTInboxMessage cTInboxMessage, Bundle bundle, HashMap hashMap, int i2) {
        e2(bundle, i, cTInboxMessage, hashMap, i2);
    }

    void e2(Bundle bundle, int i, CTInboxMessage cTInboxMessage, HashMap hashMap, int i2) {
        b h2 = h2();
        if (h2 != null) {
            h2.a(this, i, cTInboxMessage, bundle, hashMap, i2);
        }
    }

    void f2(Bundle bundle, CTInboxMessage cTInboxMessage) {
        e1.r("CTInboxActivity:didShow() called with: data = [" + bundle + "], inboxMessage = [" + cTInboxMessage.e() + "]");
        b h2 = h2();
        if (h2 != null) {
            h2.b(this, cTInboxMessage, bundle);
        }
    }

    @Override
    public void h(Context context, CTInboxMessage cTInboxMessage, Bundle bundle) {
        e1.r("CTInboxActivity:messageDidShow() called with: data = [" + bundle + "], inboxMessage = [" + cTInboxMessage.e() + "]");
        f2(bundle, cTInboxMessage);
    }

    b h2() {
        b bVar;
        try {
            bVar = (b) this.V.get();
        } catch (Throwable unused) {
            bVar = null;
        }
        if (bVar == null) {
            this.U.m().b(this.U.c(), "InboxActivityListener is null for notification inbox ");
        }
        return bVar;
    }

    void i2(b bVar) {
        this.V = new WeakReference(bVar);
    }

    public void j2(InAppNotificationActivity.c cVar) {
        this.Y = new WeakReference(cVar);
    }

    public void k2(boolean z) {
        this.X.i(z, (InAppNotificationActivity.c) this.Y.get());
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        try {
            Bundle extras = getIntent().getExtras();
            if (extras == null) {
                throw new IllegalArgumentException();
            }
            this.R = (CTInboxStyleConfig) extras.getParcelable("styleConfig");
            Bundle bundle2 = extras.getBundle("configBundle");
            if (bundle2 != null) {
                this.U = (CleverTapInstanceConfig) bundle2.getParcelable("config");
            }
            b0 M = b0.M(getApplicationContext(), this.U);
            this.W = M;
            if (M != null) {
                i2(M);
                j2(b0.M(this, this.U).y().l());
                this.X = new j1(this, this.U);
            }
            Z = getResources().getConfiguration().orientation;
            setContentView(n1.inbox_activity);
            this.W.y().h().J(this);
            Toolbar findViewById = findViewById(m1.toolbar);
            findViewById.setTitle(this.R.e());
            findViewById.setTitleTextColor(Color.parseColor(this.R.f()));
            findViewById.setBackgroundColor(Color.parseColor(this.R.d()));
            Drawable e = androidx.core.content.res.h.e(getResources(), l1.ct_ic_arrow_back_white_24dp, (Resources.Theme) null);
            if (e != null) {
                e.setColorFilter(Color.parseColor(this.R.a()), PorterDuff.Mode.SRC_IN);
            }
            findViewById.setNavigationIcon(e);
            findViewById.setNavigationOnClickListener(new a());
            LinearLayout linearLayout = (LinearLayout) findViewById(m1.inbox_linear_layout);
            linearLayout.setBackgroundColor(Color.parseColor(this.R.c()));
            this.S = (TabLayout) linearLayout.findViewById(m1.tab_layout);
            this.T = linearLayout.findViewById(m1.view_pager);
            TextView textView = (TextView) findViewById(m1.no_message_view);
            Bundle bundle3 = new Bundle();
            bundle3.putParcelable("config", this.U);
            bundle3.putParcelable("styleConfig", this.R);
            int i = 0;
            if (!this.R.n()) {
                this.T.setVisibility(8);
                this.S.setVisibility(8);
                b0 b0Var = this.W;
                if (b0Var != null && b0Var.E() == 0) {
                    textView.setBackgroundColor(Color.parseColor(this.R.c()));
                    textView.setVisibility(0);
                    textView.setText(this.R.g());
                    textView.setTextColor(Color.parseColor(this.R.h()));
                    return;
                }
                ((FrameLayout) findViewById(m1.list_view_fragment)).setVisibility(0);
                textView.setVisibility(8);
                for (Fragment fragment : getSupportFragmentManager().F0()) {
                    if (fragment.getTag() != null && !fragment.getTag().equalsIgnoreCase(g2())) {
                        i = 1;
                    }
                }
                if (i == 0) {
                    CTInboxListViewFragment cTInboxListViewFragment = new CTInboxListViewFragment();
                    cTInboxListViewFragment.setArguments(bundle3);
                    getSupportFragmentManager().s().c(m1.list_view_fragment, cTInboxListViewFragment, g2()).i();
                    return;
                }
                return;
            }
            this.T.setVisibility(0);
            ArrayList l = this.R.l();
            this.Q = new n(getSupportFragmentManager(), l.size() + 1);
            this.S.setVisibility(0);
            this.S.setTabGravity(0);
            this.S.setTabMode(1);
            this.S.setSelectedTabIndicatorColor(Color.parseColor(this.R.j()));
            this.S.setTabTextColors(Color.parseColor(this.R.m()), Color.parseColor(this.R.i()));
            this.S.setBackgroundColor(Color.parseColor(this.R.k()));
            Bundle bundle4 = (Bundle) bundle3.clone();
            bundle4.putInt("position", 0);
            CTInboxListViewFragment cTInboxListViewFragment2 = new CTInboxListViewFragment();
            cTInboxListViewFragment2.setArguments(bundle4);
            this.Q.d(cTInboxListViewFragment2, this.R.b(), 0);
            while (i < l.size()) {
                String str = (String) 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.Q.d(cTInboxListViewFragment3, str, i);
                this.T.setOffscreenPageLimit(i);
            }
            this.T.setAdapter(this.Q);
            this.Q.notifyDataSetChanged();
            this.T.c(new TabLayout.TabLayoutOnPageChangeListener(this.S));
            this.S.setupWithViewPager(this.T);
        } catch (Throwable th) {
            e1.u("Cannot find a valid notification inbox bundle to show!", th);
        }
    }

    protected void onDestroy() {
        this.W.y().h().J(null);
        if (this.R.n()) {
            for (Fragment fragment : getSupportFragmentManager().F0()) {
                if (fragment instanceof CTInboxListViewFragment) {
                    e1.r("Removing fragment - " + fragment.toString());
                    getSupportFragmentManager().F0().remove(fragment);
                }
            }
        }
        super.onDestroy();
    }

    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        com.clevertap.android.sdk.o.c(this, this.U).e(false);
        com.clevertap.android.sdk.o.f(this, this.U);
        if (i == 102) {
            if (iArr.length <= 0 || iArr[0] != 0) {
                ((InAppNotificationActivity.c) this.Y.get()).b();
            } else {
                ((InAppNotificationActivity.c) this.Y.get()).a();
            }
        }
    }

    protected void onResume() {
        super.onResume();
        if (!this.X.c() || Build.VERSION.SDK_INT < 33) {
            return;
        }
        if (androidx.core.content.b.checkSelfPermission(this, "android.permission.POST_NOTIFICATIONS") == 0) {
            ((InAppNotificationActivity.c) this.Y.get()).a();
        } else {
            ((InAppNotificationActivity.c) this.Y.get()).b();
        }
    }

    @Override
    public void y0(boolean z) {
        k2(z);
    }
}