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
0
votes
1 answer

Transition / Animation (onTouchListener)

So here is the code of simple transitioning,from top_left to bottom_right, I dont understand why I have to return false for onTouch() to work properly, 1.If I set return true, one a single touch , it sets counter from 0 to 3 , or simply adds 2 or 3…
0
votes
1 answer

No reaction onTouchEvent Android

I am trying to build a drawing app. First, I was trying to draw something on the screen, this is working. Now I am trying to make a circle to follow my finger. This is not working the app runs and there are no errors or warnings on compile. What's…
0
votes
1 answer

Handle only horizontal movement using onTouchEvent

I am overriding onTouchEvent in a layout, and want to handle horizontal movement only. i.e, if right of left swipe happens then I will show next/prev post and if any vertical movement happens then I wont do anything and the parent scrolling will…
0
votes
0 answers

How can I have an ImageView with TouchListener together with Doubletap Listener in Android

I have an imageView with a simple touchlistener which on ACTION.UP it get the color of the bitmap pixel. img.setOnTouchListener(new View.OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent event) { …
user6183885
0
votes
1 answer

How to count how many times I move my finger on screen with touchevent in Android

I want to count and display on textView how many times I move my finger on the screen I used the following but it counts how many times coordinates have changed case MotionEvent.ACTION_MOVE: i++; txtMoves.setText(String.valueOf(i)); break;
Miaoulis Nikos
  • 182
  • 1
  • 15
0
votes
1 answer

How to get ImageView's color from pixel using Touch Event in Android

I have an ImageView source with two colors. I want to touch a color and display a message. I have done the following but something is not going well because maybe I use the method getDrawingCache it has a delay on displaying the correct…
0
votes
0 answers

How to determine coordinates of touch event on an imageview which has an arc and rectangle in Android

I have the following shape-image I want to validate my touch events when I touch in the blue area or not in my imageview. I need to combine the arc and the rectangle as one and validate the coordinates of the touch event? I use this if it was a…
Miaoulis Nikos
  • 182
  • 1
  • 15
0
votes
0 answers

android - How to handle all onTouch events in child and parent

I hava RecyclerView with custom views, which handle onTouch event and do some work when ACTION_UP handled. Also I want to get gestures and handle onTouch event in my root view. I need to handle full event: ACTION_DOWN ... ACTION_UP in both of my…
Alexey Markov
  • 1,546
  • 2
  • 23
  • 41
0
votes
1 answer

Competing onTouchEvent handlers?

I understand Views can decide to handle MotionEvent themselves by returning true in onTouchEvent when being passed a ACTION_DOWN event. If they return true, then they will receive all the subsequent MOVE/UP/CANCEL events. This is working fine. What…
mbonnin
  • 6,893
  • 3
  • 39
  • 55
0
votes
1 answer

Youtube API - Touch Event Passed to Views Behind Youtube Player

I am using a YoutubeAndroidPlayerAPI in my Android App. In my YouTubePlayerSupportFragment I am setting youtubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CUSTOM_LAYOUT); so that I can change between Fullscreen without having to…
Abbas
  • 3,529
  • 5
  • 36
  • 64
0
votes
1 answer

How to get touch event for different view in single touch in android?

How can I get touch event of different view in single touch as you can see in below image. I had try with private void showAlert() { dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); …
Hitesh Dhamshaniya
  • 2,088
  • 2
  • 16
  • 23
0
votes
2 answers

Android touch event stucked in ListView

I have a container View that should process touches. It has Listview with overrided onTouch(), which returns false (it will return true, when container is expanded by swipe). When Listview touch occurs it passes to container View and everything is…
Nik Kober
  • 868
  • 11
  • 16
0
votes
1 answer

Handle touch on scren vertically in android

I am playing video from web in VideoView in landscape mode. Now I want to control its volume when I move finger on screen vertically. When I scroll down to up volume should increase and when scroll finger up to down then volume should decrease. How…
shailesh ojha
  • 247
  • 4
  • 15
0
votes
1 answer

Why simulating touch events in Lollipop doesn't work

I want to inject touch events into the device. I use instrumentation for that. The method works well on Jelly Bean, but it doesn't inject nor does it give any error in Lollipop. When I searched I found that it might be due to the enforcement of…
0
votes
1 answer

How to handle touch events for scaled ImageView?

I need to handle touch events only for scaled/translated/rotated ImageView (only resource part). Setting touch event on ImageView it handles the whole screen .not the resource part. Any ideas are appreciated.
I.S
  • 1,904
  • 2
  • 25
  • 48
1 2 3
12
13