-
Notifications
You must be signed in to change notification settings - Fork 18
DSL
Alexander Zhirkevich edited this page Sep 5, 2022
·
1 revision
QrOptions
can be created using DSL build function:
inline fun createQrOptions(
width: Int,
height: Int = width,
padding: Float = .125f,
crossinline build : QrOptionsBuilderScope.() -> Unit
)
With the following builder scope:
sealed interface QrOptionsBuilderScope {
var shape : QrShape
val padding : Float
val width : Int
val height : Int
var errorCorrectionLevel : QrErrorCorrectionLevel
fun offset(block : QrOffsetBuilderScope.() -> Unit)
fun logo(block : QrLogoBuilderScope.() -> Unit)
fun background(block: QrBackgroundBuilderScope.() -> Unit)
fun colors(block : QrColorsBuilderScope.() -> Unit)
fun shapes(block : QrElementsShapesBuilderScope.() -> Unit)
}
All child scopes have the same properties as equivalent Qr...
analogue