0

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

mark
  • 503
  • 5
  • 27
  • 1
    You shouldn't do it! It is NOT an ANDROID pattern! – Gabriele Mariotti Jun 05 '14 at 05:43
  • it is the requirement , can you please tell me the way – mark Jun 05 '14 at 05:51
  • I already answered how to remove icon from navigation drawer [link](http://stackoverflow.com/questions/19727233/how-to-remove-navigation-drawer-icon/22612901#22612901). And for Align actionbar title center in android [link](http://stackoverflow.com/questions/12387345/how-to-align-actionbar-title-center-in-android). – none Jun 05 '14 at 06:17
  • there is a miraculous methods like button.openDrawer(drawer) and button.closeDrawer(drawer) :)) – rubberdont Jun 05 '14 at 06:20
  • I want to just remove app icon from action bar, not toggle icon; and I tried both links, but applying custom layout not working for all conditions like when drawer open. – mark Jun 05 '14 at 06:21
  • removing app icon maybe not an ideal way to do what you want. the best way is to create a custom action bar. I already did customizing action bar. I just add a button to open the drawer. Just i said set on button.onClickListener the drawerLayout.openDrawer() and drawerLayout.closeDrawer() – rubberdont Jun 05 '14 at 06:28
  • can you please guide me how to apply above succession, I need some hint, how to apply our own toggle button in our custom layout, and fetch its id for apply onClickListener. Thanks. – mark Jun 05 '14 at 06:58

2 Answers2

1

You should creat a customize action bar. Then, if you want you can add a button that can open and close your drawerlayout.

rubberdont
  • 464
  • 3
  • 15
  • @mark you can address your button as like this. DrawerButton = (ImageView) actionBarLayout .findViewById(R.id.bSideButton); DrawerButton is my Button on my action bar. and actionBarLayout is my ViewGroup – rubberdont Jun 05 '14 at 07:29
0

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.

mark
  • 503
  • 5
  • 27