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

    Andy Himberger

    03/28/2022, 3:46 PM
    How to get AndroidView factory to run again on recompose? I have a composable helper we use to create some of our legacy views, and even on recompose or changing the factory function instance, the factory doesn't create a new item -- this is the one workaround I've found that works but looking for a proper way to do it -- (component is an enum value passed into the function, I have tried different factory function implementations)
    ReusableContent(component) {
        AndroidView(factory = {
            createView(it, component)
        }, Modifier.fillMaxSize(), { })
    }
    I tried some other things like recomposer.invalidate when the component changed, creating different factory function instances that differed slightly, but that didn't change anything... I was really expecting when the args to AndroidView changed, it would create a new view underneath and clean up the old one. Maybe I'm missing something
    a
    a
    p
    • 4
    • 11
  • c

    Creep Toe

    03/29/2022, 7:23 AM
    Why does this make the button fill the whole screen/surface? I have to specify wrapContentWidth/wrapContentHeight for the button. IconButton works fine.
    Surface(modifier = Modifier.fillMaxSize()) {
        Button(onClick = {}) {}
    }
    👀 2
    a
    • 2
    • 2
  • f

    Filip Wiesner

    03/29/2022, 7:24 AM
    There is one issue that has been fixed in Compose AOSP but it's not yet released in a version of Compose. Is there some way to get the fix now without forking the whole Compose? 😅
    n
    • 2
    • 2
  • k

    Kshitij Patil

    03/29/2022, 10:32 AM
    How do we show Emojis in Jetpack Compose? I came across this open issue. Any updates on the same?
    p
    a
    • 3
    • 12
  • c

    Colton Idle

    03/29/2022, 10:41 AM
    Does anyone know if anythings changed in regards to having autofill for password managers? I'm going back and forth between my login screens from my view based activity, and then my compose based activity and in view based, the LastPass autofill comes up automatically, but nothing for compose. Looking through the docs on this for compose and its very light at the moment. Google issue tracker also coming up empty.
    ➕ 1
    b
    • 2
    • 1
  • f

    Filip Wiesner

    03/29/2022, 12:39 PM
    Can someone please confirm that as of
    1.2.0-alpha06
    the IME is not hidden when focused element exits composition? 🙏 I've been jumping back and forth from
    alpha05
    and
    06
    and now I am not sure if what I'm seeing is really a bug.
    c
    t
    +2
    • 5
    • 12
  • m

    mattinger

    03/29/2022, 5:23 PM
    Hi all. I’m trying in implement a Scaffold Type component, which will monitor scroll state, and when the Column/LazyColumn is not fully scrolled to the bottom, will present a clickable item to make it scroll down a single page. I’ve got all that working, but the issue i’m having is that I can’t really make it work for LazyColumn using the same code as Column. The issue is really calculating how far to scroll down, because LazyListState and ScrollState have different ways of determining where in the scrolling you are.
    • 1
    • 2
  • m

    myanmarking

    03/29/2022, 5:41 PM
    does any1 know how to specify initial camera position for the map, based on a route? I can only do
    position = CameraPosition.fromLatLngZoom
    , which internally do
    CameraUpdateFactory.newCameraPosition(value)
    but i would like to use
    CameraUpdateFactory.newLatLngBounds
    m
    • 2
    • 4
  • c

    Chris Johnson

    03/29/2022, 7:26 PM
    So I'm not seeing any current way to change your content width/height in
    LazyVerticalGrid
    or
    LazyHorizontalGrid
    in 1.2.0-alpha05. It seems like your content's size is determined by the columns/rows, horizontal/vertical arrangement/alignment, and contentPadding. Is there no way to custom it and say I want every item in my LazyVerticalGrid to be 40x80dp?
    a
    • 2
    • 2
  • a

    allan.conda

    03/29/2022, 7:57 PM
    I’m getting feedback from my team that their debug builds are unbearably slow for daily development. For example, It’s difficult to eye-check animations since it doesn’t run smoothly anymore, or it’s just slow in general. We understand release or r8'd builds are faster; and is there any way we could somehow speedup debug builds as well?
    c
    r
    • 3
    • 3
  • g

    georgiy.shur

    03/29/2022, 10:30 PM
    In
    LazyListScope
    there is a
    stickyHeader { }
    function. I’d like to achieve the same behavior, but for sticky footer: the item should stick to the bottom until the user scrolls to it, and after the user scrolls further down, the item has to scroll normally together with the content. Is there some smart way to achieve this behavior?
    c
    a
    • 3
    • 7
  • d

    Dazai

    03/30/2022, 7:13 AM
    update: just learned about the weight modifier. putting a weight of 1 on the textfield and no weight on the search button did the trick
    c
    • 2
    • 1
  • a

    Alexandru Hadăr

    03/30/2022, 10:25 AM
    I’ve seen that the first few times I’m using
    AnimatedVisibility
    , the animation seems a bit staggering/sluggish. After I’ve played a coupled of times with it, it moves smoothly. I tend to believe this is due to some kind of lazy initialization? Or what could be the case and what could be the solution? I’m using compose version
    1.1.1
    🧵
    f
    r
    d
    • 4
    • 12
  • m

    Maciej Czekański

    03/30/2022, 1:43 PM
    Hey, does anyone has workaround for this @Preview error?
    The following classes could not be instantiated:
    - androidx.compose.ui.tooling.ComposeViewAdapter (Open Class, Show Exception, Clear Cache)
     Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE.  If this is an unexpected error you can also try to build the project, then manually refresh the layout.  Exception Details java.lang.ClassNotFoundException: androidx.customview.poolingcontainer.R$id
    It happened to me after updating compose to
    1.2.0-alpha06
    . It doesn't work both on Chipmunk and Dolphin
    👀 1
    f
    c
    +2
    • 5
    • 18
  • t

    Trym Nilsen

    03/30/2022, 2:00 PM
    What is the recommended/googly way of handling arguments in compose navigation? How are people passing parcelable or serialisable objects? Serialising it to a json string feels a bitt iffy 😅
    s
    • 2
    • 2
  • l

    Lauren Yew

    03/30/2022, 4:27 PM
    Hi all, has anyone had trouble with
    @Composable
    interface methods getting
    AbstractMethodError
    issues? I have a simple interface that I'm using with Hilt to pass Compose Theme components back to a library.
    import androidx.compose.material.Colors
    import androidx.compose.runtime.Composable
    
    interface DevSettingsMaterialTheme {
        @Composable
        fun devSettingsLightColors(): Colors?
    ...
    }
    
    class SampleDevSettingsMaterialTheme : DevSettingsMaterialTheme {
      
        @Composable
        override fun devSettingsLightColors(): Colors? = null // crashes w AbstractMethod
    ...
    }
    The library itself was able to implement the interface no problem, and I have tested with one app and it works fine, but another sample app where I'm using the same library (same gradle plugin version 7.1.0 + kotlin version 1.6.10, Java version 11, compose version 1.1.1), when I run the app and try to use the library feature, I get the error
    java.lang.AbstractMethodError: abstract method "androidx.compose.material.Colors com...android.devsettings.di.DevSettingsMaterialTheme.devSettingsLightColors(androidx.compose.runtime.Composer, int)"
    . Any ideas on how I can work around this? Thanks!
    a
    • 2
    • 2
  • t

    theapache64

    03/30/2022, 5:57 PM
    Getting below error when accessing
    layoutCoordinates.positionInRoot()
    . This is only happening in release build.
    Fatal Exception: java.lang.IllegalStateException
    LayoutCoordinate operations are only valid when isAttached is true
    d
    • 2
    • 15
  • a

    Afzal Najam

    03/30/2022, 6:11 PM
    Should the
    scrollable
    ,
    verticalScroll
    , and
    horizontalScroll
    modifiers also have a
    contentPadding
    argument like the Lazy layouts do? Otherwise their children get clipped at the beginning and end if they’re animated to scale even a little bit.
    j
    • 2
    • 2
  • c

    Colton Idle

    03/30/2022, 6:41 PM
    Maybe a weird question. But I have a mutableState that is accessible in my VM. Is there a way in the VM to observe changes of that state? Ideally I could do something like
    init { myMutableState.collect { refresh() } }
    c
    t
    a
    • 4
    • 15
  • u

    ursus

    03/30/2022, 11:15 PM
    If you were to do instagram stories ui (the progressbar), how would you drive the progress? ValueAnimator? Coroutines, flow?
    d
    • 2
    • 1
  • k

    K Merle

    03/31/2022, 4:34 AM
    Hopefully question is in the right channel. Does anyone who uses navigation transition has little stutter while loading large set of data and showing it? Sometimes I get stutter during transition animation and I was wondering how to resolve that. Doing small delay on data fetch (200ms) removes the stuttering. I am using coroutines and upstream is on IO dispatcher.
    r
    • 2
    • 4
  • s

    Shivam Dhuria

    03/31/2022, 6:05 AM
    Is there a way to create a frosted glass effect using Jetpack Compose? My background is dynamic and I only want the part behind the card to be blurred. (for versions > android 8) I am trying to make something like this -
    f
    f
    s
    • 4
    • 4
  • m

    myanmarking

    03/31/2022, 8:54 AM
    in compose map, how do i get a screenshot of the map, as in:
    snapshot(@NonNull GoogleMap.SnapshotReadyCallback callback) ?
    o
    • 2
    • 6
  • o

    Orhan Tozan

    03/31/2022, 10:20 AM
    I want to emit 6 times the same composable (Card), but in the middle, I want a Divider. So I want to get something like: C C C D C C C How would one do this?
    f
    c
    a
    • 4
    • 32
  • m

    Mikołaj Kąkol

    03/31/2022, 11:54 AM
    hi, is there an API in compose for EditText’s
    /**
     * Called when a context menu option for the text view is selected.  Currently
     * this will be one of {@link android.R.id#selectAll}, {@link android.R.id#cut},
     * {@link android.R.id#copy}, {@link android.R.id#paste} or {@link android.R.id#shareText}.
     *
     * @return true if the context menu item action was performed.
     */
    public boolean onTextContextMenuItem(int id) {
    s
    • 2
    • 4
  • m

    Mykola

    03/31/2022, 1:36 PM
    Ran into a blocker with Compose Navigation. Every Compose Screen gets white background if navigated using Compose Navigation. Meaning I can’t create screen B that will be placed on top of screen A where screen A will be partially visible in the background. This is pretty strange.
    m
    • 2
    • 25
  • y

    Yacov Rosenberg

    03/31/2022, 1:41 PM
    Any recomendation to a architecture where could I use compose with regular Ui toolkit together?
    m
    • 2
    • 4
  • m

    Mikael Ohlson

    03/31/2022, 2:48 PM
    I'm having some issues with
    rememberAnimatedVectorPainter
    with an animated vector drawable from a resource, when the drawable contains a "translateXY" property (as seen in some AOSP classes). As far as I can tell, any animated vector drawable containing the object animator below will cause a crash. Is this a known issue, am I just being silly and doing something dumb, or should I report it?
    <objectAnimator xmlns:android="<http://schemas.android.com/apk/res/android>"
        xmlns:aapt="<http://schemas.android.com/aapt>"
        android:propertyName="translateXY"
        android:duration="500"
        android:startOffset="0"
        android:propertyXName="translateX"
        android:propertyYName="translateY"
        android:pathData="M 12.138,24C -1.1690000000000005,24 17.919,24 12.138,24">
        <aapt:attr name="android:interpolator">
            <pathInterpolator android:pathData="M 0.0,0.0 c0.333,0.168 0.667,1 1.0,1.0" />
        </aapt:attr>
    </objectAnimator>
    And it is being referenced like this
    @OptIn(ExperimentalAnimationGraphicsApi::class)
    @Composable
    fun BadgeIconImage() {
        val image = AnimatedImageVector.animatedVectorResource(R.drawable.triangle_animated_vector)
        var atEnd by remember { mutableStateOf(false) }
    
        Image(
            painter = rememberAnimatedVectorPainter(image, atEnd),
            contentDescription = "Your content description",
            modifier = Modifier.size(64.dp).clickable {
                atEnd = !atEnd
            }
        )
    }
    where the triangle_animated_vector just uses the above object animator on a simple triangle. I'm on version 1.1.1 of compose.
    d
    • 2
    • 8
  • p

    Pardip

    03/31/2022, 2:49 PM
    Hello everyone, I want to achieve sticky footer using jetpack compose like in screenshot. A is scrollable list of row items. When A is smaller than screen(or parent) size, B (footer) should be placed bellow the last row. When A+B are bigger than screen size, then B becomes fixed at the bottom and A content is scrollable. I’m wondering if there is easy way to achieve this, using compose ConstraintLayout.
    t
    • 2
    • 1
  • a

    andrew

    03/31/2022, 3:06 PM
    Hey y’all, I’m working on a thermostat view in jetpack compose, and I was facing an issue using
    pointerInteropFilter
    on the knob views in conjunction with
    pointerInput
    on a
    Canvas
    view underneath. Multitouch breaks with a NPE. I have a small sample pasted below the stack trace, and some context explaining why I need to do things this way
    j
    • 2
    • 12
Powered by Linen
Title
a

andrew

03/31/2022, 3:06 PM
Hey y’all, I’m working on a thermostat view in jetpack compose, and I was facing an issue using
pointerInteropFilter
on the knob views in conjunction with
pointerInput
on a
Canvas
view underneath. Multitouch breaks with a NPE. I have a small sample pasted below the stack trace, and some context explaining why I need to do things this way
In case y’all are wondering what it looks like, for some context
Here’s the stack trace
2022-03-31 11:07:30.166 15447-15447/com.stratisiot.mobile E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.stratisiot.mobile, PID: 15447
    java.lang.NullPointerException
        at androidx.compose.foundation.gestures.DragGestureDetectorKt.awaitDragOrCancellation-rnUCldI(DragGestureDetector.kt:844)
        at androidx.compose.foundation.gestures.DragGestureDetectorKt$awaitDragOrCancellation$1.invokeSuspend(Unknown Source:15)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
        at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
        at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
        at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine.offerPointerEvent(SuspendingPointerInputFilter.kt:509)
        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.dispatchPointerEvent(SuspendingPointerInputFilter.kt:404)
        at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter.onPointerEvent-H0pRuoY(SuspendingPointerInputFilter.kt:417)
        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:310)
        at androidx.compose.ui.input.pointer.Node.dispatchMainEventPass(HitPathTracker.kt:297)
        at androidx.compose.ui.input.pointer.NodeParent.dispatchMainEventPass(HitPathTracker.kt:179)
        at androidx.compose.ui.input.pointer.HitPathTracker.dispatchChanges(HitPathTracker.kt:98)
        at androidx.compose.ui.input.pointer.PointerInputEventProcessor.process-BIzXfog(PointerInputEventProcessor.kt:80)
        at androidx.compose.ui.platform.AndroidComposeView.sendMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1223)
        at androidx.compose.ui.platform.AndroidComposeView.handleMotionEvent-8iAsVTc(AndroidComposeView.android.kt:1173)
        at androidx.compose.ui.platform.AndroidComposeView.dispatchTouchEvent(AndroidComposeView.android.kt:1112)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
        at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:498)
        at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
        at android.app.Activity.dispatchTouchEvent(Activity.java:4202)
        at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:456)
        at android.view.View.dispatchPointerEvent(View.java:14858)
        at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6446)
        at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6247)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5725)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
        at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5913)
        at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
        at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5970)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
        at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5782)
        at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5748)
2022-03-31 11:07:30.167 15447-15447/com.stratisiot.mobile E/AndroidRuntime:     at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5756)
        at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5729)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8696)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8647)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:8616)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8819)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:259)
        at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
        at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:239)
        at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:8776)
        at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:8905)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037)
        at android.view.Choreographer.doCallbacks(Choreographer.java:845)
        at android.view.Choreographer.doFrame(Choreographer.java:772)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7870)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
@Composable
fun Reproduction(modifier: Modifier = Modifier) {
    BoxWithConstraints(modifier) {
        Canvas(Modifier.fillMaxSize().pointerInput(Unit) {
            detectDragGestures(
                onDrag = { _, dragAmount -> println(dragAmount) }
            )
        }) {
            drawCircle(Color.Red, size.width / 3)
        }

        Box(Modifier.size(48.dp).background(Color.Yellow).pointerInteropFilter { event ->
            when (event.action) {
                MotionEvent.ACTION_DOWN -> { println("DOWN") }
            }

            false
        })
    }
}

@Composable
@Preview
private fun Reproduction_Preview() {
    Reproduction(Modifier.padding(48.dp).aspectRatio(1F))
}
I’m on 1.2.0-alpha06
For context, I need pointerInteropFilter to pass through the touch event, but detect when one of the knobs are touched so I can perform a bunch of circle math to get the progress of the currently downed knob
Also, this happens only with multutouch
j

jossiwolf

04/01/2022, 9:37 AM
Would you mind filing an issue with the repro here? 🙂
a

andrew

04/01/2022, 9:30 PM
Sure thing @jossiwolf
You may have linked an internal facing thing, I’ve created an issue on the public tracker: https://issuetracker.google.com/issues/227759166
j

jossiwolf

04/12/2022, 11:28 AM
Indeed I have, ty Andrew!
a

andrew

04/12/2022, 1:30 PM
No prob!
View count: 61