Any idea how to implement tabs like these (the one on top with home image, star, etc)
Using tabs in an action bar on Ice Cream Sandwich.
Or ActionBarSherlock tabs for a full on backward compatibility.
Those are so-called "swipey tabs", probably on top of a ViewPager. ViewPagerIndicator has an implementation of such tabs.
if you wish to use the same tabs-pager like on the android market app (aka google play) , you can get the android support library from the sdk manager and see their sample on ".../extras/android/support/samples/Support4Demos" .
there , find the fragment example called "tabs and pager" . i think you will like it ... :)
Try this. The solution there is to use the setDividerDrawable(...) method of the TabWidget class. Then you can define the looks of the tabs with XML.
Related
I have been doing a small research on UI designs for Android for the last few weeks. My main concern right now is the action bar along with tabs. I believe the default android implementation takes to much room on the screen.
Recently I took a look at the Flickr app and I really like how they do this but I am not sure how to implement tabs this smoothly inside the action bar itself.
All help / ideas are appreciated.
Thanks in advance.
Screenshot of the action bar can be found here:
https://dl.dropboxusercontent.com/u/242865/Screenshot_2014-11-11-11-04-05.png
Check out this library on github.
It's an Android Library to help you create actionbar tabs like Capitaine train app by Cyril Mottier.
You have to set a customview in your actionbar and use something like ViewPagerIndicator
http://viewpagerindicator.com/
To setup a custom view in your actionbar just use setCustomView but remember to enable the display of custom view first.
Take a look at this
http://www.jfarrell.net/2013/10/customizing-action-bar-in-android.html
I am developing an android app, where I want to put action bar for phones below API 11.
I am following the below link.
http://hmkcode.com/add-actionbar-to-android-2-3-x/
I am making use of the v7 support library, and I am able to get the actionbar. But, the problem is I want to add a navigational listener or tab listener to the action bar. How is it possible.
Please help! Thanks in Advance.
You should use ActionBarSherlock. It is an excellent library of tools that allow you to use Action Bars in older phones and is widely used. The catch is that all your Activities will need to extend SherlockActivity instead of Activity and you have to be careful to call methods like getSherlockActivity() in Fragments instead of getActivity().
I prefer HoloEverywhere library
It allows much more than ActionBarSherlock, but makes your app ~3Mb bigger in size
I am sure you have not seen this
http://developer.android.com/guide/topics/ui/actionbar.html
I want to create an android application in which each menu should seen like the attached image. Is there any possible way to create this types of menus in android..
I am a beginner in android ..if anyone knows how to make this types of menus.. please give me an example code, it will very helpful for me.
Check out TabActivity. Or this is what you need to go through http://developer.android.com/design/building-blocks/tabs.html
For adding menu for an tab you can use ActionBar instead of TabActivity. This will give you an option to add Spinner to the Tab. http://developer.android.com/design/patterns/actionbar.html
But actionBar is available for API level 11 and above.
I am new in android development and I am working on the TabHost, I need to customize the tabs following is the screen shot link how i want to show my tabs.
text in starting should be dynamic and can change based on the tabs click
In screen shot i have selected chat if I select home the text should change to Home etc.
please help me to solve this out thanks...
That's called an ActionBar. If you're developing under 3.0 or higher it's standard. If you want to support earlier versious, you can check Greendroid or ActionBar Sherlock libraries ;-)
This is an ActionBar if I am not wrong, you can use ActionBarSherlock for your app it's located here
As in this image:
![two muppets][1]
where the buttons are Main, Favorites, and Help.
This is obviously a Tab Layout. Read Google's documentation and this more clear example
check this:
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
That is not the Button. It's Tab Bar that is Displayed at the Top instead of Bottom
Tab Bar aligned Top
I would recommend that you look at the Android Tab layout tutorial: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
HOWEVER please be aware that this tutorial uses the TabActivity class, which is deprecated. The documentation for TabActivity contains a version done using Fragments, which is the way tabs should be done now: http://developer.android.com/reference/android/app/TabActivity.html
Note that if you are developing for older Android devices, you should download the v4 support library, which allows you to use Fragments on old API versions: http://developer.android.com/sdk/compatibility-library.html