Delegates include:
-
Bundle delegates: Read/write. Similar to the standard library
by map()
, this delegate takes an arbitrary type maps it to a bundle, and reads and writes properties via that bundle.a.
by bundleDelegate
: Delegates to the primitive andParcelable
values in aBundle
. Usage:var Bundle.isSigningOut by bundleDelegate(false)
b.
by intentExtras
: Delegates to the extras in anIntent
Bundle
. Usage:var Intent.isSigningOut by intentDelegate(false)
c.
by activityIntent
: Delegates to the extras in theActivity
Intent
Bundle
. Usage:var Intent.isSigningOut by intentDelegate(false)
d.
by fragmentArgs<T>``: Delegates to the arguments
Bundleof the
Fragment` so that it survives process death. Usage:class MyFragment { private var userId: String by fragmentArgs() }
-
Fragment
ViewBinding
delegate: Read only. Delegates to the lazy evaluation of the typedViewBinding
by invokingrequireView()
on theFragment
. The delegate will throw if theFragment
view has not been created or has been destroyed . It is also lifecycle aware, cleaning up after itself when theFragment
View
is destroyed. Usage:class AFragment { private val binding by viewLifecycle(AFragmentBinding::bind) }
A convenience API for interacting with Bound Services in Android, removing a lot of the boilerplate involved with the added benefit of generic typing.
Extensions to cover ContextCompat methods
Extensions for CharSequence styling with spans items.
Extensions to cover Drawable methods