-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add parsing of independent padding attributes #69
Conversation
- Allows paddingLeft and paddingRight to be set separately - For existing apps that _only_ specify left or right, they must add the other property for no change to be effected - For existing apps that specify the same padding for left and right, they needn't do anything to maintain behaviour - For existing apps that specify different values for left and right padding, they must increase the smaller padding to match the higher one to maintain behaviour - For existing apps that use `app:pstsPaddingMiddle="true"` no change is required to maintain behaviour (this seems to override the padding values anyway)
int paddingRight = a.getDimensionPixelSize(PADDING_RIGHT_INDEX, padding); | ||
int padding = a.getDimensionPixelSize(PADDING_INDEX, 0); | ||
paddingLeft = padding > 0 ? padding : a.getDimensionPixelSize(PADDING_LEFT_INDEX, 0); | ||
paddingRight = padding > 0 ? padding : a.getDimensionPixelSize(PADDING_RIGHT_INDEX, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as per typical Android views, if android:padding
is given, it will override android:padding[Side]
❗ depending on usage, this is a behaviour changing commit:
|
👍 for those awesome gif examples |
Cheers for the PR, I will try to find some time this weekend to review PR's and bugs. Regarding the this PR. I developed it like that in the first place, to be honest I don't know why I changed it. It is better to have both options. 👍 to the awesome gifs as well |
cool, let me know if you want changes / I don't mind if you checkout my branch and commit on top of it to get it to a state where you're happy to merge in. |
In our app, we require the ability to set a different value for the right padding (we want 0). Although the material guidelines specify that it's possible to add an offset to indicate that the tab strip is scrollable, there are no written guidelines written that mandate the right padding should equal the left padding.
This change allows users to specify the left and right paddings independently.