To create a tab widget with custom design - android

I would like to create a android application with the following page.
I would like to create a tab UI as it is in the image. Can anyone please help me how I can replicate the same design using the tab widget and tab host.
In Short I would like to design the BUY and SELL tabs as same as it is in the Image.

Create a fragment_buy and another fragment_sell in your layout folder. Then create a Java class for each of them. Both of these fragments should run on top of your main activity

Related

Custom tabs on android

I want to create some tabs on android but I do not know if this kind of tabs is possible to create on android. If they are possible can someone give me some link to a similar tutorial or example so I can take a look how to create such tabs in android.
Here is what I'm looking for:
I need to have 2 tabs left and right, and a logo in the center that is not clickable.
You can use my library on Github it allows you to create a custom tab layout and use it. So you can create a layout which contains both image and text, and then you can modify tab according to position.

How to maintain custom tab on screen and change class without redrawing the tab again?

Let me try to make my question much clearer here. Supposed I have a custom tab created by using buttons and images in XML layout and it looks like this.
Each of these buttons, should call a class. Normally, Intent is used to call new class when onClick. But the whole layout would be redrawn when I call any of the classes via Intent.
Intent intent1 = new Intent(TabBar.this, Favourites.class);
startActivity(intent1);
I tried using TabHost and it worked, but my project requires me to use a custom tab bar.
I also tried the solution to this Dynamically change view inside view in Android, which is similar to what I wanted, (switching layouts and maintaining the tab bar below it), which worked as well.
My goal is to maintain the custom tab that I have, and change the classes instead of layout without redrawing the custom tab bar everytime I click on every buttons. With classes, I can run different functions and call different activities.
I googled a lot on this but couldn't seem to find a solution or reference. Can somebody guide me? Thanks in advance.
Update :
I'm new in Android, and after attempting many times, I decided to try out codes from AdilSoomro to achieve what I wanted, http://adilsoomro.blogspot.com/2011/06/iphone-like-tabs-in-android.html which is to create custom tabs that looks like iPhone tabs. However, this project uses TabActivity that is now deprecated in Android 4.1. I attempted to change it to FragmentActivity after referring to other sources that uses Fragments for tabs.
http://android.codeandmagic.org/2011/07/android-tabs-with-fragments/
http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/
I managed to create it using FragmentActivity and here is where you can refer to them :
How to use custom iPhone tab in FragmentActivity?
You can use TabHost control to achieve this. Go through this post
It explains all the possibilities. It also includes using custom tab bar defined in the xml file.
One of the way to achieve this is create footer and use it in all your activity. Like This. And Let me know its useful as per your requirement or not.

Mono for Android, TabHost with abs to swap Views within the same Activity

I'm new to Mono for Android, and I'm trying to port an old application, and I'm having difficulties with TabHost ...
In the tutorials page Xamarin writes:
"You can implement your tab content in one of two ways: use the tabs to swap Views within the same Activity, or use the tabs to change between entirely separate activities.
In this tutorial, you'll create a tabbed UI that uses a separate Activity for each tab."
Someone can help developing something "use the tabs to swap Views within the same Activity"?
Thank you
Now you have tabs on the ActionBar, and your "content" zone will be made of fragments.
Follow this link for further explanation and tutorial on how to add tabs to your app:
http://docs.xamarin.com/Android/Guides/Platform_Features/Introduction_to_Ice_Cream_Sandwich#Action_Bar_Tabs

How is skype android app doing it?

If you have seen the skype android app, then you may have noticed that when skype moves from one activity to another, the top bar remains in place while the rest of the page slides out and the new activity comes in.
So how are they doing it? I want to do something like that.
Fragments can do what you wan't, and a lot more
In skype.. They are using Tab Activity...
Refer : http://developer.android.com/reference/android/app/TabActivity.html
Android TabHost Tutorial
Also if you want to use a single title through out the applciation :
You can define a title_layout.xml... & include it in the top of all your layouts like
<include layout="#layout/title_header"/>
You need to create a custom view which will act as your Tab Bar.
After creating your custom tab bar use it in whatever activity as you want.
Check this for more info on custom views.
http://developer.android.com/guide/topics/ui/custom-components.html

how to use android tabs in the same Activity

Hallo,
Any idea where I can find a simple tabs example?
The Android Developers Hello Views Tab Layout example only details how to use separate Activities for each Tab.
I would like to use tabs to extend a screen of settings without scrolling, i.e. there are too many options for a single screen, so I'd like to split them over two tabs, but still handle them in the same Activity.
Each tab can refer to a separate layout file if that is how it needs to be done,
TIA,
-Frink
if your tabs don't need to be dynamic you can just load the views in the xml file. Just like in this example http://developer.android.com/guide/tutorials/views/hello-tabwidget.html
In your tabhost instead of passing an intent you can pass a viewID

Categories

Resources