28 lines
880 B
Java
28 lines
880 B
Java
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) : "";
|
|
}
|
|
}
|