1.0.3
🎉 Released a new version 1.0.3
! 🎉
What's New?
- Added new expressions
bundleNonNull
andobserveBundle
.
bundleNonNull
The bundle
expression for initializing objects (e.g. Bundle, CharSequence, Parcelable, Serializable, Arrays), the property type must be null-able. But If we want to initialize them non-nullable type, we can initialize them to non-nullable type using the bundleNonNull
expression.
- val poster: Poster? by bundle("poster")
+ val poster: Poster by bundleNotNull("poster")
observeBundle
We can observe the bundle data as LiveData using the observeBundle
expression.
If there are no extra & arguments in the Activity or Fragment, null
will be passed to the observers.
private val id: LiveData<Long> by observeBundle("id", -1L)
private val poster: LiveData<Poster> by observeBundle("poster")
id.observe(this) {
vm.id = it
}
poster.observe(this) {
binding.name = it.name
}