Android Question How to create a vertically stacked UI (example video)?

Inman

Well-Known Member
Licensed User
Longtime User
I am trying to create an Android app like inShorts. Please check the video below. Play the 3 seconds from 0:28 to 0:31. You can see the UI I am talking about.


As you can see, when the user swipes from bottom to top, the activity (or maybe a panel) moves from bottom to top and out of the screen. As the activity moves to the top, you can already see the next one below it. Swiping it up brings the next one. And this continues.

I wonder how this can be done. Is the entire activity going up or is it a panel? And how can the memory usage be restricted so that the app doesn't crash due to 100 panels stacked on top of each other?
 

Cableguy

Expert
Licensed User
Longtime User
I would say using panels, 5 of them, and circle through, preloading the 2 next and previous panel's content, while showing the "center" one
 
Upvote 0

Inman

Well-Known Member
Licensed User
Longtime User
Thanks man. I also thought about doing it with 2 panels but I guess 5 is safer.

Now how about the swipe gesture? The front panel moves with the finger while the panel behind slowly gets visible (probably varying transparency). But if the user lifts the finger, the panel drops down and falls to its original position, while the panel behind fades back.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
You can catch the touch even, and figure out in which direction the swipe has been done, or use the gesture lib
[Edit] i see you found that already
 
Upvote 0

walterf25

Expert
Licensed User
Longtime User
I am trying to create an Android app like inShorts. Please check the video below. Play the 3 seconds from 0:28 to 0:31. You can see the UI I am talking about.


As you can see, when the user swipes from bottom to top, the activity (or maybe a panel) moves from bottom to top and out of the screen. As the activity moves to the top, you can already see the next one below it. Swiping it up brings the next one. And this continues.

I wonder how this can be done. Is the entire activity going up or is it a panel? And how can the memory usage be restricted so that the app doesn't crash due to 100 panels stacked on top of each other?
Maybe not exactly what you're looking for, don't know if you know how to wrap a library but here is this project which I actually like better than the one on your video.

https://android-arsenal.com/details/3/4400

Cheers,
Walter
 
Upvote 0
Top