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
  • a

    Austin Nelson

    02/02/2022, 1:55 AM
    https://play.google.com/store/apps/details?id=com.refect.hue4wear It’s finally here 🙌 If anyone has Philips Hue products, would love any feedback. This is my first Jetpack Compose application, and the application is 100% Compose. The initial build is somewhat limited, but still offers full [local] control over all of your Philips Hue lights (on/off, color, and brightness). I am opening a beta track tomorrow and will be releasing automatic bridge finding, color temperatures, groups/rooms, scenes, and remote auth soon! Watchface complications, Tiles, and Hue Entertainment integration are also on the way 💡 Much thanks to this community! (If this kind of content isn’t allowed, I can remove this post)
    👍🏻 1
    👍 6
    🎉 11
    y
    p
    +3
    • 6
    • 44
  • y

    yschimke

    02/04/2022, 3:03 PM
    My Home navigation target is dynamic, because it has a ViewPager What is the right way to navigate to the top of the stack? I ended up using a while loop and popBackStack, because it doesn't see to work if I don't know the route exactly. cc @Steve Bower [G]
    fun navigateToPlayer(clearBackstack: Boolean = true) {
            val route = NavigationScreens.Player.route + "?page=0"
            if (clearBackstack) {
                while (navController.popBackStack()) {}
    
                navController.navigate(route)
            } else {
                navController.navigate(route)
            }
        }
    s
    i
    • 3
    • 6
  • y

    yschimke

    02/07/2022, 10:45 AM
    What is the library approach to dealing with @DimenRes in APIs? Does compose-wear always expect resource values to be resolved outside of the APIs? cc @John Nichol @saryong
    s
    j
    a
    • 4
    • 3
  • j

    John Nichol

    02/10/2022, 6:13 AM
    Compose for Wear OS Alpha16 has been released including ProgressIndicators. Snapping on Pickers and some enhancements for ScalingLazyColumn with more to come in the following releases
    🙌 4
    :nice: 1
    :party-parrot: 6
    👀 4
    🙌🏼 1
    • 1
    • 1
  • l

    Lebron James

    02/10/2022, 7:36 AM
    How does dialog get the value in item across domains? Click in item to open dialog. Because dialog cannot appear in onclick {}, the value in item cannot be modified after onclick {} operation.
    j
    • 2
    • 3
  • a

    Andrew Leung

    02/10/2022, 1:43 PM
    I have a question related more so around distribution of an embedded wear app (not sure if this is the correct forum since this is more for jetpack compose), but the developer docs aren't very clear or up to date anymore. I’ll try here first and perhaps someone can direct me accordingly.
    j
    k
    y
    • 4
    • 18
  • l

    Lebron James

    02/11/2022, 2:44 AM
    Picker supports adsorption, celebrate!!!
    j
    • 2
    • 2
  • l

    louiscad

    02/21/2022, 9:53 PM
    Hello, it looks like we don't have a channel for WearOS Watch Face developers. Is anyone busy making one here?
    j
    k
    +2
    • 5
    • 11
  • l

    Lebron James

    02/23/2022, 9:39 AM
    When I use scalinglazycolumn (autocentring = false), how can I make this page automatically scroll to the top. thank you.
    k
    j
    • 3
    • 7
  • l

    louiscad

    02/26/2022, 10:27 PM
    As I'm rewriting a 6 years old Watch Face project on top of AndroidX Wear Watchface, with the intent of publishing it on the Play Store this time, I'm wondering why we have a Compose backed API for Tiles in Glance, but we don't for WatchFaces. I think it'd be very helpful to have access to
    remember { … }
    ,
    State
    , and other Compose facilities for interactive and animated Watch Faces. Is there a reason we don't have such an API? I'd think maybe there would be some performance concerns, or other potential issues, or maybe just bandwidth? I'm wondering about that because I am pondering about hacking around to use Compose to control what gets rendered on my Watch Face.
    👍 1
    ➕ 1
    y
    z
    j
    • 4
    • 20
  • y

    yschimke

    03/03/2022, 9:30 AM
    Curious is anyone has experience with Lottie in Wear Compose. Well documented the binary and runtime differences. https://github.com/airbnb/lottie/blob/master/android.md#what-is-the-impact-of-lottie-on-apk-size Ultimately this is an app/UX decision, I'm happy to make.
    j
    a
    • 3
    • 3
  • j

    John Nichol

    03/09/2022, 6:21 PM
    Hello - time for your regular fortnightly reminder that there is a new Compose for Wear OS Alpha18 release. Updates for Dialogs, Position Indicator and ScalingLazyList autoCentering mode as well as UX updates and a sample RSB (Rolling Side Button) scroll+fling handler
    :party-parrot: 2
    ❤️ 3
    👍 2
    👍🏽 1
    a
    y
    • 3
    • 5
  • l

    louiscad

    03/12/2022, 8:02 PM
    Hello, can we expect the https://github.com/androidx/androidx repo to accept AndroidX Wear contributions soonish?
    ➕ 3
    j
    y
    • 3
    • 16
  • y

    yschimke

    03/14/2022, 11:25 AM
    I've got a question about using Scaffold with Navigation. I'm switching my PositionIndicator scroll state whenever the navigation NavBackStackEntry changes. The default for this doesn't appear to work, I'm guessing because my scroll type is always ScalingLazyListState state, while other tests change between different scroll types. I've worked around it by wrapping it with
    key(currentBackStackEntry?.destination?.route)
    but surprised I needed to. Is this expected? Am I doing something wrong with when I'm accessing a state field? Or is it a bug in PositionIndicator?
    j
    s
    s
    • 4
    • 13
  • y

    yschimke

    03/16/2022, 9:30 AM
    The UiAutomator code in Compose Macrobenchmarks makes me a bit sad. I do wonder whether there could be say a Compose aware higher level API, since I suspect we are going to replicate various bespoke implementations of actions scroll through list.
    👀 1
    s
    • 2
    • 6
  • u

    건유1019

    03/20/2022, 12:32 PM
    Hi, I'd like to ask you to use Page Viewer (Page Indicators). Are there still Page Viewer (Page Indicators) that are compatible with wearables? I'm using an acompanist-pager because I can't find a way. I'd like to ask if this is the right way.
    j
    • 2
    • 1
  • a

    Austin Nelson

    03/20/2022, 7:02 PM
    Is there a way to dynamically disable the swipe to dismiss gesture? My use case is that I am using the HsvColorPicker composable from https://github.com/skydoves/colorpicker-compose and it works great, except when I start dragging to the right 😕
    j
    s
    • 3
    • 5
  • y

    yschimke

    03/20/2022, 8:27 PM
    Not sure if anyone else uses fastlane to automate play store releases, but if you do this screenshot strategy, fixes the screenshots to be acceptable for the Play Store https://github.com/yschimke/rememberwear/blob/main/wear/src/androidTest/kotlin/com/google/wear/soyted/fastlane/WearScreenshotStrategy.kt
    private fun screenshot(screenshotName: String, block: @Composable () -> Unit) {
            composeTestRule.setContent {
                RememberTheMilkTheme {
                    Scaffold(timeText = {
                        TimeText(timeSource = FixedTimeSource)
                    }) {
                        block()
                    }
                }
            }
    
            composeTestRule.onRoot().assertIsDisplayed()
    
            val context = InstrumentationRegistry.getInstrumentation().context
            val isScreenRound = context.resources.configuration.isScreenRound
            Screengrab.screenshot(screenshotName, WearScreenshotStrategy(isRoundDevice = isScreenRound))
        }
    t
    • 2
    • 5
  • y

    yschimke

    03/23/2022, 8:57 AM
    A question about Compose Tests building on Wear Compose / Material. I ended up with a test like
    @Test
        fun testAutoHide() {
            composeTestRule.setContent {
                VolumePositionIndicator(
                    modifier = Modifier.testTag(TEST_TAG),
                    volumeState = { volumeState },
                    autoHide = true
                )
            }
    
            val positionIndicator = composeTestRule.onNodeWithTag(TEST_TAG)
    
            positionIndicator.assertDoesNotExist()
    
            volumeState = volumeState.copy(current = 51)
    
            composeTestRule.mainClock.advanceTimeByFrame()
            composeTestRule.mainClock.advanceTimeBy(500L)
    
            composeTestRule.onRoot(useUnmergedTree = true).printToLog("testAutoHide")
    
            positionIndicator.assertIsDisplayed()
        }
    j
    s
    • 3
    • 11
  • j

    John Nichol

    03/24/2022, 9:54 AM
    Compose for Wear OS Alpha19 landed yesterday. It includes a new take on the
    CurvedRow
    CurvedLayout
    API including a DSL for describing curved components. Also some APIs moved from experimental to public (such as SwipeToDismissBox) with some minor API updates.
    PositionIndicator
    has had some updates to allow control over positioning, better handing of unscrollable contents, etc. Finally some UX updates to
    ScalingLazyColumn
    scaling parameters and
    CircularProgressIndicator
    size, padding and track colors.
    🎉 1
    🚀 3
    • 1
    • 1
  • y

    Yingding Wang

    03/25/2022, 8:05 PM
    I got some
    Rendering sandbox error
    to use the compose preview with ui-tooling:1.2.0-alpha06 in Bumblebee. Really like
    Devices.WEAR_OS_SQUARE
    and
    Devices.WEAR_OS_SMALL_ROUND
    from compose 1.2.0 in Preview By turning off the rendering sandbox seems to solve the issue, is it recommended to do so? My apology if it is an off-topic question.
    @Preview(
        apiLevel = WEAR_PREVIEW_API_LEVEL,
        uiMode = Configuration.UI_MODE_TYPE_WATCH,
        backgroundColor = WEAR_PREVIEW_BACKGROUND_COLOR_BLACK,
        showBackground = WEAR_PREVIEW_SHOW_BACKGROUND,
        showSystemUi = false, // the android system bar on top
        device = Devices.WEAR_OS_SQUARE
    )
    @Preview(
        apiLevel = WEAR_PREVIEW_API_LEVEL,
        uiMode = Configuration.UI_MODE_TYPE_WATCH,
        device = Devices.WEAR_OS_SMALL_ROUND
    )
    @Composable
    fun WearAppPreview() {
        WearApp()
    }
    k
    • 2
    • 1
  • b

    Bernt Julian

    04/07/2022, 10:06 AM
    Are there any libraries for displaying graphs / charts, while using compose? Thanks
    👀 3
    d
    y
    j
    • 4
    • 3
  • l

    Lebron James

    04/08/2022, 10:24 AM
    Why does scalinglazycolumn constantly refresh the item when the page scrolls? Thanks!
    j
    • 2
    • 4
  • a

    andrew

    04/15/2022, 12:43 AM
    We thought it’d be a cool idea to also write a wearable version of our app, and so it begins!
    :party-parrot: 6
    j
    • 2
    • 2
  • a

    andrew

    04/19/2022, 3:13 AM
    Is there any reason why rotary input on the wear emulator doesnt seem to scroll lists?
    j
    y
    • 3
    • 5
  • j

    John Nichol

    04/20/2022, 6:13 PM
    Compose for Wear OS Alpha 21 is out. Release notes can be found here and there are a lot of changes with some new APIs for curved modifiers as well as a lot of API tidy up as we prepare for API freeze and Beta release. More specifics in the thread.
    :party-parrot: 5
    🚀 7
    👀 3
    🖖 1
    :parrot-upside-down: 2
    🖖🏻 1
    t
    k
    • 3
    • 4
  • y

    Yingding Wang

    04/25/2022, 1:10 PM
    Regarding the ToggleChip in Compose Wear OS Alpha 21, switchIcon() returns now an ImageVector. As i use the following code, the switch Icon doesn’t show anymore in ToggleChip.
    ToggleChip(
        modifier = modifier,
        checked = checked,
        toggleControl = {
            ToggleChipDefaults.switchIcon(checked = checked)
        },
        onCheckedChange = {
            checked = it
        },
    Is there any additional steps in
    toggleControl
    I will need to display the switch icon as that of Alpha 20?
    k
    • 2
    • 2
  • y

    yschimke

    04/30/2022, 8:24 AM
    Anyone using Lottie for animations on Wear? Any issues?
    j
    a
    j
    • 4
    • 10
  • b

    barat

    05/02/2022, 9:11 AM
    Have you ever met this error in wear-compose 1.0.0-alpha21 and accompanist pager(above 0.21.3-beta) environment?
    java.lang.IllegalArgumentException: Inconsistency between the count of nodes tracked by the state (0) and the children count on the SubcomposeLayout (2). Are you trying to use the state of the disposed SubcomposeLayout?
    I thinks it is a same issue on compose issueTracker accompanistIssue I need version 1.0.0-alpha21 to use edgeSwipToDismiss in my pagerScreen. According to the issue tracker above, it seems that the version of compose need downgrade. Does anyone know the solution?
    j
    y
    z
    • 4
    • 5
  • l

    Lisandro Di Meo

    05/05/2022, 1:39 PM
    message has been deleted
    j
    s
    • 3
    • 7
Powered by Linen
Title
l

Lisandro Di Meo

05/05/2022, 1:39 PM
message has been deleted
j

John Nichol

05/05/2022, 3:05 PM
@Steve Bower [G]
s

Steve Bower [G]

05/05/2022, 3:16 PM
Hi Lisandro - I'll have a look at this, but at first sight I would expect a) SwipeDismissableNavHost to always pop the navigation back stack when you swipe to dismiss b) the back button (e.g. on the emulator) to trigger the BackHandler you've configured.
l

Lisandro Di Meo

05/05/2022, 3:30 PM
b is happening correctly
But now you mention, I think I should change the backstack when going to this path in order to change swipedismissablenavhost to pop the navigation where i expect
s

Steve Bower [G]

05/05/2022, 3:40 PM
Yes, you could pop the backstack on the way to C so that swiping back takes you to A. That's nice, because it means you can configure different behaviour according to how you get to C (e.g. for A -> D -> C you might still want to swipe back to D).
🙌 1
Also, the NavController defaults its back button handler to popping the back stack - so changing the backstack on that path means everything is consistent and there's no need to configure a BackHandler.
l

Lisandro Di Meo

05/05/2022, 4:31 PM
Great! Thank you for helping 😄 I'll try that and let you know 🙌 🙌
View count: 6