Questions tagged [android-touch-event]

For questions about detecting, handling and responding to touch events in a view, in the Android platform.

Use this tag for questions related to detecting, handling and responding to touch events in a view, in the Android platform.

Documentation:

190 questions
2
votes
0 answers

1st fragment getting onScroll event from 2nd fragment scrolling of listview android

I have two fragment in my application under one activity. My problem is when I moved to second fragment using gridview click on 1st fragment, my 1st fragment still getting the touch onscroll event from 2nd fragment scrolling and touch. Here is the…
0xAliHn
  • 18,390
  • 23
  • 91
  • 111
2
votes
0 answers

touchEvent.touches.length returns always 1 on Android

It's the first time I am dealing with touch devices, and to implement some basic functions in my website/webapp, I would need to manage touch events. In the flow of my application, after having dynamically created a div, I attach to it a touchstart…
2
votes
1 answer

How to set movement listener for a view

I have to listen for the position change of a particular view. The view can be anywhere , like , it can be an item of the listview or recycler view , or it can be a child of a scrollview or nested scrollview etc. But whenever the position in the…
user4489210
2
votes
0 answers

Android touch event dispatching from parent to child

I have a parent Viewgroup with a child View inside of it. I'm am noticing some behavior during touch events that differs from my mental model of how touch events are dispatched. Viewgroup A takes up the full screen and View B is programmatically…
neonDion
  • 2,278
  • 2
  • 20
  • 39
2
votes
0 answers

palm rejection for android canvas

After completing an android canvas app(where the user can draw or jot), im now curious about how a finger-touch event can be disabled.Also let me know if the following line in my manifest does anything at all
onexf
  • 3,674
  • 3
  • 22
  • 36
2
votes
0 answers

Android TouchEvent Tracker

I want to create a tracking circle which appears when i touch the screen and moves along the pointer.Right now the code draws a circle on ACTION_DOWN but stays on the initial position.How do I move the circle along with the pointer?? …
zek54
  • 415
  • 3
  • 20
2
votes
1 answer

Getting the coordinates of a touched item inside a gridview

I have a gridviewthat contains some items. I want to get the screen related coordinates when touching any item in the grid. I know I can do that using MotionEvent.getRawX and MotionEvent.getRawY. The problem is that I cannot set the touch listener…
2
votes
6 answers

Double tap: zoom on Android MapView?

After a little bit of work my route application works fine. The only thing I just want to add is a double tap zoom in function, but I don't know how. Could you give me a hint?
poeschlorn
  • 12,230
  • 17
  • 54
  • 65
1
vote
0 answers

A touch interaction BUG of native view (like TextView \ PDFView) which nested in a AndroidView and scaled by a wrapped Box

Describe the bug Background: I want use Android native view like PDFView in Android Compose, so I should use a AndroidView to wrap it. And also I want my parent compose component set a scale factor by Modifier.scale(). Here is my code : …
1
vote
0 answers

How to dispatch gesture from AccessibilityService onGesture

I'm trying to build an app that can detect different gestures and then perform some action. I'm able to detect gestures using AccessibilityService onGesture method. But I want to dispatch the gesture so that user actions are not blocked. How can I…
1
vote
0 answers

dispatchTouchEvent() is crashing on Vivo device, Android 12 with 'java.lang.String java.lang.Object.toString()'

Firebase Crashlytics is reporting the following log specifically on Vivo devices, Android 12 OS. Any help would be appreciated, thank you. Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String…
1
vote
1 answer

Checking if finger is over certain view not working in Android

I am working on a paint app with the following layout: For the paint app, I detect touch events on the Canvas using onTouchEvent. I have one problem, I want to also detect touch events in which the user begins the swipe on the root and then hovers…
1
vote
0 answers

Motion layout on swipe is not working I have use tab view with view pager

I have created a bottom sheet with motion layout having default open 35% and in side that we have tabview and view pager and on Swipe of tabView I want that view pager height gone. But onSwipe is not working on touch of tab view. this is my Activity…
1
vote
0 answers

Android Application : How do I get touch event on Home Screen when the app in Background Action

Using WindowManager, I make the app floaintView in home screen like Facebook Messenger. MotionEvent allows to move the Floated View. I'd like to set up WindowManager Flag and get a touch event for a screen other than Floating, but it's not…
1
vote
0 answers

Disable Touch When Running ACTION_RECOGNIZE_SPEECH Intent

Part of my Android app uses speech-to-text, and I want to disable touch events while it does that because otherwise the user can accidentally touch their phone and stop the conversation. I'm trying to use a ViewGroup that can be the parent for that…