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

    Jan Skrasek

    03/03/2021, 8:04 PM
    I'm trying to create a button with insets - i.e. a part with react to the click but it is outside and doesn't draw any ripple effect outside the button. How can I do that?
    t
    c
    • 3
    • 3
  • t

    TheMrCodes

    03/03/2021, 8:47 PM
    ❓Set Animation duration: Is there any way how I can set the duration of a SpringSpec Animation?
    d
    z
    • 3
    • 12
  • j

    Jordi Saumell

    03/03/2021, 9:13 PM
    Yesterday I published a sample app with Compose beta01. It focuses on doing MVVM without AAC-ViewModels and without fragments (binding Koin scopes to navigation destinations). Also, config changes are handled manually, app state is saved, layout adapts to landscape or multi-window, and more… It has been an interesting challenge, and I think it can be useful to those building apps that are fully in Compose UI. Also, comments are more than welcome, as I’m quite new to declarative UI. So in case someone is interested, here it is 🙂
    👍 2
    🎉 6
    • 1
    • 1
  • f

    FunkyMuse

    03/03/2021, 9:33 PM
    With the current Bottom navigation view and the navigation compose artifact, once i leave the application and come back to it, the navigation is restarted, any workaround or I'm missing something?
    g
    i
    s
    • 4
    • 5
  • b

    bruno.aybar

    03/03/2021, 10:39 PM
    Hello. Is there any way to draw blurred content inside a
    Canvas
    ?
    r
    m
    +2
    • 5
    • 12
  • d

    Denis

    03/04/2021, 1:50 AM
    Is there a way to change the order of drawing for deep descendants (not direct children) of the same parent? I'm trying
    .zIndex
    , but it only works "for the children of the same layout parent". Code in the thread.
    🇳🇴 1
    • 1
    • 2
  • s

    sen kumar

    03/04/2021, 1:59 AM
    Will Nested LazyColumns be possible any time?
    c
    a
    a
    • 4
    • 10
  • j

    Jason Inbody

    03/04/2021, 2:30 AM
    java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.serialization.DescriptorSerializer$Companion.registerSerializerPlugin(org.jetbrains.kotlin.serialization.DescriptorSerializerPlugin)'
    	at androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar$Companion.registerProjectExtensions(ComposePlugin.kt:152)
    	at androidx.compose.compiler.plugins.kotlin.ComposeComponentRegistrar.registerProjectComponents(ComposePlugin.kt:102)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli(KotlinCoreEnvironment.kt:584)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:132)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:172)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt)
    	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:426)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:226)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:152)
    	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
    	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
    	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
    	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:386)
    	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:110)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:286)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:99)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:114)
    	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:74)
    	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:607)
    	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:96)
    	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1659)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
    	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
    	at java.base/java.security.AccessController.doPrivileged(Native Method)
    	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:834)
    :thread-please: 3
    j
    d
    • 3
    • 8
  • d

    Denis

    03/04/2021, 4:31 AM
    How to draw an ImageVector into Canvas?
    n
    • 2
    • 2
  • c

    Ch8n

    03/04/2021, 6:23 AM
    Hi guys can you guide me on how can I achieve this behavior? the purple color moves down and it does the color of the text changes from white to purple?
    j
    n
    +2
    • 5
    • 13
  • u

    Utkarsh Tiwari

    03/04/2021, 8:05 AM
    What compose component would be apt if I want to replicate this kind of popup menu? In my case, the trigger could be a button in an activity on tablets.
    pop action list.mp4
    s
    v
    • 3
    • 4
  • a

    Albert Chang

    03/04/2021, 9:57 AM
    Is there any way to draw onto an independent layer with transparent background?
    graphicsLayer()
    doesn't seem to work. (Details in thread)
    n
    • 2
    • 4
  • z

    zhuinden

    03/04/2021, 10:04 AM
    I've successfully managed to transition between two composables in https://github.com/Zhuinden/simple-stack-compose-integration/blob/bb3410086dd40041[…]en/simplestackcomposeintegration/core/ComposeIntegrationCore.kt but Accompanist/CoilImage is flickering. What can I do about it? 🤔
    device-2021-03-04-104428.mp4
    a
    e
    • 3
    • 4
  • a

    Archie

    03/04/2021, 10:12 AM
    Hi, I was wondering if anyone else encountered this issue. I have a
    TextField
    inside a
    LazyColumn
    . If I focus on the
    Textfield
    (which naturally opens the
    SoftKeyboard
    ) and scroll to the point where the focused TextField isn't in the screen, it throws an error :
    Try to begin a session [IME_SESSION] whose parent [INPUT_VIEW_SESSION] hasn't begun
    May I ask for some advice?
    d
    • 2
    • 4
  • a

    Ali Albaali

    03/04/2021, 10:27 AM
    message has been deleted
    🚀 2
    🎉 5
    d
    • 2
    • 2
  • j

    julioromano

    03/04/2021, 10:52 AM
    Is there something similar to
    android:tileMode="repeat"
    we used to use in drawable XMLs ? (I have a drawable which I’d like to display tiled).
    ✅ 1
    n
    • 2
    • 4
  • c

    curtjrees

    03/04/2021, 11:53 AM
    I’ve ran into an issue where I believe my Composable should be recomposed when I change a parameter But it seems to only be recomposed on the first change and not subsequent ones Can anyone see an issue with my code? (in thread)
    g
    • 2
    • 3
  • a

    Archie

    03/04/2021, 1:37 PM
    Hi Guys, Is it possible to position
    AlertDialog
    so it is Anchord at the Bottom of the screen rather than the middle?
    z
    • 2
    • 2
  • t

    Thiago

    03/04/2021, 2:27 PM
    Hi folks. Has Compose Animations the interval concept where I can run another animation based on parent progress? Or do I need create each separated animation and stay checking parent progress to start each at time? E.g:
    // Sample 1
    .listenParent { progress ->
        if (progress < 0.1f) // update opacity state to start opacity animation
        else if (progress < 0.25f) // update width state to start width animation
        ...
    }
    
    // Sample 2
    @Composable
    fun OpacityComposable(parentProgress: Float = 0f, parentTimeMs: Long = 300) {
        val target = (parentProgress / 0.1f).coercIn(0f, 1f)
        // Ignore the unexpected behavior where the parent restart will first animate opacity to 0f before 1f
        val opacity = animateFloatAsState(
            targetValue = target,
            animationSpec = tween(
                durationMillis = parentTimeMs * 0.1f, // Is it the way to keep time sync between them?
                easing = LinearOutSlowInEasing // To have an independent curve 
            )
        )
    }
    👀 3
    d
    • 2
    • 5
  • e

    escodro

    03/04/2021, 2:43 PM
    Hello, everyone! 😊 Has anyone else having with
    performClick()
    functions in Instrumented Tests after updating to Compose 1.0.0-beta01? After the update it is not clicking at all in any views. Thanks in advance!
    • 1
    • 2
  • d

    Deepak Gahlot

    03/04/2021, 3:17 PM
    Hello, I was using scrollToItem(int, int) inside the LazyColumn and it does scroll to the item but them it does not scroll to the offset
    c
    a
    • 3
    • 8
  • s

    Se7eN

    03/04/2021, 3:51 PM
    I have a
    SnapshotStateList
    of
    Path
    . How do I redraw when I edit one of my
    Path
    objects from the list? I'm implementing drawing with finger
    Canvas(
        modifier.pointerInput(Unit) {
            detectDragGestures(
                onDragStart = { position -> paths.add(Path().also { moveTo(...) }) },
                onDragEnd = { ... },
                onDragCancel = { ... },
                onDrag = { change, dragAmount ->
                    change.consumePositionChange()
                    paths.last().quadraticBezierTo(...)
                }
            )
        }
    ) {
        paths.value.forEach { path ->
            drawPath(path, ...)
        }
    }
    • 1
    • 1
  • a

    Arun

    03/04/2021, 4:07 PM
    Hello! I want square
    Box
    items. Let’s say I have the following. How do I make sure the
    Box
    child composables are perfect squares? What value do I have to set it’s
    height
    to?
    @Composable
    @Preview
    fun PreviewSquareItems() {
    
        Row(modifier = Modifier.fillMaxWidth()) {
            val total = 2
    
            repeat(total) { index ->
    
                Box(
                    modifier = Modifier
                        .weight(1f)
                        .height(245.dp) // how to find this height?
                        .clip(RoundedCornerShape(8.dp))
                        .background(color = Color.Blue),
                )
    
                if (index + 1 < total) {
                    Spacer(modifier = Modifier.width(10.dp))
                }
            }
        }
    }
    s
    • 2
    • 1
  • t

    timmy

    03/04/2021, 4:38 PM
    hello please what's the equivalent of this compose desktop code in mobile:
    LocalAppWindow.current.height
    j
    z
    • 3
    • 5
  • v

    Vivek Sharma

    03/04/2021, 5:08 PM
    I am not able to create and pass param of
    size of custom width or height
    in
    Canvas
    , while drawing Rect I am hacking it like taking whole canvas size using
    size
    which gives me Canvas size and then doing
    size.copy(customWidth, customHeight)
    prev there was Size() function but cant access it now? how can I make size of custom width or height?
    s
    • 2
    • 8
  • d

    Denis

    03/04/2021, 5:21 PM
    [SOLVED] Is there a way to draw an ImageVector into Canvas? Particularly, I want to draw an Icon. I see
    drawImage
    method, but it accepts only an ImageBitmap. Probably I need to convert ImageVector to ImageBitmap, but I don't understand how
    n
    n
    • 3
    • 10
  • r

    rachael

    03/04/2021, 5:29 PM
    Say you're building a new app with compose that will have lots of screens, and many of the screens will handle a fair number of network interactions and business logic. It seems like the preference in a pure compose app is to not use fragments at all. Does that mean a single activity app where I have a ViewModel for every screen that's tied to that single Activity's lifecycle? Are there any potential downsides to having many long-lived ViewModels?
    v
    a
    +4
    • 7
    • 14
  • g

    grandstaish

    03/04/2021, 5:53 PM
    is there a public way to turn a compose
    FontFamily
    ,
    FontWeight
    , and
    FontStyle
    into a platform
    Typeface
    ? It looks like
    TypefaceAdapter
    is what I want but it’s internal
    c
    • 2
    • 3
  • a

    ak

    03/04/2021, 6:00 PM
    Update: FIXED 👋 Has anyone run into a Jetpack-Compose
    beta01
    compiler error when using the latest Koin
    3.0.1-alpha-6
    , and injecting a viewmodel instance via
    getViewModel()
    in your @Composable function?
    Internal error: Couldn't inline method call 'getViewModel'
    (further stacktrace in thread)
    e
    a
    • 3
    • 5
  • v

    Vivek Sharma

    03/04/2021, 8:01 PM
    I tried taking input in dialog using
    TextField
    inside
    Dialog
    , when I close the dialog , app crashes saying
    java.lang.ArrayIndexOutOfBoundsException: length=5120; index=-2
            at androidx.compose.runtime.SlotTableKt.groupSize(SlotTable.kt:2558)
            at androidx.compose.runtime.SlotTableKt.access$groupSize(SlotTable.kt:1)
            at androidx.compose.runtime.SlotReader.groupSize(SlotTable.kt:596)
            at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2215)
            at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2499)
            at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:2625)
            at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:406)
            at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:724)
    t
    s
    m
    • 4
    • 6
Powered by Linen
Title
v

Vivek Sharma

03/04/2021, 8:01 PM
I tried taking input in dialog using
TextField
inside
Dialog
, when I close the dialog , app crashes saying
java.lang.ArrayIndexOutOfBoundsException: length=5120; index=-2
        at androidx.compose.runtime.SlotTableKt.groupSize(SlotTable.kt:2558)
        at androidx.compose.runtime.SlotTableKt.access$groupSize(SlotTable.kt:1)
        at androidx.compose.runtime.SlotReader.groupSize(SlotTable.kt:596)
        at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2215)
        at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2499)
        at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:2625)
        at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:406)
        at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:724)
t

Timo Drick

03/05/2021, 7:48 AM
Yesterday i had the same problem during implementing the countdown timer for the dev challenge.
s

Se7eN

03/05/2021, 9:12 AM
Here's the issue: https://issuetracker.google.com/issues/180021390
👍 2
t

Timo Drick

03/05/2021, 9:47 AM
hmm it says that it is duplicate. And the other issue: https://issuetracker.google.com/issues/180124293 is already fixed.
v

Vivek Sharma

03/05/2021, 12:16 PM
yeah, I think it will be fixed in later beta version
m

MBegemot

03/10/2021, 6:03 PM
I've just stumbled now on it .... what a consolation, I give up for today!
t

Timo Drick

03/11/2021, 11:36 AM
I just implemented my own dialog. To be able to continue: (It is not a dialog just an overlay)
@Composable
fun SetTimerDialog(currentSeconds: Int, newSecondsSet: (seconds: Int?) -> Unit) {
    var textValue by remember { mutableStateOf(currentSeconds.toString()) }
    Box(Modifier.fillMaxSize().zIndex(10f).background(Color.Black.copy(alpha = 0.75f)), contentAlignment = Alignment.Center) {
        Surface(shape = MaterialTheme.shapes.medium) {
            Column(Modifier.padding(16.dp)) {
                Text("Set count down in seconds.", Modifier.padding(bottom = 4.dp))
                TextField(
                    value = textValue,
                    onValueChange = { textValue = it },
                    keyboardOptions = KeyboardOptions(
                        autoCorrect = false,
                        keyboardType = KeyboardType.Number,
                        imeAction = ImeAction.Done
                    ),
                    keyboardActions = KeyboardActions(onAny = { newSecondsSet(textValue.toInt()) })
                )
            }
        }
    }
}
View count: 2