-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[Layouts] Add an InsetDividerLinearLayout component #8
[Layouts] Add an InsetDividerLinearLayout component #8
Conversation
ba935d2
to
8bdbfc9
Compare
Ref material-components#7 Adds a standalone modification to LinearLayoutCompat which allows for control over divider insets. Users may specify "start" and "end" insets, which affect the appropriate dimension in both horizontal and vertical orientations, as well as LTR and RTL layout directions. Users may also specify which dividers to inset, similar to the `showDividers` attribute. To make it easier to adhere to the Material Design baseline grid, dividers are drawn over child views instead of offsetting them. This also allows for backgrounds to be set directly on children without leaving gaps where they would normally be offset. * https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-baseline-grids Additionally, start/end dividers are drawn outside of the layout's padding by ignoring child dimensions and simply drawing them along the top/bottom (in vertical orientation) or left/right (in horizontal orientation) edges of the layout. This makes it easier to apply the recommended top/bottom padding to the layout per the Lists spec. * https://material.io/guidelines/components/lists.html#lists-specs Tests were added to verify some basic behavior as well as covering all permutations of inset mode, orientation, and layout direction. These pass on emulators from platform versions 2.3.7 to 7.1.1.
8bdbfc9
to
32d4007
Compare
return (mApplyInsets & INSET_DIVIDER_END) != 0; | ||
} | ||
|
||
int getFirstVisibleChildIndex() { |
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.
@VisibleForTesting
return Integer.MAX_VALUE; | ||
} | ||
|
||
int getLastVisibleChildIndex() { |
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.
@VisibleForTesting
} | ||
} | ||
|
||
void drawDividersHorizontal(Canvas canvas) { |
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.
private
? +the next two methods
Thanks for the PR! We're catching up from holidays and new year planning. But we'll be giving this more attention soon! |
Since this pr is quite old and there were no pings we're going to close it for now. If it is still a desirable addition to the library please ping on this pr. We'll reopen it and take a look. |
Ref #7
Adds a standalone modification to LinearLayoutCompat which allows for
control over divider insets. Users may specify "start" and "end" insets,
which affect the appropriate dimension in both horizontal and vertical
orientations, as well as LTR and RTL layout directions. Users may also
specify which dividers to inset, similar to the
showDividers
attribute.
To make it easier to adhere to the Material Design baseline grid,
dividers are drawn over child views instead of offsetting them. This
also allows for backgrounds to be set directly on children without
leaving gaps where they would normally be offset.
Additionally, start/end dividers are drawn outside of the layout's
padding by ignoring child dimensions and simply drawing them along the
top/bottom (in vertical orientation) or left/right (in horizontal
orientation) edges of the layout. This makes it easier to apply the
recommended top/bottom padding to the layout per the Lists spec.
Tests were added to verify some basic behavior as well as covering all
permutations of inset mode, orientation, and layout direction. These
pass on emulators from platform versions 2.3.7 to 7.1.1.