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 andParcelablevalues in aBundle. Usage:var Bundle.isSigningOut by bundleDelegate(false)b.
by intentExtras: Delegates to the extras in anIntentBundle. Usage:var Intent.isSigningOut by intentDelegate(false)c.
by activityIntent: Delegates to the extras in theActivityIntentBundle. Usage:var Intent.isSigningOut by intentDelegate(false)d.
by fragmentArgs<T>``: Delegates to the argumentsBundleof theFragment` so that it survives process death. Usage:class MyFragment { private var userId: String by fragmentArgs() } -
FragmentViewBindingdelegate: Read only. Delegates to the lazy evaluation of the typedViewBindingby invokingrequireView()on theFragment. The delegate will throw if theFragmentview has not been created or has been destroyed . It is also lifecycle aware, cleaning up after itself when theFragmentViewis 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