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

    jannis

    12/01/2021, 3:47 PM
    Is there any way to get the position of the Cursor within a
    TextField
    ? I know about the
    selection
    of the
    TextFieldValue
    . But I need the coordinates. As an alternative: Is there any way to scroll to the current Cursor positon within a scrollable
    TextField
    or one within a scrollable container?
    z
    • 2
    • 14
  • j

    Joey

    12/01/2021, 4:01 PM
    Are variable fonts in TTF format supported by Compose?
    z
    a
    s
    • 4
    • 4
  • s

    Stylianos Gakis

    12/01/2021, 4:12 PM
    Is there an
    animateContentSize
    modifier that does not clip the item to its bounds? And I’d love to understand the reason that it is a default without a parameter that can change it @Doris Liu My use case is that I have a simple Card inside a RecyclerView that I’d like to animate when it changes, but the fact that it’s forced to clip bounds cuts the shadow and makes it look super ugly. Is there maybe a different API I should be using instead? For now I simply copy-pasted the private functions existing in the library and removed the
    clipToBounds
    call and it does exactly what I wanted it to.
    d
    • 2
    • 2
  • m

    Marcello Galhardo

    12/01/2021, 4:26 PM
    Today I noticed the existence of a modifier against a “default custom Modifier” (see example below). Does anyone know what is the reasoning? And what is the alternative to provide a custom behaviour that can be replaced? That feels like the most intuitive and obvious way of doing it. For example (that is not a real code as
    bringIntoView
    is actually mandatory but you should get the point):
    @Composable
    private fun MyTextField(
        // other attributes
        modifier: Modifier = Modifier.bringIntoView(), // optional modifier that can be overriden.
    ) {
    And the warning:
    Optional Modifier parameter should have a default value of Modifier
    d
    • 2
    • 2
  • m

    ms

    12/01/2021, 5:03 PM
    Implemented Fibonnaci animation using Compose. Inspired from
    @physics_only_
    Instagram reel but was removed now. Tried with different approaches but finally went with Recursive Composables (it was fun) GitHub repo Original animation in 🧵
    👍🏼 1
    👍 3
    😍 8
    • 1
    • 3
  • z

    zsperske

    12/01/2021, 5:58 PM
    Edit: Solved. We’re running into:
    java.lang.NoSuchMethodError: No virtual method setContent(Lkotlin/jvm/functions/Function0;)V in class Landroidx/compose/ui/platform/ComposeView; or its super classes (declaration of 'androidx.compose.ui.platform.ComposeView' appears in /data/app/~~80WnH7kFvYH_QJwuutqQpw==/com.ourapp.android.debug-V0ZNfKBI9LNUKhjnWxUOKg==/base.apk)
    We have a
    buildSrc
    and so tried to follow the guidance here
    <https://issuetracker.google.com/issues/176079157>
    however when I add
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
    to my buildSrc gradle file, I get a
    Plugin request for plugin already on the classpath must not include a version
    Has anyone else run into this?
    • 1
    • 1
  • c

    CLOVIS

    12/01/2021, 6:57 PM
    Is Compose compatible with Google's Live Translate? It seems like it has an effect directly on the view system, which Compose doesn't use (but I've got no way of testing it)
    a
    • 2
    • 1
  • m

    mcpiroman

    12/01/2021, 7:15 PM
    Can I make a TextField or some other component that is invisible but sill receives keyboard events?
    k
    z
    • 3
    • 3
  • a

    Arkadii Ivanov

    12/01/2021, 8:23 PM
    Looks like version 1.1.0-beta04 with Kotlin 1.6.0 was released today. Should we expected a stable version 1.0.x with Kotlin 1.6.0?
    j
    • 2
    • 3
  • t

    tad

    12/01/2021, 8:25 PM
    Should Compose honor the "Remove animations" accessibility preference in Android 12?
    • 1
    • 1
  • t

    Tim Malseed

    12/01/2021, 9:16 PM
    I finally solved my Compose testing problems, after spending quite some time trying to track down some very obscure bugs! With Compose, when testing screens, you call 
    composeTestRule.setContent { MyScreen() }
      - if you’ve written Compose UI tests, you’d be familiar with this. If you need to run the tests against a particular activity, for some reason, you can use 
    androidComposeTestRule<MyActivity>
    In my case, 
    MyActivity
     calls 
    setContent { MyScreen() }
     during 
    onCreate()
    . So, what ends up happening, is the test instantiates 
    MyActivity
    , which calls 
    setContent()
    , and the screen is composed, with its ViewModel and various dependencies. While this is happening, the test calls its own 
    setContent()
     and the screen is composed again, in parallel! This causes all kinds of nightmarish problems. tl;dr Make sure when testing Compose, that you only call 
    setContent()
     once per test. And be careful about which 
    Activity
     you use to host the test, if you need one!
    👀 1
    ☝️ 1
    c
    a
    • 3
    • 10
  • j

    jeff

    12/01/2021, 10:13 PM
    Compose TextField's cursor is overlaying system ui (keyboard, statusbar, etc) -- Is this a known issue? Is there a workaround? I couldn't find anything.
    z
    f
    • 3
    • 7
  • b

    brabo-hi

    12/01/2021, 10:54 PM
    Hi All, what is the point of keeping theme.xm files and reference them in the manifest file since theming colors are defined on the
    MaterialTheme
    color fies
    c
    • 2
    • 3
  • v

    Vinay Gaba

    12/02/2021, 6:08 AM
    I need to launch a coroutine in the
    onDispose
    of the DisposableEffect but I'm getting a
    JobCancellationException
    . This is probably due to the coroutine scope that I'm using (its the one that
    rememberCoroutineScope
    returns) that's not available anymore when I'm executing the
    onDispose
    block. Wondering how I can solve this?
    z
    • 2
    • 6
  • c

    Colton Idle

    12/02/2021, 6:22 AM
    At 1:31 the speaker says something along the lines of ~"composables are completely different from views. it doesn't use the view hierarchy at all" https://www.droidcon.com/2021/11/10/testing-jetpack-compose-ui/ Maybe a bit pedantic, but that's not entirely true right? Composables on android still essentially just live in a view hierarchy?
    g
    r
    • 3
    • 2
  • a

    abbic

    12/02/2021, 9:58 AM
    Hi folks, in the 1.1.0-beta03 version of compose material library we have added a new ExposedDropdownMenuBox component that is fantastic, but the default design is the filled dropdown menu style, not the outlined one which is what i'm looking for. is there a way to configure it such?
    d
    • 2
    • 6
  • o

    olonho

    12/02/2021, 1:02 PM
    We’re happy to announce the availability of Compose Multiplatform 1.0 - first stable release of JetBrains UI toolkit for Kotlin. See

    https://www.youtube.com/watch?v=JKjN5mmnSX0▾

    and blog post at https://blog.jetbrains.com/kotlin/2021/12/compose-multiplatform-1-0-is-going-live/ for details of what is being released. Enjoy Compose Multiplatform!!!
    🎉 8
    👍 4
    🚀 18
    :party-parrot: 13
    :compose-multiplatform: 2
    :kotlin-intensifies: 46
    c
    z
    s
    • 4
    • 8
  • e

    Ehsan Mehranberg

    12/02/2021, 3:26 PM
    Hello devs. I want to have shared element transition in a hybrid app where we have fragments and the fragment content is composable. I’ve created the following composable to have an
    AndroidView
    that wraps a
    ComposeView
    and the content of the
    ComposeView
    could be any composable
    @Composable
    fun SharedElement(
        modifier: Modifier = Modifier,
        transitionTag: String,
        @IdRes viewId: Int,
        content: @Composable () -> Unit
    ) {
        AndroidView(
            modifier = modifier,
            factory = { context ->
                ComposeView(context).apply {
                    transitionName = transitionTag
                    id = viewId
                    setContent {
                        content()
                    }
                }
            }
        )
    }
    The problem is when the first fragment gets destroyed, the content of shared element gets decomposed as well and we can’t have a smooth transition between fragments. Ideally, shared composables should decompose when the element transition ends but I couldn’t find a way to do that. Any idea how this shared element transition can be nailed with composables and fragments?
    i
    • 2
    • 10
  • r

    robnik

    12/02/2021, 3:47 PM
    Should I report bugs in the following situation: I released an app, and I see Crashlytics crash reports with a stack trace in Compose, but no frames from my code. I can't reproduce the crash. My guess is there are some bugs in Compose causing it, but is a stack trace and message not enough for a report? Example in thread.
    ➕ 1
    s
    • 2
    • 9
  • a

    Arpit Shukla

    12/02/2021, 4:06 PM
    Is there some way to disable overScroll effect in HorizontalPager by Accompanist?
    a
    c
    f
    • 4
    • 10
  • t

    Tgo1014

    12/02/2021, 4:17 PM
    Do I have to specify all Material3 colors? I would imagine
    primaryContainer
    would be generated from
    primary
    for example
    c
    a
    r
    • 4
    • 34
  • b

    Brian Donovan

    12/02/2021, 4:46 PM
    Hey all, How do I get rid of that grey bottom line on the text field?
    j
    • 2
    • 3
  • m

    Marcin Wisniowski

    12/02/2021, 6:06 PM
    How do people handle full screen `@Preview`s? I have seen opinions previews should only be used for individual composables, not screens, but I also think the XML layout previews were useful and I would like a preview of an entire screen.
    ➕ 1
    a
    c
    • 3
    • 12
  • d

    dimsuz

    12/02/2021, 6:17 PM
    Is there a way for a component up in hierarchy to be notified when none of its not immediate nested children has focus? I.e. if I have deeply nested set of TextFields and want to do something when focus is lost? I tried adding onFocusEvent to this grand-parent component, but it receives
    hasFocus = false
    immediately after one of the children receives
    hasFocus = true
    z
    r
    • 3
    • 6
  • t

    Tuba Kesten

    12/02/2021, 6:40 PM
    Hi 😄 I added AnimatedVisibility to each item in a lazyColumn. I want to invoke an action at the end of tween animation. I can add listener to 
    animateColorAsState
     ; however,  this causes to take action while tween animation is running. Is there any way to understand  when the exit animation completed?
    c
    d
    • 3
    • 3
  • p

    Paul

    12/02/2021, 9:13 PM
    I was checking the
    MotionLayout
    for Compose and cannot understand whether it supports specifying
    OnSwipe
    gestures that we can define inside scene files in XML. Is it something that will be added later on, because the docs say that the first version of
    MotionLayout
    for Compose supports only a subset of features?
    n
    c
    • 3
    • 7
  • s

    Sololo

    12/03/2021, 6:15 AM
    what is the Compose’s advantage over Flutter?
    ✅ 1
    c
    z
    • 3
    • 6
  • r

    Rene Win

    12/03/2021, 6:25 AM
    I have an AndroidView where i get some custom Font via
    ResourcesCompat.getFont()
    Is there any possibility to render this view in the preview? It failes with an exception "Font resource ID #0x7f080000 could not be retrieved" If I build and deploy the application it all works fine
    y
    • 2
    • 2
  • f

    Florian

    12/03/2021, 8:07 AM
    does someone have the code for a CircularProgressInIndicator with rounded edges on the progress bar?
    c
    s
    • 3
    • 6
  • d

    Deepak Gahlot

    12/03/2021, 12:26 PM
    Hello, In BottomSheetScaffold do we have an option to collapse the sheet when user taps or clicks outside of the sheet.
    • 1
    • 1
Powered by Linen
Title
d

Deepak Gahlot

12/03/2021, 12:26 PM
Hello, In BottomSheetScaffold do we have an option to collapse the sheet when user taps or clicks outside of the sheet.
Any inputs will be great help!!!
View count: 1