How to make tabs like Nexus one weather/news App? - java

is anyone have an idea how to make tabs like the nexus one tabs from the weather/news app, and i mean the functionality which by flick the screen you could go to the next tab, Thanks
Video: http://www.youtube.com/watch?v=hIu6kCnZVF0
alt text http://www.gadget.pdamu.com/wp-content/uploads/2010/01/Google-Phone-Nexus-One-weather-apps.jpg

You can now do this out-of-the-box in the Android Compatibility library with a ViewPager: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html?m=1
ViewPager slides between Fragments much the same way ListViews scroll up and down with views.
If you're not interested in scrolling the tabs, there's an example in the SDK that uses a TabHost (instead of making the tabs themselves scrollable left-to-right), but you need not use a TabHost. You could, if you wanted horizontally-scrolling tabs, use a HorizontalScrollView with some buttons in it.
For an approach that doesn't use the compatibility lib, or fragments, see here: https://github.com/olibye/AndroViews

its called a Workspaces UI pattern more information about it and how to implement it here http://www.androiduipatterns.com/2011/06/android-ui-pattern-workspaces.html

Related

I have several activities that I want to string together using tabs

In order to do this, I think they need to be fragments or something because that is what viewpager requires. I am not really sure how to do this because I have built my app up using activities, not fragments. Is there a simple way to tab between activities so that the tab bar is persistent?

Want to implement tabs in android?

I am trying to implement swipe tabs in my application but don't know what is the best way to do it.I am confused as to whether I should action bar navigation bars or some other mechanism.
I want my application to have Scroll-able views like in the link below?
https://play.google.com/store/apps/details?id=com.asus.todolist
You can use uiautomatorviewer to determine what that app is using. My guess is that it is using a ViewPager with a PagerTabStrip for the tabs.

How do you put tabs under another layout similar to the Google+ app? (Example Pic Incuded)

I want to implement something simlar to this Google+ layout. The page scrolls until the tabs at the bottom hit the top. Then the list view in the tabs scroll. Does anyone have an idea to do that? (The tabs should still be visible but the content inside scrolls.)
Please don't hesitate to ask for clarification.
Any help is appreciated. Thanks.
If you were to use uiautomatorviewer to examine that app, I suspect that you will find that the tabs are a tabbed indicator for a ViewPager. PagerTabStrip is one that ships with the Android Support package, the ViewPagerIndicator library has another, and there are still more floating around out there. Such a tab strip can be placed pretty much anywhere.

Sliding Tabs in Android

I want to have a sliding tab menu that is compatable with 2.x and up. I want this to work with ActionBarSherlock so that it doesn't look different across devices. There seems to be a lot of different ways to have tabs and a pager, but the way that ABS shows "Tabs and Pager" in it's "ABS: Fragments" app running on a 2.3 device defaults to the old style of tabs. There are applications on my 2.3 phone that slide while having tabs and they it looks like ICS. Any ideas on this?
Tabs:
Picture here

Android: Different Java files for each view

I'm building an Android application which contains a fixed header with the application title in it. Right now, when the application changes activities, the header will slide out and slide in as well because both activity's have the same header. I really like this header to stay fixed at all times, even when switching activities.
I think this could easily be done by using a viewswitcher/viewflipper on the lay-out below the header and switch views only on that perticular part of the application. That would create my desired effect. The problem with this is, that every single screen I have in my application, would use the same java file. As I have around 12/13 different screens, all containing buttons textviews, listviews etc, that would create very messy code. I'd therefore prefer to use java files for each 'screen' but then I'd have to stick with different activity's and I can't keep the header on top during transistioning of activity's.
Is there a solution to actually keep a fixed header (and be able to animate the view/lay-out below) while using different java files for every application screen?
Work with Fragments, a FragmentStatePagerAdapter and a ViewPager. You could create a layout where you have the fixed header - and below that you have your ViewPager containing the different Fragments, each containing their own logic.
It's quite a change working with Fragments instead of only Activities, however I've found them very useful. For a starting point, check this link.
To not allow the user to swipe, but still being able to switch the viewpager item programatically, check out this tutorial and do your swiping using the setCurrentItem method.

Categories

Resources