Kotlin-powered multiplatform-support solution to format strings using masks in easy way.
The key entity in whole project is Mask
@IncubatingMaskaradeAPI
interface Mask : Collection<Mask.Slot>, Parcelable, Serializable {
val hint : String
sealed class Slot : Parcelable, Serializable {
object Digit : Slot()
object Letter : Slot()
data class Hardcoded(val symbol: Char) : Slot()
}
}
Obtain mask with provided factory functions:
@IncubatingMaskaradeAPI
fun Mask(block : MaskBuilder.() -> Unit): Mask
@IncubatingMaskaradeAPI
fun Mask(stringRepresentation: String): Mask
@IncubatingMaskaradeAPI
fun Mask(fromSingleChar: Char): Mask
@IncubatingMaskaradeAPI
fun Mask(slot: Mask.Slot): Mask
@IncubatingMaskaradeAPI
fun Mask(slots: Iterable<Mask.Slot>): Mask
java.io.Serializable | Android, JVM |
---|---|
android.os.Parcelable | Android |
maskarade-core | API level 14 |
---|---|
maskarade-compose | API level 21 |