简体   繁体   中英

How do I make a custom view stay in the screen

I need to create something similar as shown in the image, Need some help as I've already tried many things and I'm out of ideas. Can't post code, sorry about

Image URL: https://imgur.com/a/bF7BEhv

(1) Initial State (2) What I want, (even after revealing the recyclerview in the first view, the other views should stay in the screen) (3) what actually happens

Each view on click expands or reveals a recycler view inside it On expanding a view it shows a recycler view

Edit: This is how I tried the layout to look like(code us abstract not exact):

<ConstraintLayout>
  <CardLayout>
    <TextView/>
    <RecyclerView/>
  </CardLayout>
  <CardLayout>
    <TextView/>
    <RecyclerView/>
  </CardLayout>
  <CardLayout>
    <TextView/>
    <RecyclerView/>
  </CardLayout>
</ConstraintLayout>

If you want to use 3rd party library, you can do this with MultiLevel Expandable RecyclerView .

Add the following dependency in your build.gradle file in your app folder:

dependencies {
    implementation 'com.muditsen.multilevelrecyclerview:multilevelview:1.0.0'
}

Here is the detail description and documentation: https://github.com/muditsen/multilevelrecyclerview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM