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

    Val Salamakha

    02/26/2020, 4:28 AM
    It seems to me Android Studio 4.0-beta01 supports compose applications, but it shows the warning “Jetpack Compose is a preview feature, and support for Compose is included only in Canary versions of Android Studio. To use Compose in your app project, download and install the latest Canary version of the IDE.” When will be available a new Canary version?
    z
    1 reply · 2 participants
  • j

    Jitendra

    02/26/2020, 5:36 AM
    val testList = mutableListOf(testList0, testList1)
    
    for (i in 0 until 2) {
        tableRow {
            for (j in 0 until 3) {
                Padding(5.dp) {
                    //Cell
                    Button(
                    text = testList[i][j],
     onClick = {
         Toast.makeText(context,testList[i][j],Toast.LENGTH_SHORT).show()
    
                        
                        }
    
                    )
                }
    
            }
        }
    }
    i want to show button text on click of Button, but here no way to get text,
    a
    1 reply · 2 participants
  • v

    Vincent tiensi

    02/26/2020, 6:06 AM
    Is there a place to get changelogs/updates for changes to the compose plugin?
    l
    4 replies · 2 participants
  • b

    Brandon Risell

    02/26/2020, 3:27 PM
    Related to @Val Salamakha’s observation above, I had AS Canary update to Beta 1, and was surprised to find Compose functionality stripped. I first checked the Compose docs thinking that maybe there was something I needed to do to re-enable it. The Android Studio + Compose page (https://developer.android.com/jetpack/compose/setup) currently leads you to the preview page, which has you download Beta 1. Might be good to update that link + docs to point to the preview archive page (https://developer.android.com/studio/archive), with directions to look for the most recent canary build?
    l
    m
    3 replies · 3 participants
  • b

    Brian Gardner

    02/26/2020, 3:29 PM
    AdapterList view not measured
    a
    5 replies · 2 participants
  • b

    Brian Gardner

    02/26/2020, 3:38 PM
    What’s more interesting is that I can scroll the
    AdapterList
    slowly and the app does not crash. It crashes when I try to fling the list up or down. I’m also seeing messages from the Choreographer about skipping frames so I’m thinking the quick fling is causing the UI updates to fall too far behind so the measure is missed at some point before the draw.
    l
    z
    2 replies · 3 participants
  • k

    Kevin Hester

    02/26/2020, 9:44 PM
    just fyi if you are tracking early experimental Compose uses. https://hackaday.com/2020/02/26/lora-mesh-network-with-off-the-shelf-hardware/
    🎉 1
    💯 1
    👍 6
    m
    b
    2 replies · 3 participants
  • m

    Miguel A. Ruiz

    02/26/2020, 10:31 PM
    Hello! I am trying to add to my project a row with a column with take the maximum space available and other only the minimum space needed. I show in the codelab the modifiers Flexible and Inflexible but these seem to be deprecated. What are the replacement for this?
    l
    a
    8 replies · 3 participants
  • a

    amar_1995

    02/27/2020, 6:54 AM
    How can I pass
    spanned
    text to compose
    Text
    api ?
    l
    z
    +1
    7 replies · 4 participants
  • z

    Zach Klippenstein (he/him) [MOD]

    02/27/2020, 9:50 PM
    Flutter has a UI component
    BackdropFilter
    that lets you do stuff like blur whatever’s behind a view. I know that effect isn’t part of the Material spec, but is something like that possible (or potentially possible in the future) with Compose?
    l
    c
    +1
    13 replies · 4 participants
  • a

    alexzhukovich

    02/27/2020, 10:07 PM
    Hello! I'm trying to add background image for card in a list and card has a favourite toggle. When favourite state changing the composable function re-drawing the card and background re-drawing again. Is it possible to avoid re-drawing background image every time?
    l
    a
    4 replies · 3 participants
  • c

    codeslubber

    02/28/2020, 12:28 AM
    Made a new project with
    dev05
    today and cannot get
    MaterialTheme.typography().h3
    (or any other style) to work. Reports a code generation error and says see the log? also, if you just type MaterialTheme.typ and choose the code completion suggestion, it drops in a crazy string that includes a package name?
    l
    a
    +3
    59 replies · 6 participants
  • s

    shikasd

    02/28/2020, 2:16 AM
    Hi, I am experimenting with
    Draw
    function and transitions currently and have noticed that child composable get recomposed every time transition state changes. Is it possible to avoid child function recomposition? Example:
    val child = @Composable() { println("Hello") } 
    Transition(definition) { state ->
        val x = state[X]
        Draw(child) {
            canvas.save()
            drawChildren()
            canvas.restore()
        }
    }
    s
    l
    7 replies · 3 participants
  • c

    codeslubber

    02/28/2020, 5:16 PM
    Had slider working, not working anymore, another cryptic error I can do nothing with:
    l
    l
    +1
    17 replies · 4 participants
  • c

    codeslubber

    02/28/2020, 7:25 PM
    I am doing a CountdownTimer. So I am showing the time left in a Text component. But then I want to have a field that you can edit, and upon editing it, it will save some changes. I have used
    TextField
    before, but with a
    TextFieldInput
    that was in a state var, e.g.
    state { TextFieldInput("") }
    ) But I already have a state so I wanted to put the TextFieldInput into that instance, so, something like
    state { TimerState() }
    where TimerState has the TextFieldInput in it, but not having much success with that. The other possibility (part of why I am posting) is way back during early MVC days there was another pattern called PAC. One of the main distinctions is PAC had hierarchies of components, and each component might have its own Abstraction (model) and controller. Should I do that? Make the text input a component? and if so, how do I bubble the edit result up to the enclosing component?
    l
    145 replies · 2 participants
  • k

    Kevin Hester

    02/29/2020, 3:28 AM
    Re
    CircularProgressIndicator
    I notice it doesn't take a modifiers parameter. What is the recommended way to be able to change the layout of this component when it is underneath a Column{}. I want to be able to set LayoutGravity.center
    l
    z
    3 replies · 3 participants
  • j

    Javier

    02/29/2020, 3:19 PM
    Jetpack compose can’t work with kapt no?
    🇳🇴 3
    i
    4 replies · 2 participants
  • m

    manueldidonna

    03/01/2020, 1:28 AM
    When I interact with views I often need to post an action or wait until the next layout pass, etc... If I need to expand a view with an animation I can do something like this
    container.doOnLayout { 
        val originalHeight = it.height
    
        // expandedChild visibility was GONE
        expandedChild.isVisible = true
    
        view.doOnPredraw {
            val newHeight = it.height
            expandedChild.isVisible = false
        }
    }
    // Now I can animate the container height between originalHeight & newHeight
    How Could I achieve a similar behaviour with compose?
    z
    1 reply · 2 participants
  • k

    Karthick

    03/01/2020, 10:22 AM
    Current Ui toolkit for nested scrolling has a lot of things, nested scrolling parent, nested scrolling child, versions 1,2,3. Which is really confusing and bad. How compose will resolve this
    👍 3
    a
    1 reply · 2 participants
  • v

    vipulasri

    03/01/2020, 1:41 PM
    Is there a way to benchmark
    VerticalScroller
    and
    AdapterList
    performance? As far as I have tried using HWUI Rendering test, can't make much out of it!
    a
    3 replies · 2 participants
  • k

    Kevin Hester

    03/02/2020, 1:28 AM
    Just some if useful fyi from the "try deploying compose even though you shouldn't experiment". So far it seems to go well and the (fairly geeky) users are happy. But you might want to loop in the "Firebase Test lab" people if you haven't already. Because their standard instrumentation really doesn't like apps that don't use the conventional view hierarchy for their drawing. Lot's of false positives saying that the first frame is taking forever to draw, when in fact the app is running fine and cycling through it's test frames. Also a place to add analytics hooks for "screen" changes would be useful.
    a
    1 reply · 2 participants
  • i

    Ian Warwick

    03/02/2020, 8:56 AM
    Hey composers, is
    onActive
    and
    onCommit
    etc still considered effects? Just the documentation for
    onActive
    starts with "
    An effect used to observe the lifecycle of the composition.
    So just wondering so I know what I am talking about when discussing this 😆
    a
    4 replies · 2 participants
  • i

    Ian Warwick

    03/02/2020, 11:11 AM
    Some ramblings on LiveData usage, interested in feedback on how other folks are using LiveData so far with compose https://medium.com/@fluxtah/another-way-of-using-livedata-with-jetpack-compose-77a28c287af9?sk=69d5bf1973cffcb7d3665a33a405e99c
    👍 3
    a
    5 replies · 2 participants
  • k

    Kazemihabib1996

    03/02/2020, 8:53 PM
    How compose box model works? for eg in
    Surface(
    modifier = modifier + LayoutPadding (
    left = 8.dp,
    top = 8.dp,
    right = 8.dp,
    bottom = 0.dp
    ),
    color = Color.Green
    ) {
    Container(width = 10.dp, height = 10.dp, padding = EdgeInsets(all = 10.dp)) {}
    }
    The green colors not paints on the paddings neither padding of Suface, neither Container. I tested with dev05.
    z
    5 replies · 2 participants
  • c

    Chase James

    03/03/2020, 4:26 AM
    Hi. I'm trying to use Icons.Menu as a vector icon for an AppBarIcon, but it's expecting a Painter type for the icon argument. Anyone have any tips?
    👍 1
    l
    s
    +1
    6 replies · 4 participants
  • t

    Tristan

    03/03/2020, 4:52 PM
    Hello, Is it planned to have a clear guideline of how to build an app with Jetpack Compose, or it will be like React, and do what you want, it's just a UI library. 😊
    👍 1
    2️⃣ 1
    ❤️ 1
    z
    a
    4 replies · 3 participants
  • c

    Chang Ge

    03/03/2020, 8:43 PM
    Hello, does Compose support bottom navigation bar? I googled a lot but all the pages seem to talk about bottom app bar, not the nav bar.
    l
    i
    4 replies · 3 participants
  • k

    Kazemihabib1996

    03/03/2020, 9:00 PM
    any reason that imageResource and loadImageResource are started with lowercase?
    a
    2 replies · 2 participants
  • m

    Mantas Varnagiris

    03/03/2020, 9:24 PM
    I was playing with
    compose-router
    library made by @Zsolt . Found a few issues regarding back stack sequence and while trying to fix I ended up with a very different code base. I also needed callbacks for navigation events for DI or SL to be able to scope instances. Then I went deeper into it as I want to learn more about Compose and ended up with another navigation library. So here it is. Feel free to use it. Hopefully this is going to be deprecated as soon as Google rolls out their. Now I have some feedback to give them once they start doing it. https://github.com/mvarnagiris/compose-navigation
    ❤️ 2
    👌 1
    s
    m
    3 replies · 3 participants
  • m

    molikto

    03/04/2020, 7:30 AM
    I have a question: it seems to me a lot of times, a old-style dialog API is easier to use in simple cases, like
    onClick = { showDialog(..., onPositive= { changeSomeState() }...) }
    what's your opinions?
    z
    2 replies · 2 participants
Powered by Linen
Title
m

molikto

03/04/2020, 7:30 AM
I have a question: it seems to me a lot of times, a old-style dialog API is easier to use in simple cases, like
onClick = { showDialog(..., onPositive= { changeSomeState() }...) }
what's your opinions?
z

Zach Klippenstein (he/him) [MOD]

03/04/2020, 5:27 PM
How do you update the contents of the dialog while it's showing?
m

molikto

03/14/2020, 5:46 AM
I am talking the case when this is not needed "a lot of times"
View count: 1