GSala GSala - 1 year ago 104
Android Question

Align Toolbar title and SearchView with list content with avatars

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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download