2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.tos;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import c.a.d.l;
|
|
|
|
import c.a.l.b;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.discord.app.AppFragment;
|
|
|
|
import com.discord.databinding.WidgetTosAcceptBinding;
|
|
|
|
import com.discord.models.requiredaction.RequiredAction;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import com.discord.utilities.view.text.LinkifiedTextView;
|
|
|
|
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.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
/* compiled from: WidgetTosAccept.kt */
|
|
|
|
public final class WidgetTosAccept extends AppFragment {
|
|
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.W(WidgetTosAccept.class, "binding", "getBinding()Lcom/discord/databinding/WidgetTosAcceptBinding;", 0)};
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, WidgetTosAccept$binding$2.INSTANCE, null, 2, null);
|
|
|
|
|
|
|
|
/* compiled from: WidgetTosAccept.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void show(Context context) {
|
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
l.e(context, WidgetTosAccept.class, null, 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetTosAccept() {
|
2021-07-13 20:23:20 +00:00
|
|
|
super(2131559276);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$configureUI(WidgetTosAccept widgetTosAccept, RequiredAction requiredAction) {
|
|
|
|
widgetTosAccept.configureUI(requiredAction);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ WidgetTosAcceptBinding access$getBinding$p(WidgetTosAccept widgetTosAccept) {
|
|
|
|
return widgetTosAccept.getBinding();
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void configureUI(RequiredAction requiredAction) {
|
|
|
|
if (requiredAction == RequiredAction.AGREEMENTS) {
|
|
|
|
LinkifiedTextView linkifiedTextView = getBinding().e;
|
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView, "binding.alertTosTermsOfService");
|
2021-07-13 20:23:20 +00:00
|
|
|
b.m(linkifiedTextView, 2131894013, new Object[0], null, 4);
|
2021-06-27 20:44:35 +00:00
|
|
|
LinkifiedTextView linkifiedTextView2 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(linkifiedTextView2, "binding.alertTosPrivacyPolicy");
|
2021-07-13 20:23:20 +00:00
|
|
|
b.m(linkifiedTextView2, 2131892531, new Object[0], null, 4);
|
2021-06-27 20:44:35 +00:00
|
|
|
getBinding().b.setOnCheckedChangeListener(new WidgetTosAccept$configureUI$1(this));
|
2021-07-13 20:23:20 +00:00
|
|
|
MaterialButton materialButton = getBinding().f1992c;
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(materialButton, "binding.alertTosAckContinue");
|
|
|
|
CheckBox checkBox = getBinding().b;
|
|
|
|
m.checkNotNullExpressionValue(checkBox, "binding.alertTosAck");
|
|
|
|
materialButton.setEnabled(checkBox.isChecked());
|
2021-07-13 20:23:20 +00:00
|
|
|
getBinding().f1992c.setOnClickListener(new WidgetTosAccept$configureUI$2(this));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private final WidgetTosAcceptBinding getBinding() {
|
|
|
|
return (WidgetTosAcceptBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[0]);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
|
|
public void onViewBound(View view) {
|
|
|
|
m.checkNotNullParameter(view, "view");
|
|
|
|
super.onViewBound(view);
|
|
|
|
AppFragment.setOnBackPressed$default(this, WidgetTosAccept$onViewBound$1.INSTANCE, 0, 2, null);
|
|
|
|
AppFragment.setActionBarOptionsMenu$default(this, 2131623963, WidgetTosAccept$onViewBound$2.INSTANCE, null, 4, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppFragment
|
|
|
|
public void onViewBoundOrOnResume() {
|
|
|
|
super.onViewBoundOrOnResume();
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(StoreStream.Companion.getUserRequiredActions().observeUserRequiredAction(), this, null, 2, null), WidgetTosAccept.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new WidgetTosAccept$onViewBoundOrOnResume$1(this), 62, (Object) null);
|
|
|
|
}
|
|
|
|
}
|