This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotificationBuilder( | |
context: Context | |
) : ResourcedBuilder by context() { | |
var contentText: CharSequence? by optional { contentTextRes } | |
@StringRes var contentTextRes: Int? = null | |
var title: CharSequence by required { titleRes } | |
@get:StringRes var titleRes: Int? = null | |
@get:DrawableRes var smallIconRes: Int by required() | |
internal fun build(): Notification { | |
return builder | |
.setContentTitle( title ) | |
.apply { contentText?.let { setContentText( it ) } } | |
... | |
.build() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment