Skip to content

Instantly share code, notes, and snippets.

@andreymusth
Created July 19, 2021 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreymusth/e3681cf9438c8eed7fe0195bae0cbb09 to your computer and use it in GitHub Desktop.
Save andreymusth/e3681cf9438c8eed7fe0195bae0cbb09 to your computer and use it in GitHub Desktop.
modifier update
override var modifier: Modifier = Modifier
set(value) {
if (value == field) return
...
field = value
...
// Create a new chain of LayoutNodeWrappers, reusing existing ones from wrappers
// when possible.
val outerWrapper = modifier.foldOut(innerLayoutNodeWrapper) { mod, toWrap ->
var wrapper = toWrap
...
if (mod is PointerInputModifier) {
wrapper = PointerInputDelegatingWrapper(wrapper, mod).assignChained(toWrap)
}
...
}
wrapper
}
outerWrapper.wrappedBy = parent?.innerLayoutNodeWrapper
outerMeasurablePlaceable.outerWrapper = outerWrapper
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment