workflow-kotlin icon indicating copy to clipboard operation
workflow-kotlin copied to clipboard

Provide a mechanism for LayoutRunners to track changes to particular rendering values between update passes

Open zach-klippenstein opened this issue 4 years ago • 2 comments
trafficstars

Expensive view configuration often only needs to be performed when a value coming in from the rendering or the view environment changes. Sometimes these values need to be remembered across config changes or process death. Custom Views and Compose both have mechanisms for doing this, but LayoutRunner does not. Until we can deprecate LayoutRunner, we should provide some way to do this.

zach-klippenstein avatar Jan 05 '21 22:01 zach-klippenstein

One particular use case for this is tracking events that are send from the workflow to the view by changing IDs, e.g. for showing toasts. The event ID needs to be tracked across config changes so the toast isn't re-shown on every rotation.

zach-klippenstein avatar Jan 05 '21 22:01 zach-klippenstein

Not a ui-1.0 blocker, if we ever bother. It's not hard to hack this by adding an invisible TextView with an id -- shockingly robust, actually.

rjrjr avatar Apr 15 '22 21:04 rjrjr