Reputation: 129
I have an edit text in android studio, and I want to get a value for hours, minutes, and seconds from the user. How can I start with the edit text saying 00:00:00
, and have the user input numbers, but leave the :'s intact?
I'd rather not ask the user to enter the semicolons themselves
Upvotes: 1
Views: 2238
Reputation: 22945
You can use MaskedEditText
build.gradle
dependencies {
compile 'com.vicmikhailau:MaskedEditText:2.0.3'
}
add in xml
<com.vicmikhailau.maskededittext.MaskedEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:mask="your_mask" />
Upvotes: 1