what-the-bank/sources/o/fLY.java

28 lines
880 B
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.text.InputFilter;
import android.text.Spanned;
/* loaded from: classes5.dex */
public final class fLY implements InputFilter {
private final int c;
public fLY(boolean z) {
this.c = z ? 15 : 13;
}
@Override // android.text.InputFilter
public final CharSequence filter(CharSequence charSequence, int i, int i2, Spanned spanned, int i3, int i4) {
StringBuilder sb = new StringBuilder(spanned);
sb.replace(i3, i4, charSequence.subSequence(i, i2).toString());
String obj = sb.toString();
StringBuilder sb2 = new StringBuilder("(([0-9]{1})([0-9\\,]{0,");
sb2.append(this.c - 1);
sb2.append("})?)?(\\.[0-9]{0,4})?");
if (obj.matches(sb2.toString())) {
return null;
}
return charSequence.length() == 0 ? spanned.subSequence(i3, i4) : "";
}
}