Just showing off :grin: This thingie I made recently. Custom `pointerInput` to convert drag gesture...
d
Just showing off 😁 This thingie I made recently. Custom
pointerInput
to convert drag gestures into "rotary" input with polar coordinates and custom layout which keeps rotating buttons "upright" (using
Modifier.rotate
wouldn't work here for them). I have made it using "slots": slot for "rotating base" and slot for "button", so it's customizable. Maybe one day turn it into a small lib.
👏🏽 2
👏🏼 2
👏 11
👏🏻 1
👏🏾 1
K 17
jetpack compose 14
🙌🏾 1
🙌 3
t
Are you planning to open source the code even if it's not exactly a library? I would be curious to take a look at the code 😄
d
I guess it wouldn't be too difficult to upload it to github. I'll post a link here whenever I do it :)
I would also like to add fling handling, currently there's none, but to make it look naturally would be perhaps rather complicated, this involves "physics of a solid rotating body under several forces" 🙂 Of course I could try faking by using fling velocity + some kind of spring/tween to imitate inertia, but it would be interesting to try a more "simulating real world" route.
c
Nice job! 🙂 I know how hard it can be to implement such Modifier, since I implemented basically the same thing in the good old View system. It has fling support, feel free to adopt the code if you feel like it could be of help https://github.com/szugyi/Android-CircleMenu
d
Oh, great, thanks, I will take a look!
c
🤯 The design looks super cool. Are you using images for that, or drawing all in compose?
d
Unfortunately that's a lot of images layered on top of each other. Designer went wild there. I wish I could do all this with compose, but although this looks almost like doable, it's mostly not. The main problem is using a lot of tricky gradients, especially gradients with blur and custom dash pattern and custom rotation. And also non-standard BlendModes some of which are supported only on recent API versions. But I still plan to revisit that and try as much as I could replace images with code-made gradients, some of them seem doable.
d
This looks like something built with Rive.
c
Ooh. Haven't heard of rive. We've mostly used Lottie for animations but this looks different