forked from Juby210/discord-jadx
82 lines
4.9 KiB
Java
82 lines
4.9 KiB
Java
package com.discord.widgets.auth;
|
|
|
|
import android.widget.CheckBox;
|
|
import c0.z.d.m;
|
|
import c0.z.d.o;
|
|
import com.discord.R;
|
|
import com.discord.utilities.auth.AuthUtils;
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
import com.discord.utilities.view.validators.BasicTextInputValidator;
|
|
import com.discord.utilities.view.validators.Input;
|
|
import com.discord.utilities.view.validators.InputValidator;
|
|
import com.discord.utilities.view.validators.ValidationManager;
|
|
import com.google.android.material.checkbox.MaterialCheckBox;
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function2;
|
|
/* compiled from: WidgetAuthRegisterAccountInformation.kt */
|
|
public final class WidgetAuthRegisterAccountInformation$validationManager$2 extends o implements Function0<ValidationManager> {
|
|
public final /* synthetic */ WidgetAuthRegisterAccountInformation this$0;
|
|
|
|
/* compiled from: WidgetAuthRegisterAccountInformation.kt */
|
|
/* renamed from: com.discord.widgets.auth.WidgetAuthRegisterAccountInformation$validationManager$2$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 implements InputValidator<CheckBox> {
|
|
public final /* synthetic */ WidgetAuthRegisterAccountInformation$validationManager$2 this$0;
|
|
|
|
public AnonymousClass1(WidgetAuthRegisterAccountInformation$validationManager$2 widgetAuthRegisterAccountInformation$validationManager$2) {
|
|
this.this$0 = widgetAuthRegisterAccountInformation$validationManager$2;
|
|
}
|
|
|
|
public CharSequence getErrorMessage(CheckBox checkBox) {
|
|
m.checkNotNullParameter(checkBox, "view");
|
|
if ((WidgetAuthRegisterAccountInformation.access$isConsentRequired$p(this.this$0.this$0) && checkBox.isChecked()) || !WidgetAuthRegisterAccountInformation.access$isConsentRequired$p(this.this$0.this$0)) {
|
|
return null;
|
|
}
|
|
return checkBox.getContext().getString(R.string.terms_privacy_opt_in_tooltip);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetAuthRegisterAccountInformation.kt */
|
|
/* renamed from: com.discord.widgets.auth.WidgetAuthRegisterAccountInformation$validationManager$2$2 reason: invalid class name */
|
|
public static final class AnonymousClass2 extends o implements Function2<MaterialCheckBox, CharSequence, Boolean> {
|
|
public static final AnonymousClass2 INSTANCE = new AnonymousClass2();
|
|
|
|
public AnonymousClass2() {
|
|
super(2);
|
|
}
|
|
|
|
/* 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, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public /* bridge */ /* synthetic */ Boolean invoke(MaterialCheckBox materialCheckBox, CharSequence charSequence) {
|
|
return Boolean.valueOf(invoke(materialCheckBox, charSequence));
|
|
}
|
|
|
|
public final boolean invoke(MaterialCheckBox materialCheckBox, CharSequence charSequence) {
|
|
m.checkNotNullParameter(materialCheckBox, "checkBox");
|
|
m.checkNotNullParameter(charSequence, "errorMessage");
|
|
c.a.d.m.h(materialCheckBox.getContext(), charSequence, 0, null, 12);
|
|
ViewExtensions.hintWithRipple$default(materialCheckBox, 0, 1, null);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetAuthRegisterAccountInformation$validationManager$2(WidgetAuthRegisterAccountInformation widgetAuthRegisterAccountInformation) {
|
|
super(0);
|
|
this.this$0 = widgetAuthRegisterAccountInformation;
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final ValidationManager mo17invoke() {
|
|
TextInputLayout textInputLayout = WidgetAuthRegisterAccountInformation.access$getBinding$p(this.this$0).e;
|
|
m.checkNotNullExpressionValue(textInputLayout, "binding.authRegisterAccountInformationUsernameWrap");
|
|
BasicTextInputValidator.Companion companion = BasicTextInputValidator.Companion;
|
|
InputValidator[] inputValidatorArr = {companion.createRequiredInputValidator(R.string.username_required)};
|
|
TextInputLayout textInputLayout2 = WidgetAuthRegisterAccountInformation.access$getBinding$p(this.this$0).d;
|
|
m.checkNotNullExpressionValue(textInputLayout2, "binding.authRegisterAccountInformationPasswordWrap");
|
|
return new ValidationManager(new Input.TextInputLayoutInput("username", textInputLayout, inputValidatorArr), new Input.TextInputLayoutInput("password", textInputLayout2, companion.createRequiredInputValidator(R.string.password_required), AuthUtils.INSTANCE.createPasswordInputValidator(R.string.password_length_error)), new Input.GenericInput("tos", WidgetAuthRegisterAccountInformation.access$getBinding$p(this.this$0).f, new AnonymousClass1(this), AnonymousClass2.INSTANCE));
|
|
}
|
|
}
|