Article about how kotlin makes development smooth ...
# android
n
p
You should write it more like a dsl
Its quite error prone like it is now:
Copy code
context: Context,
    themeId: Int,
    onPositiveClick: () -> Unit = {},
    onNegativeClick: () -> Unit = {},
    onNeutralClick: () -> Unit = {},
    messageStringId: Int,
    titleId: Int = -1,
    cancelable: Boolean = false,
    positiveButtonTextId: Int,
    negativeButtonTextId: Int = -1,
    showNegativeButton: Boolean = false,
    showNeutralButton: Boolean = false,
    neutralButtonTextId: Int = -1
You can set onNegativeClick and negativeButtonTextId but forget set showNegativeButton etc
s
@Paul Woitaschek what’s good example of converting something like that into DSL which you said in your first comment ?
n
thanks for you r feedback @Paul Woitaschek