Fixed
Status Update
Comments
ma...@google.com <ma...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
ch...@google.com <ch...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
mo...@google.com <mo...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
ch...@google.com <ch...@google.com> #6
Yep, that's exactly what I'd like in the library.
I can also see the benefit of having another modifier to know the content size within the parent too.
ch...@google.com <ch...@google.com> #7
Just tried the code above but modifySize
doesn't seem to be in LayoutModifier2
(it is in the deprecated LayoutModifier
though)
mo...@google.com <mo...@google.com>
mo...@google.com <mo...@google.com> #8
Chris, I'd like to make a sample for using OnSizeChanged. Can you give me a short example of how it would be used?
mo...@google.com <mo...@google.com> #10
Nice! I've put in a simplified version of that.
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 9209f5d65524cf83c0860459955bd83c5615a817
Author: George Mount <mount@google.com>
Date: Tue Sep 01 14:55:57 2020
Add onSizeChanged() and OnRemeasuredModifier
Added a new modifier to make it faster to notify only when a
layout's content size changes. This avoids the down-hierarchy
notifications required when using onPositioned.
Relnote: "Added OnRemeasuredModifier and onSizeChanged() to
receive a callback when content layout has been remeasured and
the size has changed, respectively."
Fixes: 154108792
Bug: 162351735
Test: OnSizeChangedTest
Change-Id: I657cf033de811e9279a2b2079933ca0bd89e5e60
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
A compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/OnSizeChangedSamples.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/OnSizeChangedTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/OnRemeasuredModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
https://android-review.googlesource.com/1418715
Branch: androidx-master-dev
commit 9209f5d65524cf83c0860459955bd83c5615a817
Author: George Mount <mount@google.com>
Date: Tue Sep 01 14:55:57 2020
Add onSizeChanged() and OnRemeasuredModifier
Added a new modifier to make it faster to notify only when a
layout's content size changes. This avoids the down-hierarchy
notifications required when using onPositioned.
Relnote: "Added OnRemeasuredModifier and onSizeChanged() to
receive a callback when content layout has been remeasured and
the size has changed, respectively."
Fixes: 154108792
Bug: 162351735
Test: OnSizeChangedTest
Change-Id: I657cf033de811e9279a2b2079933ca0bd89e5e60
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
A compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/OnSizeChangedSamples.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInputEventProcessorTest.kt
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/layout/OnSizeChangedTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/OnRemeasuredModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
Description
Currently I'm using
Modifier.onPositioned
a lot to know the laid out size of a node, butonPositioned
is wasteful for this, especially when it's in a scroller.Ideally I want just a
onSizeChanged
modifier to know only when the size changes.