What I try to do
Hello Guys, I'm creating an app, and I want that it looks nice and simple to control. In my app I got a Tabhost with 3 Tabs. Every Tab is a fragment with diffrent content. Now its the problem, when I switch the tab. I have to do this over a click on the tabhost.
But if you take a look at the Youtube-App on Android 4.0 its possible to switch the tab over a swipe gesture. And exactly here I stuck, how is that possible.
I searched the web, took a look into the Android Documentation, but I didn't really find anything about this topic. So how is that possible to create something like that?
Question
What do I need to do, that I can switch in my tabhost like its done in the Youtube-App. If you have some great tutorials, code snippets or any other tipps, please post them.
Thx for your help in advance.
safari
Pictures
Here you find some pictures to explain better what I'd like to create. They are ordered chronologically.
They are using a ViewPager for that.
ActionBarSherlock samples contains great examples of ViewPager+Fragments tabs:
http://goo.gl/GpbY4
Related
I would like to implement subtabs in SlidingTabLayout.
I searched a lot, but I don't have found anything like it.
Does anyone have a solution or a suggestion for implementing this?
Thanks.
There's quite a simple approach. You can associate you main tabs with viewpagers. Then, in those viewpagers you may add more slidingtablayouts in order to attain what you want to. I've got it working successfully. So nest the slidingtablayouts and you'll do fine. If you want some code, feel free to ask for it.
I implemented a simple example of sub tabs with slidingtab:
https://github.com/steinmetz/SubSlidingTabs
I'm developing an application for android that is supposed to have three tabs that shows three different listviews. It should look pretty much like this video example:
http://www.androidhive.info/2012/05/android-combining-tab-layout-and-list-view/
The problem i have is that TabActivity is deprecated and i can't found any good tutorials for the Fragment view (which I think is the one to replace TabView). Anyone know how to combine these two views?
You might want to look into ActionBar and Fragments. Maybe the following link could help you out? http://www.lucazanini.eu/2012/android/tab-layout-in-android-with-actionbar-and-fragment/?lang=en
I would like to know which will be the best method to create custom tabs in Android 2.2. something like this.
I know about the TabHost but not satisfied with its UI. I would like to create my own tab UI in 2.2 like shown in the above pic. Please suggest me the best and easy method to do this.
Create a custom view for your tab complete with state lists drawables and more!
Best tutorial for you:
http://joshclemm.com/blog/?p=136
And this is a example code:
http://code.google.com/p/android-custom-tabs/
ActionBarSherlock has tab feature. You can download Demos Sample from here and look at Tab Navigation Sample. I think you can find it useful.
I am pretty new at all this android java development to create apps but after a series of tutorial I feel more confident.
I have ideas for an app in which the layout would be like the phone app in android 4.0.3.
Let me explain : my app would.consist in three or four tabs where the user could switch between on to the other by swiping the finger left or right. The top of the layout would display the title of each tab and underline in blue the name current tab (same as the phone app does).
Does anyone have some hints or places where I could find some sample code ? Or even the code of the androidphone app ?
Thank you very much for your help.
David
http://www.pushing-pixels.org/2011/08/11/android-tips-and-tricks-swipey-tabs.html
http://blog.stylingandroid.com/archives/537
Is this what You are refering to ?
Your best bet would be to use ViewPager and TitlePageIndicator.
The ViewPager you can find on the compatibility package or on the ActionBarSherlock library (strongly recommend the last one which can be found here http://actionbarsherlock.com/) and TitlePageIndicator, found here https://github.com/JakeWharton/Android-ViewPagerIndicator)
Plus, by using the ViewPager you will learn a bit about Fragments which is very nice :)
could somebody help me and give a example of how can I do a viewpager that can be rotated right/left, something like this: http://1.bp.blogspot.com/-0Sjg8-LaZuo/TkxHAPOkAkI/AAAAAAAACgM/VjNo-nK9fuk/s1600/device-2011-08-18-005327.png
thanks!!!
What you need is this http://viewpagerindicator.com/
Best solution I have seen so far.
Archive that you'll find on this site contains both library and example showing how to implement such type of GUI in you app.