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

    Daniel Candeias

    07/09/2021, 10:23 AM
    Hey! Does compose support
    fitsSystemWindows
    flag? The
    TopAppBar
    is being displayed below status bar, and needs to be shift below device status bar.
    o
    s
    • 3
    • 3
  • d

    dimsuz

    07/09/2021, 10:50 AM
    Sometimes designers use "lineHeight" attribute in Figma to expand a text style height. For example on the below image textSize is
    15dp
    , but lineHeight is
    24dp
    . And that's used across all screens (UiKit). How would you encode this universally with Compose?
    TextStyle.lineHeight
    works only on paragraphs, and setting
    Modifier.height(24.dp)
    on
    Text
    doesn't center it vertically inside. So far the only solution that works is having a
    Box
    around the text, but that feels like rather verbose solution... or not? UPD. screen shot in the thread
    a
    c
    • 3
    • 3
  • w

    Walter Berggren

    07/09/2021, 11:14 AM
    Hi! I’m attempting to animate item entry and exit in a
    Row
    with
    AnimatedVisibility
    ,
    expandHorizontally
    , and
    shrinkHorizontally
    .
    shrinkHorizontally
    works just fine, but
    expandHorizontally
    unexpectedly moves the content vertically too. If I lock the row height to the same height as the items, the item doesn’t move as much but it still jiggles a bit. Am I missing something or is this a bug?
    Screen Recording 2021-07-09 at 14.03.42.mov
    👌🏽 1
    • 1
    • 3
  • l

    lhwdev

    07/09/2021, 2:13 PM
    (Compose Ui/Android) How can I lay
    Dialog
    under the system decorators(status bar etc.)? I enabled
    setDecorFitsSystemWindows
    and I want to implement full screen dialog. I saw in
    1.0.0-rc01
    usePlatformDefaultWidth
    is added so I can fit full width and height(excluding decors) but cannot fully implement full screen dialog.
    • 1
    • 1
  • j

    Jan

    07/09/2021, 2:24 PM
    What do you guys think of that spinner? And also can I center the text ('m using BasicTextField because of some bugs with the other ones)
    k
    c
    • 3
    • 6
  • y

    YASAN

    07/09/2021, 8:05 PM
    Is there an easy way to put a vertical grid inside a
    LazyColumn
    ? Using
    LazyVerticalGrid
    throws an exception which says I cannot use two scrollable layouts in one direction & I cannot find a non scrollable version of
    Grid
    to use. I do not want to grid scroll independently, I just want to put a grid inside my
    LazyColumn
    . I know I can manually implement it using Rows & Columns but I am trying to avoid that especially since my grid is adaptive and the number of items on each row depend on the device.
    n
    • 2
    • 2
  • r

    Rob

    07/09/2021, 8:41 PM
    I have a ComposeView in a Fragment, that doesn't get it's state restored when from popping the back stack for a fragment transaction. I've tried using an XML with an id set on the ComposeView which normally would save view state for non-compose views. This is resetting my LazyColumn position to the top. I can work around it by having a LazyListState in the Fragment ViewModel. Having to save all view state in the VM to be restored when popping the back stack doesn't seem optimal. Am I doing something wrong?
    i
    m
    • 3
    • 27
  • c

    Chuck Stein

    07/09/2021, 9:59 PM
    Is there a way to add a touch listener to a composable, which is called even if the touch started outside of the composable? i.e. when I press down on a star in a rating bar, and drag my finger to another star, I want to register a touch event in that other star to update the rating.
    a
    • 2
    • 5
  • f

    freddiewang

    07/10/2021, 2:06 AM
    Is it possible to apply a transform matrix on
    ComposePath
    directly? I would like to draw multiple paths with different transform matrices (including scale and rotation). but I am not sure how to draw it correctly in Compose
    r
    • 2
    • 5
  • n

    Namig Tahmazli

    07/10/2021, 9:47 AM
    I am having weird behaviour with
    BoxWithConstraints
    composable. The closure that is being passed to it gets called multiple times with the height being different values each times. There is no animation or no state that can cause it to be recomposed. P.S. I am using
    1.0.0-rc01
    version of compose. The code and stack trace in 🧵
    d
    t
    j
    • 4
    • 7
  • c

    chansek

    07/10/2021, 12:06 PM
    I have a list of items composed via LazyColumn. If any one of the item gets changed in the list, how can I make sure only that particular item of LazyColumn gets recomposed instead of the entire LazyColumn.
    d
    a
    • 3
    • 8
  • d

    Daniele Segato

    07/10/2021, 12:46 PM
    Can we have some tooling to count recompositions by screen areas?
    c
    a
    s
    • 4
    • 11
  • r

    raenardev

    07/10/2021, 4:31 PM
    I have Column > Box > Column hierarchy. All have
    fillMaxSize
    modifier, while box also has
    verticalScroll
    . As soon as box has scroll, its child column can no longer be at max size. Is this expected? Feels like a bug to me. Screenshots and code in thread
    a
    • 2
    • 13
  • k

    Karthick

    07/10/2021, 5:23 PM
    I have two types of approaches, which is good? Code in thread 🧵
    b
    f
    • 3
    • 5
  • t

    Tiago Nunes

    07/10/2021, 11:30 PM
    Hey everyone, is there no way to get the scroll offset from the start of a LazyList?
    val lazyListState = rememberLazyListState()
    Here
    lazyListState
    only has the properties
    firstVisibleItemScrollOffset
    and
    firstVisibleItemIndex
    . The
    firstVisibleItemScrollOffset
    resets to 0 after each item scroll. I know I can do
    firstVisibleItemScrollOffset + firstVisibleItemIndex ª itemHeight
    , but sometimes getting the
    itemHeight
    is tricky or impossible
    d
    • 2
    • 5
  • p

    Prashast Rastogi

    07/11/2021, 3:56 AM
    How do we change the screen orientation dynamically in compose? @Adam Powell @Andrey Kulikov
    c
    • 2
    • 2
  • s

    suhas

    07/11/2021, 10:58 AM
    Is it possible to create home screen widgets using compose? Has anyone tried it?
    👀 1
    a
    a
    +2
    • 5
    • 4
  • f

    Foso

    07/11/2021, 2:11 PM
    I have a question about testing. I'm using IntentsTestRule to start "Activity1". When i click there on a button "Activity2" will open. Now i want to verify that Activity2 is shown by checking if a String is displayed. Activity2 is using Compose, Activity1 classic Views. I can't find the String, because inside the View Hierarchy of Actvity2 is only a AndroidComposeView. Is there any way to make a Composable findable for the "normal" Espresso assertions?
    p
    • 2
    • 1
  • a

    Archie

    07/11/2021, 2:14 PM
    Hi @Doris Liu, just wondering if there is any guide around animating TextSize change? Would it be enough to simply create a
    State
    holder for the font size? Just would want to be sure that this is the correct way since with `View`s (Correct me if I’m wrong), animating the font size directly isn’t the suggested (optimize) way of doing it.
    d
    • 2
    • 7
  • y

    YASAN

    07/11/2021, 6:06 PM
    I show a
    Dialog
    when the user clicks on an item in a
    LazyColumn
    . Is there a way to make the
    Dialog
    's position depend on the items position? Basically showing the dialog above/below the item instead of in the center of the screen.
    k
    • 2
    • 2
  • m

    miqbaldc

    07/12/2021, 1:20 AM
    Does it possible using UI Automator on Jetpack Compose UI?
    :yes: 1
    a
    m
    +3
    • 6
    • 10
  • p

    Peter Mandeljc

    07/12/2021, 7:53 AM
    is it possible to make Text() font size fixed (not scale with font scale)?
    ➕ 1
    z
    u
    j
    • 4
    • 6
  • a

    Ayfri

    07/12/2021, 8:01 AM
    Hi, how can I modify the color of a Button when clicked ?
    m
    t
    +2
    • 5
    • 20
  • m

    Michal

    07/12/2021, 10:45 AM
    AnimatedImageVector has been temporarily removed in rc01. Will it be added back in rc02 or later? I wasn't able to find any information and it is still mentioned in the resources compose documentation. Thank you!
    z
    a
    • 3
    • 3
  • s

    Shabinder Singh

    07/12/2021, 11:09 AM
    A small Typo In Official Documentation... :blob-thinking-upside-down: How to report it ?
    m
    • 2
    • 1
  • r

    Rafael Santiago

    07/12/2021, 11:18 AM
    Is it possible to anchor a snackbar to a FAB in Compose, preferably using scaffolds? I'm looking for a similar behaviour we can implement this using CoordinatorLayout, which the snackbar pushes the FAB up when it shows.
    z
    • 2
    • 2
  • k

    Kareem Waleed

    07/12/2021, 11:32 AM
    I have a method with the signature :
    fun map(name: String): @Composable ()->Unit
    . I need to generate this function using
    KotlinPoet
    but I can’t add
    @Composable
    to the return type, any clues how to do it ?
    j
    • 2
    • 8
  • a

    Artur Schwarz

    07/12/2021, 12:01 PM
    Does retaining a scroll position of a LazyRow via LazyListState work without compose navigation?
    a
    • 2
    • 13
  • i

    izyaboi

    07/12/2021, 1:22 PM
    why its not possible to preview a AlertDialog? is there a way to do it? i use for preview the beta09 in android studio bumblebee canary 3? or is there a bug?
    ➕ 1
    p
    • 2
    • 1
  • c

    Colton Idle

    07/12/2021, 1:25 PM
    Do these live templates work for anyone? Just tried the
    paddp
    and
    weight
    with no luck. Curious if there's something I have to enable or something? Using latest bumblebee
    s
    • 2
    • 1
Powered by Linen
Title
c

Colton Idle

07/12/2021, 1:25 PM
Do these live templates work for anyone? Just tried the
paddp
and
weight
with no luck. Curious if there's something I have to enable or something? Using latest bumblebee
s

Shakil Karim

07/12/2021, 1:37 PM
Yup, I use
comp
and
prev
all the time, not sure about paddp and weight
View count: 1