amar_1995

    amar_1995

    2 years ago
    I am implementing
    BottomSheet
    using
    BottomDrawerLayout
    but in doc it written that bottomDrawer is only used with bottom app bars. So, Is it okay to make bottomSheet using BottomDrawerLayout ?
    matvei

    matvei

    2 years ago
    I think BottomSheet will exist like a separate component. We don't have it now though. The idea is pretty similar to BottomDrawerLayout, so you can try. If you have any questions, or, more importantly, feedback -- hit me up 🙂
    amar_1995

    amar_1995

    2 years ago
    I tried making
    BottomSheet
    with
    BottomDrawerLayout
    but when ever I click on blank space bottomsheet closes. I want that it will only close by clicking cancel or save button.
    I kept
    gestureEnabled
    false
    matvei

    matvei

    2 years ago
    I think you can try passing empty lambda to
    onStateChange
    amar_1995

    amar_1995

    2 years ago
    But then how to change the state when cancel or save button is click ?
    Cancel and save button will be inside my bottomSheet drawer. So, I only want to change the state when cancel and save button clicked.
    matvei

    matvei

    2 years ago
    By changing the state directly
    amar_1995

    amar_1995

    2 years ago
    Thanks, It is working.
    @matvei Is there anyway to resize the
    BottomDrawerLayout
    as
    Persistant
    or
    Modal
    bottomsheet or is there anyway to expand it to whole screen ?
    Or is there anyway to make a new
    activity
    with custom size in compose ?
    matvei

    matvei

    2 years ago
    I'm not sure I understand the question, sorry. You want to open BottomSheet fullscreen instead of half of the screen right away?
    I don't think we do anything special about Activities in compose, so second question is just pure Android activity question 🙂
    amar_1995

    amar_1995

    2 years ago
    My first question is there anyway to resize the
    BottomDrawerLayout
    matvei

    matvei

    2 years ago
    The layout itself of just the sheet that is sliding from the bottom?
    amar_1995

    amar_1995

    2 years ago
    Yes, the layout itself
    I want to resize
    drawerContent
    of BottomDrawer
    matvei

    matvei

    2 years ago
    I think it's forced to have surface that will take whole screen's width. That what material design says. What's your use case?
    amar_1995

    amar_1995

    2 years ago
    I want to resize height
    For example, drawerContent show up. Let say it will occupied half-screen. Then user drag the drawerContent and now it will takes full-screen.
    matvei

    matvei

    2 years ago
    That's what it does right now, doesn't it?
    amar_1995

    amar_1995

    2 years ago
    I think we can't able to drag up the drawerContent to full-screen. When we change the state of
    drawerState
    to opened DrawerContent shows up and it will have a fixed height
    matvei

    matvei

    2 years ago
    Hm. I just checked it in my simple demo from BottomDrawerLayout sample. When you change drawerState to DrawerState.Open in open on half the screen, and then user can drag it and expand as full screen, and then close it or drag back to half. Is it not working for you?
    amar_1995

    amar_1995

    2 years ago
    Okay keeping gestureEnable true will allow it expand in full screen. But I want drawer open only when any click(trigger) occurs and then it will be dragged to full screen.
    matvei

    matvei

    2 years ago
    I think you can use
    gestureEnabled
    to achieve this behavior