Thread
#compose
    Alex

    Alex

    1 year ago
    Is there a way to prevent the parent composables padding to clip the shadow of the child-composables?
    e.g. to prevent this:
    Filip Wiesner

    Filip Wiesner

    1 year ago
    I think that all top-level scroll componets clip children. In this example I would remove the padding of parent and set it on children
    Alex

    Alex

    1 year ago
    So every child needs to set the padding separately? This seems to be really un-DRY though?
    Oh wow, I just found out that it's all about the ordering of the modifier
    This clips:
    Modifier
    .padding(horizontal = 24.dp)
    .verticalScroll(rememberScrollState())
    This does not clip:
    Modifier
    .verticalScroll(rememberScrollState())
    .padding(horizontal = 24.dp)
    Interesting (TM)
    Filip Wiesner

    Filip Wiesner

    1 year ago
    Oh! You are not using "top-level scroll componet" then 😄 Yeah, this makes sense...
    Alex

    Alex

    1 year ago
    I am using a
    Column
    and enable the scroll and padding on that component via the modifier.. is this the wrong way to go about things? 😄
    Filip Wiesner

    Filip Wiesner

    1 year ago
    If there will more than those few children like on the pic than yes. You should use
    LazyColumn
    Alex

    Alex

    1 year ago
    Yeah this is what I gathered from the available info. From my understanding it's the same as
    RecyclerView
    vs
    ScrollView
    right?
    ScrollView
    has its uses too, so if the lists are short and not too dynamic I would use a
    Column
    with
    scrollModifier
    . Is this the right way to do it though?
    Filip Wiesner

    Filip Wiesner

    1 year ago
    Exactly. But I personally would just use
    LazyColumn
    for everything scrollable since it's not that much harder. But for small lists you can certainly use
    Column
    with scroll modifier if that's what you prefer.