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

    MBegemot

    06/27/2021, 5:48 PM
    I have a question about swipe I'll put the details in a thread
    • 1
    • 3
  • a

    Alejo

    06/27/2021, 6:27 PM
    Hi everyone! I want to update a composable depending on if a user is touching the screen or not. What I want is to update the UI if the user stops interacting with the app for 5 seconds.
    l
    • 2
    • 7
  • h

    Hatice Sarp

    06/27/2021, 8:04 PM
    Hi everyone! While deleting the account, I open three different alert dialogs in a row. I keep mutableState to dismiss alert dialogs. After the second alert dialog, I throw the delete request. According to the result of this request, I show the third alert dialog. The third dialog does not dismiss. What do you think could be the reason?
    z
    • 2
    • 2
  • w

    Waqas Tahir

    06/28/2021, 4:28 AM
    Hi everyone! Its a good enough usable Seekbar , if you would like to use in your project https://gist.github.com/wakaztahir/f1421f45ebe7fea1bb27ca51034fe5d1
    z
    i
    • 3
    • 8
  • k

    Kunal Raghav

    06/28/2021, 6:51 AM
    Hi while building a compose app, I noticed a particular behaviour on MIUI 12, they have mode for running apps in freeform mode, called floating window. In that mode while the UI looks pixel perfect the touch interactions are offset a bit upwards, example touching the bottom navigation bar of an app would send the touch input to the page above instead. The compose app behaves as expected in multiwindow mode.
    a
    • 2
    • 2
  • w

    Waqas Tahir

    06/28/2021, 8:12 AM
    Hi , Does anyone know a way to save compose Canvas to Bitmap/Png
    z
    • 2
    • 1
  • p

    Paulo Pinheiro

    06/28/2021, 9:17 AM
    Hello. Is it possible/easy to mix regular composable like Text, Buttons with Canvas? I was looking to build a node-based ui (like unreal blueprint) and that would help things. Any material on the topic?
    h
    z
    • 3
    • 3
  • y

    Yuri Drigin

    06/28/2021, 10:20 AM
    Has anyone caught this error: BottomSheetScaffold not expanded after upgrade to beta09?
    w
    • 2
    • 2
  • s

    Slackbot

    06/28/2021, 11:22 AM
    This message was deleted.
    ❓ 2
    i
    o
    • 3
    • 2
  • w

    Waqas Tahir

    06/28/2021, 12:01 PM
    does anyone know a way to get screen width and height in compose
    a
    • 2
    • 1
  • d

    dimsuz

    06/28/2021, 12:22 PM
    Modal sheet seems to be fully broken in
    beta09
    ?
    ModalBottomSheetLayout(sheetContent = { Text("Hello, World") }) {
      // empty content, but anything can be here
    }
    Adding the above immediately crashes my app with
    java.lang.IllegalArgumentException: The initial value must have an associated anchor.
    • 1
    • 2
  • l

    Louis

    06/28/2021, 12:37 PM
    Hey, how am i supposed to do a scroll in a compose test where the view is a column with a scroll modifier ? I tried this but this didnt worked
    testRule.onNode(hasScrollToKeyAction()).performScrollToIndex(index)
    a
    j
    • 3
    • 3
  • n

    nglauber

    06/28/2021, 3:45 PM
    Very dummy question… Why
    isSystemInDarkTheme()
    is always returning true even when I switch to light mode? 🤔
    i
    a
    +4
    • 7
    • 30
  • a

    Alexandros Boutakidis

    06/28/2021, 4:03 PM
    Hello chat, what combination of compose views would you use to create a swift style LazyVGrid in the sense that it can have fixed num of columns but different width modifiers in each column. For example in LazyVGrid you can do fixed 3 columns where 2 are flexible (same weight) and one with fixed width or wrap width.
    a
    • 2
    • 3
  • s

    solidogen

    06/28/2021, 4:28 PM
    how would I proceed with making this widget’s UI in compose? it’s instagram-style pager indicator, I’m not sure how to layout this correctly. Especially scrolling part and keeping current page in the middle
    a
    • 2
    • 5
  • s

    subashz

    06/28/2021, 6:01 PM
    What's your criteria on using padding vs spacer ? Most of the time I got confused whether to apply padding or use the spacer.
    c
    k
    • 3
    • 3
  • t

    Tash

    06/28/2021, 7:22 PM
    When using
    AnimatedVisibility
    , is it possible for the content to provide custom `Enter/ExitTransition`s, i.e. other than slide/fade/shrink/expand?
    d
    • 2
    • 11
  • t

    Tash

    06/29/2021, 12:24 AM
    Seeing a lint error with beta09 for modules that don’t directly have Compose enabled … 🧵 ⬇️
    l
    • 2
    • 6
  • m

    Michał Diner

    06/29/2021, 8:13 AM
    Hi everyone, is there any compose equivalent for
    android:windowBackground
    in xml? And I'm talking about an app-wide solution.
    a
    n
    +2
    • 5
    • 19
  • n

    Nathan Castlehow

    06/29/2021, 9:06 AM
    hey weird animation question : when using animate*AsState how come i have to set the targetvalue after “animate*AsState” has been created and not just when its initially setup in order for it to run. (Code in thread)
    a
    • 2
    • 8
  • b

    Boris Kachscovsky

    06/29/2021, 11:31 AM
    👋 We’re trying to sync up loading animations on multiple screens based on the
    monotonicFrameClock
    , but see some stuttering at the beginning of the animation. Any idea why this stuttering might be happening?
    var progress by remember { mutableStateOf(0f) }
        LaunchedEffect(Unit) {
            while (true) {
                val frameTime = withInfiniteAnimationFrameMillis { it }
                progress = (frameTime % Duration).toFloat() / Duration
            }
    My guess is that it’s because the initial progress is set to 0? How can we sync that (from the start) with the frame time? Another possibility is that because
    LaunchedEffect
    is launched after the first frame, we start one frame behind. Don’t think I can use
    DisposableEffect
    (which doesn’t have this issue) as
    withInfiniteAnimationFrameMillis
    is a
    suspend
    function.
    2021-06-29_10_28_53.mp4
    t
    d
    +2
    • 5
    • 15
  • s

    Se7eN

    06/29/2021, 1:13 PM
    I have a
    pointerInput
    modifier on
    Box
    and
    pointerInteropFilter
    on its children. However, the
    pointerInteropFilter
    modifiers on the children do not receive events because of the
    pointerInput
    on the parent. When I remove the parent
    pointerInput
    , the
    pointerInteropFilter
    modifiers on children work fine. I'm creating a draggable, rotatable, and resizable composable with controls at the corner (see image). How can I fix this? Code in thread
    a
    • 2
    • 5
  • s

    Shabinder Singh

    06/29/2021, 2:08 PM
    How To achieve HorizontalPager Velocity Based Scrolling in accompanist pager? Context: I am using HorizontalPager and by default, it scrolls by 1 offset on a swipe. I want to implement a custom scroll, like if users swipes with a much larger velocity, then scroll accordingly like 5-6 cards ahead ... I saw FlingBehaviour is a parameter , but I wasn't able to understand on How to use it , any help will be appreciated and it would be gr8 if there is a sample / example showing such customization Is Fling Behaviour best suited ? OR can I disable Gestures/dragEnabled and Manually calculate scrollOffset using Modifier and then use animateScrollToPage (if this is the case , how to do this?) https://github.com/google/accompanist/discussions/529
    c
    z
    • 3
    • 9
  • a

    Artem Kopan

    06/29/2021, 2:59 PM
    How to change height of TextField? Looks like there are vertical padding
    d
    j
    d
    • 4
    • 20
  • p

    Peter Mandeljc

    06/29/2021, 3:23 PM
    I'm getting weird shadow for dark theme, any ideas?
    Column(modifier = Modifier.padding(16.dp)) {
            Surface(
                elevation = 10.dp,
                modifier = Modifier.fillMaxWidth(),
            ) {
                Text(text = "Test")
            }
        }
    a
    l
    • 3
    • 10
  • m

    Mehdi Haghgoo

    06/29/2021, 4:00 PM
    Does Compose Beta09 have a bug loading vector resources with
    painterResource(R.drawable.vector)
    ? I cannot load any vector asset from resources to show in Image.
    c
    n
    • 3
    • 9
  • c

    Chris Johnson

    06/29/2021, 4:12 PM
    Does
    AnimatedVisibility
    have a finished listener? I know it has
    MutableTransitionState
    where you can check if all the animations are done via
    isIdle
    but I guess I'm looking for an example of when to use that check. I assume it wouldn't be inside the
    AnimatedVisibility
    content composable and outside of it would make it get hit on every recomposition if I'm remembering the
    MutableTransitionState
    a
    d
    • 3
    • 3
  • c

    Colton Idle

    06/29/2021, 4:33 PM
    Just upgraded from 08 to 09
    import androidx.compose.ui.text.style.TextOverflow.Ellipsis
    is gone now? Auto import can't find a replacement.
    s
    a
    • 3
    • 3
  • b

    brandonmcansh

    06/29/2021, 6:02 PM
    But beware aware that it doubles layout pass each time it renders
    a
    • 2
    • 1
  • v

    Vinay Gaba

    06/29/2021, 6:27 PM
    I'm curious if there's any plans for an equivalent of the
    findFragment(view: View)
    method for Compose - https://developer.android.com/reference/androidx/fragment/app/FragmentManager#findFragment(android.view.View). Basically need a way to find the fragment that's hosting the composable (Don't judge me for saying that 😄 Need it for practical reasons). If there's no plans for first class support, how can I go about creating similar functionality. The view system essentially makes use of the
    get/setTag
    method to associate a view to a fragment using this id
    R.id.fragment_container_view_tag
    .
    i
    • 2
    • 5
Powered by Linen
Title
v

Vinay Gaba

06/29/2021, 6:27 PM
I'm curious if there's any plans for an equivalent of the
findFragment(view: View)
method for Compose - https://developer.android.com/reference/androidx/fragment/app/FragmentManager#findFragment(android.view.View). Basically need a way to find the fragment that's hosting the composable (Don't judge me for saying that 😄 Need it for practical reasons). If there's no plans for first class support, how can I go about creating similar functionality. The view system essentially makes use of the
get/setTag
method to associate a view to a fragment using this id
R.id.fragment_container_view_tag
.
i

Ian Lake

06/29/2021, 6:37 PM
What do you need the fragment for that wouldn't be better suited as either one of the existing CompositionLocals (i.e.,
LocalLifecycleOwner
) or your own
LocalFragment
?
AndroidViewBinding
might be doing something similar to the hacking that you're proposing: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]va/androidx/compose/ui/viewinterop/AndroidViewBinding.kt;l=66
👍 1
Using
LocalView.current
with
findFragment()
v

Vinay Gaba

06/29/2021, 7:13 PM
Needed the fragment due to the existing assumptions that some of our tooling was making. That can certainly be changed though.
and thanks for the link! This seems promising!
View count: 8