正在查看: Namma Yatri v3.3.7 应用的 CTInboxActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Namma Yatri v3.3.7 应用的 CTInboxActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.clevertap.android.sdk.inbox;
import android.content.Context;
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.appcompat.widget.Toolbar;
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.inbox.g;
import com.clevertap.android.sdk.r;
import com.clevertap.android.sdk.t;
import com.google.android.material.tabs.TabLayout;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import k3.E0;
import k3.F0;
import k3.G0;
import k3.H0;
import k3.InterfaceC1358f;
import k3.InterfaceC1369k0;
public class CTInboxActivity extends FragmentActivity implements g.b, InterfaceC1369k0 {
public static int f17374j;
j f17375a;
CTInboxStyleConfig f17376b;
TabLayout f17377c;
ViewPager f17378d;
private CleverTapInstanceConfig f17379e;
private WeakReference f17380f;
private com.clevertap.android.sdk.i f17381g;
private InterfaceC1358f f17382h = null;
private t f17383i;
class a implements View.OnClickListener {
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 i7, CTInboxMessage cTInboxMessage, Bundle bundle, HashMap hashMap, int i8);
}
private String M() {
return this.f17379e.h() + ":CT_INBOX_LIST_VIEW_FRAGMENT";
}
void K(Bundle bundle, int i7, CTInboxMessage cTInboxMessage, HashMap hashMap, int i8) {
b N6 = N();
if (N6 != null) {
N6.b(this, i7, cTInboxMessage, bundle, hashMap, i8);
}
}
void L(Bundle bundle, CTInboxMessage cTInboxMessage) {
r.r("CTInboxActivity:didShow() called with: data = [" + bundle + "], inboxMessage = [" + cTInboxMessage.g() + "]");
b N6 = N();
if (N6 != null) {
N6.a(this, cTInboxMessage, bundle);
}
}
b N() {
b bVar;
try {
bVar = (b) this.f17380f.get();
} catch (Throwable unused) {
bVar = null;
}
if (bVar == null) {
this.f17379e.z().b(this.f17379e.h(), "InboxActivityListener is null for notification inbox ");
}
return bVar;
}
void O(b bVar) {
this.f17380f = new WeakReference(bVar);
}
@Override
public void c(Context context, CTInboxMessage cTInboxMessage, Bundle bundle) {
r.r("CTInboxActivity:messageDidShow() called with: data = [" + bundle + "], inboxMessage = [" + cTInboxMessage.g() + "]");
L(bundle, cTInboxMessage);
}
@Override
public void e(Context context, int i7, CTInboxMessage cTInboxMessage, Bundle bundle, HashMap hashMap, int i8) {
K(bundle, i7, cTInboxMessage, hashMap, i8);
}
@Override
public void j(boolean z6) {
t tVar = this.f17383i;
if (tVar != null) {
tVar.g(this, z6);
}
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
Bundle extras = getIntent().getExtras();
if (extras == null) {
throw new IllegalArgumentException();
}
this.f17376b = (CTInboxStyleConfig) extras.getParcelable("styleConfig");
Bundle bundle2 = extras.getBundle("configBundle");
if (bundle2 != null) {
this.f17379e = (CleverTapInstanceConfig) bundle2.getParcelable("config");
}
com.clevertap.android.sdk.i a12 = com.clevertap.android.sdk.i.a1(getApplicationContext(), this.f17379e);
this.f17381g = a12;
if (a12 != null) {
O(a12);
this.f17383i = new t(this.f17379e, this.f17381g.p0().f().q());
}
f17374j = getResources().getConfiguration().orientation;
setContentView(G0.f21938l);
this.f17381g.p0().i().K(this);
Toolbar toolbar = (Toolbar) findViewById(F0.f21852I0);
toolbar.setTitle(this.f17376b.f());
toolbar.setTitleTextColor(Color.parseColor(this.f17376b.g()));
toolbar.setBackgroundColor(Color.parseColor(this.f17376b.e()));
Drawable f7 = androidx.core.content.res.h.f(getResources(), E0.f21820b, null);
if (f7 != null) {
f7.setColorFilter(Color.parseColor(this.f17376b.a()), PorterDuff.Mode.SRC_IN);
}
toolbar.setNavigationIcon(f7);
toolbar.setNavigationContentDescription(getString(H0.f21953c));
toolbar.setNavigationOnClickListener(new a());
LinearLayout linearLayout = (LinearLayout) findViewById(F0.f21887h0);
linearLayout.setBackgroundColor(Color.parseColor(this.f17376b.c()));
this.f17377c = linearLayout.findViewById(F0.f21848G0);
this.f17378d = (ViewPager) linearLayout.findViewById(F0.f21856K0);
TextView textView = (TextView) findViewById(F0.f21921y0);
Bundle bundle3 = new Bundle();
bundle3.putParcelable("config", this.f17379e);
bundle3.putParcelable("styleConfig", this.f17376b);
int i7 = 0;
if (!this.f17376b.r()) {
this.f17378d.setVisibility(8);
this.f17377c.setVisibility(8);
com.clevertap.android.sdk.i iVar = this.f17381g;
if (iVar != null && iVar.C0() == 0) {
textView.setBackgroundColor(Color.parseColor(this.f17376b.c()));
textView.setVisibility(0);
textView.setText(this.f17376b.h());
textView.setTextColor(Color.parseColor(this.f17376b.l()));
return;
}
((FrameLayout) findViewById(F0.f21905q0)).setVisibility(0);
textView.setVisibility(8);
for (Fragment fragment : getSupportFragmentManager().v0()) {
if (fragment.getTag() != null && !fragment.getTag().equalsIgnoreCase(M())) {
i7 = 1;
}
}
if (i7 == 0) {
Fragment gVar = new g();
gVar.setArguments(bundle3);
getSupportFragmentManager().p().c(F0.f21905q0, gVar, M()).h();
return;
}
return;
}
this.f17378d.setVisibility(0);
ArrayList p7 = this.f17376b.p();
this.f17375a = new j(getSupportFragmentManager(), p7.size() + 1);
this.f17377c.setVisibility(0);
this.f17377c.setTabGravity(0);
this.f17377c.setTabMode(1);
this.f17377c.setSelectedTabIndicatorColor(Color.parseColor(this.f17376b.n()));
this.f17377c.N(Color.parseColor(this.f17376b.q()), Color.parseColor(this.f17376b.m()));
this.f17377c.setBackgroundColor(Color.parseColor(this.f17376b.o()));
Bundle bundle4 = (Bundle) bundle3.clone();
bundle4.putInt("position", 0);
g gVar2 = new g();
gVar2.setArguments(bundle4);
this.f17375a.w(gVar2, this.f17376b.b(), 0);
while (i7 < p7.size()) {
String str = (String) p7.get(i7);
i7++;
Bundle bundle5 = (Bundle) bundle3.clone();
bundle5.putInt("position", i7);
bundle5.putString("filter", str);
g gVar3 = new g();
gVar3.setArguments(bundle5);
this.f17375a.w(gVar3, str, i7);
this.f17378d.setOffscreenPageLimit(i7);
}
this.f17378d.setAdapter(this.f17375a);
this.f17375a.j();
this.f17378d.c(new TabLayout.h(this.f17377c));
this.f17377c.setupWithViewPager(this.f17378d);
} catch (Throwable th) {
r.u("Cannot find a valid notification inbox bundle to show!", th);
}
}
@Override
protected void onDestroy() {
this.f17381g.p0().i().K(null);
if (this.f17376b.r()) {
for (Fragment fragment : getSupportFragmentManager().v0()) {
if (fragment instanceof g) {
r.r("Removing fragment - " + fragment.toString());
getSupportFragmentManager().v0().remove(fragment);
}
}
}
super.onDestroy();
}
@Override
public void onRequestPermissionsResult(int i7, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i7, strArr, iArr);
t tVar = this.f17383i;
if (tVar != null) {
tVar.f(this, i7, iArr);
}
}
@Override
protected void onResume() {
super.onResume();
t tVar = this.f17383i;
if (tVar != null) {
tVar.e(this);
}
}
}