-
Notifications
You must be signed in to change notification settings - Fork 68
/
MaskStyle.kt
32 lines (27 loc) · 741 Bytes
/
MaskStyle.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.santalu.maskara
/**
* Created by fatih.santalu on 7/7/2020.
*
* Defines the mask visibility and behavior of the cursor
*
* [NORMAL]
* Mask is never visible.
* Cursor is not limited.
*
* [COMPLETABLE]
* Mask becomes visible right after the user started typing until the user deleted everything.
* Cursor is not limited.
*
* [PERSISTENT]
* Mask becomes visible right after the user started typing and never becomes hidden.
* Cursor is limited between mask characters.
* Placeholders are not allowed to delete.
*/
enum class MaskStyle {
NORMAL,
COMPLETABLE,
PERSISTENT;
companion object {
fun valueOf(ordinal: Int): MaskStyle = values().find { it.ordinal == ordinal } ?: NORMAL
}
}