https://kotlinlang.org logo
Join Slack
Powered by
# compose-wear
  • l

    Lauri Koskela

    04/28/2025, 5:06 PM
    Is it possible to use
    ComposeTestRule
    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")
    y
    s
    • 3
    • 9
  • l

    Lauri Koskela

    05/04/2025, 12:44 PM
    Can someone explain what's going on here with horizontal scrolling? I'm seeing an issue where scrolling an element horizontally sometimes just triggers the system activity swipe-to-dismiss action instead of scrolling. This happens almost all the time on my real device (Galaxy Watch 5) and a bit less frequently in an emulator. It kind of feels like there's some race condition in
    scrollable
    implementation that sometimes passes drag gestures to the activity and some times not. Here's a minimal sample:
    Copy code
    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
    Copy code
    .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 anywhere
    s
    • 2
    • 1
  • s

    stevebower

    05/08/2025, 10:49 AM
    Hi all - I'm delighted to announce that the Wear Compose team has released 1.5.0-beta01, the first beta release for the Wear Compose Material3 library. Additional API changes in this release: the hierarchical focus API now splits the functionality between modifiers for the focus handling and a new LocalScreenIsActive composition local that can be checked to tell if a screen is the currently active one; SwipeToReveal has been updated so that the experimental Foundation API is now deprecated and those parts that are still used have been migrated to the material and material3 libraries - the release notes give more details on this iteration, which removes the SwipeToReveal DSL and makes use of slots for primary, secondary and undo actions. Bug fixes: performance improvements to ScrollIndicator and LocalReduceMotion; fixed issues with EdgeButton and TransformingLazyColumn animations; updated motion of indeterminate CircularProgressIndicator; SwipeDismissableNavHost focus issue addressed; corrected the default alignment for ListHeader and ListSubHeader. Please also see the release notes for a summary of the new components and features, as well as more details on the items called out above - thanks.
    πŸŽ‰ 9
  • s

    stevebower

    05/21/2025, 9:09 AM
    Hi all - we have released 1.5.0-beta02 for Wear Compose, including fixes to TransformingLazyColumn and SwipeToReveal - please see the release notes for more details, thanks.
    πŸŽ‰ 3
  • f

    florent

    05/21/2025, 9:26 PM
    I was so much hoping for a beta version of the material 3 compose, I guess it is maybe for next year then πŸ˜„
    y
    s
    +2
    • 5
    • 10
  • m

    Morgan

    05/26/2025, 3:11 PM
    Anyone from the wear-compose team ? Why is this method
    private
    ? 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
    Copy code
    @Composable
        private fun snapBehavior(
            scrollableState: ScrollableState,
            layoutInfoProvider: RotarySnapLayoutInfoProvider,
            snapSensitivity: RotarySnapSensitivity,
            snapOffset: Dp,
            hapticFeedbackEnabled: Boolean
        ): RotaryScrollableBehavior
    y
    m
    • 3
    • 5
  • b

    bod

    06/12/2025, 4:37 PM
    Am I reading this correctly that watch faces that want to run/render their own UI are deprecated?
    kodee angry 1
    kodee happy 1
    e
    k
    +3
    • 6
    • 19
  • s

    stevebower

    06/19/2025, 9:47 AM
    Hi all - we have released 1.5.0-beta04 for Wear Compose, including some bug fixes - please see the release notes for more details.
    πŸŽ‰ 4
  • s

    stevebower

    07/04/2025, 10:18 AM
    Hi all - we have released 1.5.0-beta05 for Wear Compose with some more bug fixes - please see the release notes for more details.
    πŸŽ‰ 1
  • b

    bod

    07/04/2025, 12:40 PM
    Sorry, this isn't about Compose, but just some piece of WearOS feedback, maybe this can be passed on to people working on the OS. Notifications about apps that are disabled, or permissions being revoked -> on the watch this is intrusive and utterly useless πŸ™‚ Not sure if there's a setting to disable them (if not, please add one) but they should be disabled by default. (In fact, even on the phone, this is very dubious that this brings any value). There you go, just my 2c.
    βž• 5
  • f

    Frank Bouwens

    07/18/2025, 9:40 AM
    1.5.0-beta06 has been released https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0-beta06
    πŸš€ 3
    πŸŽ‰ 2
  • s

    stevebower

    07/31/2025, 10:23 AM
    And now 1.5.0-rc01 has been released with some more bug fixes (especially to TimePicker where some internationalisation bugs had been found and now fixed). https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0-rc01
    πŸŽ‰ 2
  • s

    stevebower

    08/14/2025, 10:08 AM
    We've released 1.5.0-rc02 with small a TimePicker bug fix - https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0-rc02
  • y

    yschimke

    08/27/2025, 8:12 AM
    Horologist 0.8.2-alpha adds a new API for capturing a Composable to a Bitmap for use in Tiles. Might be useful for reusing assets such as charts, between your App and Tiles.
    Copy code
    private 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())
    πŸŽ‰ 1
    m
    • 2
    • 1
  • s

    stevebower

    08/28/2025, 10:05 AM
    Hi all - I'm delighted to announce that Wear Compose 1.5.0 is now released, see https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0 for the full release notes.
    πŸŽ‰ 5
    🦜 2
    πŸš€ 6
    jetpack compose 4
  • y

    yschimke

    08/28/2025, 3:54 PM
    There is an Wear OS #AskAndroid tomorrow

    https://www.youtube.com/watch?v=JWXMywahxEgβ–Ύ

    , come and chat and ask some fun questions.
    βž• 3
  • k

    Kseniia Shumelchyk

    08/28/2025, 4:51 PM
    Hi everyone! If you have missed, we are hosting the Wear OS Spotlight Week this week: https://android-developers.googleblog.com/2025/08/spotlight-week-wear-os.html?m=1 Some nice updates for Material 3 Expressive across Compose and Tiles, Credential Manager, Watch Faces and developer case studies from our friends at Todoist, Amoledwatchfaces and Dashlane πŸ’š And wrapping everything with an #AskAndroid livestream tomorrow as Yuri shared above :)
    πŸš€ 2
  • f

    florent

    09/03/2025, 3:39 PM
    Hi, I am migrating to material3 my app to also add some material expressive components. Is there an equivalent of https://material-foundation.github.io/material-theme-builder/ for wear? I got most of the colors from my phone app but I am missing those:
    Copy code
    primaryDim = TODO(),
        secondaryDim = TODO(),
        tertiaryDim = TODO(),
        surfaceContainerLow = TODO(),
        surfaceContainer = TODO(),
        surfaceContainerHigh = TODO(),
        outlineVariant = TODO(),
        errorDim = TODO(),
    k
    c
    • 3
    • 10
  • f

    florent

    09/03/2025, 4:50 PM
    and I think
    HorizontalPagerScaffold
    is missing a TimeText param πŸ˜…
    s
    • 2
    • 2
  • y

    yschimke

    09/03/2025, 6:13 PM
    I think that just goes in the AppScaffold, or ScreenScaffold
    🧡 2
  • f

    florent

    09/04/2025, 8:04 AM
    and so you can't customize the time string if you use an horizontal or vertical pager?
  • y

    yschimke

    09/04/2025, 8:28 AM
    You can, just nest the scaffolds?
  • y

    yschimke

    09/04/2025, 8:29 AM
    I think that's why it's not there. Because you can put ScreenScaffold above the pager, or in each page, and I believe it will do the right thing
  • f

    florent

    09/04/2025, 8:59 AM
    ah ok I though the design was one AppScaffold and then one of the sub Scaffold πŸ‘
  • f

    florent

    09/04/2025, 3:47 PM
    Do you have a sample that do that? https://developer.android.com/design/ui/wear/guides/get-started/apply#variable-font-axis
    🧡 2
    c
    • 2
    • 3
  • s

    stevebower

    09/11/2025, 10:59 AM
    Hi all - we have released 1.6.0-alpha01 with the additional of new non-clickable `Card`/`TitleCard`/`AppCard`variations and also a new
    TimePicker
    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.
    πŸš€ 2
  • y

    yschimke

    09/16/2025, 12:21 PM
    Not specifically wear-compose, but does include it. But @Garan Jenkin implemented a awesome Androidify feature https://github.com/android/androidify/pull/105 using Watchface Push
    πŸš€ 2
    πŸ‘πŸΌ 1
    πŸ’š 1
  • s

    stevebower

    09/25/2025, 11:02 AM
    Hi all - we have released 1.6.0-alpha02 with the introduction of text-warping using the new
    CurvedTextStyle
    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.
    😲 1
  • s

    stevebower

    10/09/2025, 4:22 PM
    Hi - we have released 1.6.0-alpha03 which implements missing support for verticalAlignment in TransformingLazyColumn (also patched into 1.5.3), adds a parameter to TimePicker so that you can specify the column to be focused initially, and we've removed an unused parameter (targetProgress) in the drawCircularProgressIndicator method. The computation for curved text width has been updated to take spaces before and after text into account (fixes issues with backgrounds not reaching the edge of the curved letters) - this latter change may break screenshots, particularly those with curved text on a background.
    πŸš€ 1
  • t

    Tolriq

    10/13/2025, 2:31 PM
    Quickly checking and it seems the m3 expressive shapes and wavy indicators are not present in Wear Compose ? Is there any plans for that or can we reuse them from the normal m3 ?
    s
    • 2
    • 4