104 lines
5 KiB
Java
104 lines
5 KiB
Java
package com.discord.widgets.home;
|
|
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import c.d.b.a.a;
|
|
import com.discord.app.AppDialog;
|
|
import com.discord.databinding.ViewDialogConfirmationBinding;
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.google.android.material.button.MaterialButton;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: WidgetMainSurveyDialog.kt */
|
|
public final class WidgetMainSurveyDialog extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.W(WidgetMainSurveyDialog.class, "binding", "getBinding()Lcom/discord/databinding/ViewDialogConfirmationBinding;", 0)};
|
|
public static final Companion Companion = new Companion(null);
|
|
private static final String EXTRA_SURVEY_BODY = "extra_survey_body";
|
|
private static final String EXTRA_SURVEY_ID = "extra_survey_id";
|
|
private static final String EXTRA_SURVEY_TITLE = "extra_survey_title";
|
|
private static final String EXTRA_SURVEY_URL = "extra_survey_url";
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetMainSurveyDialog$binding$2.INSTANCE, null, 2, null);
|
|
|
|
/* compiled from: WidgetMainSurveyDialog.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final void show(FragmentManager fragmentManager, String str, String str2, String str3, String str4) {
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(str, "surveyId");
|
|
m.checkNotNullParameter(str2, "surveyUrl");
|
|
m.checkNotNullParameter(str3, "surveyBody");
|
|
m.checkNotNullParameter(str4, "surveyTitle");
|
|
WidgetMainSurveyDialog widgetMainSurveyDialog = new WidgetMainSurveyDialog();
|
|
Bundle bundle = new Bundle();
|
|
bundle.putString("extra_survey_id", str);
|
|
bundle.putString("extra_survey_url", str2);
|
|
bundle.putString("extra_survey_body", str3);
|
|
bundle.putString("extra_survey_title", str4);
|
|
widgetMainSurveyDialog.setArguments(bundle);
|
|
widgetMainSurveyDialog.show(fragmentManager, "WidgetMainSurveyDialog");
|
|
}
|
|
}
|
|
|
|
public WidgetMainSurveyDialog() {
|
|
super(2131558746);
|
|
}
|
|
|
|
private final ViewDialogConfirmationBinding getBinding() {
|
|
return (ViewDialogConfirmationBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
}
|
|
|
|
@Override // com.discord.app.AppDialog
|
|
public void onViewBound(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
Bundle arguments = getArguments();
|
|
String str = null;
|
|
String string = arguments != null ? arguments.getString("extra_survey_url") : null;
|
|
Bundle arguments2 = getArguments();
|
|
String string2 = arguments2 != null ? arguments2.getString("extra_survey_body") : null;
|
|
Bundle arguments3 = getArguments();
|
|
String string3 = arguments3 != null ? arguments3.getString("extra_survey_id") : null;
|
|
Bundle arguments4 = getArguments();
|
|
if (arguments4 != null) {
|
|
str = arguments4.getString("extra_survey_title");
|
|
}
|
|
boolean z2 = false;
|
|
if (!(string == null || string.length() == 0)) {
|
|
if (string3 == null || string3.length() == 0) {
|
|
z2 = true;
|
|
}
|
|
if (!z2) {
|
|
TextView textView = getBinding().d;
|
|
m.checkNotNullExpressionValue(textView, "binding.viewDialogConfirmationHeader");
|
|
textView.setText(str);
|
|
TextView textView2 = getBinding().e;
|
|
m.checkNotNullExpressionValue(textView2, "binding.viewDialogConfirmationText");
|
|
textView2.setText(string2);
|
|
MaterialButton materialButton = getBinding().b;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.viewDialogConfirmationCancel");
|
|
materialButton.setText(getString(2131891566));
|
|
getBinding().b.setOnClickListener(new WidgetMainSurveyDialog$onViewBound$1(this));
|
|
MaterialButton materialButton2 = getBinding().f1652c;
|
|
m.checkNotNullExpressionValue(materialButton2, "binding.viewDialogConfirmationConfirm");
|
|
materialButton2.setText(getString(2131891807));
|
|
getBinding().f1652c.setOnClickListener(new WidgetMainSurveyDialog$onViewBound$2(this, string));
|
|
AnalyticsTracker.INSTANCE.surveyViewed(string3);
|
|
return;
|
|
}
|
|
}
|
|
dismiss();
|
|
}
|
|
}
|