2021-08-09 22:50:52 +00:00
|
|
|
package com.discord.utilities.auth;
|
|
|
|
|
2021-08-18 07:29:27 +00:00
|
|
|
import c.a.k.b;
|
2021-08-09 22:50:52 +00:00
|
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
|
|
import com.discord.utilities.view.validators.InputValidator;
|
|
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
|
|
import d0.g0.s;
|
|
|
|
import d0.z.d.m;
|
|
|
|
/* compiled from: AuthUtils.kt */
|
|
|
|
public final class AuthUtils$createDiscriminatorInputValidator$1 implements InputValidator<TextInputLayout> {
|
|
|
|
public final /* synthetic */ int $invalidFormatResId;
|
|
|
|
public final /* synthetic */ int $invalidValueResId;
|
|
|
|
|
|
|
|
public AuthUtils$createDiscriminatorInputValidator$1(int i, int i2) {
|
|
|
|
this.$invalidFormatResId = i;
|
|
|
|
this.$invalidValueResId = i2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public CharSequence getErrorMessage(TextInputLayout textInputLayout) {
|
|
|
|
m.checkNotNullParameter(textInputLayout, "view");
|
|
|
|
String textOrEmpty = ViewExtensions.getTextOrEmpty(textInputLayout);
|
|
|
|
Integer intOrNull = s.toIntOrNull(textOrEmpty);
|
|
|
|
if (intOrNull == null || textOrEmpty.length() != 4) {
|
|
|
|
return b.j(textInputLayout, this.$invalidFormatResId, new Object[0], null, 4);
|
|
|
|
}
|
|
|
|
if (intOrNull.intValue() <= 0) {
|
|
|
|
return b.j(textInputLayout, this.$invalidValueResId, new Object[0], null, 4);
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|