forked from Juby210/discord-jadx
93 lines
4.5 KiB
Java
93 lines
4.5 KiB
Java
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.j;
|
|
import c.a.k.b;
|
|
import c.d.b.a.a;
|
|
import c0.z.d.m;
|
|
import com.discord.R;
|
|
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 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.Z(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");
|
|
j.e(context, WidgetTosAccept.class, null, 4);
|
|
}
|
|
}
|
|
|
|
public WidgetTosAccept() {
|
|
super(R.layout.widget_tos_accept);
|
|
}
|
|
|
|
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");
|
|
b.n(linkifiedTextView, R.string.terms_of_service_url, new Object[0], null, 4);
|
|
LinkifiedTextView linkifiedTextView2 = getBinding().d;
|
|
m.checkNotNullExpressionValue(linkifiedTextView2, "binding.alertTosPrivacyPolicy");
|
|
b.n(linkifiedTextView2, R.string.privacy_policy_url, new Object[0], null, 4);
|
|
getBinding().b.setOnCheckedChangeListener(new WidgetTosAccept$configureUI$1(this));
|
|
MaterialButton materialButton = getBinding().f2472c;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.alertTosAckContinue");
|
|
CheckBox checkBox = getBinding().b;
|
|
m.checkNotNullExpressionValue(checkBox, "binding.alertTosAck");
|
|
materialButton.setEnabled(checkBox.isChecked());
|
|
getBinding().f2472c.setOnClickListener(new WidgetTosAccept$configureUI$2(this));
|
|
}
|
|
}
|
|
|
|
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, R.menu.menu_settings_logout, 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);
|
|
}
|
|
}
|