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

    cb

    12/02/2020, 8:47 PM
    🚀 Accompanist v0.4.0 has been released. The big feature is the new animated insets support (keyboard animations). ⌨️ https://github.com/chrisbanes/accompanist/releases/tag/v0.4.0
    👏 7
    🎉 25
    a
    • 2
    • 9
  • k

    Kshitij Patil

    12/02/2020, 8:52 PM
    Is it possible to use navigation-compose deeplink from a workmanager with pending intent attached to a notification to launch that specific composable in a defined state?
    i
    • 2
    • 1
  • r

    Robert Menke

    12/02/2020, 9:24 PM
    Is there an issue open for animation between views with navigation-compose?
    i
    • 2
    • 3
  • n

    Nate Ridderman

    12/02/2020, 9:39 PM
    Is there a way to query semantic properties for an element from a modifier on the element? I was hoping to use custom semantic properties as the basis for a style system.
    z
    • 2
    • 3
  • j

    jaqxues

    12/02/2020, 9:49 PM
    Running into this issue after updating to alpha08 https://youtrack.jetbrains.com/issue/KT-43635
    j
    • 2
    • 6
  • d

    Dominaezzz

    12/02/2020, 11:31 PM
    derivedStateOf
    vs
    remember
    . When should I prefer one over the other?
    z
    o
    • 3
    • 6
  • n

    Nipun Rajput

    12/03/2020, 10:30 AM
    Hi All, Is there any way to display alert dialog on full width?
    t
    • 2
    • 4
  • r

    Rafs

    12/03/2020, 10:32 AM
    How do I center a view of variable width on the screen?
    d
    • 2
    • 2
  • a

    allan.conda

    12/03/2020, 10:35 AM
    We’ve been getting Modifier.clickable issues for a while now on a scrollable composable when going back from a navigation. We’ve just migrated to alpha08 and the issue is still not fixed. steps: 1. tap on a component with Modifier.clickable() (except a Button) that navigates to a different screen 2. go back and try to click the same component. The composable cannot be tapped. Can’t replicate this on a Button. The issue is fixed if you try to scroll-drag a little. It’s quite difficult to write a sample project and report a bug though. Anyone else encountering this issue and possibly may have filed a bug? I didn’t find any.
    d
    • 2
    • 1
  • v

    Vivek Sharma

    12/03/2020, 11:02 AM
    When using
    scaffold
    with
    bottomBar
    , and the
    body
    content , the
    body
    content goes below
    bottomBar
    , how can we avoid it? so that our content dont hide behind
    bottomBar
    a
    • 2
    • 3
  • r

    Rafs

    12/03/2020, 11:27 AM
    What is the preferred way of loading an icon into a
    FloatingActionButton
    ?
    a
    k
    a
    • 4
    • 13
  • i

    Irving

    12/03/2020, 11:47 AM
    I just migrated to alpha08 and then :
    androidx.compose.ui.util.fastAny
    and
    androidx.compose.ui.util.fastForEach
    can't resolve. The util lib need i resolve manually?
    a
    c
    • 3
    • 9
  • d

    ds3fdfd3

    12/03/2020, 11:52 AM
    Now that navigation-compose library is out, I am trying an app without any fragments and only with compose screens. However, I am getting doubts on where do we create our ViewModels now. Some can be created in Activity scope but there are many optional screen where user may or may not go and it doesn't make sense to create their ViewModel beforehand.
    a
    • 2
    • 12
  • a

    allan.conda

    12/03/2020, 12:05 PM
    Has someone found yet where
    createComposeRule
    is in alpha08?
    • 1
    • 2
  • n

    nrobi

    12/03/2020, 12:42 PM
    Suppose I want to call
    @Composable registerForActivityResult()
    from the callback of a
    clickable()
    . Are there any options/workarounds to call it directly from the callback?
    i
    • 2
    • 6
  • k

    Kshitij Patil

    12/03/2020, 12:42 PM
    How can I do
    arrangement.End
    and
    spacedBy(x.dp)
    for a row?
    s
    • 2
    • 2
  • m

    Maik

    12/03/2020, 12:54 PM
    Hello everyone, With the following code I want to draw a border on a box only at the top edge.
    @Composable
    fun Greeting() {
    
        Box(
                modifier = Modifier.height(250.dp)
        ) {
    
            Box(
                    modifier = Modifier
                            .align(Alignment.TopCenter)
                            .size(100.dp)
                            .border(3.dp, Color.Cyan)
            )
    
            Box(
                    modifier = Modifier
                            .align(Alignment.BottomCenter)
                            .size(100.dp)
                            .border(3.dp, Color.Cyan, GenericShape { size ->
    
                                moveTo(0f, 0f)
                                lineTo(size.width, 0f)
                            })
            )
        }
    }
    As you can see in the screenshot, the border is drawn, but it does not have the right width and also not the right color. Maybe someone can explain me where my mistake is or how I can draw a corresponding border at the top edge. I used the current version of Compose and Kotlin.
    r
    n
    • 3
    • 2
  • r

    Rafs

    12/03/2020, 1:10 PM
    Is there anything like
    Arrangement.SpaceEvenly
    for
    LazyRowFor
    ?
    a
    s
    • 3
    • 4
  • m

    Mini

    12/03/2020, 1:12 PM
    Trying to add 1.0.8 to an existing project, kotlin 1.4.20
    composeOptions {
        kotlinCompilerVersion '1.4.20'
        kotlinCompilerExtensionVersion '1.0.0-alpha08'
    }
    kotlinOptions {
        useIR = true
        jvmTarget = "1.8"
    }
    Everything works until I add buildFeatures { compose true } When compose is enabled the project never finishes building. I have multiple attempts, and my last one has been running for 3 hours 36 minutes 😕 Any ideas what might be wrong?
    j
    j
    +2
    • 5
    • 17
  • m

    mattinger

    12/03/2020, 2:02 PM
    Anyone else having issues with compose in 4.2 beta 1? When i try it says it’s a preview feature and can’t be enabled.
    a
    m
    a
    • 4
    • 8
  • m

    mattinger

    12/03/2020, 2:33 PM
    java.lang.IncompatibleClassChangeError: Found interface org.jetbrains.kotlin.ir.declarations.IrClass, but class was expected
    	at androidx.compose.compiler.plugins.kotlin.VersionChecker.check(VersionChecker.kt:65)
    	at
    s
    • 2
    • 3
  • d

    Daniele B

    12/03/2020, 2:33 PM
    Only 2 families of DeclarativeUIs in the future?
    💡 1
    👍 7
    j
    c
    +3
    • 6
    • 26
  • v

    Vivek Sharma

    12/03/2020, 3:13 PM
    I am navigating from 1 composable to another (kind of screens), so I passed
    navController.popBackStack()
    while navigating, and using this on pressing
    backButton
    in 2nd composable but when I am in 2nd compose and
    rotate
    screen , and then press
    backButton
    , it doesnt do anything Any idea why ? 🤔
    a
    i
    • 3
    • 6
  • z

    zoha131

    12/03/2020, 4:20 PM
    is it possible to use
    fillParentMaxWidth()
    in
    ScrollableRow
    ? or can I scroll programmatically in
    LazyRow
    ?
    a
    • 2
    • 2
  • k

    Kshitij Patil

    12/03/2020, 4:34 PM
    @cb how can I make Glide/Coil image
    fillMaxWidh()
    ? Seems like
    preferredSize()
    is a compulsory step to do.
    c
    • 2
    • 7
  • k

    Kirill Grouchnikov

    12/03/2020, 11:08 PM
    Is there something in core Compose or maybe the material layer that "propagates" the enabled state to the content / children composables? Specifically, I'm looking at the
    Button
    composable that uses
    enabled
    to configure the surface and content color. Is
    AmbientContentColor
    then used at the icon level to tint the child icon in the disabled state? What if the icon is not created from one of the material icons, but rather a "simple" bitmap? What would be the recommended way to propagate the disabled state to it so that it can draw itself at, say, 50% alpha?
    l
    a
    • 3
    • 3
  • t

    Timo Drick

    12/04/2020, 12:05 AM
    Does anyone know what is the state of compose support for system windowinsets? Which tell you the padding needed for navigation/status bar. Just bring my app to the current alpha08 and thought maybe i can get rid of my custom solution.
    j
    a
    a
    • 4
    • 6
  • z

    zoha131

    12/04/2020, 1:04 AM
    Anyone else facing long build time after upgrading to alpha-08 and Arctic Fox?
    🇳🇴 1
    c
    • 2
    • 1
  • l

    Lilly

    12/04/2020, 1:17 AM
    Hi I have 3 questions regarding state. I have the following composable:
    @Composable
    fun BluetoothDeviceListAdapterComponent(
        items: List<BluetoothDeviceWrapper>,
        connectVM: ConnectViewModel,
        onConnected: () -> Unit
    ) {
    
        // initial state is a problem here
        val connectState: BluetoothConnectState by connectVM.state.collectAsState()
    
        onCommit(connectState) {
            Timber.w("connectState changed")
            when(connectState) {
                is BluetoothConnectState.Loading -> {
                    Timber.w("Loading")
                }
                is BluetoothConnectState.Success -> {
                    Timber.w("GoTo next screen.")
                    onConnected()
                }
                is BluetoothConnectState.Failure -> {
                    // how to call toast from here?
                }
            }
        }
    state
    is a
    MutableStateFlow
    and can be Loading, Success or Failure(val errorMessage). First problem is that
    MutableStateFlow
    needs an initial value which triggers
    onCommit
    on first start but it should only be triggered when viewModel changes its state explicitly. Second problem is when state is Success and next screen is started: When I get back to the screen,
    onCommit
    is trigged with value Success and starts the next screen again, although the state hasn't changed. Last question would be how to call a Toast from
    onCommit
    ? Is this approach even optimal for my use case?
    s
    • 2
    • 80
  • z

    zoha131

    12/04/2020, 1:34 AM
    I am getting an error while trying:
    var expanded by remember { mutableStateOf(false) }
    the error:
    Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
    l
    • 2
    • 2
Powered by Linen
Title
z

zoha131

12/04/2020, 1:34 AM
I am getting an error while trying:
var expanded by remember { mutableStateOf(false) }
the error:
Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
l

Lilly

12/04/2020, 1:35 AM
You have to import:
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
💯 1
z

zoha131

12/04/2020, 1:37 AM
thanks @Lilly
View count: 1