Customize the action bar color background changing - android

I am trying to add and action bar to my app, and customize it.
i used onCreateOptionMenu() and Inflaters to add to my code.
but i don't know how to customize background and remove that package name which appears next to the logo so i can give more "Room" to my items to be displayed correctly.
can anybody help please?
Thank you in advance.

I would suggest to create a custom action bar in layout folder and use it with below code:
ActionBar actionBar = getActionBar(); //Applications action bar isntance
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
actionBar.setCustomView(R.layout.my_action_bar);
If you use this, you can directly use action bar view's content and do whatever you want.

Related

Is it possible to customize items in split action bar?

I'm working with split action bar for my project, i would like to know is it possible to customize the items position in split action bar (i.e) i want some of the menu items in top of the action bar and some of them bottom of the action bar dynamically as my wish is it possible ?
Thanks in advance,
It is not possible to use normal actions on the top and split ActionBar at the same time. There is a trick you can use that is described below:
How to display both normal and split ActionBar?
But it is an old question and ActionBar is deprecated. You can now use multiple Toolbar objects instead of ActionBar. That way you can keep one of them at the bottom and add whatever actions you want to it.

Android: Can i add Tabs within actionBar?

I have done practice adding menu on action bar. But for this case I have to add tab in actionbar (not below the actionbar) like below figure:
Please help me to find out the solution. Thanks in advance and sorry for bad English.
For your purpose you can try a simple stuff by creating custom ActionBar like this
You can create custom Action bar like this ..
// gets actionBar reference ..
actionBar = getSupportActionBar();
// This sets custom layout to action bar
actionBar.setCustomView(R.layout.action_provider);
// this is how... .... you get id of layout defined
iv_d = (ImageView) actionBar.getCustomView().findViewById(R.id.action_menu);
Now if you need to show stuff like ActionBar tabs then simply provide background on every layout where each layout contains a text and Image... This will provide a look n feel of ActionBar Tab over ActionBar.
Hope it clears your doubt. Let me know if still you have any concern in same.
Thanks.

Customize Navigation Drawer Action Bar (App Compact) in android

I want to customize navigation drawer app compact action bar, I want to remove app icon from that and want to make its title center in action bar.
I have applied all solutions , but nothing is working with all the conditions.
Please give me some clue for applying it correctly
You should creat a customize action bar. Then, if you want you can add a button that can open and close your drawerlayout.
I have solved my problem. As mentioned, I have two problems, and I solved that in following way :
1) For making title centre, we need to make custom layout of action bar, and need to remove action bar title.
2) for remove app icon from action bar, we need to set android:icon property of that activity in manifest with transparent image or colour.

How to change the color of a specific component of the action bar

I would like to change the color of a specific part of the action bar; since I really don't know how to call it I will post an image:
You see the blue line? Well I would like to make it of another color; what should I do? Thanks.
just do this:
ActionBar bar = getActionBar();
bar.setBackgroundDrawable(new ColorDrawable("COLOR"));
I commented useful link to do what you want with action bar

Customize Action Bar Sherlock

I am working on an app in which I have implemented Action Bar using Action Bar Sherlock. I have also assigned style to it using Action Bar Style Generator from the following link:-
(http://jgilfelt.github.io/android-actionbarstylegenerator/#name=test_style&compat=sherlock&theme=light&actionbarstyle=solid&texture=0&hairline=0&backColor=9c0%2C100&secondaryColor=D6D6D6%2C100&tabColor=33B5E5%2C100&tertiaryColor=fff%2C100&accentColor=ff0%2C100&cabBackColor=fff%2C100&cabHighlightColor=33B5E5%2C100)
Its perfectly doing what I want but now my problem is that I have no control on the font type/size/color of the title of Action Bar or even on the pop-up menu font. I just want to know how can I change the font size/type/color of my Action Bar from the styles that I have generated from the above link.
Please help me to sort this out, any help would be appreciable
Thanks in Advance.

Categories

Resources