https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
compose-wear
  • y

    yschimke

    10/10/2022, 8:21 AM
    If you are using Horologist's
    fadeAway
    modifier. It's being replaced by scrollAway temporarily, and this will be coming in Wear Compose 1.1. The design has changed also for Column and LazyList, so it also fades away. Previously it was just scrolling (like
    Modifier.offset
    ) https://github.com/google/horologist/pull/669/files
  • y

    yschimke

    10/13/2022, 12:42 PM
    Paparazzi 1.1 now has support for 3 Wear devices. It will render automatically with round time text (isScreenRound = true) for 2 of them, and crop screenshots in a circle. https://twitter.com/yschimke/status/1580429572067463168
  • y

    Yingding Wang

    10/14/2022, 1:38 PM
    I tried to rewrite the
    WatchFaceConfig
    class from the
    WatchFaceKotlin
    example using compose-wear, (https://github.com/yingding/wear-os-examples/blob/main/Wear3KtxWatchFaceConfigExam[…]xample/watchfaceconfigexample/editor/WatchFaceConfigActivity.kt), So far everything works fine, except adding the onClick events to setComplication on top of the WatchFace Bitmap generated from EditorSession. In the original example, two Button views are vaguely put to the whole viewports. How can i do this in compose wear in a more accurate way? It would be nice to have a
    EditorSession.renderWatchFaceToComposable(...) ->  (@Composable()()->Unit)
    function to allow me specify the onClick events. Any thoughts on this matter?
    watchface_config.webm
  • a

    andrew

    10/15/2022, 7:02 PM
    It's here!!!!
    b
    • 2
    • 4
  • l

    louiscad

    10/16/2022, 2:42 PM
    ScalingLazyColumn
    is incredibly, mind blowingly, fascinatingly… extremely laggy, even in release builds… 😕 You don't even get 10fps! How is that possible? I tested on the Pixel Watch and the Samsung Galaxy Watch 4. Is Google using these in their apps with some tricks, or is Google using only View APIs? Here's my code:
    import androidx.wear.compose.foundation.CurvedLayout
    import androidx.wear.compose.material.AutoCenteringParams
    import androidx.wear.compose.material.Icon
    import androidx.wear.compose.material.ScalingLazyColumn
    import androidx.wear.compose.material.Text
    import androidx.wear.compose.material.ToggleChip
    import androidx.wear.compose.material.ToggleChipDefaults
    import androidx.wear.compose.material.curvedText
    import androidx.wear.compose.material.rememberScalingLazyListState
    
    
    @Composable
    fun SomeScreenContent() {
        ScalingLazyColumn(
            Modifier.fillMaxSize(),
            state = listSate,
            autoCentering = AutoCenteringParams(itemIndex = 0),
        ) {
            items(20) {
                ToggleChip(
                    checked = false,
                    onCheckedChange = { isChecked -> },
                    label = {
                        Text("Some setting")
                    },
                    toggleControl = {
                        Icon(
                            imageVector = ToggleChipDefaults.switchIcon(checked = false),
                            contentDescription = "setting disabled"
                        )
                    }
                )
            }
        }
    }
    y
    b
    +4
    • 7
    • 77
  • b

    barat

    10/19/2022, 3:13 PM
    Is anyone make base profile with wear os? My app is currently developed with only compose. Scrolling is slow right after running the app, and the speed improves after a certain period of time. If I run the app again after killing the process on the watch, it is slow for a while, and the scroll speed improves after a certain period of time. Can this case also be considered a JIT issue like the thread below? https://kotlinlang.slack.com/archives/C02GBABJUAF/p1655128462622249 I also read about under thread. but my app is already speed-profile. [status=speed-profile] [reason=install] https://kotlinlang.slack.com/archives/C02GBABJUAF/p1665931379289959 I'm trying to proactively add a base profiler into my app. I finished all the settings with base profile code-lab, but I found that "gradle managed device" is not available on the watch. It seems that I have no choice but to root my test device or use an emulator, is there any problem with the improvement effect of the base profiler even if I make base profiler with watch emulator? Also make baseProfile on watch emulator is extreamly slow. I waiting 7 hours but it still PROGRESSING. Currently I give up about processing and retry make baseprofile on next morning. @yschimke How did you create baseline-prof.txt on under commit? Please advise me. https://github.com/android/wear-os-samples/pull/572/files
    y
    b
    +2
    • 5
    • 27
  • j

    John Nichol

    10/24/2022, 7:49 PM
    The team are pleased to announce that Compose for Wear OS 1.1.0-beta01 has been released. Release notes can be found here. More details in the thread.
    • 1
    • 3
  • f

    florent

    10/26/2022, 10:03 AM
    Hi, is the wear os swimming sample from Monday keynote available somewhere? Thanks!
    k
    a
    • 3
    • 5
  • a

    andrew

    10/27/2022, 7:26 PM
    Starting to mock up the wear version of our app rewrite for real 🙂
    j
    k
    • 3
    • 8
  • a

    andrew

    10/27/2022, 7:26 PM
    It’s kinda exciting 🙂
  • a

    andrew

    10/27/2022, 7:31 PM
    It’s also a fun challenge trying to translate over a mobile consumer oriented design language to the wrist, but so far I’m liking what I see 😄
    y
    • 2
    • 2
  • y

    Yingding Wang

    10/29/2022, 10:10 PM
    The onClick of CompactChip has stopped working after I upgraded to
    Wear Compose 1.1.0-beta01
    and
    compose 1.3.0
    . Is there an example how to define CompactChip and make it clickable?
    CompactChip(
        modifier = modifier.padding(top = 8.dp),
        onClick = onClick,
        label = {
            Text(
                text = stringResource(R.string.click_me),
                maxLines = 1,
                overflow = TextOverflow.Ellipsis
            )
        }
    )
    y
    j
    s
    • 4
    • 19
  • f

    florent

    10/31/2022, 10:13 AM
    Hi does wear os support app bundle? I doesn't look like it right? Like you put your app and your wear os app in the same app bundle and the Google play manage the distribution of it to the correct channels
    y
    l
    • 3
    • 2
  • f

    florent

    11/01/2022, 4:09 PM
    Hi it is me again 😁! About the ambient, is it managed by compose automatically? It is probably the case right otherwise you would mention it on the doc and there will be a local provider for it, right?
    j
    k
    • 3
    • 7
  • a

    Andy Himberger

    11/03/2022, 4:52 PM
    I couldn't find just a 'wear' channel so trying here, is there a way to catch exceptions like this from within the wear communication layer? This is the top crash in our watch app that seems to have started/spiked about a month ago:
    Exception e4.b: 20: The connection to Google Play services was lost due to service disconnection.
      at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus (ApiExceptionUtil.java)
      at com.google.android.gms.common.internal.zap.zaa (zap.java)
      at com.google.android.gms.common.internal.zar.onComplete (zar.java)
      at com.google.android.gms.common.api.internal.BasePendingResult.zab (BasePendingResult.java)
      at com.google.android.gms.common.api.internal.BasePendingResult.setResult (BasePendingResult.java)
      at com.google.android.gms.common.api.internal.BasePendingResult.forceFailureUnlessReady (BasePendingResult.java)
      at com.google.android.gms.common.api.internal.zav.zaa (zav.java)
      at com.google.android.gms.common.api.internal.zav.zaa (zav.java)
      at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zaa (GoogleApiManager.java)
      at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnectionSuspended (GoogleApiManager.java)
      at com.google.android.gms.common.internal.zag.onConnectionSuspended (zag.java)
      at com.google.android.gms.common.internal.BaseGmsClient$zzb.handleMessage (BaseGmsClient.java)
      at android.os.Handler.dispatchMessage (Handler.java:106)
      at android.os.Looper.loop (Looper.java:246)
      at android.os.HandlerThread.run (HandlerThread.java:67)
    y
    • 2
    • 9
  • j

    JORGE ALBER

    11/04/2022, 4:50 PM
    Hello everyone i have been reading about compose but i cant understand how to implemente user input, anyone can provide som info please
    k
    y
    i
    • 4
    • 3
  • i

    Ilya K

    11/10/2022, 6:31 AM
    Hi all, i’ve run into a strange bug in ScalingLazyColumn on Wear OS When I use a long Text inside of ScalingLazyColumn and launch the app the bottom of the Text gets the focus, instead of the beginning. Here’s detailed description of a problem with a code snippet https://stackoverflow.com/questions/74384254/bug-in-default-behavior-of-scalinglazycolumn-jetpack-compose-wear-os Any idea how to fix it? Feel free to respond in this thread or on Stack Overflow. In my opinion, it should be the default behavior to focus on the beginning of the first element, focusing on the bottom of the first element makes no sense, hence I feel like it’s a bug
    j
    • 2
    • 2
  • y

    yschimke

    11/10/2022, 6:38 AM
    ScalingLazyListState defaults to the center of the second item (index 1). You can tell it to instead start in the first item and even jn the ScalingLazyColumn parameters use the start of items.
    i
    s
    j
    • 4
    • 7
  • j

    John Nichol

    11/12/2022, 10:24 AM
    Compose for Wear OS 1.1.0-rc01 was released on Wed 9th. It includes updated baseline profiles and a number of bug fixes in preparation for the upcoming 1.1.0 final release. See the release notes for details
  • o

    Odin

    11/13/2022, 9:24 PM
    Hi all 👋 Does anyone know if there is a plan to make a BOM (Bill of Materials) for wear compose artefacts like they introduced for Compose in October (https://android-developers.googleblog.com/2022/10/whats-new-in-jetpack-compose.html)? 🙂 If yes, will that then include the artefacts that compose has or would you need to use the compose BOM as well? Just curious 🙂
    a
    l
    • 3
    • 4
  • j

    JORGE ALBER

    11/13/2022, 10:22 PM
    Hello, i have two projects in compose one for Wear and one for Mobile, i want to sync and share data between them, how can i perform it? Thanks in advance
    y
    f
    +3
    • 6
    • 36
  • i

    Ilya K

    11/14/2022, 8:14 AM
    Google published a playlist of the new Dev Summit, it has a quite a few videos that show how to architect and design apps on Wear OS with Jetpack Compose, I recommend to check it out https://www.youtube.com/playlist?list=PLWz5rJ2EKKc9jBnpl83LH6oZc7nFIVSRq
    y
    • 2
    • 3
  • y

    yschimke

    11/15/2022, 9:32 AM
    Hey @Odin, nice PR for the SquareSegmentedProgressIndicator. Paparazzi screenshot tests, Android Studio previews with animation. https://github.com/google/horologist/pull/695
    o
    • 2
    • 3
  • a

    Arjun Achatz

    11/17/2022, 3:59 PM
    This isn't a compose question (I know I know) BUT I wanted to ask if using the data client on the watch could potentially be a big battery drain ? I have an app sending data every second
    y
    • 2
    • 3
  • n

    Nat Strangerweather

    11/23/2022, 9:03 PM
    Hi, is there an up-to-date tutorial for a simple connection between a mobile phone and a watch? I only want to send a
    String
    . I have tried to follow the DataLayer code in the wear-os-samples, but it is a bit complicated for my level... 🤔
    y
    • 2
    • 2
  • l

    louiscad

    11/24/2022, 5:47 AM
    Hello, if anyone wants/needs to use
    RecyclerView
    or
    WearableRecyclerView
    in a
    @Composable
    function, you need to hack around to get rotary input to work. If any of you need that, let me know, I will share my code in a gist or in an open source library. BTW, does anyone know how to have something like
    ScalingLazyColumn
    but with
    RecyclerView
    ? Basically, I'm looking for the same effect as in the Settings app and in the App Drawer from the Pixel Watch.
    j
    y
    • 3
    • 29
  • m

    Michail Kulaga

    11/24/2022, 3:49 PM
    Hey everyone 👋 . In the latest Horologist release (0.2.3) we added support for rotary with haptics 🎉. We added 3 modifiers :
    rotaryWithScroll
    ,
    rotaryWithFling
    and
    rotaryWithSnap
    .
    rotaryWithScroll
    - a modifier when only scroll is required
    rotaryWithFling
    - scrolling with flinging. Supports any scrollableState
    rotaryWithSnap
    - scrolling with snapping. For now supports only ScalingLazyColumn ( Picker and Pager will be supported as well later ) All modifiers support haptics out of the box, which can be switched off if necessary.
    PXL_20221124_154134932_2.mp4
    l
    y
    +2
    • 5
    • 8
  • a

    Arjun Achatz

    11/24/2022, 6:51 PM
    What is the wear os app lifecycle? Like when does an app go into start/resume/pause/stop ? If it's only OS driven, is there a way to trigger this manually ?
    a
    g
    f
    • 4
    • 16
  • y

    Yingding Wang

    11/24/2022, 11:13 PM
    A silly question, I want to use bluetooth debugging with pixel watch. But can’t find the debugging over bluetooth in android pixel watch app. Is this possible?
    m
    l
    • 3
    • 5
  • f

    florent

    11/25/2022, 4:00 PM
    Hi, is this intended or a bug? I am using wear os scaffold and HorizontalPageIndicator, we can notice that on android studio running device preview it looks ok however on the device the indicator circle is cut. The more I test my composables between the Samsung galaxy watch 4 and the Pixel Watch it seems that their notion of screen size is different, I was expecting compose to abstract that complexity from me. Is it still something being worked on? Thanks 🤗
    a
    y
    • 3
    • 24
Powered by Linen
Title
f

florent

11/25/2022, 4:00 PM
Hi, is this intended or a bug? I am using wear os scaffold and HorizontalPageIndicator, we can notice that on android studio running device preview it looks ok however on the device the indicator circle is cut. The more I test my composables between the Samsung galaxy watch 4 and the Pixel Watch it seems that their notion of screen size is different, I was expecting compose to abstract that complexity from me. Is it still something being worked on? Thanks 🤗
a

Arjun Achatz

11/25/2022, 6:16 PM
Hmm .. I'm using this widget as well, but it works as expected for me. I'm using fillMaxSize for my pages though
I didn't see my indicator dots being cut, but I did offset my circles by 10dp
y

yschimke

11/25/2022, 6:21 PM
Are you using HorizontalPager from accompanist and PageIndicator from Wear Compose?
Horologist has a WearPager that combines them, applies the right 10dp padding and also crops to circle for when you swipe between. If you can reproduce with WearPager, even just to confirm your problem. Then I can fix the bug if any
f

florent

11/25/2022, 6:29 PM
I use the one from wear compose. I had a look at the one from horologist but it uses a snap library from accompanist that is now deprecated.
y

yschimke

11/25/2022, 6:30 PM
Thanks for flagging.
f

florent

11/25/2022, 6:31 PM
So I guess that spacing is gonna be fixed on a newer wear compose version?
y

yschimke

11/25/2022, 6:32 PM
I don't think so, I believe you can just apply the padding.
f

florent

11/25/2022, 6:32 PM
It is a bit weird to have both the components on horologist and wear compose
y

yschimke

11/25/2022, 6:32 PM
I asked this, and believe I got told to apply the padding.
Horlogist uses wear compose pageindicator.
But wear compose can't depend on accompanist, while horologist can
I don't think their is any duplicated pager related code or functionality between them
@florent which is the snap library? We use Accompanist HorizontalPager, which still uses Chris Banes' Snapper. But that project is archived because of core Compose's SnapFlingBenhaviour in 1.3.0.
Which one are you using that doesn't use that?
Archived project: https://github.com/chrisbanes/snapper
Usages in Accompanist https://github.com/google/accompanist/search?l=Kotlin&q=snapper&type=code
f

florent

11/25/2022, 7:04 PM
I built my own pager using compose 1.3 snapflingbehavior. Snapper is the one that for me is deprecated now
y

yschimke

11/25/2022, 7:05 PM
Hardcore :)
f

florent

11/25/2022, 7:05 PM
Hehe 😁
It is not really hardcore in practice, I see that more as an investment to understand compose api
y

yschimke

11/27/2022, 10:42 AM
I've raised this for accompanist https://github.com/google/accompanist/issues/1419, I don't think it's great to expect everyone to implement their own custom pager, since there is a lot of subtle UX to get this right.
BTW I lied about the padding for the indicator, it's 6.dp here https://github.com/google/horologist/blob/37fe1b9366eb8dad344935195002662847158f22[…]java/com/google/android/horologist/compose/pager/PagerScreen.kt
f

florent

11/27/2022, 11:06 AM
2 dp was enough for my case
View count: 20