Bundler
Android Intent & Bundle extensions that insert and retrieve values elegantly.
Including in your project
Gradle
Add below codes to your root build.gradle
file (not your module build.gradle file).
And add a dependency code to your module's build.gradle
file.
Usage
Intent
intentOf
is an expression for creating an Intent using Kotlin DSL style and we can put extras using the putExtra
method. Also, we can put extras using the +
keyword in front of a key/value pair.
StartActivity
We can start activities using the intentOf
expression like below.
We can also use other options for creating an intent.
bundle
bundle
is an expression for initializing lazily extra values from the intent.
We can initialize a Parcelable value with a defaut value.
Also, we can initialize type of Array and ArrayList using bundleArray
and bundleArrayList
expression.
Fragment
The below example shows setting arguments using the intentOf
expression.
We can initialize argument values lazily in Fragments using the bundle
expression like below.