250 lines
13 KiB
Java
250 lines
13 KiB
Java
package c.a.a;
|
|
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.widget.CompoundButton;
|
|
import android.widget.ImageView;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import c.a.i.u;
|
|
import com.discord.app.AppDialog;
|
|
import com.discord.dialogs.ImageUploadDialog;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
import com.discord.utilities.analytics.Traits;
|
|
import com.discord.utilities.rest.FileUploadAlertType;
|
|
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.switchmaterial.SwitchMaterial;
|
|
import d0.z.d.k;
|
|
import d0.z.d.m;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: ImageUploadFailedDialog.kt */
|
|
public final class b extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.W(b.class, "binding", "getBinding()Lcom/discord/databinding/ImageUploadFailedDialogBinding;", 0)};
|
|
public static final C0005b j = new C0005b(null);
|
|
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, c.i, null, 2, null);
|
|
public Function0<Unit> l;
|
|
|
|
/* compiled from: java-style lambda group */
|
|
public static final class a implements View.OnClickListener {
|
|
public final /* synthetic */ int i;
|
|
public final /* synthetic */ Object j;
|
|
|
|
public a(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) {
|
|
Function0<Unit> function0 = ((b) this.j).l;
|
|
if (function0 != null) {
|
|
function0.mo1invoke();
|
|
}
|
|
((b) this.j).dismiss();
|
|
} else if (i == 1) {
|
|
((b) this.j).dismiss();
|
|
} else if (i == 2) {
|
|
((b) this.j).dismiss();
|
|
} else if (i == 3) {
|
|
AnalyticsTracker.INSTANCE.premiumSettingsOpened(new Traits.Location(null, "File Upload Popout (w/ Compression)", null, null, null, 29, null));
|
|
WidgetSettingsPremium.Companion companion = WidgetSettingsPremium.Companion;
|
|
m.checkNotNullExpressionValue(view, "it");
|
|
Context context = view.getContext();
|
|
m.checkNotNullExpressionValue(context, "it.context");
|
|
WidgetSettingsPremium.Companion.launch$default(companion, context, null, null, 6, null);
|
|
((b) this.j).dismiss();
|
|
} else if (i == 4) {
|
|
KProperty[] kPropertyArr = b.i;
|
|
((b) this.j).g().f158c.toggle();
|
|
} else {
|
|
throw null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ImageUploadFailedDialog.kt */
|
|
/* renamed from: c.a.a.b$b reason: collision with other inner class name */
|
|
public static final class C0005b {
|
|
public C0005b(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
|
|
public final void a(FragmentManager fragmentManager, boolean z2, int i, float f, float f2, Function0<Unit> function0, int i2, boolean z3, boolean z4, boolean z5) {
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
float f3 = (float) 1048576;
|
|
StoreStream.Companion.getAnalytics().trackFileUploadAlertViewed(z2 ? FileUploadAlertType.OVER_MAX_SIZE : FileUploadAlertType.NITRO_UPSELL, i2, (int) (f * f3), (int) (f3 * f2), z3, z4, z2);
|
|
b bVar = new b();
|
|
bVar.l = function0;
|
|
Bundle bundle = new Bundle();
|
|
bundle.putBoolean("PARAM_IS_USER_PREMIUM", z2);
|
|
bundle.putBoolean("PARAM_CAN_COMPRESS", !z4 && !z5);
|
|
bundle.putInt("PARAM_MAX_FILE_SIZE_MB", i);
|
|
bVar.setArguments(bundle);
|
|
bVar.show(fragmentManager, ImageUploadDialog.class.getName());
|
|
}
|
|
}
|
|
|
|
/* compiled from: ImageUploadFailedDialog.kt */
|
|
public static final /* synthetic */ class c extends k implements Function1<View, u> {
|
|
public static final c i = new c();
|
|
|
|
public c() {
|
|
super(1, u.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/ImageUploadFailedDialogBinding;", 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 u invoke(View view) {
|
|
View view2 = view;
|
|
m.checkNotNullParameter(view2, "p1");
|
|
int i2 = 2131362501;
|
|
ImageView imageView = (ImageView) view2.findViewById(2131362501);
|
|
if (imageView != null) {
|
|
i2 = 2131363541;
|
|
MaterialButton materialButton = (MaterialButton) view2.findViewById(2131363541);
|
|
if (materialButton != null) {
|
|
i2 = 2131363542;
|
|
SwitchMaterial switchMaterial = (SwitchMaterial) view2.findViewById(2131363542);
|
|
if (switchMaterial != null) {
|
|
i2 = 2131363543;
|
|
RelativeLayout relativeLayout = (RelativeLayout) view2.findViewById(2131363543);
|
|
if (relativeLayout != null) {
|
|
i2 = 2131363544;
|
|
View findViewById = view2.findViewById(2131363544);
|
|
if (findViewById != null) {
|
|
i2 = 2131363545;
|
|
MaterialButton materialButton2 = (MaterialButton) view2.findViewById(2131363545);
|
|
if (materialButton2 != null) {
|
|
i2 = 2131363546;
|
|
RelativeLayout relativeLayout2 = (RelativeLayout) view2.findViewById(2131363546);
|
|
if (relativeLayout2 != null) {
|
|
i2 = 2131363547;
|
|
MaterialButton materialButton3 = (MaterialButton) view2.findViewById(2131363547);
|
|
if (materialButton3 != null) {
|
|
i2 = 2131363548;
|
|
MaterialButton materialButton4 = (MaterialButton) view2.findViewById(2131363548);
|
|
if (materialButton4 != null) {
|
|
i2 = 2131363549;
|
|
TextView textView = (TextView) view2.findViewById(2131363549);
|
|
if (textView != null) {
|
|
i2 = 2131364729;
|
|
TextView textView2 = (TextView) view2.findViewById(2131364729);
|
|
if (textView2 != null) {
|
|
i2 = 2131364730;
|
|
TextView textView3 = (TextView) view2.findViewById(2131364730);
|
|
if (textView3 != null) {
|
|
return new u((RelativeLayout) view2, imageView, materialButton, switchMaterial, relativeLayout, findViewById, materialButton2, relativeLayout2, materialButton3, materialButton4, textView, textView2, textView3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
|
|
}
|
|
}
|
|
|
|
/* compiled from: ImageUploadFailedDialog.kt */
|
|
public static final class d implements CompoundButton.OnCheckedChangeListener {
|
|
public static final d a = new d();
|
|
|
|
@Override // android.widget.CompoundButton.OnCheckedChangeListener
|
|
public final void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
|
|
StoreStream.Companion.getUserSettings().setIsAutoImageCompressionEnabled(z2);
|
|
}
|
|
}
|
|
|
|
public b() {
|
|
super(2131558525);
|
|
}
|
|
|
|
public final u g() {
|
|
return (u) this.k.getValue((Fragment) this, i[0]);
|
|
}
|
|
|
|
/* JADX DEBUG: Can't convert new array creation: APUT found in different block: 0x0169: APUT (r3v2 java.lang.Object[]), (0 ??[int, short, byte, char]), (r10v7 java.lang.CharSequence) */
|
|
/* JADX DEBUG: Can't convert new array creation: APUT found in different block: 0x0189: APUT (r3v1 java.lang.Object[]), (0 ??[int, short, byte, char]), (r10v4 java.lang.CharSequence) */
|
|
@Override // com.discord.app.AppDialog
|
|
public void onViewBound(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
int i2 = getArgumentsOrDefault().getInt("PARAM_MAX_FILE_SIZE_MB");
|
|
boolean z2 = getArgumentsOrDefault().getBoolean("PARAM_IS_USER_PREMIUM");
|
|
boolean z3 = this.l != null && getArgumentsOrDefault().getBoolean("PARAM_CAN_COMPRESS");
|
|
int i3 = 8;
|
|
int i4 = i2 != 8 ? i2 != 50 ? i2 != 100 ? i2 != 200 ? 0 : 2131888512 : 2131888511 : 2131888510 : 2131888513;
|
|
MaterialButton materialButton = g().i;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.imageUploadFailedSendCompress");
|
|
materialButton.setVisibility(z3 ? 0 : 8);
|
|
g().i.setOnClickListener(new a(0, this));
|
|
boolean z4 = z2 && !z3;
|
|
View view2 = g().e;
|
|
m.checkNotNullExpressionValue(view2, "binding.imageUploadFailedDivider");
|
|
boolean z5 = !z4;
|
|
view2.setVisibility(z5 ? 0 : 8);
|
|
MaterialButton materialButton2 = g().h;
|
|
m.checkNotNullExpressionValue(materialButton2, "binding.imageUploadFailedOkay");
|
|
materialButton2.setVisibility(z4 ? 0 : 8);
|
|
g().h.setOnClickListener(new a(1, this));
|
|
MaterialButton materialButton3 = g().b;
|
|
m.checkNotNullExpressionValue(materialButton3, "binding.imageUploadFailedCancel");
|
|
materialButton3.setVisibility(z5 ? 0 : 8);
|
|
g().b.setOnClickListener(new a(2, this));
|
|
RelativeLayout relativeLayout = g().g;
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.imageUploadFailedNitroWrapper");
|
|
relativeLayout.setVisibility(z2 ^ true ? 0 : 8);
|
|
g().f.setOnClickListener(new a(3, this));
|
|
RelativeLayout relativeLayout2 = g().d;
|
|
m.checkNotNullExpressionValue(relativeLayout2, "binding.imageUploadFaile…pressionSettingsContainer");
|
|
if (z3) {
|
|
i3 = 0;
|
|
}
|
|
relativeLayout2.setVisibility(i3);
|
|
g().d.setOnClickListener(new a(4, this));
|
|
SwitchMaterial switchMaterial = g().f158c;
|
|
m.checkNotNullExpressionValue(switchMaterial, "binding.imageUploadFaile…mpressionSettingsCheckbox");
|
|
switchMaterial.setChecked(StoreStream.Companion.getUserSettings().getIsAutoImageCompressionEnabled());
|
|
g().f158c.setOnCheckedChangeListener(d.a);
|
|
TextView textView = g().j;
|
|
m.checkNotNullExpressionValue(textView, "binding.imageUploadFailedText");
|
|
CharSequence charSequence = null;
|
|
if (z2 || !z3) {
|
|
Context context = getContext();
|
|
if (context != null) {
|
|
Object[] objArr = new Object[1];
|
|
Context context2 = getContext();
|
|
objArr[0] = context2 != null ? c.a.l.b.g(context2, i4, new Object[0], null, 4) : null;
|
|
charSequence = c.a.l.b.g(context, 2131894117, objArr, null, 4);
|
|
}
|
|
} else {
|
|
Context context3 = getContext();
|
|
if (context3 != null) {
|
|
Object[] objArr2 = new Object[1];
|
|
Context context4 = getContext();
|
|
objArr2[0] = context4 != null ? c.a.l.b.g(context4, i4, new Object[0], null, 4) : null;
|
|
charSequence = c.a.l.b.g(context3, 2131894118, objArr2, null, 4);
|
|
}
|
|
}
|
|
textView.setText(charSequence);
|
|
}
|
|
}
|