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

    05/06/2022, 5:33 PM
    Maybe a navigation question, but is there an easy way to tell the difference between a destination becoming active by back (swipe or button) vs navigation (with launchtop)?
    j
    s
    • 3
    • 4
  • y

    yschimke

    05/10/2022, 12:43 PM
    I have a design that requires a variable width chip. Chip with the slots seems to grab full width, assuming it's across the whole screen. Is there a particular form I should use to get the CustomChip described here? https://developer.android.com/training/wearables/compose/chips Or that's not supported by the Wear material components at the moment?
    k
    s
    j
    • 4
    • 17
  • l

    louiscad

    05/11/2022, 9:58 PM
    ⚠️ Found a kinda dead link on that article in the "Compose for Wear OS" section: https://android-developers.googleblog.com/2022/05/whats-new-in-jetpack-compose.html It leads to https://android-developers.googleblog.com/2022/05/announcing-compose-for-wear-os-beta.html that looks empty.
    k
    • 2
    • 1
  • k

    Kseniia Shumelchyk

    05/12/2022, 12:07 AM
    Glad to share that today we released the first Beta of Compose for Wear OS! 🎉 You can read more about the announcement in blogpost: https://android-developers.googleblog.com/2022/05/announcing-compose-for-wear-os-beta.html Huge thank you for everyone who tried early versions, gave us feedback and helped to shape the APIs! There is also another release announcement inside this blogpost 🥚🙃 Hope you’re enjoying Google I/O, stay tuned for Wear OS content coming on Day 2 👀
    👍 5
    🖖 1
    👍🏽 2
    👍🏼 1
    ⌚ 4
    ❤️ 9
    🖖🏻 1
    🎉 7
    👍🏻 3
    t
    y
    • 3
    • 2
  • y

    yschimke

    05/13/2022, 8:17 AM
    Some Compose for Wear OS preview utilities from horologist https://github.com/google/horologist/pull/147/files#diff-9dc0d46485295a9dd95df35a83c430891488937f7cc1fafd0bbf08cd3b35c347
    @WearPreviewDevices
    @WearPreviewFontSizes
    @Composable
    @OptIn(ExperimentalHorologistAudioUiApi::class)
    fun VolumeScreenPreview(
        @PreviewParameter(AudioOutputProvider::class) audioOutput: AudioOutput
    ) {
    :nice: 4
    👍 8
    👍🏻 1
    👍🏼 1
    👍🏽 2
    c
    a
    • 3
    • 11
  • y

    yschimke

    05/15/2022, 9:25 AM
    Another Horologist feature - WearNavScaffold. https://twitter.com/yschimke/status/1524825410068004864
    👍 1
    • 1
    • 3
  • y

    yschimke

    05/15/2022, 10:02 AM
    @John Nichol What is the UX guidance for GoogleMaps? We use Vignette for content that might go to the edge. Maps seems to have similar case, would you suggest using CurvedLayout with a gradient to blur the edges for full bleed content like Maps?
    j
    • 2
    • 2
  • b

    Bogdan C

    05/16/2022, 8:40 AM
    Hello all. Did anyone encounter huge lag and FPS drop for the first ~5-10 seconds when a screen with ScalingLazyColumn is used? I switched to Column + .verticalScroll() and it's much better.
    j
    k
    s
    • 4
    • 8
  • b

    Bogdan C

    05/16/2022, 5:56 PM
    Before I ask the next one, please inform me if this is not the right place for these questions. I am trying to add a complication and glance tile for my app. Each of those would have the same logic: 1. get the location 2. do a network request with the result 3. update the complication/tile My main concern is that the get location from FusedLocationProviderClient is not synchronous, so 2 and 3 are in addOnSuccessListener. I am looking for some directions in how this is supposed to work. Currently I am trying to start a Worker to get the location and do the network request and then somehow this one should request an update on the UI. Is this the right way?
    j
    k
    +3
    • 6
    • 23
  • y

    yschimke

    05/18/2022, 12:22 PM
    Another feature from Horologist - but hopefully more an example for Connecting Bezel/RSB scrolling with something not directly UI related. In this case volume control.
    volumescroll.mp4
    :kotlin-intensifies: 1
    😯 3
    👍🏽 1
    👍 3
    👍🏼 1
    a
    • 2
    • 10
  • t

    Tgo1014

    05/18/2022, 12:44 PM
    The Live Edit also works for wear?
    k
    • 2
    • 2
  • j

    John Nichol

    05/19/2022, 6:42 AM
    Compose for Wear OS 1.0.0-beta02 is available - It includes a collection of UX improvements and bug fixes including Picker, HorizontalPageIndicator EdgeSwipe. and snappier ScalingLazyList snapping The main thing I want to bring your attention to is a change in UX bahaviour of Chip/CompactChip/ToggleChip/SplitToggleChip which will now default their size to fit their contents rather than default to full width of their parent.
    🤸‍♂️ 2
    🎉 4
    🤸‍♂️🏽 1
    🤸‍♂️🏻 1
    y
    • 2
    • 3
  • y

    yschimke

    05/20/2022, 7:50 AM
    Another blatant Horologist commercial, this time thanks to @Steve Bower [G] and the Wear OS UX team - some high quality full screen date and time pickers. https://google.github.io/horologist/composables/
    👍🏼 1
    👍🏽 1
    👍 4
    j
    z
    • 3
    • 7
  • v

    Venthorus

    05/23/2022, 5:13 PM
    With the introduction of Health Services on Wear OS and the arrival of the Pixel Watch in a few months I'm a bit surprised about the lack of guidance for Ambient Mode in Compose, which will probably be used by most fitness and medical apps to show some data during an exercise. Right now I am just setting a Boolean from onEnterAmbient() and onExitAmbient(), which then leads to hiding interactive UI elements and the progress indicator (which would otherwise update every frame). I do not handle the other methods (e.g. onUpdateAmbient()) at all; is that how it is supposed to be? It feels like I should do more. There is also a problem where Ambient Mode still is not working correctly or not as expected on the Samsung Galaxy Watch 4: When entering Ambient Mode, I receive almost no updates, so the time does not update every second (the heart rate does not update either, but that is probably an issue with the Health Services batching them despite being in Ambient Mode). At first I thought that might be an issue with Compose and handling Ambient Mode wrong (like updating the screen too often), but the Google Fit app has exactly the same problem while the Samsung Fit app works perfectly during Ambient Mode. I guess Google Fit doesn't use Compose yet and the Samsung Fit app probably has some special API access?
    👀 2
    k
    • 2
    • 1
  • j

    Jeremiah Jordan

    05/24/2022, 6:51 PM
    Quick question: To implement a horizontal pager (or carousel) on Wear Compose, do I use the ViewPager2 components or the HorizontalPager components (from accompanist)?
    y
    • 2
    • 7
  • b

    bod

    05/28/2022, 7:28 AM
    Hello, World! Is it expected that the Wear Compose preview don't work on AS Chipmunk?
    j
    y
    j
    • 4
    • 17
  • b

    bod

    05/28/2022, 10:07 AM
    I have a full screen horizontal pager (using Accompanist's
    HorizontalPager
    ), and the default Activity's swipe to dismiss behavior "vaguely works" 🙂 By that I mean, if I swipe with a quick enough gesture, it works. If I swipe slowly, it doesn't. (not using
    NavHost
    or
    SwipeToDismissBox
    ) Any idea/pointers?
    j
    y
    s
    • 4
    • 10
  • b

    barat

    05/29/2022, 5:29 PM
    Previously I was using Yuri's solution for rotaryInput. However, as wear-compose was raised to beta, that solution did not work. I replaced it with onRotaryScrollEvent and focusRequest, which were added to Alpha-15 in the past, and it seems to work normally now. Please let me know if you have any known issues or better suggestions regarding this.
    val scope = rememberCoroutineScope()
    val focusRequester = remember { FocusRequester() }
    LaunchedEffect(Unit) {
        focusRequester.requestFocus()
    }
    Modifier
    .onRotaryScrollEvent{
       scope.launch{
           scalingLazyListState.scollBy(it.verticalScrollPixels)
       }
       true
    }
    .focusRequester(focusRequester)
    .focusable()
    What I additionally found out about this is that focuseRequester() and focasable() must not be above onRotaryScrollEvent{}. • working
    .onRotaryScrollEvent{
       scope.launch{
           scalingLazyListState.scollBy(it.verticalScrollPixels)
       }
       true
    }
    .focusRequester(focusRequester)
    .focusable()
    • not working
    .focusRequester(focusRequester)
    .focusable()
    .onRotaryScrollEvent{
       scope.launch{
           scalingLazyListState.scollBy(it.verticalScrollPixels)
       }
       true
    }
    🙌 1
    y
    t
    j
    • 4
    • 14
  • j

    John Nichol

    06/03/2022, 6:23 AM
    Compose for Wear OS Beta03 has been released. This includes changes to enable
    ScalingLazyColumn
    to work in @Preview and also a change in its default behaviour so that content will be Center rather than Left aligned by default. We expect this to be the final beta release.
    🎉 12
    🙌🏻 1
    🙌 2
    y
    • 2
    • 2
  • y

    Yingding Wang

    06/06/2022, 3:28 PM
    I have a quick question regarding the differences between Accompanist and Horologist. The Accompanist is designed for Android in mind and Horologist is for Wear OS? They both are based on compose right? I was looking for Pager Layouts in Horologist, but it is still only available in Accompanist.
    j
    y
    • 3
    • 9
  • y

    Yingding Wang

    06/07/2022, 10:51 AM
    I found it rather difficult to us
    compose-wear
    with an
    AppCompactActivity
    on Wear OS, if i want to migrate to wear compose along side my view system code. The following steps are necessary: 1. the view code need to use
    Theme.AppCompat.DayNight.NoActionBar
    from MDC lib
    com.google.android.material:material
    2. use the AppCompatTheme Adaptor from the Accompanist
    com.google.accompanist:accompanist-appcompat-theme
    to copy over the AppCompat Theme to a MaterialTheme composable 3. Add wear compose dependencies, and also horologist dependencies I wish there is a codelab for this 🙂 I made an example project to demo this possibility that I can also migrate to compose-wear starting with new features along side view system code (https://github.com/yingding/wear-os-examples/tree/main/Wear3KtxPagerExample), would love to hear your thoughts on this.
    y
    • 2
    • 20
  • y

    yschimke

    06/07/2022, 12:49 PM
    @Yingding Wang For the codelab, is it specifically about introducing a first compose screen into an existing Wear app? I can't promise anything, but just like to understand the scope of what you are after and if it's slightly different what other material we already have. Or if it's important to have ways to share themes between android:theme and Wear MaterialTheme.
    y
    • 2
    • 1
  • z

    Zoltan Demant

    06/08/2022, 7:58 AM
    Just making sure I dont shoot myself in the foot further down the line. The wear foundation is additive to the regular one, meaning that Id be fine bringing the regular foundation into my wear integration, while also depending on and making use of the wear specific one to support curved modifiers, etc?
    k
    • 2
    • 1
  • y

    yschimke

    06/10/2022, 4:46 PM
    PSA: You should look at Paparazzi for your screenshot testing needs https://github.com/cashapp/paparazzi/
    ➕ 2
    a
    a
    • 3
    • 4
  • y

    yschimke

    06/13/2022, 7:41 AM
    If anyone here also has a Tile for their app. I've added support to the Horologist project for Android Studio previews (via the Compose @ Preview annotation). Here shown previewing different devices (small round, large round, square) and font sizes.
    🙏 1
    j
    l
    • 3
    • 9
  • t

    Tgo1014

    06/13/2022, 12:49 PM
    I’m having an “issue” where, when opening a detail screen, the top item is displayed but the padding on the top is not respected, so the item is behind the clock. Is there a way to fix it?
    device-2022-06-13-004154.webm
    y
    b
    j
    • 4
    • 29
  • y

    yschimke

    06/13/2022, 1:54 PM
    @Tgo1014 @bod Curious about what each of your tech stack looks like? Compose obviously, but Coil for images? something else? Do you plan a tile for your app? Feel free to respond 1:1, or not at all.
    b
    t
    +4
    • 7
    • 62
  • y

    Yingding Wang

    06/13/2022, 5:07 PM
    Is there already a material-icon or material widget in wear os compose to show monk skin tone scale? (https://blog.google/products/search/monk-skin-tone-scale/)
    🤔 1
    j
    b
    y
    • 4
    • 13
  • t

    Tgo1014

    06/13/2022, 11:25 PM
    I found a small bug, if you use
    scrollBy
    the
    PositionIndicator
    is not shown but if you use
    animateScrollBy
    instead, it shows (at least when calling inside the
    onPreRotaryScrollEvent{}
    . I'll post the code to reproduce on the 🧵
    👀 1
    j
    y
    • 3
    • 6
  • b

    bod

    06/14/2022, 5:55 PM
    Hey this is kind of a digression, related to the topic of performance and baseline profiles. And this is probably a naive question, but I was wondering: why not compiling the whole app, ahead of time? Instead of just the "hot spots"? Which need to be collected beforehand and then packaged etc. What am I missing?
    l
    y
    • 3
    • 6
Powered by Linen
Title
b

bod

06/14/2022, 5:55 PM
Hey this is kind of a digression, related to the topic of performance and baseline profiles. And this is probably a naive question, but I was wondering: why not compiling the whole app, ahead of time? Instead of just the "hot spots"? Which need to be collected beforehand and then packaged etc. What am I missing?
l

Landry Norris

06/14/2022, 6:11 PM
The JIT compiler can use information that it gets during runtime to sometimes generate code that’s faster then AOT compiled code, especially C2, where the generated code doesn’t have to work in general. Most JVMs use tiered compilation for this reason. Because of this, I would assume the JIT is the primary way of running code, with AOT there to help startup times.
b

bod

06/14/2022, 9:53 PM
Thanks! It's probably a bit over my head 😅. Also found this good article that explains a few things (not Android but JVM): https://www.cesarsotovalero.net/blog/aot-vs-jit-compilation-in-java.html
y

yschimke

06/14/2022, 10:49 PM
I think the android aspect is key. It's very different to the JVM and Graal story. Not sure the same choices apply.
On Android the tension of multiple apps installed from playstore, app updates becoming more frequent, subtle pervasive animations etc.
But most of all, androidx unbundled most critical code, now shipped with your app, while views are code optimised because its part of the system.
I think I remember this being a good podcast on the topic https://adbackstage.libsyn.com/episode-183-baseline-profiles
👀 1
🙏 1
View count: 12