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

    Arun Joseph

    02/03/2022, 9:54 AM
    I setup my content in composeTestRule in
    @Before
    composeTestRule.setContent {
        MainNavHost()
    }
    How can I finish the activity completely in
    @After
    I tried
    composeTestRule.activity.finish()
    But that hangs forever
    m
    • 2
    • 5
  • m

    mattinger

    02/03/2022, 3:54 PM
    Does anyone know the rationale behind not exposing any semantic properties for text styles? All i seem to be able to validate is the text string, but not the font size, font family, etc….
    t
    • 2
    • 7
  • t

    Tolriq

    02/03/2022, 4:18 PM
    Facing a strange text issue and wondering what could explain it that I may be doing wrong.
    h
    • 2
    • 7
  • m

    marios proto

    02/03/2022, 4:20 PM
    👋 I get this exception on a release build only, when using an abstactcomposeview inside a coordinator layout
    ViewTreeLifecycleOwner not found from androidx.coordinatorlayout.widget.CoordinatorLayout
    Is this a known issue? Any [G] here that might help perhaps? I can see similar issues on issue tracker, but all recommended that appcompat 1.3+ would fix this, but I am seeing in on 1.41.
    s
    • 2
    • 4
  • s

    Sweety Bertilla

    02/03/2022, 4:52 PM
    Hello everyone, how do we test
    Modifier
    ,
    text styles
    and
    drawables
    in compose
    k
    • 2
    • 3
  • s

    Stephen Vinouze

    02/03/2022, 5:19 PM
    Hello, is there a way to apply a rotation animation with an anchor point? So far, all modifiers I've found apply the rotation at the center. There is a
    rotationMatrix
    method where you can specify your anchor point but I don't think it's supported by Compose yet. Am I missing something?
    r
    • 2
    • 2
  • j

    Joseph Hawkes-Cates

    02/03/2022, 10:00 PM
    I have a layout where I have some common content outside of my navHost which works fine except I have some nav routes where we don’t want to display the components outside of the navHost so I’m hiding them. I have this working fine except, the animation for hiding the stuff outside of the navHost happens before the navigation within the navhost completes which results in a really bad looking transition. I was wondering if anyone else had found a good way to solve this. Details and code examples in 🧵
    i
    • 2
    • 5
  • m

    Marcin Wisniowski

    02/03/2022, 10:36 PM
    I need to animate item additions/removals in a
    LazyColumn
    , which is currently not a built-in functionality (issue: https://issuetracker.google.com/issues/150812265). How are other people solving this? No animation is quite jarring and waiting a few months for an official implementation doesn't really work.
    c
    a
    • 3
    • 2
  • b

    brabo-hi

    02/04/2022, 4:11 AM
    hi all, when using compose i have the following
    BoxWithConstraints {
       Image(painter = painterResource(id = R.drawable.image), contentDescription = null)
    }
    how can i make the image
    width == parent's width
    but the height to keep a constant ration as the original image?
    c
    a
    • 3
    • 5
  • s

    Slackbot

    02/04/2022, 5:32 AM
    This message was deleted.
    r
    • 2
    • 1
  • j

    james

    02/04/2022, 6:00 AM
    when using `ModalBottomSheetLayout`*,* is there a straightforward way to catch a press of the back button and just dismiss the bottom sheet, rather than navigating back entirely? at the moment when I hit back, the entire screen behind the
    ModalBottomSheetLayout
    is popped too, and I'm trying to avoid that behaviour
    ➕ 1
    i
    c
    • 3
    • 4
  • t

    theapache64

    02/04/2022, 6:34 AM
    ⁉️ I am having trouble with
    ComposeTestRule#advanceTimeBy
    method. It doesn’t work as expected with animations. ▶️ Here’s more details : https://stackoverflow.com/questions/70982285/compose-advancetimeby-doesnt-work-with-animation.
    🐛 1
    d
    r
    b
    • 4
    • 11
  • r

    rsktash

    02/04/2022, 6:41 AM
    Can we add extension function like
    SpacedBy(4.dp) { Content() }
    for
    ColumnScope
    and
    RowScope
    ?
    m
    d
    • 3
    • 5
  • c

    Colton Idle

    02/04/2022, 7:02 AM
    My app has 4 tabs at the bottom. On Tab1Screen I'm using a ModalBottomSheetLayout, but the "Modal" shows beneath my tabs. Is there a way to change the "z-index" of my Modal so that it shows up on top of my bottom tabs so that it's a "proper" modal?
    t
    t
    o
    • 4
    • 12
  • z

    Zoltan Demant

    02/04/2022, 9:20 AM
    Why would a
    SaveableStateHolder
    fail to save/restore the state of a
    LazyList
    ? Ive verified that my keys are correct, and Ive stripped out any surrounding logic, yet it doesnt do its thing.
    t
    a
    • 3
    • 16
  • l

    Lukasz Burcon

    02/04/2022, 9:30 AM
    Hey, is there any way of chaining multiple animations depending on each other? Let’s say I want to animate both view’s X offset and it’s size, but the size should start animating after X offset’s animation is finished. Wondering what’s the best approach here
    a
    • 2
    • 3
  • b

    Butter.Flock

    02/04/2022, 11:51 AM
    Hey, I have a tricky problem. I need a
    Pager
    in Compose that wraps its content (so the pager has the height of the largest child). I used Horizontal Pager from Accompanist, however since it is based on
    LazyList
    only the current item is measured and used for height calculation. If now the children have different heights this causes the content below the pager to jump around see video. So far my ideas: • Forcing the
    LazyList
    to measure/draw also items that are not visible (this is possible for RecyclerView), so far I could not find anything in the implementation source code to enable this behaviour. But maybe one of you has an idea? • Using
    Row
    instead of
    LazyList
    . I have an PoC for this, but it resulted in a lot of code since I had to implement Snapper for normal Rows and currently it is still a little bit buggy. I’m happy for every hint on this topic 🙂
    WrapContentPager.mp4
    :plus1: 2
    c
    c
    c
    • 4
    • 9
  • c

    Colton Idle

    02/04/2022, 12:13 PM
    When I add a label to my text field while it's on the screen, it shifts down just ever so slightly (to make room for the floating label text). Is there anyway to get it so that it's always at its max height so to speak even if the label is blank?
    z
    • 2
    • 5
  • m

    mattinger

    02/04/2022, 3:10 PM
    So, i’m experimenting with wrapping some of my composables in View classes to bridge the gap between the xml world and the compose world. Yes, programmers could put a raw ComposeView in and set the stuff in code, but it’s more convenient for them this way. I figured i would write a view that extends FrameLayout and adds a compose view, reads xml attribute and renders the contents of the ComposeView based on those. This works all well and good, except that it breaks the xml preview. The preview pane complains that it can’t find the viewTreeLifecycleOwner during the recomposer creation. Code and error screenshot in thread.
    a
    • 2
    • 7
  • r

    Ravi

    02/04/2022, 4:57 PM
    hi, I’m trying to pass string argument in navgraph, its crashing even after encoding more in the thread
    i
    • 2
    • 6
  • l

    Lukasz Kalnik

    02/04/2022, 6:56 PM
    Can I enable logging for
    AsyncImage
    in coil-compose?
    j
    z
    y
    • 4
    • 13
  • m

    Marcin Wisniowski

    02/04/2022, 11:28 PM
    This is probably something silly, but I just can't find a solution: I have a scrolling column of cards, with a header with a shadow (elevation) at the top (screenshot 1). For some reason, the header's shadow is not visible when a card is under it (screenshot 2). Why is that? How to fix it?
    ✅ 1
    a
    c
    • 3
    • 4
  • r

    Rob

    02/04/2022, 11:28 PM
    Anyone else getting java.lang.AbstractMethodError when building minified builds? This started happening when upgrading gradle to 7.1.0. When I disable obfuscation in proguard-rules.pro this exception doesn't happen. I've tried both compose 1.1.0-rc03 and 1.0.5. Thanks!
    Untitled.txt
    a
    p
    • 3
    • 3
  • j

    james

    02/04/2022, 11:35 PM
    if I have a NavDrawer whose content is largely dynamic (let's say 75% of the items in it come from our API), is it a reasonable thing to do to create a ViewModel for the drawer itself? most of the code I've seen demonstrating NavDrawers in Compose all have static hardcoded items, but my use case requires dynamic content and it feels right to have a NavDrawerViewModel to manage it. does this seem like a good idea?
    m
    • 2
    • 1
  • a

    Ayfri

    02/05/2022, 12:15 AM
    Hi, I have multiple textfields that can be errored, and I have a button to validate everything, and I want to only enable the validate button when no fields are errored, so I created a first-class array of strings, and when an field is errored, the name of the field is added to the array, and my button has the property
    enabled = array.isEmpty()
    but the problem is that the button enabled state is only updated after the array has changed Like if I have a field errored, the array has correctly a new value inside, but the button is only updated when the list is updated after this (like adding/removing an element), not directly when a new element is added to array
    a
    • 2
    • 6
  • c

    chansek

    02/05/2022, 3:28 AM
    open class A(
        open val a: Int,
        val b: String = "Something"
    )
    
    data class B(
        override val a: Int = 20,
        val c: Int = 30
    ) : A(a)
    I have a composable which is dependant upon
    class B
    .
    @Composable
    fun BCard(b: B) {
        // Compose something
    }
    BCard
    recomposes when
    a
    nad
    c
    are changed, but not when
    b
    is changed. How can I solve this?
    ✅ 1
    m
    • 2
    • 1
  • t

    theapache64

    02/05/2022, 8:41 AM
    Why
    Color.White
    doesn’t work? but other colors like
    Color.Red
    or
    Color.Blue
    works! 🧵
    a
    z
    • 3
    • 14
  • a

    Arpit Shukla

    02/05/2022, 3:10 PM
    I have seen some discussions around avoiding architecture component view models in pure compose apps because these ViewModels only work in Android. Does that also mean I should avoid Hilt as well? If yes, what is the recommended way of dependency injection in such apps?
    y
    l
    k
    • 4
    • 5
  • b

    bitkiller

    02/05/2022, 4:20 PM
    Anyone running Compose app on old devices (2015/2016)? I'm finding it visually slow.
    r
    • 2
    • 7
  • m

    Mehdi Haghgoo

    02/05/2022, 5:22 PM
    What is the difference between the composition stage and drawing stage? Apparently, they are not the same.
    a
    • 2
    • 1
Powered by Linen
Title
m

Mehdi Haghgoo

02/05/2022, 5:22 PM
What is the difference between the composition stage and drawing stage? Apparently, they are not the same.
a

Adam Powell

02/05/2022, 5:38 PM
https://developer.android.com/jetpack/compose/phases#3-phases
❤️ 1
View count: 2