Closed jorgevalbuena56 closed 7 years ago
The profile header, where the user name, email and avatar are, I would to have them all align to the center of the drawer
This can be done, but you'll have to use your own custom XML layout for it (this can be set via the customViewRes
property inside the accountHeader
block), as the base library doesn't provide specific support for it. Should be fairly straightforward though, it looks like it just needs small tweaks to the original layout that the library uses.
Do you know, by any chance, where is the XML Layout used by the original library?
Yes, I've actually looked it up, it's this one.
It looks like you'd just have to realign the ImageView (@+id/material_drawer_account_header_current
) and the two TextViews inside the second LinearLayout (@+id/material_drawer_account_header_text_section
). Maybe that LinearLayout itself too.
Excellent, I'll do that and let you know
I am trying to set my new view like this:
customViewRes = R.layout.material_drawer_header
And I am getting this compile error:
I thought you wanted to center the one selected profile that's on the very top of the header. If that's what you're trying to do, then you should use the customViewRes
property a level higher:
accountHeader {
customViewRes = R.layout.something
profile("Jane" {}
profile("Sally") {}
}
Or did I misunderstand, and are you actually trying to center every profile item in the profile list?
ohh, ok, I was wrong, Yes, you r right, I moved the line there and now it's picking up the new xml
Great, it's just a matter of XML customization from there, so I'll close this. Good luck with it.
Can you be a bit more specific? Where are you trying to center and which part of the profile?