https://kotlinlang.org logo
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
  • t

    Tgo1014

    06/14/2022, 6:54 PM
    Not exactly compose related, but I noticed all apps when I open show the icon on black background while loading as splash but mine is just a black screen until the app loads. How do I make this splash screen?
    y
    y
    • 3
    • 15
  • j

    John Nichol

    06/15/2022, 6:08 PM
    Compose for Wear OS 1.0.0-rc01 has been released. We expect this to be the only release candidate with the next release being the 1.0.0 final. The release includes a few UX updates to match the latest UX guidance and small enhancement to enable
    ScalingLazyColumn
    to be visible in Android Studio Previews.
    🤸‍♂️ 2
    ⌚ 2
    🚀 8
    🏗️ 2
    🎉 11
    🖖 3
    • 1
    • 1
  • y

    Yingding Wang

    06/16/2022, 11:10 AM
    Is it possible to add elevation to wear compose chip and also make it outline style? Or is it desired for the watch design guidance to not elevate chip or make it outline? I would like to make this 👇 elvated 8.dp and outline style.
    j
    • 2
    • 3
  • y

    Yingding Wang

    06/16/2022, 9:41 PM
    I have a quick question to the
    WearNavScaffold
    of horologist. I used a
    scalingLazyColumnComposable
    to show a menu and default time text. Wenn I swipe back to the menu screen, the time text is gone. Is it desired behaviour? My navi graph code
    Screen Recording 2022-06-16 at 23.31.39.mov
    👀 1
    j
    y
    • 3
    • 56
  • d

    Daniel Quantil

    06/17/2022, 5:27 AM
    What composable could I use to generate a screen with multiple buttons and text element? Is it scaffold? Maybe someone knows where to find a code example for something similar?
    🙌 1
    ✅ 1
    y
    j
    • 3
    • 14
  • z

    Zoltan Demant

    06/17/2022, 5:40 AM
    I need to use
    rememberRipple()
    in a shared module. Is it OK to bring in material as
    implementation
    (not
    api
    ) even though the module is eventually consumed by both phone & wear variants that make use of material/material-wear? Docs advice against mixing these up, but afaik thats just to ensure that you dont make use of the wrong
    MaterialTheme
    (etc); material-wear itself depends on material?
    y
    j
    • 3
    • 5
  • y

    yschimke

    06/17/2022, 4:09 PM
    Are there clear conventions on where to put a Background on Composables? Or where assumptions about MaterialTheme.colors.background are applied. I just did a deep dive investigating an issue reported for the Media UI and think I've come to the conclusion that user code should almost never set a background, unless it's specific to a Screen such as Artwork.
    j
    • 2
    • 10
  • t

    Tgo1014

    06/17/2022, 6:59 PM
    I was taking a look into the Tile documentation and it says that you can add some time for refreshing the tile using the
    setFreshnessIntervalMillis
    when overriding
    onTileRequest
    . I'm using the Horologist's
    CoroutinesTileService
    where
    onTileRequest
    is final so I can't change when it should refresh. Is there some option for it?
    y
    • 2
    • 8
  • b

    bod

    06/18/2022, 7:28 PM
    Just to be sure: Compose doesn't support text hyphenation yet, right?
    e
    a
    s
    • 4
    • 6
  • y

    yschimke

    06/20/2022, 8:38 AM
    The example discussed previously of using Compose DrawScope to share elements between Canvas and Tiles is now available in the Horologist library. API is still very experimental, mainly around pixels/dp params which I don't think is right yet. But let's you draw the same weekly goals chart to your app and tile. Design first in compose, use compose previews to edit the chart, and then reuse in a Tile.
    🚀 3
    t
    • 2
    • 9
  • j

    John Nichol

    06/22/2022, 5:49 PM
    Compose for Wear OS 1.0.0-rc02 has been released along side Core Compose 1.2.0-rc02. There are a few small UX tweaks for gradients backgrounds on Chips and Cards. The 1.0.0 final version of Compose for Wear OS will be released along with Core Compose 1.2.0 final in the coming weeks.
    🖖 3
    🚀 6
    :parrot-upside-down: 3
  • j

    james

    06/24/2022, 6:29 AM
    is there anything similar to
    animateItemPlacement()
    for
    ScalingLazyColumn
    ?
    j
    • 2
    • 3
  • b

    bod

    06/25/2022, 6:28 AM
    In the same vein, any plans to support sticky headers? I know they are still experimental in LazyColumn but I'm finding myself needing them for my little Wear app 😊 (will use LazyColumn for now)
    👀 1
    j
    • 2
    • 1
  • j

    John Nichol

    06/30/2022, 6:14 AM
    Compose for Wear OS 1.1.0-alpha01 has been released with accessibility improvements for Pickers. Due to a break for the US 4th July weekend the next releases are scheduled for 29th July
    🚀 4
    🎉 7
  • y

    yschimke

    07/01/2022, 1:57 PM
    Not sure if anyone else is doing similar, but I've found it helpful to use paparazzi to compare our stateless composables against Figma designs
    👍🏻 1
    👍 4
    👍🏼 1
    c
    • 2
    • 5
  • y

    yschimke

    07/03/2022, 9:10 AM
    Interesting question on Stack Overflow https://stackoverflow.com/questions/72833107/jetpack-compose-wear-os-scroll-to-top-onresume Jetpack Compose Wear OS Scroll to top onResume?
    👍 1
  • y

    Yingding Wang

    07/03/2022, 12:10 PM
    [Solved] Will there be a horologist modifier to detect bezel event for ScalingLazyColumn? The
    scrollableColumn
    modifier doesn’t seem to register the rotation of GW4 bezel. Is this still the way to do it with
    onRotaryScrollEvent
    modifier (https://stackoverflow.com/questions/70060650/how-to-implement-positionindicator-for-bezel-galaxy-watch-4-classic-wear-os-3) ?
    y
    • 2
    • 4
  • y

    yschimke

    07/04/2022, 3:31 PM
    Is there any guidance for how to do deeplinks from a Complication to a Wear Navigation app?
    a
    b
    y
    • 4
    • 17
  • z

    Zoltan Demant

    07/11/2022, 11:53 AM
    I used to get
    "cannot access file, it is used by another process"
    errors after adopting compose for my phone app; I saw that IntelliJ addressed it in one of their latter releases, and after it got merged into Android Studio I havent ran into it again. Unfortunately, the same thing seems to repeat itself now that Im actively working on a wear specific app. Has anyone else ran into this? Any insights?
    y
    j
    k
    • 4
    • 6
  • z

    Zoltan Demant

    07/14/2022, 9:15 AM
    Im considering creating a custom Text composable that I can reuse across phone/wear variants of my app. Im mostly worried about
    TextStyle
    provided through
    LocalTextStyle
    , which I wouldnt have any access to. At the same time, I have my own design system (which leans on material); components with text all make use of my custom Text composable as well (and provide the appropiate style). The material/material-wear text composables look very similar to me, is there anything else I should keep in mind before doing this?
    y
    • 2
    • 5
  • b

    bod

    07/14/2022, 3:59 PM
    Q: Isn't there a simple way to have a
    ScalingLazyColumn
    with a
    TimeText
    as the first item, so it scrolls with the rest of the contents? (Like the system settings). The samples I can find seem to make it fade away in complicated ways 🙂 And if I naively put a TimeText as the first item in my list, it takes the whole screen height 🤔
    untitled.webmuntitled2.webm
    k
    j
    • 3
    • 8
  • b

    bod

    07/14/2022, 4:44 PM
    Another question: the recommended way to have toggles in a settings-like screen is to use
    ToggleChip
    with
    ToggleChipDefaults.switchIcon
    , correct? Is there a way to animate the toggle switch?
    k
    j
    y
    • 4
    • 7
  • b

    bod

    07/16/2022, 9:23 PM
    Hey I noticed a small animation glitch when showing a dialog. I think it's a vignette appearing for a second at the begin and end of the appear/disappearing animation of the dialog
    untitled.webm
    j
    s
    • 3
    • 6
  • p

    Prosper Ekwerike

    07/20/2022, 9:20 AM
    quick one, I saw @yschimke’s reply to a StackOverflow question related to launching the Gboard activity on a compose wear app. I want to find out whether it is possible to specify to Gboard to open the keyboard directly (as the first screen that shows up) instead of presenting the user with an option to select between audio and text input. For more context, my app already provides a custom audio input alternative for the user, because of this, the extra audio input support provided by Gboard looks a bit redundant.
    y
    • 2
    • 5
  • l

    louiscad

    07/24/2022, 4:44 PM
    Hello, is there a way to get the chin height in a composable?
    y
    j
    a
    • 4
    • 11
  • y

    Yingding Wang

    07/25/2022, 5:37 PM
    A quick question unrelated to compose, but regarding migration to androidx. Is there a guidance of how to migrate
    com.google.android.support:wearable
    to the
    androidx.wear
    libs? There is a mapping for the
    android.support.wear
    lib (https://developer.android.com/jetpack/androidx/migrate/class-mappings), but I haven’t found one for
    com.google.android.support:wearable
    sofar, which contains Watchface, Complication and so on, the kotlin one might be https://developer.android.com/jetpack/androidx/releases/wear-watchface, and it feels almost impossible to just switch the libs, but more like to rewrite everything new. I would really appreciate any hints of how to do that gradually, instead of a big bang.
    l
    j
    g
    • 4
    • 4
  • j

    John Nichol

    07/27/2022, 5:15 PM
    The Compose for Wear OS team is pleased to announce that version 1.0.0 final is released. The release includes a small number of bug fixes from the RC02 but the API is as per the Beta01. Release notes can be found here. Thanks to all of the developers who provided feedback, raised bugs, asked questions to help us reach this milestone.
    j
    t
    • 3
    • 4
  • e

    enighma

    08/02/2022, 5:53 PM
    nice! 999x999 is a very unique resolution of a watch I must say 😄
    y
    • 2
    • 1
  • y

    yschimke

    08/05/2022, 7:52 AM
    I feel optimistically close to having Wear specific support for Compose in Paparazzi. https://github.com/cashapp/paparazzi/pull/411
  • y

    Yingding Wang

    08/05/2022, 10:02 AM
    Is the ScalizingLazyListState() and ScalingLazyColumn autoCentering conflict still present in wear compose-material:1.0.0? The following code doesn’t work, which shows only a dark screen at the beginning.
    val state: ScalingLazyListState = rememberScalingLazyListState()
    Scaffold (
         vignette = { Vignette(vignettePosition = VignettePosition.TopAndBottom) },
         positionIndicator = { PositionIndicator(scalingLazyListState = state) }
    ) {
         ScalingLazyColumn (
             modifier = Modifier.fillMaxSize(),
             verticalArrangement = Arrangement.Center,
             state = state,
             anchorType = ScalingLazyListAnchorType.ItemCenter,
         ) {...
    After I set the ScalingLazyListState(), and autoCentering both to (0, 0), the first element is shown correctly.
    val state: ScalingLazyListState = rememberScalingLazyListState(
                initialCenterItemIndex = 0,
                initialCenterItemScrollOffset = 0
    )
    Scaffold (
         vignette = { Vignette(vignettePosition = VignettePosition.TopAndBottom) },
         positionIndicator = { PositionIndicator(scalingLazyListState = state) }
    ) {
         ScalingLazyColumn (
             modifier = Modifier.fillMaxSize(),
             verticalArrangement = Arrangement.Center,
             state = state,
             anchorType = ScalingLazyListAnchorType.ItemCenter,
             autoCentering = AutoCenteringParams(itemIndex = 0, itemOffset = 0)
         ) {...
    And set to (1, 0) as the both defaults are, doesn’t work. (0, 0) seems to be the only working combi. I think this issue was also present in horologist (https://github.com/google/horologist/issues/245). Any thoughts on this are appreciated. Update: It is worth to mention that my items are two full screen elements. After I scrolled the screen, the code behaved like I had set (0, 0).
    item {
       Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
          Text(text = "Hello World!")
       }
    }
    j
    • 2
    • 16
Powered by Linen
Title
y

Yingding Wang

08/05/2022, 10:02 AM
Is the ScalizingLazyListState() and ScalingLazyColumn autoCentering conflict still present in wear compose-material:1.0.0? The following code doesn’t work, which shows only a dark screen at the beginning.
val state: ScalingLazyListState = rememberScalingLazyListState()
Scaffold (
     vignette = { Vignette(vignettePosition = VignettePosition.TopAndBottom) },
     positionIndicator = { PositionIndicator(scalingLazyListState = state) }
) {
     ScalingLazyColumn (
         modifier = Modifier.fillMaxSize(),
         verticalArrangement = Arrangement.Center,
         state = state,
         anchorType = ScalingLazyListAnchorType.ItemCenter,
     ) {...
After I set the ScalingLazyListState(), and autoCentering both to (0, 0), the first element is shown correctly.
val state: ScalingLazyListState = rememberScalingLazyListState(
            initialCenterItemIndex = 0,
            initialCenterItemScrollOffset = 0
)
Scaffold (
     vignette = { Vignette(vignettePosition = VignettePosition.TopAndBottom) },
     positionIndicator = { PositionIndicator(scalingLazyListState = state) }
) {
     ScalingLazyColumn (
         modifier = Modifier.fillMaxSize(),
         verticalArrangement = Arrangement.Center,
         state = state,
         anchorType = ScalingLazyListAnchorType.ItemCenter,
         autoCentering = AutoCenteringParams(itemIndex = 0, itemOffset = 0)
     ) {...
And set to (1, 0) as the both defaults are, doesn’t work. (0, 0) seems to be the only working combi. I think this issue was also present in horologist (https://github.com/google/horologist/issues/245). Any thoughts on this are appreciated. Update: It is worth to mention that my items are two full screen elements. After I scrolled the screen, the code behaved like I had set (0, 0).
item {
   Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
      Text(text = "Hello World!")
   }
}
(0, 30) for both seem to work, maybe it is because I have two full screen items, thus (1, 0) defaults doesn’t seem to work well, but should the initialization of
ScalingLazyListState
and
autoCentering
of
ScalingLazyColumn
are not the same, the code doesn’t work.
val listState: ScalingLazyListState = rememberScalingLazyListState(
    initialCenterItemIndex = 0,
    initialCenterItemScrollOffset = 30
)

...
   ScalingLazyColumn(
    autoCentering = AutoCenteringParams(itemIndex = 0, itemOffset = 0)
The construct of state and autoCentering is somehow confusing.
j

John Nichol

08/05/2022, 12:09 PM
there are no issues with ScalingLazyColumn that I know of - not sure what conflict you are referring to
AFK at the moment but will take a look and try and repro your use case
could you raise a bug and attach repro project if possible
The Horologist bug you referenced https://github.com/google/horologist/issues/245 was about Time Text not ever displaying if you give wrong config - so doesn't seem related at all
I have tried and failed to reporoduce the issue - here is my code based on your description
@Composable
fun SLCLargeItemsNotVisible() {
    val state = rememberScalingLazyListState()
    ScalingLazyColumn(
        modifier = Modifier.fillMaxSize(),
        verticalArrangement = Arrangement.Center,
        state = state,
        autoCentering = AutoCenteringParams()
    ) {
        items(4) {
            Card(
                onClick = {},
                modifier = Modifier.height(300.dp),
            ) {
                Box(modifier = Modifier
                    .fillMaxSize()
                    .background(Color.Blue))

            }
        }
    }
}
I also tried adjusting both autoCentering and rememberScalingLazyListState indexes
I am running on an 384x384 px round emulator
y

Yingding Wang

08/05/2022, 2:40 PM
Sure. Let me double check if there is something different and I will try to attach a repo and make a bug report.
my bad, it happens with a fullscreen Image composable only
@Composable
fun fullScreenImage() {
    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        Image(
            painter= painterResource(R.drawable.watch_preview_circular_384),
            contentDescription = "Yellow fullscreen"
        )
    }
}

@Composable
fun fullScreenText() {
    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        Text(text = "Hello World!")
    }
}
will open an issue report.
@John Nichol @yschimke Thanks for looking into this issue, I have opened a bug report (https://issuetracker.google.com/issues/241545939) and attached a Github repo (https://github.com/yingding/autoCentering) to it. A video record for issue UI behaviour is available at: (

https://github.com/yingding/autoCentering/blob/main/video/NotShowingImageAtStart.mov▾

) A video record for desired UI behaviour is available at:

https://github.com/yingding/autoCentering/blob/main/video/showImageAtStart.mov▾

j

John Nichol

08/06/2022, 9:32 AM
Thanks - will probably be Monday before I take a look - interesting that is it happening for
Images
I don't have any immediate ideas why it would matter what the type of content is - but with a repro case I am sure we will soon get to the bottom of it.
I think I have found and fixed the problem, just need to do a bit more testing and a patch should land today. As a workaround add a 0.dp height spacer as a third item in your list and it should be visible as expected.
Also thanks for the great bug report - so much easier to find these issues when you have a good repro case.
y

Yingding Wang

08/09/2022, 11:43 AM
Indeed the workaround adding a 0.dp height spacer as a third item in my ScalingLazyColumn works. 😇 Thanks also for the rapid responses, I am glad that I can help make wear-compose rock solid.
j

John Nichol

08/09/2022, 12:06 PM
cool - the patch will land in 1.0.1 and 1.1.0-alpha04 on 24th August as we missed the cut for this weeks release - but as we have a workaround hopefully that is not too inconvenient
View count: 12