Fixed
Status Update
Comments
js...@google.com <js...@google.com>
lp...@google.com <lp...@google.com> #2
Nader, what is our intention with Dp.Hairline? Because the value is 0, layouts won't take up any space, so it only really works for drawing commands that end up inside Skia. Do we need to support this manually in all components that accept a size?
nj...@google.com <nj...@google.com> #3
Divider seems like a good candidate to support Dp.Hairline, but I think it might need to be determined on a case by case basis. I could imagine it may not make sense to support Dp.Hairline for all composables/modifiers.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit efe6ccf3faccdd64c6d71b51cc35194d53e36d59
Author: Nader Jawad <njawad@google.com>
Date: Wed Aug 25 10:41:55 2021
Update Divider to respect Dp.Hairline
Relnote: "Updated Divider composable to
respect Dp.Hairline for the thickness parameter
to support drawing single pixel dividers
regardless of display density."
Fixes: 196840810
Test: Added test to DividerUiTest
Change-Id: I16ffb642eda86c17b65f56249686ffe67082ffe5
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/DividerUiTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Divider.kt
https://android-review.googlesource.com/1809156
Branch: androidx-main
commit efe6ccf3faccdd64c6d71b51cc35194d53e36d59
Author: Nader Jawad <njawad@google.com>
Date: Wed Aug 25 10:41:55 2021
Update Divider to respect Dp.Hairline
Relnote: "Updated Divider composable to
respect Dp.Hairline for the thickness parameter
to support drawing single pixel dividers
regardless of display density."
Fixes: 196840810
Test: Added test to DividerUiTest
Change-Id: I16ffb642eda86c17b65f56249686ffe67082ffe5
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/DividerUiTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Divider.kt
Description
It'd be nice if
Divider
supportedDp.Hairline
. In its current implementation, the divider becomes invisible ifDp.Hairline
is used.I'm currently working this around by manually calculating
1px
indp
:I'd also like to call it out that it feels weird to have
Dp.Hairline
globally available, only to realize that it's up to Composables to manually support it(?). From what I understand, onlyBorderStroke
andModifier.border
account for hairlines inv1.0.1
.