Skip to content

Multi–property update

zed-alpha edited this page Sep 18, 2026 · 2 revisions

Package: com.zedalpha.shadowgadgets.view


Helper functions for modifying multiple library shadow properties simultaneously.


View.updateShadow

(docs)

public fun View.updateShadow(block: View.() -> Unit)

An update function that takes a lambda in which multiple shadow properties can be modified while minimizing the internal operations that the library must perform. This is especially useful in recycling Adapters that modify multiple shadow properties.

This function should always be used where applicable whenever setting ShadowGadgets.throwOnUnhandledErrors to true, in order to avoid ShadowExceptions from invalid intermediate states.


View.resetShadow

(docs)

public fun View.resetShadow()

A convenience that resets all the properties of a target's library shadow, effectively disabling it and restoring the native, presumably broken draw. Mainly meant for testing and debugging.


Demo links

The demo app uses updateShadow() in the ViewRootTopic class.

Clone this wiki locally