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

    tcracknell

    10/01/2020, 5:29 PM
    Hello! The latest Jetpack Compose minor release, alpha04, is finally here! You can get it now on Google’s Maven Repository.  Release notes are available at https://developer.android.com/jetpack/androidx/versions/all-channel. Two important things to be aware of:  • androidx.compose:compose-compiler has been refactored to androidx.compose.compiler:compiler • Compose Version 1.0.0-alpha04 is only compatible with Android Studio 4.2 Canary 13 and later.
    🎉 32
    👍 11
    🔥 13
    z
    z
    +2
    • 5
    • 10
  • g

    Guy Bieber

    10/01/2020, 6:55 PM
    What happened to Modifier.weight in alpha04
    😱 2
    😫 1
    r
    z
    • 3
    • 13
  • a

    Alex Burdusel

    10/01/2020, 7:21 PM
    Can't seem to figure out why gradle is searching for
    compose-compiler
    event though I declared
    androidx.compose.compiler:compiler
    as dependency.
    Untitled
    z
    • 2
    • 8
  • n

    Neil

    10/01/2020, 7:24 PM
    Hi All, Is it possible to add a header item into a LazyColumnFor. So it appears once at the top of the List , but also scrolls with the list.
    y
    n
    d
    • 4
    • 10
  • c

    Colton Idle

    10/01/2020, 8:58 PM
    Does compose Alpha 04 work with kotlin 1.4.20? (Before you say "Just try it" I'm trying to migrate an existing project where 1.4.20 solves other issues like kotlinx.synthetics, plus some other kotlin bugs I had, and so it's hard for me to tell who the culprit is which is why I'm just posing the question 😄) EDIT: Aha! I think I have my answer. Even though the newest AS canary mentions
    kotlinCompilerVersion '1.4.10'
    it also mentions
    ext.kotlin_version = "1.4.20-M1"
    j
    • 2
    • 10
  • b

    Bsn Net

    10/01/2020, 10:04 PM
    Hi, LazyColumn in alpha4 works great, should we use LazyColumn or LazyColumnFor and what is the difference ? Another question, how to control scroll offset index using LazyColumn/LazyColumnFor, thanks
    z
    • 2
    • 4
  • c

    Colton Idle

    10/01/2020, 10:10 PM
    Has anyone run into this when trying to migrate an existing app to compose? Getting this as a build failure. (full stacktrace in thread)
    e: java.lang.NoSuchMethodError: org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor.getVisibility()Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;
    	at org.jetbrains.kotlin.kapt3.stubs.ClassFileToSourceStubConverter.convertMethod(ClassFileToSourceStubConverter.kt:840)
    	at org.jetbrains.kotlin.kapt3.stubs.ClassFileToSourceStubConverter.convertClass(ClassFileToSourceStubConverter.kt:395)
    	at org.jetbrains.kotlin.kapt3.stubs.ClassFileToSourceStubConverter.convertTopLevelClass(ClassFileToSourceStubConverter.kt:186)
    	at org.jetbrains.kotlin.kapt3.stubs.ClassFileToSourceStubConverter.convert(ClassFileToSourceStubConverter.kt:131)
    	at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.generateKotlinSourceStubs(Kapt3Extension.kt:295)
    	at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:170)
    	at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:100)
    	...
    • 1
    • 1
  • b

    Bsn Net

    10/01/2020, 10:34 PM
    I think LazyColumn and LazyColumnFor still have bug in the LazyListState scroll position, my scenario : I have list of items (100 items), when I scroll down to say item no 30, then I filter the list, so it only has 10 items, it will crashed java.lang.IllegalStateException: entered drag with non-zero pending scroll: -1403.0696 at androidx.compose.foundation.lazy.LazyListState.onScroll$foundation_release(LazyListState.kt:171) at androidx.compose.foundation.lazy.LazyListState$scrollableController$1.invoke(LazyListState.kt:144) On comparison, when I use ScrollableColumn, it works perfectly
    ➕ 2
    m
    j
    +2
    • 5
    • 13
  • s

    Sam

    10/01/2020, 11:05 PM
    Great to see
    alpha04
    release, does anyone know if Navigation was merged yet?
    👍 1
    v
    i
    r
    • 4
    • 6
  • b

    bruno.aybar

    10/02/2020, 4:44 AM
    This one is not exactly related to Compose, however, I'm having issues with the latest AS canary + collections. Canary 13 + Kotlin 1.4.0 = I can use the standard Kotlin
    emptyList()
    Canary 13 + Kotlin 1.4.10 = forces me to import
    java.util.Collections.emptyList
    , does not allow me to reference the standard one. (sorry, I do not know if this was happening in previous canary versions. I have just updated to Kotlin 1.4.10 to test alpha04) P.S.: I tested Kotlin 1.4.10 in stable AS and in IDEA, no issues there.
    g
    j
    • 3
    • 12
  • v

    Vikas Singh

    10/02/2020, 5:51 AM
    How can we make animations in lazycolumn or lazyrow using compose ? Is there anything like itemAnimator used in recycler view
    a
    v
    • 3
    • 4
  • b

    Bsn Net

    10/02/2020, 6:39 AM
    Is it possible to resize the width of sidebar menu from scaffold? I tried it on tablet landscape and it occupied 80% of the tablet width which is correct for phone but not correct for tablet
    m
    • 2
    • 2
  • c

    Colton Idle

    10/02/2020, 7:03 AM
    n
    • 2
    • 1
  • d

    Dieter Holz

    10/02/2020, 8:38 AM
    The critical code seems to be
    Tab(
            text = { Text(homeScreenTab.title) },
            selected = currentTab == homeScreenTab,
            onClick = { currentTab = homeScreenTab }
    )
    When I click on the tab, the exception occurs (but only if the content of the tab contains a TextField)
    f
    a
    +2
    • 5
    • 7
  • z

    zoha131

    10/02/2020, 9:37 AM
    I am facing a weird issue. Whenever I
    cmd + click
    on any standard
    Composable
    it takes me to the class file instead of the kt file. e.g. When I
    cmd + click
    on
    Image
    it takes me to
    ImageKT.class
    file instead of
    Image.kt
    file. Anyone can help me with this?
    👍 3
    a
    s
    +4
    • 7
    • 23
  • r

    Rosen Dimov

    10/02/2020, 10:13 AM
    Hi guys, great to see alpha04 bringing performance optimizations to
    LazyColumnFor
    ! I'm not sure if I'm doing something wrong, but I can't see any difference with the issue I filed sometime ago. I only had to change the version number for Kotlin and compose from alpha01 (last one I tested with) to 04. I also did Rebuild project a few times, not sure if this is enough for changes to take effect. Also, what I see is that on every scroll the compose function gets called for certain items (added a
    Log.w
    inside it to verify). On the other hand, everything is really smooth with
    RecyclerView
    and with a more complex view than the one in the sample project in the issue. I haven't changed anything to the code, apart from versions, in the sample project in the bug, probably I need to add something? Appologies if this is configuration issue! Thanks!
    a
    • 2
    • 2
  • s

    Se7eN

    10/02/2020, 10:24 AM
    Are there any performance optimizations for
    LazyColumn
    in alpha04?
    a
    r
    • 3
    • 8
  • j

    jaqxues

    10/02/2020, 4:17 PM
    I have an issue with a project with the following setup • The app module and one dynamic feature, which both use Compose • Compose dependency is in app/build.gradle:
    api "*compose dependencies"*
    • r8 / minification is enabled Now assembleRelease won't work, it will fail at
    > Task :app:minifyReleaseWithR8
    with a java.lang.NullPointerException
    • 1
    • 2
  • s

    streetsofboston

    10/02/2020, 4:26 PM
    • 1
    • 1
  • g

    Guy Bieber

    10/02/2020, 5:00 PM
    Is anyone else having serious stability issues with Alpha04 and Android Studio 4.2 Canary 13. I have crashes happening all over the place now.
    s
    • 2
    • 3
  • z

    zoha131

    10/02/2020, 6:08 PM
    is
    Box
    and
    Stack
    deprecated now?
    r
    • 2
    • 2
  • g

    Guy Bieber

    10/02/2020, 6:19 PM
    Seems to be down in the mutableState logic… Any ideas?
    a
    j
    • 3
    • 6
  • z

    zoha131

    10/02/2020, 7:07 PM
    Is there any way to use
    matchConstraint
    in compose
    ConstraintLayout
    ?
    • 1
    • 1
  • g

    Geert

    10/02/2020, 7:11 PM
    I want to go to a new screen with a left to right animation. Is there another way than using a pager? Dont want just crossfade, it has to go from left to right.
    s
    d
    • 3
    • 2
  • g

    Guy Bieber

    10/02/2020, 7:44 PM
    I am trying to go back to Alpha03 but get the following error with canary13:
    Execution failed for task ':model:prepareDebugKotlinCompileTask'.
    Could not resolve all files for configuration ‘:model:kotlin-extension’.
    > Could not find androidx.compose.compiler:compiler:1.0.0-alpha03. Searched in the following locations: - https://dl.bintray.com/kotlin/kotlin-eap/androidx/compose/compiler/compiler/1.0.0-alpha03/compiler-1.0.0-alpha03.pom - https://repo.maven.apache.org/maven2/androidx/compose/compiler/compiler/1.0.0-alpha03/compiler-1.0.0-alpha03.pom - https://dl.google.com/dl/android/maven2/androidx/compose/compiler/compiler/1.0.0-alpha03/compiler-1.0.0-alpha03.pom - https://jcenter.bintray.com/androidx/compose/compiler/compiler/1.0.0-alpha03/compiler-1.0.0-alpha03.pom Required by: project :model
    z
    j
    +2
    • 5
    • 19
  • z

    zoha131

    10/02/2020, 8:29 PM
    is it possible to move keyboard to the next
    TextField
    using
    imeAction
    ?
    • 1
    • 1
  • s

    streetsofboston

    10/02/2020, 8:47 PM
    This maybe a silly question, but I’m just starting with Compose. What material compose component can be used for a Label, a read-only TextField (no cursor, no focus, no keyboard pop-up)?
    z
    z
    s
    • 4
    • 28
  • j

    JimK

    10/02/2020, 8:52 PM
    Updated to canary 13 with alpha04 and found that my imports for Modifiers need a package change from :
    import androidx.compose.foundation.layout.RowScope.weight
    to
    import androidx.compose.foundation.layout.RowScope.Companion.weight
    r
    a
    • 3
    • 6
  • z

    zoha131

    10/02/2020, 8:52 PM
    have anyone tried
    OutlinedTextField
    at the bottom of the screen? It doesn’t get up of the keyboard first time. And for the third time it does not response at all.
    • 1
    • 2
  • v

    Vsevolod Ganin

    10/02/2020, 9:45 PM
    Hi, is there a way to have an effect equivalent to
    clipChildren=false
    ? I have a
    Column
    composed of scrollable
    LazyColumnFor
    +
    FloatingActionButton
    and I want the scrollable column to be seen behind the FAB. But scrolling should end just above the FAB, not below
    z
    z
    • 3
    • 7
Powered by Linen
Title
v

Vsevolod Ganin

10/02/2020, 9:45 PM
Hi, is there a way to have an effect equivalent to
clipChildren=false
? I have a
Column
composed of scrollable
LazyColumnFor
+
FloatingActionButton
and I want the scrollable column to be seen behind the FAB. But scrolling should end just above the FAB, not below
z

Zach Klippenstein (he/him) [MOD]

10/02/2020, 10:21 PM
Add an empty item at the bottom of your list equal to the height of the FAB?
v

Vsevolod Ganin

10/02/2020, 10:27 PM
But I need to calculate the size of the FAB then, right? I think this is not done very easely in Compose
z

Zach Klippenstein (he/him) [MOD]

10/02/2020, 10:35 PM
it’s really easy: https://developer.android.com/reference/kotlin/androidx/compose/ui/package-summary#onpositioned_1
v

Vsevolod Ganin

10/02/2020, 11:10 PM
I guess there is also a need to add some
MutableState
variable which stores the laid out height of FAB (modified by
onPositioned
). And then the item list should be comprised with original list + one special item which get its height updated. And then in `LazyColumnFor`’s
itemContent
we should add some kind of
when
which inspects what kind of item we got to choose the right composable. Please correct me if I overcomplicated something. Oh boy this is hard 😅
z

Zach Klippenstein (he/him) [MOD]

10/03/2020, 6:34 AM
That sounds right. I would expect this to get easier eventually, the lazy column APIs are still pretty early, and the scaffold stuff is going through some changes too I believe.
👍 1
z

zoha131

10/03/2020, 8:58 AM
@Zach Klippenstein (he/him) [MOD] is it possible to see the issues? to get an idea what they are thinking for the future.
z

Zach Klippenstein (he/him) [MOD]

10/03/2020, 9:21 AM
Yes, you can look at the pull request tracker or the issue tracker, The latter is linked from the channel description, the former is https://android-review.googlesource.com/q/project:platform%252Fframeworks%252Fsupport+status:open
View count: 2