MotionEvent object used to report movement (mouse, pen, finger, trackball) events. Motion events may hold either absolute or relative movements and other data, depending on the type of device. Motion events describe movements in terms of an action code and a set of axis values. The action code specifies the state change that occurred such as a pointer going down or up. The axis values describe the position and other movement properties.
Questions tagged [motionevent]
468 questions
0
votes
1 answer
Drag a view onLongClick and start activity onClick
I'm banging my head with this problem which probably is simple but since I'm new to this topic I somehow haven't been able to figure it out yet.
I've successfully implemented dragging a view with onTouch method. I've also successfully implemented…

Mango
- 51
- 6
0
votes
1 answer
Move Kivy window by label drag - Kivy, Python
I want to create custom window header of a Kivy window. I am very new to kivy so please provide some explanation how the events work. I need to simply move the window by "moving" the label.
First of all I want to know, why this does call any…

Jakub Bláha
- 1,491
- 5
- 22
- 43
0
votes
1 answer
Intercept motion event from RecyclerView in opened PopupWindow
In my case I want to open PopupWindow by long press on ViewHolder item and process motion event in this window without removing finger. How can I achieve this?
I trying to open CustomPopupWindow by follow:
override fun onBindViewHolder(holder:…

Anonymous
- 301
- 3
- 8
0
votes
2 answers
Recording rawX, rawY on a ScrollView in Android
I'm trying to get access to every touch event on the screen while a user is scrolling through a ScrollView so I can record the rawX, rawY, pressure, orientation and major and minor axis of the touch point. I currently am able to get access to the…

kriti
- 23
- 6
0
votes
1 answer
Problems with audio in onTouchListener and mediaplayer.setLooping
im trying to do a Soundboard for a school proyect, but I have problems when I pulse the buttons, If I pulse a button twice, the sound does not reproduce again, and, even if the condition fullfills, the audio doesnt loop. I have different buttons,…

Ametz
- 1
- 1
0
votes
0 answers
Should the onInterceptTouchEvent method intercept its own touch events?
In the Android docs it says that the OnInterceptTouchEvent method of ViewGroup:
allows you to watch events as they are dispatched to your children
This somewhat implies to me, that it would only watch events from its children excluding its own…

Crocodile
- 5,724
- 11
- 41
- 67
0
votes
2 answers
Android: Press both ImageViews at the same time
I am currently trying to make that you have to press both ImageViews simultaneously to move them to a random position on the screen. Since I can't do it with OnClickListener I tried it with the following code example. After hours of searching for…

Cagri Ersöz
- 17
- 3
0
votes
0 answers
how to solve touch coordinates jumps weird while drag and scale
i have relative parent layout and adding custom textview dynamically into it. when i drag(move) and scale my current textview it get weird jumps continuously in both pointer index. how can i solve this issue?
my custom textview as given…

Harshil Dholakiya
- 105
- 11
0
votes
1 answer
Android move slide down to slide up view
I'm using this library to use slide down menu, the problem is when I want to move the handle from top to bottom and want to change from slide down to slide up, I try to change the variable but can't make it right
This is the original code
/* User…

Dirus
- 1,033
- 2
- 14
- 21
0
votes
1 answer
Make onTouchListener to update?
I haven't seen an answer for what I am trying to do. I want to update code for as long as I am pressing down on a button and when I let go, the code stops updating. Any advice helps please. Here's my code:
forward.setOnTouchListener(new…

mike-gallego
- 706
- 2
- 12
- 27
0
votes
1 answer
Handle Floating action Button(FAB) move (inside layout i.e. visible to user) and click with OnTouchListener
I wanted to move my button if coordinates of final position are inside my view. So I store initial touch(ACTION_DOWN) in so I can differentiate move from the click, But Something is wrong. My button flying away on move event! and click doesn't work…

Mehran Zamani
- 831
- 9
- 31
0
votes
1 answer
Need to be able to pinch to zoom, but not to do a double Tap in my touch listener
So I have a view under my view, that I need to pass to the pinch to zoom. BUT, if the user double taps, than I do not want to pass the double tap to my second view. Because I need the functionality that is set on a double tap to be ignored.
The…

rosu alin
- 5,674
- 11
- 69
- 150
0
votes
0 answers
onKeyDown event getting called every 30-40 ms pressing only one time... Why?
I'm testing a game trying to bind phisical keyboard keys to it. I implemented onKeyUp and onKeyDown to know when the user has pressed a key for move. The problem is that onKeyDown event is getting called repeatedly every 30-40ms.
In theory it must…

NullPointerException
- 36,107
- 79
- 222
- 382
0
votes
0 answers
Having trouble with MotionEvent.ACTION_UP
I have a joystick application that I am implementing and am having trouble with handling motion events. Everything works fine for the most part except that I am trying to capture an event after ACTION_MOVE. So after the user is done dragging the…

Bisquick Quick
- 41
- 1
- 8
0
votes
1 answer
Android MotionEvent.ACTION_MOVE and MotionEvent.ACTION_UP
im trying to implement swipe for my list view item, i have hidden element (like a button )
i want swipe left/right item for showing this button. Everything work perfect. Except i cant click normally on item or button. Because event…

Peter
- 2,480
- 6
- 39
- 60