I am trying to disable comma character in the TextInputEditText
. I added two parameters to my XML file(digits and input type). But I'm still able to input commas from a keyboard.
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/price"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_10sdp"
android:layout_marginStart="@dimen/_20sdp"
android:layout_marginEnd="@dimen/_20sdp"
app:counterEnabled="true"
app:counterMaxLength="7"
app:errorEnabled="true"
app:hintTextColor="@android:color/holo_orange_dark"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/section_text">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/price_value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:digits="0123456789."
android:hint="@string/price_hint"
android:maxLength="7"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>