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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -21,5 +21,6 @@
android:paddingEnd="?attr/listPreferredItemPaddingEnd"
android:gravity="center_vertical|start"
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.

android:textAppearance="@style/TextAppearance.AppCompat.Body2"
android:textColor="?android:textColorSecondary"/>