discord-jadx/app/src/main/java/c/a/a/a/a.java

456 lines
20 KiB
Java

package c.a.a.a;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.DrawableRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import c.a.i.z0;
import c.a.i.z4;
import com.discord.app.AppDialog;
import com.discord.app.AppFragment;
import com.discord.utilities.analytics.AnalyticsTracker;
import com.discord.utilities.analytics.Traits;
import com.discord.utilities.view.recycler.ViewPager2ExtensionsKt;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
import com.discord.widgets.settings.premium.WidgetSettingsPremium;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.tabs.TabLayout;
import d0.t.n;
import d0.t.u;
import d0.z.d.k;
import d0.z.d.m;
import java.util.List;
import java.util.Objects;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.reflect.KProperty;
/* compiled from: PremiumUpsellDialog.kt */
public final class a extends AppDialog {
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.W(a.class, "binding", "getBinding()Lcom/discord/databinding/PremiumUpsellDialogBinding;", 0)};
public static final b j = new b(null);
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, f.i, null, 2, null);
public e l;
/* compiled from: java-style lambda group */
/* renamed from: c.a.a.a.a$a reason: collision with other inner class name */
public static final class View$OnClickListenerC0001a implements View.OnClickListener {
public final /* synthetic */ int i;
public final /* synthetic */ Object j;
public View$OnClickListenerC0001a(int i, Object obj) {
this.i = i;
this.j = obj;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
int i = this.i;
if (i == 0) {
((a) this.j).dismiss();
} else if (i == 1) {
a.g((a) this.j);
} else if (i == 2) {
a.g((a) this.j);
} else {
throw null;
}
}
}
/* compiled from: PremiumUpsellDialog.kt */
public static final class b {
public b(DefaultConstructorMarker defaultConstructorMarker) {
}
public static void a(b bVar, FragmentManager fragmentManager, int i, String str, String str2, String str3, String str4, String str5, String str6, boolean z2, boolean z3, int i2) {
if ((i2 & 4) != 0) {
str = null;
}
if ((i2 & 8) != 0) {
str2 = null;
}
if ((i2 & 16) != 0) {
str3 = null;
}
if ((i2 & 32) != 0) {
str4 = null;
}
if ((i2 & 64) != 0) {
str5 = null;
}
if ((i2 & 128) != 0) {
str6 = null;
}
if ((i2 & 256) != 0) {
z2 = true;
}
if ((i2 & 512) != 0) {
z3 = true;
}
Objects.requireNonNull(bVar);
m.checkNotNullParameter(fragmentManager, "fragmentManager");
a aVar = new a();
Bundle bundle = new Bundle();
bundle.putInt("extra_page_number", i);
if (str != null) {
bundle.putString("extra_header_string", str);
}
if (str2 != null) {
bundle.putString("extra_body_text", str2);
}
bundle.putString("extra_page_name", str3);
bundle.putString("extra_section_name", str4);
bundle.putString("extra_object_name", str5);
bundle.putString("extra_object_type", str6);
bundle.putBoolean("extra_show_other_pages", z2);
bundle.putBoolean("extra_show_learn_more", z3);
aVar.setArguments(bundle);
aVar.show(fragmentManager, a.class.getName());
}
}
/* compiled from: PremiumUpsellDialog.kt */
public static final class c {
public final int a;
public CharSequence b;
/* renamed from: c reason: collision with root package name */
public CharSequence f32c;
public c(@DrawableRes int i, CharSequence charSequence, CharSequence charSequence2) {
m.checkNotNullParameter(charSequence, "headerText");
m.checkNotNullParameter(charSequence2, "bodyText");
this.a = i;
this.b = charSequence;
this.f32c = charSequence2;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof c)) {
return false;
}
c cVar = (c) obj;
return this.a == cVar.a && m.areEqual(this.b, cVar.b) && m.areEqual(this.f32c, cVar.f32c);
}
public int hashCode() {
int i = this.a * 31;
CharSequence charSequence = this.b;
int i2 = 0;
int hashCode = (i + (charSequence != null ? charSequence.hashCode() : 0)) * 31;
CharSequence charSequence2 = this.f32c;
if (charSequence2 != null) {
i2 = charSequence2.hashCode();
}
return hashCode + i2;
}
public String toString() {
StringBuilder L = c.d.b.a.a.L("UpsellData(imageResId=");
L.append(this.a);
L.append(", headerText=");
L.append(this.b);
L.append(", bodyText=");
L.append(this.f32c);
L.append(")");
return L.toString();
}
}
/* compiled from: PremiumUpsellDialog.kt */
public static final class d extends AppFragment {
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.W(d.class, "binding", "getBinding()Lcom/discord/databinding/WidgetPremiumUpsellBinding;", 0)};
public static final C0002a j = new C0002a(null);
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, b.i, null, 2, null);
/* compiled from: PremiumUpsellDialog.kt */
/* renamed from: c.a.a.a.a$d$a reason: collision with other inner class name */
public static final class C0002a {
public C0002a(DefaultConstructorMarker defaultConstructorMarker) {
}
}
/* compiled from: PremiumUpsellDialog.kt */
public static final /* synthetic */ class b extends k implements Function1<View, z4> {
public static final b i = new b();
public b() {
super(1, z4.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetPremiumUpsellBinding;", 0);
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public z4 invoke(View view) {
View view2 = view;
m.checkNotNullParameter(view2, "p1");
int i2 = 2131364321;
TextView textView = (TextView) view2.findViewById(2131364321);
if (textView != null) {
i2 = 2131364328;
TextView textView2 = (TextView) view2.findViewById(2131364328);
if (textView2 != null) {
i2 = 2131364329;
ImageView imageView = (ImageView) view2.findViewById(2131364329);
if (imageView != null) {
return new z4((LinearLayout) view2, textView, textView2, imageView);
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
}
}
public d() {
super(2131559110);
}
public final z4 g() {
return (z4) this.k.getValue((Fragment) this, i[0]);
}
@Override // com.discord.app.AppFragment
public void onViewBoundOrOnResume() {
String string;
super.onViewBoundOrOnResume();
ImageView imageView = g().d;
Bundle arguments = getArguments();
imageView.setImageResource(arguments != null ? arguments.getInt("extra_image_id") : 0);
TextView textView = g().f189c;
m.checkNotNullExpressionValue(textView, "binding.premiumUpsellHeader");
Bundle arguments2 = getArguments();
textView.setText(arguments2 != null ? arguments2.getString("extra_header_string") : null);
TextView textView2 = g().b;
m.checkNotNullExpressionValue(textView2, "binding.premiumUpsellBody");
Bundle arguments3 = getArguments();
textView2.setText((arguments3 == null || (string = arguments3.getString("extra_body_text")) == null) ? "" : c.a.l.b.k(string, new Object[0], null, 2));
}
}
/* compiled from: PremiumUpsellDialog.kt */
public static final class e extends FragmentStateAdapter {
public final List<c> a;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public e(Fragment fragment, List<c> list) {
super(fragment);
m.checkNotNullParameter(fragment, "fragment");
m.checkNotNullParameter(list, "pages");
this.a = list;
}
@Override // androidx.viewpager2.adapter.FragmentStateAdapter
public Fragment createFragment(int i) {
c cVar = this.a.get(i);
d.C0002a aVar = d.j;
int i2 = cVar.a;
CharSequence charSequence = cVar.b;
CharSequence charSequence2 = cVar.f32c;
Objects.requireNonNull(aVar);
m.checkNotNullParameter(charSequence, "headerText");
m.checkNotNullParameter(charSequence2, "bodyText");
Bundle bundle = new Bundle();
bundle.putInt("extra_image_id", i2);
bundle.putString("extra_header_string", charSequence.toString());
bundle.putString("extra_body_text", charSequence2.toString());
d dVar = new d();
dVar.setArguments(bundle);
return dVar;
}
@Override // androidx.recyclerview.widget.RecyclerView.Adapter
public int getItemCount() {
return this.a.size();
}
}
/* compiled from: PremiumUpsellDialog.kt */
public static final /* synthetic */ class f extends k implements Function1<View, z0> {
public static final f i = new f();
public f() {
super(1, z0.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/PremiumUpsellDialogBinding;", 0);
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public z0 invoke(View view) {
View view2 = view;
m.checkNotNullParameter(view2, "p1");
int i2 = 2131364322;
LinearLayout linearLayout = (LinearLayout) view2.findViewById(2131364322);
if (linearLayout != null) {
i2 = 2131364323;
MaterialButton materialButton = (MaterialButton) view2.findViewById(2131364323);
if (materialButton != null) {
i2 = 2131364325;
View findViewById = view2.findViewById(2131364325);
if (findViewById != null) {
i2 = 2131364326;
TabLayout tabLayout = (TabLayout) view2.findViewById(2131364326);
if (tabLayout != null) {
i2 = 2131364327;
MaterialButton materialButton2 = (MaterialButton) view2.findViewById(2131364327);
if (materialButton2 != null) {
i2 = 2131364330;
MaterialButton materialButton3 = (MaterialButton) view2.findViewById(2131364330);
if (materialButton3 != null) {
i2 = 2131364332;
ViewPager2 viewPager2 = (ViewPager2) view2.findViewById(2131364332);
if (viewPager2 != null) {
return new z0((RelativeLayout) view2, linearLayout, materialButton, findViewById, tabLayout, materialButton2, materialButton3, viewPager2);
}
}
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
}
}
public a() {
super(2131558643);
}
public static final void g(a aVar) {
Bundle arguments = aVar.getArguments();
String string = arguments != null ? arguments.getString("extra_page_name") : null;
Bundle arguments2 = aVar.getArguments();
String string2 = arguments2 != null ? arguments2.getString("extra_section_name") : null;
Bundle arguments3 = aVar.getArguments();
String string3 = arguments3 != null ? arguments3.getString("extra_object_name") : null;
Bundle arguments4 = aVar.getArguments();
AnalyticsTracker.INSTANCE.premiumSettingsOpened(new Traits.Location(string, string2, string3, arguments4 != null ? arguments4.getString("extra_object_type") : null, null, 16, null));
WidgetSettingsPremium.Companion companion = WidgetSettingsPremium.Companion;
Context requireContext = aVar.requireContext();
m.checkNotNullExpressionValue(requireContext, "requireContext()");
WidgetSettingsPremium.Companion.launch$default(companion, requireContext, null, null, 6, null);
aVar.dismiss();
}
public final z0 h() {
return (z0) this.k.getValue((Fragment) this, i[0]);
}
public final boolean i() {
Bundle arguments = getArguments();
return arguments != null && arguments.getBoolean("extra_show_learn_more");
}
public final boolean j() {
Bundle arguments = getArguments();
return arguments != null && arguments.getBoolean("extra_show_other_pages");
}
@Override // androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onCreate(Bundle bundle) {
String string;
String str;
super.onCreate(bundle);
AppDialog.hideKeyboard$default(this, null, 1, null);
String string2 = getString(2131892349);
m.checkNotNullExpressionValue(string2, "getString(R.string.premi…psell_tag_passive_mobile)");
String string3 = getString(2131892348);
m.checkNotNullExpressionValue(string3, "getString(R.string.premi…l_tag_description_mobile)");
String string4 = getString(2131892338);
m.checkNotNullExpressionValue(string4, "getString(R.string.premi…ell_emoji_passive_mobile)");
String string5 = getString(2131892335);
m.checkNotNullExpressionValue(string5, "getString(R.string.premi…emoji_description_mobile)");
String string6 = getString(2131892328);
m.checkNotNullExpressionValue(string6, "getString(R.string.premi…ed_emojis_passive_mobile)");
String string7 = getString(2131892327);
m.checkNotNullExpressionValue(string7, "getString(R.string.premi…mojis_description_mobile)");
CharSequence j2 = c.a.l.b.j(this, 2131892353, new Object[0], null, 4);
Object[] objArr = {c.a.l.b.j(this, 2131888513, new Object[0], null, 4), c.a.l.b.j(this, 2131888511, new Object[0], null, 4)};
String string8 = getString(2131892323);
m.checkNotNullExpressionValue(string8, "getString(R.string.premi…ed_avatar_passive_mobile)");
String string9 = getString(2131892322);
m.checkNotNullExpressionValue(string9, "getString(R.string.premi…vatar_description_mobile)");
String string10 = getString(2131892331);
m.checkNotNullExpressionValue(string10, "getString(R.string.premi…ell_badge_passive_mobile)");
String string11 = getString(2131892330);
m.checkNotNullExpressionValue(string11, "getString(R.string.premi…badge_description_mobile)");
List listOf = n.listOf((Object[]) new c[]{new c(2131232239, string2, string3), new c(2131232155, string4, string5), new c(2131232107, string6, string7), new c(2131232240, j2, c.a.l.b.j(this, 2131892352, objArr, null, 4)), new c(2131232110, string8, string9), new c(2131232113, string10, string11)});
Bundle arguments = getArguments();
int i2 = arguments != null ? arguments.getInt("extra_page_number") : 0;
Bundle arguments2 = getArguments();
String str2 = "";
if (arguments2 != null && arguments2.containsKey("extra_header_string")) {
c cVar = (c) listOf.get(i2);
Bundle arguments3 = getArguments();
if (arguments3 == null || (str = arguments3.getString("extra_header_string")) == null) {
str = str2;
}
Objects.requireNonNull(cVar);
m.checkNotNullParameter(str, "<set-?>");
cVar.b = str;
}
Bundle arguments4 = getArguments();
if (arguments4 != null && arguments4.containsKey("extra_body_text")) {
c cVar2 = (c) listOf.get(i2);
Bundle arguments5 = getArguments();
if (!(arguments5 == null || (string = arguments5.getString("extra_body_text")) == null)) {
str2 = string;
}
Objects.requireNonNull(cVar2);
m.checkNotNullParameter(str2, "<set-?>");
cVar2.f32c = str2;
}
c cVar3 = (c) listOf.get(i2);
List mutableListOf = n.mutableListOf(cVar3);
if (j()) {
mutableListOf.addAll(u.minus(listOf, cVar3));
}
this.l = new e(this, mutableListOf);
}
@Override // com.discord.app.AppDialog
public void onViewBound(View view) {
m.checkNotNullParameter(view, "view");
super.onViewBound(view);
ViewPager2 viewPager2 = h().f;
m.checkNotNullExpressionValue(viewPager2, "binding.premiumUpsellViewpager");
e eVar = this.l;
if (eVar == null) {
m.throwUninitializedPropertyAccessException("pagerAdapter");
}
viewPager2.setAdapter(eVar);
TabLayout tabLayout = h().f186c;
m.checkNotNullExpressionValue(tabLayout, "binding.premiumUpsellDots");
int i2 = 8;
tabLayout.setVisibility(j() ? 0 : 8);
TabLayout tabLayout2 = h().f186c;
m.checkNotNullExpressionValue(tabLayout2, "binding.premiumUpsellDots");
ViewPager2 viewPager22 = h().f;
m.checkNotNullExpressionValue(viewPager22, "binding.premiumUpsellViewpager");
ViewPager2ExtensionsKt.setUpWithViewPager2$default(tabLayout2, viewPager22, null, 2, null);
h().b.setOnClickListener(new View$OnClickListenerC0001a(0, this));
MaterialButton materialButton = h().e;
m.checkNotNullExpressionValue(materialButton, "binding.premiumUpsellLearnMore");
materialButton.setVisibility(i() ? 0 : 8);
h().e.setOnClickListener(new View$OnClickListenerC0001a(1, this));
MaterialButton materialButton2 = h().d;
m.checkNotNullExpressionValue(materialButton2, "binding.premiumUpsellGetPremium");
if (!i()) {
i2 = 0;
}
materialButton2.setVisibility(i2);
h().d.setOnClickListener(new View$OnClickListenerC0001a(2, this));
}
}