android - combine ActionBar and a custom TitleBar? - android

I'm creating an application for android 4.0 and above. I use the Holo.Light theme with dark ActionBar (Tabs as navigation mode).
The problem: there are too many icons (tabs) I'd need to place into the ActionBar, so I'm thinking about creating a custom TitleBar and placing some Buttons there to keep the functionality whilst not overspamming the ActionBar.
I tried the following:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);
This causes the app to crash with following message:
08:00:24.063: E/AndroidRuntime(11283): java.lang.RuntimeException: Unable to start activity ComponentInfo{net.maver1ck.test/net.maver1ck.test.Main}: android.util.AndroidRuntimeException: You cannot combine custom titles with other title features
What are "other title features"? Is that possible to use the ActionBar and a custom title?

This is not so good idea to combine such bars. Insted of it use custom layout only.

Related

ActionBar with SearchView and tabs

I need to show the following ActionBar:
Does Android support it, or do I need to do a custom layout and set it to the ActionBar?

Android: How to remove title padding when using sliding tabs toolbar

I am following this tutorial. The tutorial basically helps to create a sliding tab menu by using the AppCompat library. It basically creates a custom toolbar using the tabs and then replaces the standard ActionBar with this toolbar.
It works perfectly, but I do not wish to show the title. I only want the tabs at the top of the screen to be my main navigation. On my activity I have set
getSupportActionBar().setTitle(null);
but this only makes the text for the title blank. Space (padding?) is still reserved for the title. How do I remove it?
The picture below shows the problem visually.

How are graphical tabs in Android made?

Screenshots
Background
Graphical tabs started to appear in stock Android application around ICS. However, they are quite different from the traditional tabs (link). Moreover, I have found no related tutorials.
Differences with Traditional Tabs
Graphics instead of text, obviously.
No selection indicator at bottom.
The color of the contents (graphics) indicates the selection instead.
Suspicions
Are they just tabs with an icon but no text, combining together with a suitable theme?
If yes, how to theme the tabs to achieve such effects?
The main difference is that old style tabs were implemented using TabHost and TabWidgets. However, since the introduction of the Action Bar the tabs are implemented as action bar tabs.
You can read about styling the tabs in here.
Basically you can create your own indicator, as well as choose between icons, text etc.

ActionBarSherlock with translucent tab navigation

In my app I have ActionBar with tabs and I want to make tabs translucent, but not ActionBar. Is it possible to achive this via styles and themes?
You can use custom layout and inflate it to use it as tabs
Please find it here : https://stackoverflow.com/a/10013297/951045
and to hide actionbar use
getSupportActionBar().hide(); // if you are using support lib
otherwise use getActionBar().hide();
You can also hide actionbar by using Theme.Sherlock.NoActionBar (for support lib)

Custom titlebar without the shadow

I want to have a GUI kindof like how Market is. Mainly I want a title with an icon and the name. So I've disabled the default titlebar and are using a 9 patch image as my custom titlebar. It looks great, but the top system bar ( cannot remember what's it called atm ) is casting a shadow on my application - specifically on my titlebar. I've looked at the Market's custom titlebar and it doesn't have a shadow, or the shadow is below the three main buttons casting on the contentlist.
How can I remove the shadow from my custom titlebar, and maybe have it below - casting on the content?
The short answer to this is that the title bar is a part of the theme and that one have to make changes to the current theme and set a custom layout for the title bar. More info here: http://www.anddev.org/my_own_titlebar_backbutton_like_on_the_iphone-t4591.html

Categories

Resources