Status Update
Comments
je...@google.com <je...@google.com> #2
Hi,
I also see my text cut off when I set maxLines = 2
. Is it the same issue?
Box(
modifier =
Modifier.size(
width = 108dp,
height = 34dp,
),
contentAlignment = Alignment.Center,
) {
BasicText(
text = "text text text",
maxLines = 2,
autoSize = AutoSize.StepBased(minFontSize = 1.sp, maxFontSize = 13.sp, stepSize = 0.2.sp),
)
}
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Jossi Wolf <
Link:
Fix TextAutoSize bug with maxLines = 1
Expand for full commit details
Fix TextAutoSize bug with maxLines = 1
We were overcaching the paragraphIntrinsics in MultiParagraphLayoutCache when mutating the style. For `AutoSizeStepBased` instances with biased windows (more values smaller/bigger than the optimal), this could result in performing layout with outdated intrinsics, and thus an outdated style and font size, without surfacing this in the TextLayoutResult.
Test: New MultiParagraphLayoutCacheTests and manual testing
Relnote: Fixed a bug in BasicText with TextAutoSize and maxLines set to 1.
Fixes: 376834366
Change-Id: Ic0450c763c5d764492995b44ee1fe570246a9689
Files:
- M
compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCacheTest.kt
- M
compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/modifiers/MultiParagraphLayoutCache.kt
Hash: e1b712d78cc60384ed67a56c006148291ba146a6
Date: Tue Jan 07 18:52:26 2025
ap...@google.com <ap...@google.com> #4
#2, yeah, that's the same issue.
ap...@google.com <ap...@google.com> #5
Thanks @jo...@google.com for fixing this! Do you know when the fix would be available for g3 apps?
ap...@google.com <ap...@google.com> #6
Moving the internal discussion offline. The bug is fixed and the fix available in snapshot builds. We will comment on this issue when the bug fix is included in a release.
je...@google.com <je...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.foundation:foundation:1.8.0-beta01
androidx.compose.foundation:foundation-android:1.8.0-beta01
androidx.compose.foundation:foundation-jvmstubs:1.8.0-beta01
androidx.compose.foundation:foundation-linuxx64stubs:1.8.0-beta01
ap...@google.com <ap...@google.com> #8
Branch: androidx-main
commit 8f6eb4adcf88d08c0da3c3f65b099ace54808865
Author: Jelle Fresen <jellefresen@google.com>
Date: Mon Aug 09 18:08:29 2021
Add support for injecting mouse gestures
Adds a MouseInjectionScope similar to the TouchInjectionScope, an
implementation of its elementary methods in MultiModalInjectionScope,
and support in InputDispatcher and AndroidInputDispatcher.
A few platform independent abstractions for mice have been introduced
because they didn't exist yet: MouseButton and ScrollWheel. These have
been made @ExperimentalTestApi since I expect to replace them with the
production variants when they become available. For this reason, and the
fact that the API and/or behavior might change in response to the final
implementation of mouse support in Compose, all mouse injection support
has been marked @ExperimentalTestApi for the time being.
Bug: 190493367
Test: Added MouseEventsTest.kt
Relnote: "Added experimental support for injecting mouse events. Use
`performMouseInput` to start sending mouse events, or send mouse events
through the `Mouse` property of `MultiModalInjectionScope` during a
multi modal input gesture with `performMultiModalInput`. See
`MouseInjectionScope` for documentation of the available API."
Change-Id: Iaa4a82131f35d2d6376d8edaa1fac4807b27045d
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/api/restricted_current.txt
A compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/MouseEventsTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/util/MotionEvents.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt
A compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/Mouse.android.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/InputDispatcher.kt
A compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Mouse.kt
A compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MouseInjectionScope.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt
M compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/DesktopInputDispatcher.desktop.kt
A compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/Mouse.desktop.kt
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit d668ae478fe1a0e9f6fbbb42d069669f1dc3961d
Author: Jelle Fresen <jellefresen@google.com>
Date: Thu Sep 16 15:12:58 2021
Fix few errors in mouse input injection docs
* Removed documentation that refers to non-existing API
* Removed TODO out of documentation
* Documented Touch and Mouse properties
* Removed stray design considerations
Bug: 190493367
Test: N/A
Change-Id: I08a9b4c224956d6ae45981993e10d36558d3e299
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MouseInjectionScope.kt
je...@google.com <je...@google.com>
ap...@google.com <ap...@google.com> #10
Branch: androidx-main
commit c6884d4c8e23a6914db4eb1afd077df119db45a6
Author: Jelle Fresen <jellefresen@google.com>
Date: Fri Sep 17 18:24:03 2021
Make MultiModalInjectionScope an interface
Which is implemented by MultiModalInjectionScopeImpl. The interface is
sealed to allow future addition of properties, and the only
implementation is internal so exhaustive when over the type of an
instance of that interface is forced to include an else block.
It will also improve layering of the API by preventing implementation
details to be leaked into the public API of MultiModalInjectionScope,
which would happen for example when it decides to implement Density by
delegation.
Bug: 190493367
Test: ./gradlew compose:ui:ui-test:cC && \
./gradlew compose:ui:ui-test:test
Relnote: N/A
Change-Id: Ib76c2ccbfe6393dc3397dfc7c3a0ec08ff4cd842
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/GestureScope.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/TouchUpTest.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/partialgesturescope/SendCancelTest.kt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/InputDispatcherTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/injectionscope/touch/UpTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/TouchCancelTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/injectionscope/touch/CancelTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/partialgesturescope/SendUpTest.kt
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit d3d5b9fc5b602ab9edc83c921e861e6dd9deacde
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Sep 08 17:53:29 2021
Move InputDispatcher tests to host side tests
Because some code is used from both host side tests and instrumented
tests, a shared folder has been added that is included in both the host
side test variant and the instrumented test variant.
Bug: 190493367
Test: ./gradlew compose:ui:ui-test:test
Change-Id: I114d9f0b6462caf3c3267b6d81d2fe3c90a44024
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/MouseEventsTest.kt
D compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/TouchUpTest.kt
A compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/Constants.kt
A compose/ui/ui-test/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/BatchingTest.kt
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/IsGestureInProgressTest.kt
M compose/ui/ui-test/build.gradle
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/util/SplitsDurationEquallyIntoTest.kt
D compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/util/Truth.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/injectionscope/touch/UpTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/injectionscope/touch/CancelTest.kt
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/util/IsMonotonicBetweenTest.kt
A compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/TouchEventsTest.kt
A compose/ui/ui-test/src/androidCommonTest/kotlin/androidx/compose/ui/test/util/MotionEventRecorder.kt
D compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/TouchDownTest.kt
M compose/ui/ui-test/src/androidCommonTest/kotlin/androidx/compose/ui/test/util/InputDispatcherTestRule.kt
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/InputDispatcherTest.kt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/partialgesturescope/SendCancelTest.kt
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/AdvanceEventTimeTest.kt
M compose/ui/ui-test/src/androidCommonTest/kotlin/androidx/compose/ui/test/util/Verifications.kt
D compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/TouchCancelTest.kt
A compose/ui/ui-test/src/androidCommonTest/README.md
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/partialgesturescope/SendUpTest.kt
D compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/inputdispatcher/TouchMoveTest.kt
ap...@google.com <ap...@google.com> #12
Branch: androidx-main
commit be6e11888b09d95b6064935562aeb51d05f01cf2
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Sep 08 18:44:15 2021
Consider root bounds when injecting mouse events
When going out of bounds, send an exit event and stop sending more
events. Only allow cancel events and events that are part of an ongoing
gesture.
Bug: 190493367
Test: ./gradlew compose:ui:ui-test:test
Change-Id: I5372348a9731ee339ca194c728a0ba80c60ab784
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/InputDispatcher.kt
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/MouseEventsTest.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt
M compose/ui/ui-test/src/test/kotlin/androidx/compose/ui/test/inputdispatcher/InputDispatcherTest.kt
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit fa5e67454053827a65bde026b4d85133d7467a71
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Apr 10 15:45:18 2024
Revisit mouse click injection API
Added a button parameter to all click methods in MouseInjectionScope
(click(), doubleClick(), tripleClick() and longClick()), and deprecated
the incorrectly named rightClick() method.
Bug: 190493367
Bug: 261439695
Test: Added tests for each method
Relnote: "`MouseInjectionScope.click()`,
`MouseInjectionScope.doubleClick()`,
`MouseInjectionScope.tripleClick()`, `MouseInjectionScope.longClick()`
now accept a `button: MouseButton` parameter to make them more
universally applicable. The default value is `MouseButton.Primary` for
all methods."
Change-Id: I31a23e6819a82b5513db3731dce3bf8cd7587d69
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/samples/src/main/java/androidx/compose/ui/test/samples/MouseInjectionScopeSamples.kt
M compose/ui/ui-test/src/androidCommonTest/kotlin/androidx/compose/ui/test/util/Verifications.kt
M compose/ui/ui-test/src/androidInstrumentedTest/kotlin/androidx/compose/ui/test/injectionscope/mouse/ClickTest.kt
M compose/ui/ui-test/src/androidInstrumentedTest/kotlin/androidx/compose/ui/test/injectionscope/mouse/Common.kt
M compose/ui/ui-test/src/androidInstrumentedTest/kotlin/androidx/compose/ui/test/util/PointerInputs.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MouseInjectionScope.kt
ap...@google.com <ap...@google.com> #14
Branch: androidx-main
commit 277edf07f9f40b6d551e29409fe61fde3d2c785f
Author: Jelle Fresen <jellefresen@google.com>
Date: Tue Mar 19 16:55:19 2024
Graduate mouse injection API to stable
Removed methods that were deprecated hidden and experimental
Bug: 190493367
Fix: 261439695
Test: bOS
Relnote: "All mouse injection API for tests are now stable"
Change-Id: I974c9e6c9114c0babf6cfeae278930c537c02847
M compose/foundation/foundation/integration-tests/lazy-tests/src/androidTest/kotlin/androidx/compose/foundation/lazy/list/LazyNestedScrollingTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/BasicMarqueeTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/BasicTooltipTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/ClickableTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/CombinedClickableTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/Draggable2DTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/DraggableTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/HoverableTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/OverscrollTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/contextmenu/ContextMenuAreaTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/contextmenu/ContextMenuGestureTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/selection/SelectableTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/selection/ToggleableTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextHoverTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/BasicTextLinkTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/ClickableTextTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/CoreTextFieldHoverTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/internal/BasicTextFieldHoverTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/input/internal/selection/TextFieldTextToolbarTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/selection/gestures/AbstractSelectionGesturesTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/selection/gestures/MultiTextSelectionGesturesRtlTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/selection/gestures/MultiTextSelectionGesturesTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/selection/gestures/MultiTextWithSpaceSelectionGesturesRegressionTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/selection/gestures/TextFieldSelectionGesturesTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/selection/gestures/TextSelectionGesturesBidiTest.kt
M compose/foundation/foundation/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/text/selection/gestures/TextSelectionGesturesTest.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/ButtonScreenshotTest.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/CheckboxScreenshotTest.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/FloatingActionButtonScreenshotTest.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/RadioButtonScreenshotTest.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/SwitchScreenshotTest.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/CardScreenshotTest.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/CheckboxScreenshotTest.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/FloatingActionButtonScreenshotTest.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/IconButtonScreenshotTest.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/RadioButtonScreenshotTest.kt
M compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/SwitchScreenshotTest.kt
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/samples/src/main/java/androidx/compose/ui/test/samples/MouseInjectionScopeSamples.kt
M compose/ui/ui-test/samples/src/main/java/androidx/compose/ui/test/samples/MultiModalInjectionScopeSamples.kt
M compose/ui/ui-test/src/androidInstrumentedTest/kotlin/androidx/compose/ui/test/injectionscope/mouse/CancelTest.kt
M compose/ui/ui-test/src/androidInstrumentedTest/kotlin/androidx/compose/ui/test/injectionscope/mouse/ClickTest.kt
M compose/ui/ui-test/src/androidInstrumentedTest/kotlin/androidx/compose/ui/test/injectionscope/mouse/MoveTest.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt
M compose/ui/ui-test/src/androidMain/kotlin/androidx/compose/ui/test/Mouse.android.kt
M compose/ui/ui-test/src/androidUnitTest/kotlin/androidx/compose/ui/test/inputdispatcher/KeyAndMouseEventsTest.kt
M compose/ui/ui-test/src/androidUnitTest/kotlin/androidx/compose/ui/test/inputdispatcher/MouseEventsTest.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/InputDispatcher.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Mouse.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MouseInjectionScope.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/MultiModalInjectionScope.kt
M compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/DesktopInputDispatcher.desktop.kt
M compose/ui/ui-test/src/desktopMain/kotlin/androidx/compose/ui/test/Mouse.desktop.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollModifierTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/MouseEventTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/input/pointer/PointerIconTest.kt
M compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/platform/AndroidViewCompatTest.kt
M tv/tv-material/src/androidTest/java/androidx/tv/material3/IconButtonScreenshotTest.kt
M tv/tv-material/src/androidTest/java/androidx/tv/material3/RadioButtonScreenshotTest.kt
M tv/tv-material/src/androidTest/java/androidx/tv/material3/SwitchScreenshotTest.kt
Description
This pattern should be extended/generalized to include other forms of input injection, primarily mouse input.