Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NavigationView] Fix section label alignment #4119

Conversation

pubiqq
Copy link
Contributor

@pubiqq pubiqq commented Mar 27, 2024

Fixes #4178

@pubiqq pubiqq mentioned this pull request May 6, 2024
android:maxLines="1"
android:textAlignment="viewStart"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an error with this:"Inconsistent alignment specification between textAlignment and gravity attributes: was center_vertical, expected start"

So we'd need to keep android:gravity="center_vertical|start". However then it's easier to just keep it as is without setting textAlignment since gravity is already working as intended.

What is your reason to use textAlignment instead of gravity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an error with this:"Inconsistent alignment specification between textAlignment and gravity attributes: was center_vertical, expected start"

That's the message from the RtlCompat lint check, isn't it?

What is your reason to use textAlignment instead of gravity?

I've added an issue, see description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thank you for filing the issue! the message is from the lint check but it's a blocking error, but I confirmed that keeping both android:gravity="center_vertical|start" and android:textAlignment="viewStart" fixes the issue so we can do that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've rebased the branch with android:gravity="center_vertical|start".

it's a blocking error

It's a false positive. RtlCompat should not be used in the library because it no longer supports API < 17.

@pubiqq pubiqq requested a review from leticiarossi May 16, 2024 22:51
@leticiarossi leticiarossi self-assigned this May 17, 2024
@pubiqq pubiqq force-pushed the navigation-view/subheader-alignment branch from 8bb965a to d05f42e Compare May 17, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NavigationView] Incorrect section label position in RTL
2 participants