Questions tagged [motionevent]

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.

468 questions
0
votes
1 answer

Recognise Drag in Android even if there are subviews on top

I have an Activity in my app where I want to detect drag gestures. So I implemented the boolean onTouchEvent(MotionEvent event) function and can now handle a drag-gesture. The only problem I have right now is that I only get the onTouchEvent called…
Georg
  • 3,664
  • 3
  • 34
  • 75
0
votes
1 answer

Motion Event / Touch registration with two overlaying views

I am currently writing a game for android. I have one normal GLSurfaceView where I am rendering my graphics and using the public boolean onTouchEvent(MotionEvent me) method to register touch inputs to for example turn the camera. In a separate class…
0
votes
1 answer

incompatible types error in toast declaration

im trying to create a toast with a message that displays the coordinates depending where the user clicks on the screen. when i declare 'mContext=this' i get an error: incompatible types required: Context. @Override public boolean…
0
votes
1 answer

Toast message after MotionEvent

I am trying to display the coordinates of a point that a user clicks on the screen using a Toast. its not working in this class for some reasons, can anyone shed some light on why? @Override public boolean onTouchEvent(MotionEvent event) …
0
votes
0 answers

Two views with two onTouchListeners... not working

I have an app with two different views, each view haves its own onTouchListener and each ontouchlistener does different things. The two views listeners works if i touch them alone. The problem is that if one view is pressed and capturing the touch…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
0
votes
1 answer

Kivy Double Tap

I have a lot of questions...) I'm trying to get Kivy to register a double tap as the motion event used to add/remove a widget [ since there is no 'hide this widget option'... maybe in the next update] because a single touch down makes the widget…
Misha Stone
  • 631
  • 7
  • 22
0
votes
1 answer

what are the factors that affect the value of motionevent.getx()?

i am doing an app to show the coordinate when i touch on the screen. however, different devices show different range of coordinate. Here is my question. Is it because of screen resolution? how can i know the max coordinate of an image? what are…
Sam
  • 1
0
votes
2 answers

Event called when the user is touching the screen?

Welcome all I'm developoing a game. I want that when the user touches the screen, a laser must be fired constantly each 100ms from bottom part of the screen to the x,y coordinates touched, until the user stop touching the screen. I have the laser…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
0
votes
1 answer

Detect Scroll from unScrollable View in MotionEvent

I am using a ScrollView, that has a scroll trigger, in unscrollable state, I would like to detect the possible scroll, but instead of scrolling the view i would like to do other things with this value. @Override public boolean…
Mikelis Kaneps
  • 4,576
  • 2
  • 34
  • 48
0
votes
0 answers

MotionEvent error

Trying to figure out how onTouchEvent(MotionEvent e) works. Just look at this: public boolean onTouchEvent(MotionEvent e) { switch(e.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_POINTER_DOWN: …
T.Vert
  • 279
  • 2
  • 13
0
votes
2 answers

Error in property animation

I'm creating a small application for practice some in Android programming. It's a kind of puzzle game like this: Screen from application I have a following issue: when I slide a button left or right in x property all is OK. I can move each button…
lukasz-zimnoch
  • 107
  • 1
  • 14
0
votes
1 answer

Drawline on canvas does not follow my fingers touch

I try to draw on ImageView from a file resource. Here is my code: private Bitmap myBitmap; private Bitmap mutableBitmap; private Canvas canvas; private Paint paint; private ImageView img; @Override protected void onCreate (Bundle…
TRX
  • 465
  • 1
  • 8
  • 17
0
votes
1 answer

Fling gestures not executing

I am trying to implement fling guestures in a game. However, it seems that the fling gestures are not detected (I am using Android emulator). I'm not sure what is wrong as I have debugged it and the gestures are not being detected. Here is my code,…
mrQWERTY
  • 4,039
  • 13
  • 43
  • 91
0
votes
1 answer

Display a view on slide up

I am new to android development.I wanted to learn that how will i be able to display a view when user slide upwards. See my Layout.! Image of Layout Now here when user slides up the blue colored view,i want a view to be displayed and also when user…
Anuj
  • 402
  • 8
  • 16
0
votes
1 answer

change background of views on hover inside dialog

im trying to build share dialog. in this share dialog I have facebook,whatsapp,mail and more. im trying the make the background of every view change on touch to indicate the toch. so far no problem. the problem is that I also want to let the user…
Gili Yaniv
  • 3,073
  • 2
  • 19
  • 34