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

    rajesh

    05/27/2021, 4:59 PM
    Hi all, How to use external library like "Sign in with Google" screen in compose? Any example or link would be appreciated.
    d
    b
    • 3
    • 9
  • i

    Ink

    05/27/2021, 5:21 PM
    Is it possible to create something like that using Compose?
    r
    c
    c
    • 4
    • 6
  • d

    dimsuz

    05/27/2021, 5:24 PM
    I have a
    Button { 
     Text(...)
     Icon() // 24x24dp
    }
    Altough button content is a
    RowScope
    with
    verticalArrangement = CenterVertical
    ,
    Text
    seems to not be vertically centered, you can see it's shifted down compared to Icon. Why is that and how can I fix this?
    c
    • 2
    • 13
  • a

    André Thiele

    05/27/2021, 6:26 PM
    Whats the main cause of IllegalStateException: ViewTreeLifecycleOwner not found from android.view.ViewOverlay when doing animations and how to fix it? I get this exception when viewing a fragment with compose and then create a material animation to another fragment.
    a
    • 2
    • 3
  • z

    Zach Klippenstein (he/him) [MOD]

    05/27/2021, 6:50 PM
    https://twitter.com/intelligibabble/status/1397981368966025217?s=20
    👍 16
    👍🏼 1
    👀 4
    👍🏻 1
    🙌🏼 2
    🙌 2
    t
    k
    • 3
    • 3
  • d

    Daniel

    05/27/2021, 8:48 PM
    If I make a
    Button
    with a
    CircleShape
    the result is oblong. Based on images online this seems like not the expected behavior. Am I missing something obvious?
    g
    • 2
    • 2
  • t

    tad

    05/27/2021, 9:07 PM
    Is there a way to find out what is causing a (re)composition?
    z
    • 2
    • 11
  • c

    Colton Idle

    05/27/2021, 9:27 PM
    Curious what you all would name this sort of class/method in Kotlin/compose The gist is that I have a class that can convert a domain model to a composable
    class DomainToComposeConverter {
        @Composable
        fun from(domainModel: MyDomainModel) {
    Now I don't think this is really idiomatic kotlin/compose because 1.
    from
    breaks the rule "Composable functions that return Unit should start with an uppercase letter" 2. Would this be better as an "object"/singleton or do you all think that this should just be an extension function on
    MyDomainModel
    ?
    d
    a
    • 3
    • 15
  • z

    Zan Skamljic

    05/28/2021, 6:47 AM
    what is the best way to achieve item snapping in a custom scrollable layout?
    👀 2
    e
    a
    • 3
    • 9
  • m

    Mjahangiry75

    05/28/2021, 9:53 AM
    can we blur something in compose?, like a
    Box
    f
    w
    g
    • 4
    • 13
  • t

    than_

    05/28/2021, 10:23 AM
    To pass the argument to the destination, you need to add the value to the route in place of the placeholder in the call to `navigate`:
    navController.navigate("profile/user1234")
    How would one pass parcelable argument to a route? Receiving is straightforward. Passing seems not.
    s
    • 2
    • 2
  • a

    Alex

    05/28/2021, 11:04 AM
    Is there a way to prevent the parent composables padding to clip the shadow of the child-composables?
    f
    • 2
    • 12
  • h

    Heikki Rauhala

    05/28/2021, 11:53 AM
    This is valid Kotlin, but breaks the compiler when
    @Composable
    annotations are added. Is this a known issue, am I doing something stupid, or should I just report a bug?
    VarArgsCrash.kt
    d
    • 2
    • 5
  • b

    brandonmcansh

    05/28/2021, 11:57 AM
    Is there currently an issue w/
    backgroundColor
    with OutlinedTextFields? I can't get it to apply for some reason
    n
    • 2
    • 5
  • p

    Paul Woitaschek

    05/28/2021, 12:17 PM
    Has someone already faced the issue that things are disappearing while scrolling? I have a LazyColumn and sometimes nested composables get rendered blank when scrolling up and down
    r
    s
    • 3
    • 3
  • d

    dimsuz

    05/28/2021, 12:20 PM
    I suspect this might be an FAQ, but didn't find right away (searched channel + googled)
    Column {
      Button(modifier = Modifier.fillMaxWidth()) {
        Icon()
        Spacer(weight = 1f)
        Text()
        Spacer(weight = 1f)
      }
    }
    This works great, but now I also have cases where I want to remove
    fillMaxWidth()
    and I want both spacers to be equal to
    0
    width when laid out. I.e. without
    fillMaxWidth
    I want this button to behave like "wrap_content" in old times: icon + text, centered in column, no space between them. Currently they still stretch, so removing
    fillMaxWidth
    has no effect and button stretches to full column width. Can this be done?
    a
    • 2
    • 2
  • s

    Spikey Sanju

    05/28/2021, 12:47 PM
    Hello All, How to
    reuse
    Custom
    OutlineTextField
    composable?. For ex - I have same repeating
    OutlineTextField
    component imagine 4 - 5 fields. Only thing I need to change is to
    remember state
    for each Input field. How to achieve this? Same I need to achieve for
    Sliders
    This is component 👇
    z
    • 2
    • 4
  • k

    Kyant

    05/28/2021, 12:49 PM
    How can I enable the scrolling effect of
    LazyCoulmn
    on Android 12?
    g
    a
    n
    • 4
    • 7
  • j

    jaran

    05/28/2021, 1:06 PM
    Can anyone see why
    mergeDescendants = true
    does not work in the snippet below? VO reads both the RadioButton and Text.
    • 1
    • 1
  • j

    julioromano

    05/28/2021, 1:06 PM
    About nested navigation graphs in
    navigation-compose
    I’ve noticed it’s possible to navigate to a nested destination without first navigating to its nested nav graph. Please see code in thread.
    i
    • 2
    • 2
  • p

    Paul Woitaschek

    05/28/2021, 1:09 PM
    How do you handle image resources in compose? I have a xml vector that has 4 different colors I need to change at runtime. Using the old xml stuff I'd create a context theme wrapper that wraps a theme and then fetch the drawable. Is there any good solution for compose? The only "workaround" I've found is to do that inside compositon local provider:
    CompositionLocalProvider(LocalContext provides LocalContext.current.withTheme(R.style.MyTheme)) {
              Image(
                modifier = Modifier.align(Alignment.TopEnd),
                painter = painterResource(id = R.drawable.my_image), contentDescription = null
              )
            }
    a
    n
    • 3
    • 3
  • j

    julioromano

    05/28/2021, 1:53 PM
    Is it possible to remove the default “background box” from a
    TextField
    ?
    z
    z
    • 3
    • 5
  • d

    Daniel

    05/28/2021, 2:18 PM
    I'm confused by why I can't save the CoroutineScope of a LaunchedEffect into a variable and then use it in a callback.
    LaunchedEffect(mapbox) {
                val scope = this
                val map = mapbox.awaitMap();
    
                map.addOnCameraIdleListener {
                    Timber.i("This is called")
                    scope.launch {
                        Timber.i("This is never called")
                        repo.setMapPosition(map.cameraPosition)
                    }
                }
    
                Timber.i("This is also called")
            }
    z
    • 2
    • 3
  • v

    Vitaliy Zarubin

    05/28/2021, 2:35 PM
    It's good way? Dao Room
    @Query("SELECT * FROM ModelRepo WHERE id = :id")
    fun getModel(id: Long): Flow<ModelRepo>
    ViewModel
    val findByIdRepo: (Long) -> Flow<ModelRepo?> = { id -> dataRepo.getModel(id).distinctUntilChanged() }
    @Composable
    val model: ModelRepo? by viewModel.findByIdRepo(repoId).collectAsState(initial = null)
    ➕ 1
    🇳🇴 1
    n
    a
    • 3
    • 12
  • a

    André Thiele

    05/28/2021, 2:57 PM
    Is it possible to use Collapsing Toolbar with LazyColumn in Jetpack Compose? Or is this not possible right now? I would like to migrate the RecyclerView to LazyColumn while using Collapsing Toolbar. (how would you add layout_behavior = appbar_scrolling_view_behavior?)
    ➕ 1
    n
    z
    s
    • 4
    • 11
  • b

    Billy Newman

    05/28/2021, 3:49 PM
    Is it possible to persist a snackbar across a device rotation? I assume that by using:
    val scope = rememberCoroutineScope()
    val scaffoldState = rememberScaffoldState()
    That is not going to happen as these are not “rememberSavable”
    a
    • 2
    • 24
  • a

    Abdalla Hassanin

    05/28/2021, 4:35 PM
    anyone getting this crash after update Android Studio Arctic Fox to 2020.3.1 today
    k
    • 2
    • 2
  • b

    Barry Fawthrop

    05/28/2021, 5:01 PM
    How would one go about have (1) layout for landscape and another layout for portrait, using jetpack Compose? and by layout I mean the arrangement of the views or elements making up the screen? Thanks
    ➕ 1
    z
    m
    e
    • 4
    • 4
  • z

    Zan Skamljic

    05/28/2021, 5:14 PM
    Is it somehow possible to change alpha of measurables/placeables when using Layout?
    k
    l
    • 3
    • 14
  • a

    Akram Bensalem

    05/28/2021, 5:15 PM
    Hello, When I call "detectDragGesture" It effect the other methods that I called in "pointerInput(Unit)" like "detectTransformGestures" What I have to do ?! 😢😢
    s
    • 2
    • 2
Powered by Linen
Title
a

Akram Bensalem

05/28/2021, 5:15 PM
Hello, When I call "detectDragGesture" It effect the other methods that I called in "pointerInput(Unit)" like "detectTransformGestures" What I have to do ?! 😢😢
s

ste

05/29/2021, 11:55 AM
Modifier
    .pointerInput(Unit) { detectDragGesture ... }
    .pointerInput(Unit) { detectTapWhatsoever ... }
a

Akram Bensalem

05/29/2021, 12:24 PM
@ste detectTransformGesture Doesn't call if I called detectDragGesture !!!
View count: 1