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

    Daniele B

    02/14/2021, 10:05 AM
    I heard that JetBrains has started experimenting on Compose for iOS. Do you have evidence of this? Twitter, Slack posts?
    o
    t
    m
    • 4
    • 3
  • z

    zoha131

    02/14/2021, 10:53 AM
    Running
    Preview
    composable on real device from
    android library module
    does not work. Is this intended behavior?
    b
    • 2
    • 3
  • t

    Timo Drick

    02/14/2021, 1:24 PM
    rememberSaveableStateHolder() will return a SaveabelStateRegistry which is restricted to store only types that can be saved as Bundle. Is there an alternative without restriction? I do not need persistence storage in my navigation solution.
    i
    a
    • 3
    • 6
  • s

    Shakil Karim

    02/14/2021, 1:39 PM
    Is there any way to create a full width Item in LazyVerticalGrid? which configure as ?
    LazyVerticalGrid(
        modifier = Modifier.fillMaxSize(),
        cells = GridCells.Fixed(column),
        contentPadding = PaddingValues(top = Constants.Padding8dp)
    ) {
    a
    • 2
    • 1
  • d

    Daniele B

    02/14/2021, 3:52 PM
    I am upgraded to: Kotlin 1.4.30 Compose 1.0.0-alpha12 NavigationCompose 1.0.0-alpha07 I get this error:
    java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/activity/compose/LocalOnBackPressedDispatcherOwner;
        at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:83)
        at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:59)
        at myapp.android.NavigationKt.Navigation(Navigation.kt:22)
    any idea?
    i
    j
    • 3
    • 21
  • u

    3bdoelnaggar

    02/14/2021, 6:07 PM
    Class 'androidx.ui.tooling.preview.Preview' is compiled by an unstable version of the Kotlin compiler and cannot be loaded by this compiler
    r
    m
    • 3
    • 2
  • s

    spierce7

    02/15/2021, 1:45 AM
    I created an app in compose for AndroidTV. I’m now ditching compose and moving back to the Android View’s to hopefully get better performance. Android TV’s are basically just super low-end Android devices. I’ve tried to identify anything I’m doing wrong, and even tried to isolate changes into individual widgets, but I still see long pauses, and chugging in animations. I’m curious if it’s known how Compose performs in relation to standard Android View’s. It seems slower to me. It’s still in alpha though, so I’m curious if performance optimizations have started to happen.
    r
    a
    +4
    • 7
    • 35
  • m

    Mehdi Haghgoo

    02/15/2021, 6:19 AM
    There is a new artifact added to compose dependencies i.e. androidx.activity:compose-activity? setContent has been moved in the recent alpha to the mentioned artifact, but the artifact is not mentioned yet in the list of dependencies in the docs.
    😂 1
    i
    • 2
    • 4
  • j

    Johan Reitan

    02/15/2021, 7:59 AM
    I started seeing this in the
    CircularProgressIndicator
    in alpha12. The animation seems to run about 2/3 of the way, then restart. This used to look correctly in earlier versions, and
    LinearProgressIndicator
    doesn’t have this problem. Is this a known issue, or should I report it?
    CircularProgressIndicator.mov
    😀 1
    ➕ 4
    m
    • 2
    • 2
  • v

    Vivek Sharma

    02/15/2021, 10:35 AM
    I was opening Compose samples, and in Crane I am getting this error dialog, how to resolve?
    p
    • 2
    • 2
  • p

    Piotr Prus

    02/15/2021, 11:57 AM
    I am trying to use
    BottomSheetScaffold
    and encountered one problem. I do not know how to open the bottomSheet to certain value. Example: 1. The view shows the list 2. User clicks the element in list 3. BottomSheet opens to certain height 4. User drags the sheet up 5. Sheet reveals to full screen I tried to use BottomSheetScaffoldState.bottomSheetState.expand { }, but this function always open the sheet to full height. I was searching for something like:
    BottomSheetScaffoldState.bottomSheetState.expandByHalf()
    or
    BottomSheetScaffoldState.bottomSheetState.setAnchor(200.dp)
    or similar to this, but no luck. Anyone knows how to make a mid step for BottomSheet?
    j
    j
    s
    • 4
    • 10
  • i

    Ian Warwick

    02/15/2021, 12:17 PM
    hey folks, what is the best "compose" way of calling suspended functions to return data for display, should I still use the
    ViewModel
    approach or is there a better way that still has the same benefits (such as surviving state changes) of using VM approach?
    c
    n
    • 3
    • 2
  • l

    lewis

    02/15/2021, 1:04 PM
    Intermittently when I open my app from the background it crashes, is this a known issue, is there anything I can do to avoid it?
    java.lang.NullPointerException
            at androidx.compose.foundation.gestures.DragGestureDetectorKt.verticalDrag-jO51t88(DragGestureDetector.kt:777)
    :thread-please: 1
    m
    • 2
    • 2
  • n

    nglauber

    02/15/2021, 2:04 PM
    Anyone else having this issue?
    java.lang.NoSuchFieldError: Companion
    	at androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar$Companion.registerProjectExtensions(ComposePlugin.kt:189)
    	at androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar.registerProjectComponents(ComposePlugin.kt:119)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:566)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:129)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:169)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:109)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:421)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:226)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:152)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
    	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:371)
    	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:105)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:249)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:38)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:80)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:92)
    	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:602)
    	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:93)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1644)
    ...
    I’m using Android Studio Arctic Fox | 2020.3.1 Canary 6 with these lib versions…
    :yes: 1
    d
    r
    • 3
    • 9
  • v

    Vivek Sharma

    02/15/2021, 2:53 PM
    prev we used vectorResource(R.drawable.something) in Image() composabe, now it is deprecated how to load image/svg from drawables now?
    r
    • 2
    • 1
  • s

    Se7eN

    02/15/2021, 3:09 PM
    I have a
    LazyColumn
    inside an
    AlertDialog
    and the title and the buttons of the dialog go outside the screen when the content in
    LazyColumn
    is large enough. Is there a way to have some padding around the dialog so the title and the buttons are always visible?
    Modifier.padding
    on the
    AlertDialog
    doesn't work
    z
    • 2
    • 2
  • s

    Shakil Karim

    02/15/2021, 3:42 PM
    Is there is any to achieve Weight like behavior in LazyColumn I have 1 item taking 100 dp and I want 2 item to fill the remaining space not fill the entire screen?
    d
    a
    • 3
    • 3
  • m

    manueldidonna

    02/15/2021, 4:07 PM
    Scroll lags with
    ScrollableTabRow
    after a swipe using alpha12. In alpha9 the scroll was ok. BottomSheetScaffold has the same weird behavior on swipe edit: I've created an issue in the tracker
    screen-20210215-170140.mp4
    s
    r
    • 3
    • 11
  • j

    Jeremy

    02/15/2021, 4:44 PM
    vectorResource
    was deprecated with recommendation to use
    painterResource
    which creates Painter. How to convert
    Painter
    to
    ImageVector
    ?
    a
    s
    j
    • 4
    • 7
  • g

    gbaldeck

    02/15/2021, 5:14 PM
    I'm using compose for desktop and I can't seem to find DropdownMenu. I am trying to make a drop down box or combo box. Is there a different component I should be using?
    r
    j
    l
    • 4
    • 7
  • m

    manueldidonna

    02/15/2021, 6:12 PM
    How can I modify the paint object used by a painter? I have a
    BitmapPainter
    and I need to disable the antialiasing
    • 1
    • 1
  • b

    Big Chungus

    02/15/2021, 6:31 PM
    Is it possible to get parent Box width?
    a
    p
    • 3
    • 5
  • s

    semoro

    02/15/2021, 6:41 PM
    Passing keys all round is very inconvenient and error prone, is there a better way to perform item list recompositions?
    a
    l
    • 3
    • 17
  • n

    natario1

    02/15/2021, 10:28 PM
    Is this a known issue? When passing enabled = false to a BasicTextField that was previously focused.
    java.lang.IllegalStateException: Use active SlotWriter to determine anchor location instead
            at androidx.compose.runtime.SlotTable.anchorIndex(SlotTable.kt:198)
            at androidx.compose.runtime.Anchor.toIndexFor(SlotTable.kt:466)
            at androidx.compose.runtime.Composer.invalidate$runtime_release(Composer.kt:1927)
            at androidx.compose.runtime.RecomposeScopeImpl.invalidateForResult(RecomposeScopeImpl.kt:111)
            at androidx.compose.runtime.RecomposeScopeImpl.invalidate(RecomposeScopeImpl.kt:117)
            at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$onValueChangeWrapper$1.invoke(CoreTextField.kt:234)
            at androidx.compose.foundation.text.CoreTextFieldKt$CoreTextField$onValueChangeWrapper$1.invoke(Unknown Source:3)
            at androidx.compose.foundation.text.TextFieldDelegate$Companion.onBlur$foundation_release(TextFieldDelegate.kt:283)
            at androidx.compose.foundation.text.CoreTextFieldKt.notifyTextInputServiceOnFocusChange(CoreTextField.kt:664)
            at androidx.compose.foundation.text.CoreTextFieldKt.access$notifyTextInputServiceOnFocusChange(Unknown Source:0)
    j
    • 2
    • 2
  • z

    Zach Klippenstein (he/him) [MOD]

    02/16/2021, 12:41 AM
    Spent some of the weekend playing with an idea for a state management solution that takes advantage of all compose’s handy tricks. This was my first time playing with KSP and I didn’t bother trying to make it pretty, but I have a working demo enough to get a feel for it. I am pretty sure this violates some Compose best practices too 🙈 Anyway, maybe there’s some parts of this that could be salvaged for a real library. https://twitter.com/zachklipp/status/1361472794312105987?s=21 https://github.com/zach-klippenstein/compose-model
    👍 4
    👌 2
    👀 11
    t
    c
    • 3
    • 5
  • j

    Jason Ankers

    02/16/2021, 3:27 AM
    How would I use
    BottomSheetScaffold
    with the navigation component? My app consists of a typical bottom-tab layout which is using
    Scaffold bottomBar = { .. }
    like in the docs, but I want to launch bottom sheets from inside my tabs. The sheets should overlay on top of the bottom tabs and I would like to be able to call
    navController.navigate(..)
    to open them. Anyone know of any example apps which have achieved this?
    i
    • 2
    • 11
  • e

    eygraber

    02/16/2021, 3:33 AM
    Is there a standard or 3rd party collection of
    Modifier.shortcuts
    for text navigation?
    • 1
    • 1
  • y

    Yuri Drigin

    02/16/2021, 8:28 AM
    Is
    android:windowSoftInputMode="adjustResize"
    and
    Scaffold { padding ->
    works properly together? Or there exists anther way to adjusting size?
    h
    a
    • 3
    • 3
  • v

    Vivek Sharma

    02/16/2021, 10:28 AM
    Prev we used Modifier.align(SomeAlignment), I guess it is changed. how to align composable , specifically in Box? [SOLVED]
    d
    • 2
    • 11
  • y

    Yuri Drigin

    02/16/2021, 11:20 AM
    What the best way to add push / pop animation to the whole NavHostController?
    p
    • 2
    • 2
Powered by Linen
Title
y

Yuri Drigin

02/16/2021, 11:20 AM
What the best way to add push / pop animation to the whole NavHostController?
p

pawegio

02/16/2021, 11:30 AM
If you mean transitions between
composables
in
NavHost
, then it’s still awaiting feature… Star this issue for updates: https://issuetracker.google.com/issues/172112072
y

Yuri Drigin

02/16/2021, 11:37 AM
Yep. It is. Hope will be implemented soon
View count: 3