Releases: skydoves/Bundler
Releases · skydoves/Bundler
1.0.4
🎉 Released a new version 1.0.4
! 🎉
What's New?
- Added
bundleValue
for retrieving intent & arguments extra values immediately from Activity and Fragment.
bundleValue
,bundleNonNullValue
,bundleArrayValue
,bundleArrayListValue
.
val id = bundleValue("id", 100L)
val name = bundleValue("name", "")
val poster = bundleValue<Poster>("poster")
- Now
observeBundle
emits data only a single time to a single observer. We can observe only once using one observer. And the observer will be unregistered from theLiveData
after observing data at once.
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
}
1.0.2
🎉 Released a new version 1.0.2
! 🎉
What's New?
- Add an infix
eq
method to add extras without need of+
(#2) - Fix type miss matching for the
CharSequence
. (d491110) - Make initialize lazily with an unsafe lazy mode to bundle expressions. (7a3021f)
- Added
ActivityBundler
andFragmentBundler
for creating an instance of theBundler
and initializing the extras data & arguments.