Alternative UI for Android ListView - android

Suppose I have a list of data to be displayed. I know how to display it using a ListView And it is very simple and easy to do it that way. But I am looking for an alternative way to achieve the same. I don't expect to have more than 20 items in the data set I am planning for.
I was thinking of a number of squares that the user can swipe to see the next one etc, similar to some widgets on home screen.
I came across android.widget.StackView, any advice available for this?

You can try StackView (http://developer.android.com/reference/android/widget/StackView.html).
This is how the Gallery and Youtube widgets are rendered.

ListView is the best option for listing lots of data. It has very efficient loading property. But if you do not want it any specific reason, you have to use ScrollView and in ScrollView, you have to place a LinearLayout and in that LinearLayout, you have to place multiple LinearLayout(for each items of data).

Maybe you can use a ViewPager (available also for lower versions of SDK through compatibility pack).
http://developer.android.com/training/implementing-navigation/lateral.html - see also the project example top right of the page : EffectiveNavigation.zip

You can use a GridView, if you want to show multiple items on a page in a different fashion than in ListView.
You can also use ViewPager (from android 3.0, or with the support library) with your custom views.

Related

Android view with many different layouts

I'm creating a home screen for an Android app. The homescreen will be a vertically scrolling list, containing many different elements.
These elements can be things such as a simple card list, a side scrolling carousel of items (ViewPager?) or just a basic WebView.
Is it possible to use a RecyclerView efficiently with multiple types of content (that can also have their own adapters). Or is there something else available that I may not be aware of?
The BBC news app is similar close to what I am trying to do.
A RecyclerView is actually designed to do such things, I don't think that you have any other choices right here, however this shouldn't cause you any problems I've tried something like this earlier last month and it worked perfectly for me
even tho i added multiple types of content, the only problem that i faced was with the ListView because i added some sort of animation to the content
but after i used a recyclerView everything worked fine but you also have to reconsider using a ViewPager inside a RecyclerView as an Item, it might cause you some problems as it should be used in conjunction with Fragment to allow users to flip left and right through pages of data which in most of the cases are tabs.
checkout the documentation.
And the BBC news app that you refer to in your question is using a RecyclerView inside a tab into a TabHost that uses ViewPager.
More Information About RecyclerView.
Good Example for RecyclerView Sample for RecyclerView

Facebook Android App News Feed Layout

I am trying to implement a vertical listview with horizontal scroll on each item just like the facebook newsfeed. Suggested apps can be seen by scrolling to right and some part of next item is also visible.
here is the screenshot :
http://i.stack.imgur.com/7JRfM.png
So I am just stuck here and don't know how to proceed.
You're probably going to need to write some custom code (which is a pretty good rule of thumb whenever you're trying to do something Facebook did on Android; they do some crazy stuff).
I don't believe you can nest ListViews in Android. There is "ExpandableListView", which lets you expand items to show more, although this isn't quite the same thing.
I would advise to just create a vertical ListView, and have the items be horizontal LinearLayouts that you can inflate yourself. You can also try making them horizontal ScrollViews (although I think this may have the same limitation as using nested ListViews).
Good luck!

best way to manage paging(swipe views) for single form fields?

I have more details for one form in android. I dont want to add scrollview because of the design limitation. Now i want to load the views on swipe(there are total 5 pages within single form). what is the best option to achieve this?
take one xml layout and hide/show different views on swipe??
I think ViewPager will be best. It's also available in compatibility package for backward compatibility.
check this for android viewpager implementation

Swipe Indication for user Android

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

Scrolling multiple images in android

I´m writing an application for Android in which I have a character that I must dress with multiple items, such as clothes, hairs, hats, earrings, etc. and on one side of the screen I need to have a container with many items inside that are available for use.
My problem is that I haven´t found any object that lets me do this simple task in android, I need it to be scrollable, and resizeable so I can place it on the right of the screen, the objects i need to add are Imageviews.
I accomplished this on iPhone with a UIScrollView but it seems that it't not that simple with Android.
Thank you.
you will use a ScrollView too, but you need embed a container of your images, like a Layout or Webview inside your ScrollView.

Categories

Resources