2021-07-24 02:37:17 +00:00
|
|
|
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;
|
2021-08-24 07:28:10 +00:00
|
|
|
import c.a.i.v;
|
2021-08-09 22:50:52 +00:00
|
|
|
import com.discord.R;
|
2021-07-24 02:37:17 +00:00
|
|
|
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;
|
2021-11-01 07:19:03 +00:00
|
|
|
import d0.z.d.k;
|
|
|
|
import d0.z.d.m;
|
2021-07-24 02:37:17 +00:00
|
|
|
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 a extends AppDialog {
|
2021-11-05 21:05:33 +00:00
|
|
|
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.b0(a.class, "binding", "getBinding()Lcom/discord/databinding/ImageUploadFailedDialogBinding;", 0)};
|
2021-07-24 02:37:17 +00:00
|
|
|
public static final b j = new b(null);
|
|
|
|
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, c.i, null, 2, null);
|
|
|
|
public Function0<Unit> l;
|
|
|
|
|
|
|
|
/* compiled from: java-style lambda group */
|
|
|
|
/* renamed from: c.a.a.a$a reason: collision with other inner class name */
|
2021-11-05 21:05:33 +00:00
|
|
|
public static final class View$OnClickListenerC0000a implements View.OnClickListener {
|
2021-07-24 02:37:17 +00:00
|
|
|
public final /* synthetic */ int i;
|
|
|
|
public final /* synthetic */ Object j;
|
|
|
|
|
2021-11-05 21:05:33 +00:00
|
|
|
public View$OnClickListenerC0000a(int i, Object obj) {
|
2021-07-24 02:37:17 +00:00
|
|
|
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 = ((a) this.j).l;
|
|
|
|
if (function0 != null) {
|
2021-11-01 07:19:03 +00:00
|
|
|
function0.mo1invoke();
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
((a) this.j).dismiss();
|
|
|
|
} else if (i == 1) {
|
|
|
|
((a) this.j).dismiss();
|
|
|
|
} else if (i == 2) {
|
|
|
|
((a) 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);
|
|
|
|
((a) this.j).dismiss();
|
|
|
|
} else if (i == 4) {
|
|
|
|
KProperty[] kPropertyArr = a.i;
|
2021-11-01 07:19:03 +00:00
|
|
|
((a) this.j).g().f173c.toggle();
|
2021-07-24 02:37:17 +00:00
|
|
|
} else {
|
|
|
|
throw null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: ImageUploadFailedDialog.kt */
|
|
|
|
public static final class b {
|
|
|
|
public b(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);
|
|
|
|
a aVar = new a();
|
|
|
|
aVar.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);
|
|
|
|
aVar.setArguments(bundle);
|
|
|
|
aVar.show(fragmentManager, ImageUploadDialog.class.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: ImageUploadFailedDialog.kt */
|
2021-08-24 07:28:10 +00:00
|
|
|
public static final /* synthetic */ class c extends k implements Function1<View, v> {
|
2021-07-24 02:37:17 +00:00
|
|
|
public static final c i = new c();
|
|
|
|
|
|
|
|
public c() {
|
2021-08-24 07:28:10 +00:00
|
|
|
super(1, v.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/ImageUploadFailedDialogBinding;", 0);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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
|
2021-08-24 07:28:10 +00:00
|
|
|
public v invoke(View view) {
|
2021-07-24 02:37:17 +00:00
|
|
|
View view2 = view;
|
|
|
|
m.checkNotNullParameter(view2, "p1");
|
2021-08-09 22:50:52 +00:00
|
|
|
int i2 = R.id.chat_input_upload_too_large_center_file;
|
|
|
|
ImageView imageView = (ImageView) view2.findViewById(R.id.chat_input_upload_too_large_center_file);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (imageView != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_cancel;
|
|
|
|
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.image_upload_failed_cancel);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialButton != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_compression_settings_checkbox;
|
|
|
|
SwitchMaterial switchMaterial = (SwitchMaterial) view2.findViewById(R.id.image_upload_failed_compression_settings_checkbox);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (switchMaterial != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_compression_settings_container;
|
|
|
|
RelativeLayout relativeLayout = (RelativeLayout) view2.findViewById(R.id.image_upload_failed_compression_settings_container);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (relativeLayout != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_divider;
|
|
|
|
View findViewById = view2.findViewById(R.id.image_upload_failed_divider);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (findViewById != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_nitro;
|
|
|
|
MaterialButton materialButton2 = (MaterialButton) view2.findViewById(R.id.image_upload_failed_nitro);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialButton2 != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_nitro_wrapper;
|
|
|
|
RelativeLayout relativeLayout2 = (RelativeLayout) view2.findViewById(R.id.image_upload_failed_nitro_wrapper);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (relativeLayout2 != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_okay;
|
|
|
|
MaterialButton materialButton3 = (MaterialButton) view2.findViewById(R.id.image_upload_failed_okay);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialButton3 != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_send_compress;
|
|
|
|
MaterialButton materialButton4 = (MaterialButton) view2.findViewById(R.id.image_upload_failed_send_compress);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (materialButton4 != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.image_upload_failed_text;
|
|
|
|
TextView textView = (TextView) view2.findViewById(R.id.image_upload_failed_text);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (textView != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.setting_label;
|
|
|
|
TextView textView2 = (TextView) view2.findViewById(R.id.setting_label);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (textView2 != null) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i2 = R.id.setting_subtext;
|
|
|
|
TextView textView3 = (TextView) view2.findViewById(R.id.setting_subtext);
|
2021-07-24 02:37:17 +00:00
|
|
|
if (textView3 != null) {
|
2021-08-24 07:28:10 +00:00
|
|
|
return new v((RelativeLayout) view2, imageView, materialButton, switchMaterial, relativeLayout, findViewById, materialButton2, relativeLayout2, materialButton3, materialButton4, textView, textView2, textView3);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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 a() {
|
2021-08-09 22:50:52 +00:00
|
|
|
super(R.layout.image_upload_failed_dialog);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2021-08-24 07:28:10 +00:00
|
|
|
public final v g() {
|
|
|
|
return (v) this.k.getValue((Fragment) this, i[0]);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2021-11-08 08:23:34 +00:00
|
|
|
/* JADX DEBUG: Can't convert new array creation: APUT found in different block: 0x0161: 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: 0x0181: APUT (r3v1 java.lang.Object[]), (0 ??[int, short, byte, char]), (r10v4 java.lang.CharSequence) */
|
2021-07-24 02:37:17 +00:00
|
|
|
@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;
|
2021-11-08 08:23:34 +00:00
|
|
|
int i4 = i2 != 8 ? i2 != 50 ? i2 != 100 ? 0 : R.string.file_upload_limit_premium_tier_2 : R.string.file_upload_limit_premium_tier_1 : R.string.file_upload_limit_standard;
|
2021-07-24 02:37:17 +00:00
|
|
|
MaterialButton materialButton = g().i;
|
|
|
|
m.checkNotNullExpressionValue(materialButton, "binding.imageUploadFailedSendCompress");
|
|
|
|
materialButton.setVisibility(z3 ? 0 : 8);
|
2021-11-05 21:05:33 +00:00
|
|
|
g().i.setOnClickListener(new View$OnClickListenerC0000a(0, this));
|
2021-07-24 02:37:17 +00:00
|
|
|
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);
|
2021-11-05 21:05:33 +00:00
|
|
|
g().h.setOnClickListener(new View$OnClickListenerC0000a(1, this));
|
2021-07-24 02:37:17 +00:00
|
|
|
MaterialButton materialButton3 = g().b;
|
|
|
|
m.checkNotNullExpressionValue(materialButton3, "binding.imageUploadFailedCancel");
|
|
|
|
materialButton3.setVisibility(z5 ? 0 : 8);
|
2021-11-05 21:05:33 +00:00
|
|
|
g().b.setOnClickListener(new View$OnClickListenerC0000a(2, this));
|
2021-07-24 02:37:17 +00:00
|
|
|
RelativeLayout relativeLayout = g().g;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout, "binding.imageUploadFailedNitroWrapper");
|
|
|
|
relativeLayout.setVisibility(z2 ^ true ? 0 : 8);
|
2021-11-05 21:05:33 +00:00
|
|
|
g().f.setOnClickListener(new View$OnClickListenerC0000a(3, this));
|
2021-07-24 02:37:17 +00:00
|
|
|
RelativeLayout relativeLayout2 = g().d;
|
|
|
|
m.checkNotNullExpressionValue(relativeLayout2, "binding.imageUploadFaile…pressionSettingsContainer");
|
|
|
|
if (z3) {
|
|
|
|
i3 = 0;
|
|
|
|
}
|
|
|
|
relativeLayout2.setVisibility(i3);
|
2021-11-05 21:05:33 +00:00
|
|
|
g().d.setOnClickListener(new View$OnClickListenerC0000a(4, this));
|
2021-11-01 07:19:03 +00:00
|
|
|
SwitchMaterial switchMaterial = g().f173c;
|
2021-07-24 02:37:17 +00:00
|
|
|
m.checkNotNullExpressionValue(switchMaterial, "binding.imageUploadFaile…mpressionSettingsCheckbox");
|
|
|
|
switchMaterial.setChecked(StoreStream.Companion.getUserSettings().getIsAutoImageCompressionEnabled());
|
2021-11-01 07:19:03 +00:00
|
|
|
g().f173c.setOnCheckedChangeListener(d.a);
|
2021-07-24 02:37:17 +00:00
|
|
|
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();
|
2021-08-18 07:29:27 +00:00
|
|
|
objArr[0] = context2 != null ? c.a.k.b.h(context2, i4, new Object[0], null, 4) : null;
|
|
|
|
charSequence = c.a.k.b.h(context, R.string.upload_area_too_large_help, objArr, null, 4);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
Context context3 = getContext();
|
|
|
|
if (context3 != null) {
|
|
|
|
Object[] objArr2 = new Object[1];
|
|
|
|
Context context4 = getContext();
|
2021-08-18 07:29:27 +00:00
|
|
|
objArr2[0] = context4 != null ? c.a.k.b.h(context4, i4, new Object[0], null, 4) : null;
|
|
|
|
charSequence = c.a.k.b.h(context3, R.string.upload_area_too_large_help_mobile, objArr2, null, 4);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
textView.setText(charSequence);
|
|
|
|
}
|
|
|
|
}
|