List with views stacked on top of each other - android

You usually traverse a list by scrolling through the views that are placed one after another. What I'm trying to achieve is similar, but the views would be stacked on top of each other. The views will also cover the whole screen. So when you scroll, the top view slides away (or uses some other transition animation), but the bottom one is not moving underneath. You can imagine that the views are like the papers in a top spiral-bound notebook.
So my question is - does something similar already exist? I haven't been able to found anything so I might need to make a custom implementation. Oh and the views will each contain an image and there might be quite a few of them, so it will need to handle that (I was thinking of using Android Universal Image Loader). Thanks.

Sounds like you want to use Depth page transformer, via http://developer.android.com/training/animation/screen-slide.html#pagetransformer

Related

Is it possible to make a two slider MotionLayout in Android?

Problem: I'm trying to make a sliding view similar to the first example on this examples page but instead of one slider I want two or more sliders. Is that possible to do in one scene with ConstraintsLayout 2.0.2 or do I need to make multiple scenes with a single slider in each?
I have looked at multiple examples on multiple sites but I can't find anything that shows two items being animated independently of each other. The closest thing I have found is the example on the link provided labeled Multi-State which is located at the bottom of the list.
No. MotionLayout has a single value "progress" which moves from 0 to 1.
You can have 2 motionlayouts in another layout and each is a slider.

Split activity with adjustable children height

I am trying to create an activity layout with two parts, where their respective size is dynamic. The activity should have two states:
Starting state:
The user scrolls the bottom part up to the second state (and back):
It's important that the change will be animated. I tried a few solutions so far but didn't manage to find the exact way to do that:
AndroidSlidingUpPanel - The panel acts as another layout, covering the upper view and moving the toolbar out of the screen.
Android Split Pane Layout - Correct behavior, but the splitter is dragged and not the bottom part (I don't want to have a visible splitter).
CoordinatorLayout with CollapsingToolbarLayout - I didn't find a way to limit the upper part from totally disappearing. Anyway I think that it's a bit abusing because I don't want to collapse a toolbar but just change the children's height with animation.
Is there a good way to implement this using another library, one of these that I perhaps didn't use correctly or with simple layouts? Thanks!
I found a custom version of the SlidingPaneLayout created by VLC, which is basically a vertical SlidingPaneLayout - the exact functionality that I was looking for.

What's the difference between HorizontalScrollView & ViewPager?

I'm new programming in Android and i have many doubts about what type of classes can i use in my first app.
I want to do a level menu like cut the rope or angry birds. Only a title and a slider menu.
I think that can do with the two classes, but I'm not sure which is better, can you tell me the difference and which is better to use?
Many thanks.
ViewPager allows you to flip between pages of data (between views). You supply an adapter to generate the pages that the view shows.
But HorizontalScrollView is a container for other views that you can scrolled through, allowing it to be larger than the physical display.
I would go with horizontal scroll view.
EDIT : See FoamyGuy's answer in Angry Birds like scrolling menu where he exactly explains how to achieve such effect.

What is the best way to slide/switch between views ? (Custom Launcher)

I Build a Custom Launcher.
The launcher is made of views (each view will contain applications, images etc..)
The user can switch between those views in the home screen (almost like in every other laucncher)
the big difference is that in the launcher i build, when the user is in a specific view, he should be able to see the edges of the prev and/or the next view (if those are exist)
I tried to implement it by having a Horizontal Linear layout that holds the views.
It performs pretty nice, but not smooth enough.
I Concidered using viewflipper, but the problem with it, is that i can't see the prev and the next view.. (am i right?)
How should i implement this system?
thanks
Try to use ViewPager (android.support.v4.view.ViewPager). You need to download this .jar file to use it. http://developer.android.com/sdk/compatibility-library.html
Gallery already does this. It has issues with the smoothness and predictability of the left/right scrolling, but it will easily show your central view and the edges of the two neighboring views.

Right way to do scrollable view of custom buttons?

I've just started playing with Android in the last few days and have begun to put together a simple application. I am struggling to work out whether I'm doing things the "right" way or just making life difficult for myself.
The app displays a series of connected nodes on the screen, similar to a mind-map. I want to be able to tap the nodes in order to edit them. When the map of nodes becomes larger than the screen, I need to be able to scroll on both X and Y axes as needed to see the whole map. Image of current implementation at http://ubergeek.org.uk/images/nodetest.png.
Currently I don't have scrolling working, however I assume that I can do that by making the root view a ScrollView and sticking an AbsoluteLayout inside that (though it's deprecated, I wish to place objects at specific X/Y coordinates).
The nodes themselves are currently each a pair of roundrects (one for the outline and one for the fill) and a drawText and are being drawn in the main activity's onDraw(). In order to make these clickable buttons I believe I need to create a custom view for the button in order to use its onClick() events. I can then create a view object for each of my nodes and add them to the AbsoluteLayout view.
Does this sound like a reasonable way to do it in Android, or is this a horrible abuse of the API? :)
Thanks!
Nope, that sounds about right. You just need to make sure that the view contained by the ScrollView has the right dimensions so the scrollbars will show up right, but I'm sure you got that covered.
It's certainly a bit non-standard, but I'm tempted to say that your approach will work right... I'd even go so far as to say that it's not a hack. Please keep us posted on how it works out, and if anything breaks!
(Btw, the SDK mentions that you should write your own layout instead of using AbsoluteLayout. Personally, I'd say use the AbsoluteLayout.)

Categories

Resources