Customize Navigation Drawer Action Bar (App Compact) in android - 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.

Related

Custom Hamburger icon with Navigation Component

I'm using new Navigation Component in my project. I created a custom Toolbar which will keep the Title in the centre even when having navigation drawer.
This is how my toolbar looks now.
I'm trying to put a custom hamburger and back icon there(basically i need white icons).
I've tried
dataBinding.appBarHome.toolbar.setNavigationIcon(ContextCompat.getDrawable(this, R.drawable.ic_hamburger));
getSupportActionBar().setHomeAsUpIndicator(ContextCompat.getDrawable(this,R.drawable.ic_hamburger));
None of it is working. if want to see any specific part of my code, feel free to ask.
Maybe it just because of style or them,
Just try with bellow style
ThemeOverlay.AppCompat.Dark.ActionBar
When every you choose dark action bar then default icon color should be white and when you select an action bar then it will be the black icon
So just replace style in your manifest or style.xml

Android: Action Bar with Different Action Buttons

I am using Android Tab Navigation using Combat Action Bar. I have implemented Custom Action Bar.
Now i want to add different buttons to Action Bar According to tabs. i want some thing like that.
In some fragment i need this button, while in other i need different button.
Any Help Will be Appreciated.
Thanks
you can use custom action bar to add number of buttons.
Try This:-
Link Here: http://www.djbp.co.uk/android-actionbar-adding-buttons/

Change launcher icon without changing it in action bar

I've tried changing the android:icon property in Android Manifest but it changes also the image in the action bar. I want one image for the action bar, one for the launcher icon? Any suggestions?
Thank you

Android action bar location and blue line?

Ive made an actionbar menu file and added it to my activity. The problem is its in the wrong place. Here is an image i found on android developer webpage:
At standard the actionbar was on location 1. When i a added a line like 'uiOptions="splitActionBarWhenNarrow"' into my manifest then the bar went to location 3. How can i make it stick to location 2 no matter what?
Also, how did they get that blue line under the action bar? :)
You cannot change the split Action Bar functionality, it is meant to be at the bottom when it is split. What Location 2 refers to are Action Bar tabs, not a split Action Bar.
Also, that "blue line" is part of the Action Bar's theme, which you can extend. This SO answer talks about changing the tab color specifically and provides a useful website to customize everything about the bar.

Android Action Bar : App Icon & Title

Is it possible to use fragment tabs on action bar with the Theme.Holo.NoActionBar theme?
I mean... I already use this theme on my layouts but apparently it is overriden since the fragments have to show up in the action bar?
What I wanted to achieve is to actually get rid of the Title and App Icon over the fragment tabs. Something similar to the Google Music app.
Is this possible?
What I wanted to achieve is to actually get rid of the Title and App Icon over the fragment tabs. Something similar to the Google Music app.
Try calling setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false) on your ActionBar, and leave the theme alone.
You can style the action bar based on your needs. I'm quite certain you can also remove the app icon and title from there. Using a NoActionbar theme by default and then recreating the action bar on your own kinda defeats the purpose of the action bar. I suggest you use a theme with action bar and then style the bar according to your needs. This page has a decent implementation.

Categories

Resources