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.
Related
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
I'm trying to develop something that has a similar concept to how Netflix is currently working on Android... But I need help with ideas for the implementation... Here is what I am trying to accomplish:
Naturally this screams to me:
ExpandableListView where the Category Names are the Groups and the movies in each category are the children. Now here is where it gets tricky; Netflix is currently using a paging theme for scrolling horizontally; and there is a little bit of a preview of the next page of movies (starred and outlined in yellow).
What do you think is a good way to code this?
I currently just have an ExpandableListView and each child is a horizontal scrollview with a linear layout; and I just add each "movie" to the linear layout inside the horizontal scrollview.. however I'd like to do something that reuses cells / is more efficient on system memory.
I'd like to use a ViewPager for each of the children and use a FragmentStatePagerAdapter as the adapter. Now here are my problems:
1) In this case the movies fill the screen proportionally; I will not know the width of the screen so how can I adjust the elements in the page so that it could look as nice as Netflix does
2) How can I setup a preview for the next page?
3) Should I be worried about the ExpandableListView stealing focus from the ViewPager children?
Am I thinking about this right or should I try something entirely different to Accomplish this?
Thanks for all of your help!
here are my findings from using uianimatorviewer as per request: #MinceMan
Currently I'm developing a small app for my parents' business. I'm trying to create a custom menu. I'd like to have something similar to this:
If you look at it, the screen is divided in two sections. The upper section is just an image and the lower section is the menu. I'd like to achieve this:
If the user places his finger over an item of the menu and swipes to the right, all the items move one position right, and the opposite if the user swipes left.
I'm quite new in this field and I'm not looking for a piece of code. I just want some tips on what to search because I don't know even where to start.
Thanks a lot!
By what I understood, ViewPager should be able to solve your problem. You hsve it nested in your layout under the main image. Have a look here: http://developer.android.com/training/animation/screen-slide.html
Suppose I have a ListView displaying exactly 10 rows that is not intended to scroll.
When the user swipes, the next list of 10 rows would be displayed. The bottom of the ListView would say something like "page 2 of 3".
How can I indicate to users that they should swipe to get the next page?
A page indicator might be helpful like you said. I view-pager may be another option. In that case I would use: http://viewpagerindicator.com/
I think you are best off rolling your own solution using a ScrollView and/or a ViewPager
According to a GoogleIO presentation about ListViews, they are coded with many "behind-the-scenes" tricks in order to optimize performance.
When you start trying to modify how they work, then you end up with a complex widget that doesn't make use of its own complexity and optimizations.
Some type of vertical view pager could be good for what you see though.
Reference: http://www.youtube.com/watch?v=wDBM6wVEO70
For my next application, I'd like a ListView to form part of the app. Specifically, I'd like it to be the top half of the screen. Having looked through the documentation, I've only been able to find full screen list views, ie with the list taking up the full screen.
Is there any way of doing ListViews differently? I know there must be, but I'm unsure how to implement them myself. Does anyone have any pointers?
Just put the ListView in a container, like a LinearLayout or RelativeLayout, along with peer widgets. Like you see here.