https://kotlinlang.org logo
#compose
Title
# compose
s

ste

03/02/2022, 6:05 PM
I was wondering why
Modifier.swipeable
is part of
compose-material
, is there a specific reason? (I mean, it may be useful to non material design users - it also doesn't depend on any MD specific item, of course)
e

Eric Chee

03/02/2022, 6:51 PM
My guess is that swipeable is a mobile pattern/Android. So from a foundation standpoint, only shared gestures or modifiers should be in the foundation. something like swipeable maybe wouldnt make sense in a Desktop Compose. vs Clickable, which is part of foudnation, is a platform agnostic gesture
j

jossiwolf

03/02/2022, 6:58 PM
Swipeable is opinionated - i.e. about resistance and (dynamic) thresholds. These are specific to the way motion works in Material. Swipeable was originally created for Material, and moving things into Foundation requires adapting the APIs to be generic and cover more use cases than just Material. Currently, Swipeable's API and design need another iteration though. After having a nice API, it would be quite nice to have a Foundation version. Do you have a use case where you don't want to depend on Material (say you're building your own design system) but still need Swipeable?
👍 3
Fwiw Swipeable isn't Android-specific🙂
e

Eric Chee

03/02/2022, 7:01 PM
Thanks for the insight Jossi
s

ste

03/02/2022, 7:05 PM
Do you have a use case where you don't want to depend on Material (say you're building your own design system) but still need Swipeable?
That's it, I'd like to use
swipeable
in my own
Drawer
(and probably many other components, in the future) - it would save a lot of lines of code
👍 1
j

jossiwolf

03/02/2022, 7:14 PM
@matvei loooook here are people to support our case!
j

Javier

03/02/2022, 10:06 PM
I am not depending on material so I have copied it
👍 2
m

mattinger

03/02/2022, 11:21 PM
why copy it? why not just bring in material and let the r8 take care of removing anything you’re not using? I always shy away from copying code personally unless i have to make modifications to it (an example being our switches, radiobuttons and checkboxes which can’t be produced according our internal design system with the existing functions)
j

Javier

03/02/2022, 11:53 PM
because I have a custom design system which doesnt expose any material component
m

matvei

03/03/2022, 11:36 AM
Good to know you all are waiting for this. WE have this feature filed for a while (https://issuetracker.google.com/issues/174241799) and I agree that it would be beneficial to have it in a separate module, even if it is under material module group (TBD). I don't have any updates on the work in this regard, but feel free to +1 the ticket to follow it
3 Views