Skip to content

1.0.3

Compare
Choose a tag to compare
@skydoves skydoves released this 30 Nov 15:56
· 28 commits to main since this release
19c7ed8

🎉 Released a new version 1.0.3! 🎉

What's New?

  • Added new expressions bundleNonNull and observeBundle.

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
}