1

I'm trying to follow the material guidelines and I aligned the Toolbar title with the avatar like the image below following the instructions of @ChrisBanes in this answer.

enter image description here

My issue now is that when the SearchView is activated, it's not aligned anymore as seen in the second image. (It was aligned before changing the inset)

enter image description here

Any ideas of how I can align both things instead of having to choose between one or the other?

Community
  • 1
  • 1
GSala
  • 946
  • 7
  • 15

2 Answers2

0

If you want to align avatar with search-view then you need remove space of homeup button and search-view.

FYI: search view behavior is different in large size device so you can go with custom action-bar.

ViramP
  • 1,659
  • 11
  • 11
0

I solved it by using app:titleMarginStart="16dp" instead of changing the contentInset. I have tested it only in a xhdpi phone, though.

GSala
  • 946
  • 7
  • 15