I am using some CMP UI I had written for Android a...
# compose-desktop
t
I am using some CMP UI I had written for Android and iOS to JVM/Desktop. This includes a view where I have both horizontal and vertical scrolling. Since desktop does not appear to support dragging with mouse at all, I need to use mouse wheel for vertical scroll. And I expect to add arrows to do the horizontal scrolling. Question is: how can I detect I am in an environment that requires this scrolling via button versus scrolling with drag? Hope that makes sense. Thank you.
a
Desktop does support dragging with the mouse. There’s even a gesture recognizer for it. But there’s no scrolling on drag, since desktop typically doesn’t do that. You can just put your desktop code in a desktopMain source-set…
You can add an isDesktop expect/actual and set to true in the desktop source-set, or have different UI implementations (also via expect/actual) in different source sets.
t
Good idea, I will just make an isDesktop and then show/hide the UI elements I do or do not need. Thanks.