Lauri Koskela
04/28/2025, 5:06 PMComposeTestRule
for UI automation when generating baseline profiles? UiAutomator does not really seem to work that well with compose+wear (e.g. scrollUntil
does not detect scrolling), and I'm wondering if Compose's better UI testing APIs could be used here
I tried to use createEmptyComposeRule
but that does not seem to work either ("No compose hierarchies found in the app")Lauri Koskela
05/04/2025, 12:44 PMscrollable
implementation that sometimes passes drag gestures to the activity and some times not. Here's a minimal sample:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
setContent { WearApp() }
}
override fun onTouchEvent(event: MotionEvent?): Boolean {
Log.d(TAG, "onTouchEvent: $event")
return super.onTouchEvent(event)
}
}
@Composable
fun WearApp() {
MyTestAppComposeTheme {
Box(
modifier = Modifier.fillMaxSize().padding(horizontal = 8.dp)
) {
val offsetX = remember { mutableFloatStateOf(0f) }
val scrollState = rememberScrollableState {
offsetX.floatValue += it
it
}
Box(
modifier = Modifier
.fillMaxRectangle()
.border(width = 1.dp, color = Color.White)
.scrollable(scrollState, Orientation.Horizontal)
contentAlignment = Alignment.Center
) {
Text(offsetX.floatValue.toString())
}
}
}
}
This renders a box that is horizontally swipeable. As far as I know it should never let the activity swipe-to-dismiss trigger as long as the scrolling gestures start inside the box, right?
Defining horizontal scroll semantics mostly fixes this; for example adding this after .scrollable
in the above snippet
.semantics {
horizontalScrollAxisRange = ScrollAxisRange(
{ offsetX.floatValue }, { 100f /* dummy value */ })
},
Is it a bug or should this be working without the semantics modifier? I know horizontal scrolling has been discussed many times here but I could not find this particular issue anywherestevebower
05/08/2025, 10:49 AMstevebower
05/21/2025, 9:09 AMflorent
05/21/2025, 9:26 PMMorgan
05/26/2025, 3:11 PMprivate
?
Will this be available in a future update ? Because at the moment, if we want to change the sensitivity, we must use the other method that takes a ScrollableState
and provide a LayoutInfoProvider
on our own.
Also, we cannot customize the sensitivity beyond these 2 values that are HIGH and DEFAULT
@Composable
private fun snapBehavior(
scrollableState: ScrollableState,
layoutInfoProvider: RotarySnapLayoutInfoProvider,
snapSensitivity: RotarySnapSensitivity,
snapOffset: Dp,
hapticFeedbackEnabled: Boolean
): RotaryScrollableBehavior
bod
06/12/2025, 4:37 PMstevebower
06/19/2025, 9:47 AMstevebower
07/04/2025, 10:18 AMbod
07/04/2025, 12:40 PMFrank Bouwens
07/18/2025, 9:40 AMstevebower
07/31/2025, 10:23 AMstevebower
08/14/2025, 10:08 AMyschimke
08/27/2025, 8:12 AMprivate suspend fun circleCompose(): ImageBitmap? =
renderer.renderComposableToBitmap(DpSize(100.dp, 100.dp)) {
Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
Canvas(modifier = Modifier.fillMaxSize()) {
drawCircle(Color.DarkGray)
}
FilledIconButton(onClick = {}) {
Text("\uD83D\uDC6A")
}
}
}
...
addIdToImageMapping("circleCompose", circleComposeBitmap.toImageResource())
stevebower
08/28/2025, 10:05 AMKseniia Shumelchyk
08/28/2025, 4:51 PMflorent
09/03/2025, 3:39 PMprimaryDim = TODO(),
secondaryDim = TODO(),
tertiaryDim = TODO(),
surfaceContainerLow = TODO(),
surfaceContainer = TODO(),
surfaceContainerHigh = TODO(),
outlineVariant = TODO(),
errorDim = TODO(),
florent
09/03/2025, 4:50 PMHorizontalPagerScaffold
is missing a TimeText param π
yschimke
09/03/2025, 6:13 PMflorent
09/04/2025, 8:04 AMyschimke
09/04/2025, 8:28 AMyschimke
09/04/2025, 8:29 AMflorent
09/04/2025, 8:59 AMflorent
09/04/2025, 3:47 PMstevebower
09/11/2025, 10:59 AMTimePicker
type for displaying only Minutes + Seconds pickers. There are some important bug fixes that have been released in 1.6.0-alpha01 and also patched into a 1.5.1 release:
β’ SwipeDismissableNavHost
now marks in-progress transitions as complete for API 36 when swiping, which fixes an issue with lifecycles
β’ ScrollIndicator
direction now matches the content layout direction by default (so if you set reverseLayout
in ScalingLazyColumn
, it will be matched by the ScrollIndicator
)
β’ ScrollAway with TransformingLazyColumn
now working correctly when navigating to another screen and back, so that TimeText
will still scroll away as expected
As always, please see the release notes for full details.yschimke
09/16/2025, 12:21 PMstevebower
09/25/2025, 11:02 AMCurvedTextStyle
parameter warpOffset
. There are some bug fixes that have been released in 1.6.0-alpha02 and also patched into a 1.5.2 release - please see the release notes for details, thanks.stevebower
10/09/2025, 4:22 PMTolriq
10/13/2025, 2:31 PM