so we will have to wait for compose team for this ...
# compose
s
so we will have to wait for compose team for this effect in jetpack compose? https://developer.android.com/about/versions/12/overscroll
c
"Support Overscroll effect" is in the public roadmap. https://developer.android.com/jetpack/androidx/compose-roadmap
❤️ 2
👍 2
s
Also, IIRC, the plan is to hook into the system's overscroll APIs and use those. So you'd get the gray indicator thingy on Android 11 and below, and the “rubber band” effect on 12 and onwards.
a
Yep. If you don't want to wait for us, have a look at the Android
EdgeEffect
API and combine it with drawing modifiers' native Canvas interop plus Compose's nested scrolling capabilities. Should be able to express the effect as a modifier.
👍 2
EdgeEffect
is the entry point for both the glow on older platforms and Android 12's new effect
EdgeEffectCompat
in Jetpack exposes conditional access to some of the newer methods from Android 12 that provide additional fine-grained control over the stretch (though it'll still stretch if you use the older API surfaces too)