Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    EpsilonOrionis
    @EpsilonOrionis
    @hzsweers How to pass custom data in the bottomsheet?
    Zac Sweers
    @hzsweers
    You need to be more specific
    xzcdfg
    @xzcdfg
    how to expand sheet when bottomsheet have been called
    Zac Sweers
    @hzsweers
    You need to be more specific
    xzcdfg
    @xzcdfg
    View view = LayoutInflater.from(getApplication()).inflate(R.layout.menu_details, bottomSheetLayout, false);
    bottomSheetLayout.showWithSheetView(view);
    Zac Sweers
    @hzsweers
    That should open it to its peeked state, yes
    xzcdfg
    @xzcdfg
    In above code, i am calling the bottomsheetlayout, the bottomsheetlayout showing in certain height, but I like to show in full layout.
    Zac Sweers
    @hzsweers
    Use the expandSheet() method
    xzcdfg
    @xzcdfg
    I have tried, after calling the above code, then I have called bottomSheetLayout.expandSheet();
    Its not showing
    Zac Sweers
    @hzsweers
    Is your layout not tall enough to fill the screen?
    I.e. is it doing wrap_content
    If so, you need to specify match_parent layout params on the view before you show it
    xzcdfg
    @xzcdfg

    <?xml version="1.0" encoding="utf-8"?>

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="50dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingBottom="50dp" android:background="@color/background_material_dark">

    <Button android:id="@+id/btn_expand_me" android:layout_width="match_parent" android:layout_height="wrap_content" android:onClick="onClick" android:text="Expand this view"/>

    <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." android:layout_gravity="center_horizontal|bottom" android:textColor="@android:color/white"/>

    </FrameLayout>

    it is match parent only!. But after pressing the button, its showing in the expanded view, but I just like to show in first time itself
    Zac Sweers
    @hzsweers
    Do expandView() does work?
    And you just want to have it start in the expanded state?
    xzcdfg
    @xzcdfg
    yes!
    Zac Sweers
    @hzsweers
    Currently it always opens to peek first
    I had plans to modify this in the future to allow you to specify an initial state, but haven't worked on the project much since I don't use it at my new job
    For now what you can do is set the peek height to the height of the screen, then show the view, then set the state to expanded, then reset the peek height to its default. It's not ideal, but it would achieve the effect you're looking for
    xzcdfg
    @xzcdfg
    Okay! I will try it! Thank you for your help
    Yash Thakur
    @yashthakur1
    how to open this bottomsheet as fullscreen
    This message was deleted
    Jason Atwood
    @tir38
    Can I ask a question about bottomsheet when inflating a layout directly into showWithSheetView?
    divijsethi822348
    @divijsethi822348
    I want to begin learning about Bottom sheet
    can anyone help me out
    >
    ?*