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

    Colton Idle

    05/22/2021, 4:14 AM
    I've seen people treat modals (with the legacy view system) as either state or an event. With compose, I'm more inclined to consider the fact that a modal is showing as part of my state for the screen. In my case I'd have an AAC ViewModel with something like
    errorModalShowing: Boolean
    Not sure if I'm missing some kind of best practice here, but let's take a quick poll! Do you treat modals as: 1️⃣ State 2️⃣ Event
    2️⃣ 1
    1️⃣ 20
    b
    • 2
    • 2
  • k

    Kyant

    05/22/2021, 4:34 AM
    Will the new Material You be used in future Compose?
    :yes: 13
    👀 4
    a
    • 2
    • 1
  • k

    Kulwinder Singh

    05/22/2021, 7:31 AM
    Hi, is there any good implementation for Navigation in Compose? Btw I have checked docs Actually our team is starting new project but after checking docs i have realised that we have to keep
    navController
    in main or root Composable and then we either have to pass this to other Composable or we have to get callback in root for navigation(please correct me if i’m wrong here) , so we are not sure how much scalable it is for bigger apps with many screens ? so that’s why i want to check if there is any good implementation of navigation component in compose ?
    👀 4
    n
    • 2
    • 1
  • i

    Ink

    05/22/2021, 11:38 AM
    Hot to inject class to my viewModel in @Composable? I use Koin and I tried to follow documentation but it doesn't work Module:
    val welcomeModule = module {
       single<MyService> { MyServiceImpl() }
    }
    ViewModel:
    class MyViewModel(private val myService: MyService) : ViewModel() {
    ...
    }
    @Composable function:
    @Composable
    fun Screen(){
       val myViewModel: MyViewModel= viewModel()
    }
    I tried:
    val myService = get<MyService>()
    and put it to viewModel() but it doesn't work
    t
    z
    a
    • 4
    • 6
  • n

    Nat Strangerweather

    05/22/2021, 3:23 PM
    Hi, I have an animation but I don't understand why the boxes are not spaced evenly in it. Please see gif and code in thread. Any ideas?
    s
    • 2
    • 6
  • s

    Saiedmomen

    05/22/2021, 6:57 PM
    Is there a way to the decide opening direction of Side Drawer in a Scaffold?
    👍 1
    • 1
    • 1
  • a

    Archie

    05/22/2021, 7:09 PM
    Hi @Doris Liu, Is there a way to seek a Color Animation based on percentage? I essentially need to animate between Colors, ex.
    Color.Red -> Color.Yellow -> Color.Green
    . I wanted to be able to get the color given a certain percentage. I tried
    updateTransition(...)
    but it seems that it only applies to a targeted state but not the in-betweens. Any advice? Thanks in advance.
    d
    c
    • 3
    • 23
  • p

    Paul Woitaschek

    05/22/2021, 7:33 PM
    Is there any way to skip code by checking if I'm currently in the preview? I have code that uses
    EmojiCompat.get()
    and that breaks the preview because EmojiCompat wasnt initialized because as we're inside the preview the application wasn't created. (sth like
    View.isInEditMode
    but statically available?)
    a
    m
    • 3
    • 8
  • b

    Bradleycorn

    05/22/2021, 7:46 PM
    Does anyone know if there are plans to make
    SubComposeLayout
    and
    Intrinsics
    work together? For example something like the following:
    Row(modifier = Modifier.fillMaxWidth.height(IntrinsicSize.Min)) {
        BoxWithConstraints(...) {
            ...
        }
    }
    this currently crashes with an IllegalStateException with a message of
    Intrinsic measurements are not currently supported by SubcomposeLayout
    Any way to “fix” this?
    z
    • 2
    • 18
  • c

    Colton Idle

    05/22/2021, 7:47 PM
    Not directly compose related, but since we've been all using Arctic Fox for some time now. Have people noticed that they have deployed their app in studio, it builds, then installs, but the old build launches again? I've noticed this a handful of times, and a restart of Studio seems to resolve it... but I just hit it again and it killed like an hour of my time. I don't know how to repro, but curious if it's compose related or if someone has a bug tracker issue handy.
    :yes: 2
    😰 1
    r
    s
    +3
    • 6
    • 8
  • h

    henrikhorbovyi

    05/23/2021, 12:41 AM
    Hey everyone \o/ I'm trying to use airbnb lottie-compose, but not working 😕 any help?
    k
    p
    n
    • 4
    • 17
  • t

    Tin Tran

    05/23/2021, 7:25 AM
    Hi guys! Is there a way to make bottom sheet have 3 level of expand? Eg. 60% -> 80% -> fully expanded
    s
    • 2
    • 9
  • v

    vipulasri

    05/23/2021, 7:41 AM
    @Preview
    annotation not working in library module. Is this intentional? I am getting this issue:
    The following classes could not be instantiated:
    - androidx.compose.ui.tooling.preview.ComposeViewAdapter
    z
    • 2
    • 2
  • s

    Shakil Karim

    05/23/2021, 3:36 PM
    Is it a good idea to create this type of UI in Constrainlayout or a custom Layout, and will there be any performance benefit if I pick the latter?
    🇨🇿 6
    n
    j
    j
    • 4
    • 13
  • c

    chansek

    05/23/2021, 5:10 PM
    How can I make a TextField with a minimum height of 3 lines? In Android XML world, it is achieved through
    android:minLines
    n
    s
    +2
    • 5
    • 12
  • n

    Nacho Ruiz Martin

    05/23/2021, 5:51 PM
    Hey! Any of you used
    ThreeTenABP
    library to manage dates in Android? As soon as a Date is used in the composables, the Preview fires an error because the timezone data is not registered. Is there anyway to initialize this kind of libraries in Preview mode?
    j
    a
    • 3
    • 4
  • s

    ste

    05/23/2021, 6:52 PM
    Solved: had to update both android studio and gradle (🤦‍♂️). I'm having troubles upgrading compose to `beta07`:
    java.lang.IllegalStateException: function = <anonymous>, count = 4, index = 4
    .
    beta06
    was working fine. I also upgraded navigation to
    2.4.0-alpha01
    , but didn't help. Full error in thread.
    n
    z
    +2
    • 5
    • 22
  • n

    Nat Strangerweather

    05/23/2021, 8:55 PM
    Hi guys, could you please have a look at this? I asked here yesterday but unfortunately I have not managed to make any progress since : https://stackoverflow.com/q/67661974/5513788
    s
    s
    • 3
    • 3
  • m

    mattinger

    05/23/2021, 10:10 PM
    I’d create that in a dagger module and inject it into my fragment/activity. With compose, you’re not dealing with individual fragments, so you can’t just scope the view models to the fragment’s ViewModelStore. Does compose provide it’s own ViewModelStore attached to the current composable?
    i
    • 2
    • 1
  • m

    mattinger

    05/23/2021, 10:19 PM
    @henrikhorbovyi Looking at the code, i’d say no. FAB is implemented as a surface with a box. And there’s no conditional anywhere that would lead me to believe you can specifically disable it.
    h
    • 2
    • 1
  • m

    mattinger

    05/23/2021, 10:23 PM
    But it does seem like a big miss on their part. But, like i said, the beauty of compose is that you can see the source code and actually understand most of it (try that with the FAB class in material design library).
    😍 1
    💯 1
    h
    l
    +2
    • 5
    • 10
  • x

    xxfast

    05/24/2021, 12:47 AM
    or is this not supported yet?
    z
    • 2
    • 1
  • d

    Daniele B

    05/24/2021, 6:06 AM
    I have seen some standard composables such as
    Row
    or
    Column
    are defined as
    inline
    . What is the purpose? and does it ever make sense for custom composables to be defined as inline?
    z
    a
    • 3
    • 3
  • t

    Tigran Galstyan

    05/24/2021, 7:11 AM
    How to use Google Maps with Jetpack Compose?
    p
    • 2
    • 6
  • b

    Bino

    05/24/2021, 8:27 AM
    How do I set a gradient background to a card correctly?
    Card(modifier = Modifier.background(linear))
    Will set the background behind the card
    Card(backgroundColor = cardBackground)
    will only accept
    Color
    and no
    Brush
    m
    • 2
    • 1
  • d

    Daniele B

    05/24/2021, 8:59 AM
    I would like to change the color of both
    iconComposable
    and
    textComposable
    based on the
    selected
    flag. How should I do this correct?
    b
    a
    • 3
    • 8
  • r

    Ravi

    05/24/2021, 9:07 AM
    i've created helper function related to spacer and invoking them like this :-
    SpaceHeight(16.dp)
    ,
    SpacerWidth(16.dp)
    . After rolling out to beta channel we are observing crashes on some devices, more in the thread
    @Composable
    fun SpacerHeight(size: Dp) {
        Spacer(modifier = Modifier.height(size))
    }
    
    @Composable
    fun SpacerWidth(size: Dp) {
        Spacer(modifier = Modifier.width(size))
    }
    ➕ 1
    👀 1
    • 1
    • 3
  • a

    alorma

    05/24/2021, 9:10 AM
    Hello. Is it possible to know on
    LazyListScope.stickyHeader { ... }
    to know when it's being sticked to the top? For example to make it different color, or have some elevation
    👀 1
    c
    • 2
    • 1
  • s

    Shakil Karim

    05/24/2021, 11:21 AM
    Hi, I'm trying to create a custom layout that needs to match the design on the right, is there a way to measure a text height based on Text Size
    c
    • 2
    • 13
  • s

    Slackbot

    05/24/2021, 12:08 PM
    This message was deleted.
    👀 1
    u
    • 2
    • 1
Powered by Linen
Title
s

Slackbot

05/24/2021, 12:08 PM
This message was deleted.
👀 1
u

ursus

05/24/2021, 12:54 PM
I think you mean "ripple"
View count: 1