Create Carousel Style ViewPager - android

I'm looking to try and implement this style pattern into my application:
http://www.androidpatterns.com/uap_pattern/carousel
But I am having trouble in finding an existing library or solution to it. Does anybody know of any libraries that I could use or how I would go about implementing this?
So far, Ive found this:
http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html
but it isn't quite what I want as it would be nice if it was hosted inside of a ViewPager so I can have buttons etc inside the view.

You might try twoway-view, an implementation of an AdapterView (similar to ListView/GridView) that supports horizontal scrolling.
In this case, you'd use it more like a ListView rather than a ViewPager, so each element would be a separate item layout, rather than Fragment.
One example of where twoway-view is in use right now is the latest Firefox for Android nightly as discussed on the announcement post, which contains some screenshots of it in use:

Related

Creating swipeable intro in android

I'm looking for a a tutorial or a start for creating swipeable intros like this image for introducing and helping users in using the app, I know it is based on android swipeable views but all the links I found had tabs, and since these kinds of intros are very popular I though maybe there is a better and more forward way to do it.
Thanks very much
Try to use : Android-ViewPagerIndicator lib(https://github.com/JakeWharton/Android-ViewPagerIndicator)
You need to use a ViewPager and a library called ViewPagerIndicator for the small circle at the bottom.

Swipe to delete for a custom view not for list item

I want to develop a layout with a very simple ImageView and a Listview binded in a Relativelayout . Now for a better user experience I want to delete the Image view by swiping it left or right same like what is implemented in android Gmail app to delete emails.
Implementing it on a listview item is very simple and there are many tuts and sample codes are available over the internet including the official Google I/O talk on animation and explained in a very good way by Chet Hasse here
https://www.youtube.com/watch?v=YCHNAi9kJI4
but I don't require to implement it on the listview items insted I want to implement it in more generic way. In my case I want the same behaviour for my ImageView item as one view and ListView another . Like shown below
As soon as the ImageView item is deleted the whole ListView should smoothly come on the top.
I have tried many way to implement the same without any success.
Suggest me the approach or some samples to do this which is supported in Gingerbread and above android OS.
You can use this code:
https://github.com/romannurik/Android-SwipeToDismiss/blob/master/src/com/example/android/swipedismiss/SwipeDismissTouchListener.java
As described in readme this code works for android 14+.
You can use the NineOldAndroids library to support old versions of Android, or use the Jake Wharton's port:
https://github.com/JakeWharton/SwipeToDismissNOA
I looked around and found this helpful.
https://github.com/nhaarman/ListViewAnimations
I implemented a custom ViewGroup that takes one child and allows you to drag/fling it to the left with a callback once the swipe is complete. My intention was for it to work just like in a RecyclerView. Works well in a LinearLayout with animateLayoutChanges=true and setting the visibility to GONE in the callback.
Gist here: https://gist.github.com/darnmason/38a1a5178a06470202784050f4dc1cdf
All you need is this library: https://github.com/timroes/EnhancedListView

Custom Android GridView

I want to create a GridView like this one:
But, I don't know how! I know how work with Android GridView, but not like this one.
Suggestions of library or any tip will be welcome.
Thanks.
I want to create a GridView like this one
The View you are referring to can quite easily be created without using a GridView. If your components (clothing, bags, shoes etc.) are static, you can use nested LinearLayouts (with weights) inside a ScrollView.
Suggestions of library or any tip will be welcome.
You can try StaggeredGridView: Link
A demo project to get you going: Link

Android interface : show form like the grouped listview style?

I'm building an App for Android that already exists for iOS. On iOS, we really like to use the listview grouped style to show details and forms. It is really useful to show details of objects that we don't know how much properties they have before loading it.
I know that Android doesn't have a similar tableview style. And I don't want to use a custom library to recreate it, because I don't want to force an iOS like interface to my Android's users.
But how would you create a consistent Android interface that show similar information? Do you have example for me?
First of all, your instinct to not force iOS style UI onto Android users is correct and I respect you for it.
Android's ListView is roughly the equivalent of iOS's UITableView. There are important differences. For instance, you should never use a ListView inside another scrollable container. If a ListView is in a particular layout, it should (usually) be the only scrollable component. If you want multiple ListViews in a layout, you probably don't want ListViews at all. You should instead use (vertical) LinearLayouts and add the items in order.
Cyril Mottier writes excellent posts on implementing custom behavior for Android's ListView.
If you want to display data in a list then you can use the ListView. Here is a great article about how to use it.

Implementing swiping between different views

I've been updating an Android app today which so far had a single TableLayout-based View. Now, I'd like to duplicate that View with another set of backing data, and use horizontal swiping to switch between both. At some point I'd also like to add a third "page" with a different TableLayout.
I haven't really found any good ways to get this going. I've been looking at http://developer.android.com/training/implementing-navigation/lateral.html, and I actually copied the code fragment for the Tabs Pattern with NAVIGATION_MODE_TABS. That results in a little dropdown widget being added to the View title in the action bar, but clicking it doesn't show the tabs I set up (with actionBar.addTab()). I'm also not sure how to set up the view (XML) code to stick the TableLayouts in there.
I should mention that I don't have to care for pre-4.0 Android for this, so compatibility is not (much of) an issue.
Try to Use ViewPager Widget you can find useful links on the web, this widget handle the horizontal swiping between views.
http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
https://github.com/JakeWharton/Android-ViewPagerIndicator
http://blog.stylingandroid.com/archives/537#
I haven't really found any good ways to get this going.
Try ViewPager. Here is an Android Developers Blog post on ViewPager: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
Here is a small sample app using ViewPager: https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/Fragments
None of the other answers ended up helping much. However, this one is pretty good:
http://thepseudocoder.wordpress.com/2011/10/05/android-page-swiping-using-viewpager/

Categories

Resources