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

    Ravi

    05/18/2021, 11:12 PM
    In owl compose sample,
    lifecycleIsResumed
    check is added to discard duplicated navigation events. Is this change required as I've followed similar pattern?
    i
    • 2
    • 7
  • c

    Colton Idle

    05/18/2021, 11:59 PM
    So does AS AF (now in beta) support compose previews? From some other slack teams I'm in it seems to be mixed on whether or not the intent is for it to work.
    :yes: 2
    a
    • 2
    • 2
  • i

    Ian Lake

    05/19/2021, 12:44 AM
    Today, we released Navigation Compose 2.4.0-alpha01: https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0-alpha01 - Navigation Compose joins the rest of the Navigation artifacts with just a single version code, no more 1.0.0 alphas. This also means that concepts like routes (which used to be extension methods you needed to import) are now APIs on the classes themselves and there's no more
    arguments?.getString(KEY_ROUTE)
    - it is just
    destination.route
    . It also means that Navigation Compose gained support for new functionality added to Navigation including multiple back stacks
    👏🏽 1
    👏 36
    🎉 6
    :party-parrot: 9
    👏🏼 2
    r
    t
    • 3
    • 5
  • c

    Colton Idle

    05/19/2021, 1:20 AM
    Anyone upgraded to latest accompanist 0.10.0 seeing this error?
    i
    • 2
    • 3
  • c

    Colton Idle

    05/19/2021, 2:12 AM
    First time that Live Literals are working for me in beta07 with Bumblebee. Super fast! Good work team!
    Kapture 2021-05-18 at 22.11.40.mp4
    🎉 5
    🔥 11
    :kotlin-intensifies: 3
    z
    j
    • 3
    • 3
  • t

    Tin Tran

    05/19/2021, 4:31 AM
    I’m having an error while calling
    rememberNavController()
    with navigation
    2.4.0-alpha01
    and
    1.0.0-beta07
    It’s throwing
    java.lang.NoSuchMethodError: No interface method startReplaceableGroup(ILjava/lang/String;)V in class Landroidx/compose/runtime/Composer;
    Does anyone know what am I missing?
    r
    i
    • 3
    • 3
  • t

    therealbluepandabear

    05/19/2021, 5:11 AM
    Google IO was very exciting, what were your favorite additions to Jetpack compose?
    👍 1
    c
    d
    • 3
    • 2
  • i

    iamthevoid

    05/19/2021, 6:22 AM
    is there way to mock composable functions calls? For example mock
    isSystemInDarkTheme()
    result
    g
    a
    • 3
    • 6
  • t

    Tlaster

    05/19/2021, 6:26 AM
    I've just noticed that there is a new package
    androidx.emoji2:emoji2
    , but it only support View based
    TextView
    , is there any chance to get Compose support?
    c
    s
    r
    • 4
    • 4
  • m

    Marko Novakovic

    05/19/2021, 6:55 AM
    when using
    accompanist-coil
    to load images, how can I get loaded image back? same as you can with
    Coil
    :
    val request = ImageRequest.Builder(context)
        .data("<https://www.example.com/image.jpg>")
        .target { drawable ->
            // Handle the result.
        }
        .build()
    or add
    Target
    on Glide?
    z
    c
    • 3
    • 9
  • s

    Samir Basnet

    05/19/2021, 7:06 AM
    Are Enter and Exit screen transitions with navigation supported in beta 07 ?
    :nope: 2
    👀 1
    t
    f
    +3
    • 6
    • 5
  • r

    Ravi

    05/19/2021, 7:59 AM
    Our app got 15 (multi) languages support and compose screens not reflecting the locale changes, Its working fine in Activity & fragment, plz help me out if anyone knows the solution
    c
    • 2
    • 3
  • a

    allan.conda

    05/19/2021, 8:05 AM
    what is this sorcery 👀
    c
    r
    • 3
    • 3
  • i

    iamthevoid

    05/19/2021, 8:16 AM
    I’m very new in compose, please say why it happens: I look into
    isSystemInDarkTheme()
    sources [1]: but when i try to change uiMode [2] i get nothing [3] If i open
    Configuration
    sources i see that
    uiMode
    just
    public int
    so (theoretically) it must changes and reads as expected but it doesn’t
    :thread-please: 1
    z
    c
    • 3
    • 18
  • m

    Marko Novakovic

    05/19/2021, 9:34 AM
    I have problem when using
    Palette
    API in Compose. it won’t generate palette for given image, same code works in old View System code.
    Palette.from(bitmap)
        .setRegion(0, 0, bitmap.width, 50) // arbitrary 50 height, doesn't matter the number it never works
        .maximumColorCount(3)
        .generate { palette -> ...}
    am trying to capture top region of the given image and extract dominant colour in that region
    • 1
    • 1
  • t

    Tlaster

    05/19/2021, 9:37 AM
    Does any have the issue that
    LazyColumn
    renders blank item content after beta07? sample code and reproduce step in thread
    ➕ 6
    s
    a
    +2
    • 5
    • 18
  • l

    Lucien Guimaraes

    05/19/2021, 1:18 PM
    As we are getting very close to Compose 1.0 I'm very surprised there is no documentation or even samples available to show how to use Permission in a fully Compose app. Is this something that will be available later on ?
    👀 2
    j
    i
    a
    • 4
    • 9
  • m

    ms

    05/19/2021, 1:20 PM
    Getting this error when upgrading AGP to
    7.1.0-alpha01
    Compose
    1.0.0-beta07
    Hilt
    2.35.1
    ➕ 3
    g
    c
    v
    • 4
    • 4
  • d

    Daniele B

    05/19/2021, 1:37 PM
    I am still getting this error, after updating to Compose 1.0.0-beta07:
    java.lang.NoSuchMethodError: No interface method startRestartGroup(ILjava/lang/String;)Landroidx/compose/runtime/Composer; in class Landroidx/compose/runtime/Composer; or its super classes (declaration of 'androidx.compose.runtime.Composer' appears in /data/app/~~yEhlq19loSoeWoeZbQDL0A==/eu.baroncelli.dkmpsample-klwx0P95NjZtTjQ6GrJhPw==/base.apk)
            at androidx.activity.compose.BackHandlerKt.BackHandler(BackHandler.kt:77)
    these are my Android dependencies:
    t
    n
    +3
    • 6
    • 22
  • z

    Zhelyazko Atanasov

    05/19/2021, 3:09 PM
    As far as I remember, a ViewModel is scoped to the first parent Fragment or Activity. In an app with a single Activity and written entirely in compose, wouldn't that result in all VMs scoped to that single Activity? Or probably I misread something 🙂
    f
    m
    +2
    • 5
    • 11
  • s

    Shakil Karim

    05/19/2021, 3:49 PM
    LazyColumn/Row in compose beta 07 still has same performance as compare to beta06 and touch ripple issue is also not resolved yet 😞
    a
    z
    • 3
    • 6
  • t

    Timilehin Aregbesola

    05/19/2021, 3:57 PM
    I have a Scaffold and I'm using scaffoldstate to show snackbar. This works fine until the keyboard is open and the snackbar shows beneath the keyboard. Is it possible to get snackbar to show above the keyboard?
    m
    • 2
    • 3
  • b

    Bradleycorn

    05/19/2021, 4:16 PM
    I’ve got a composable that uses a
    LinearGradient
    for the background on a
    BoxWithConstraints
    where the Box size is
    fillMaxSize()
    so it may be different sizes depending on where it’s used. So far I have it rendering as seen in the attached designer screen shot, which is not quite what I want. I’m trying to get it so that the “line” between red and blue always goes from the bottom left corner to the top right corner, no matter the shape of the Box. Any idea how I can achieve that? My current code is posted as a reply.
    z
    c
    n
    • 4
    • 17
  • g

    grandstaish

    05/19/2021, 4:34 PM
    Should/could nesting scrolling interop between compose and non-compose content? A colleague of mine has nested Compose content inside of an existing screen View-based bottom sheet, and is only finding out after building it that scrolling is completely broken
    m
    • 2
    • 6
  • a

    André Thiele

    05/19/2021, 4:52 PM
    Whats the best way to call remember inside a coroutineScope? I want to asynchronously load an image into a view but remember it if the key hasn't changed..
    z
    • 2
    • 7
  • f

    FunkyMuse

    05/19/2021, 4:55 PM
    does anyone else have a problem with scroll position not being retained by the LazyColumn? talking about beta07
    z
    j
    • 3
    • 6
  • a

    Aman Kapoor

    05/19/2021, 5:03 PM
    Hi, how can be disable/enable FAB button? The docs says that FAB will be disabled when onClick argument is sent as null. But onClick accepts non-null lambdas.
    m
    • 2
    • 2
  • a

    alorma

    05/19/2021, 5:36 PM
    Hi all I'm trying to add navigation and not sure if doing it wrong... https://github.com/alorma/AC-Community/commit/4988aa39985c215d755d896d494ed5f444d25a1b I have a
    HomeScreen
    with BottomNavigation with 3 items. Also, i would want other screens without BottomNavigation
    i
    • 2
    • 14
  • s

    Scott Kruse

    05/19/2021, 5:37 PM
    is compose compatible w/ Kotlin 1.5?
    m
    j
    +3
    • 6
    • 10
  • a

    alorma

    05/19/2021, 6:52 PM
    Other question... How can i make a TopBar on scaffold "floatiing" with a custom shape? I've tried adding a
    clip()
    modifier, but then elevation is lost
    b
    a
    • 3
    • 4
Powered by Linen
Title
a

alorma

05/19/2021, 6:52 PM
Other question... How can i make a TopBar on scaffold "floatiing" with a custom shape? I've tried adding a
clip()
modifier, but then elevation is lost
b

Bradleycorn

05/19/2021, 7:07 PM
maybe you can use the
graphicsLayer
modifier so that you can apply clipping and elevation? Kind of like:
modifier = Modifier
        .fillMaxWidth()
        .padding(32.dp)
        .border(width = 4.dp, color = red700, CutCornerShape(32.dp))
        .graphicsLayer {
            shadowElevation = 8.dp.toPx()
            shape = CutCornerShape(32.dp)
            clip = true
        }
This might be helpful: https://juliensalvi.medium.com/custom-shape-with-jetpack-compose-1cb48a991d42
Disclaimer: I’ve never used it myself, and only learned about it within the last few hours when learning about custom shapes.
a

Abhishek Dewan

05/20/2021, 2:11 AM
You can draw a custom shadow to replicate the shadow you would get with elevation (https://gist.github.com/cedrickring/0497965b0658d6727aaec531f59e8c5c)
View count: 1