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
1
vote
1 answer

Add swipe gestures in addition to MotionLayout transition

I am using a MotionLayout setup with a dragUp Transition to toggle some layout on my view. (Basically you can drag up to see more information.) However, I would also like to be able to support "swipe left" and "swipe right" gestures to trigger…
1
vote
0 answers

AS3: Touch event problem with drag and drop objects

I'm new to AS3 and I'm making a drag and drop game with touch events. I'm having problems with the drag and drop objects. My objects are movie clips so there's answer1_mc, answer2_mc, and answer3_mc. When I do a test run, if i click on them for the…
1
vote
0 answers

How to rotate an ImageView in Android Studio on center point using the OnTouch Move Event?

Thanks to a code purchase I made for a the development of a personal project I have in mind for years, I'm learning how the rotation animation and the degrees/angles work in the Roulette Wheel Android Studio based apps. You can see the design of the…
1
vote
1 answer

not detecting OnTouchListener for viewgroup with nestedscrollview and recycleviews

I am adding touch listener to parent view for to detect swipe gestures. My layout has a nested scrollview and three recycleviews, but my touchevent does not get triggered, i think the parent doesn't get the touchIntercept. In this case i want the…
Amir Dora.
  • 2,831
  • 4
  • 40
  • 61
1
vote
1 answer

OnTouch giving different position, compared to ImageView position

I have many ImageViews defined programmatically, and they have their positions in arrays, like that: const1Positions = arrayOf( Point(dpToPx(349), dpToPx(258)), Point(dpToPx(491), dpToPx(302)), Point(dpToPx(495), dpToPx(429)), …
Lucas
  • 87
  • 1
  • 8
1
vote
1 answer

View constrained to outside of ConstraintLayout doesn't receive touch events

I have an image view which is constrained to outside of it's parent ConstraintLayout with clipChildren set to false on the parent layout. The problem is that the image when outside the constraint layout does not receive any touch events (see code…
1
vote
0 answers

Android ViewPager2, Webview, fullscreen and touch events

I'm trying to do a proof of concept where a Webview loads local HTML files and users are able to swipe left/right to go to the next file, all while in fullscreen. I'm utilizing ViewPager2 and normal Webviews. I have that part working, but what I…
user1795832
  • 2,080
  • 8
  • 29
  • 50
1
vote
2 answers

android - MotionEvent.ACTION_UP is never called

I want to do some works while the user hold his hand on a view and stop it when he release it. My code is below: viewHolder.plus.setOnTouchListener(new View.OnTouchListener() { private Handler mHandler; @Override public…
Navid Abutorab
  • 1,667
  • 7
  • 31
  • 58
1
vote
1 answer

onClickListener for YouTubePlayer

I want to add an onClickListener event for YouTube Player API I tried many many solutions but all of them didn't work Some of my attempts YouTubePlayerView youTubePlayerView = findViewById(R.id.youtubePlayer); …
1
vote
1 answer

access to layers that created dynamically for touch listener

I want to add an image from gallery in my constraint Layout and a touch event for the image. I could do this, but when adding two images, touch event only works on the last image. my touch events are: move-resize-rotate
1
vote
0 answers

Draw arrow according to path

Currently I'm drawing a arrow head to my canvas by doing the following: mPaint.setStyle(Style.FILL); float deltaX = this.mPoints[1].x - this.mPoints[3].x; float deltaY = this.mPoints[1].y - this.mPoints[3].y; float frac = (float) 0.1; float…
ClassA
  • 2,480
  • 1
  • 26
  • 57
1
vote
1 answer

How to receive drag events on a top-layer View, but pass through clicks?

The app has some UI that receives clicks, e.g. an EditText to receive focus, and a buttons (not in the screenshot below) that triggers an action. But the whole UI piece also needs to slide to the side to reveal Views beneath. I've implemented it as…
Ollie C
  • 28,313
  • 34
  • 134
  • 217
1
vote
2 answers

I need to disable the touch of the android device when my app is running

I need to disable the touch of my android device when my app is running. Currently I am using getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE) But when call or other app notifications comes, they are touchable. I want to…
Alex king
  • 11
  • 2
1
vote
2 answers

ImageView is not at the center of the screen

I have followed One of the video on YouTube that I can move image by pressing the image and move around, but the starting position is at the top left corner and I try to move it manually but still at the same position this is my code in my Activity.…
1
vote
1 answer

How to intercept all touch events when resizing window by clicking outside the edge

I am trying to understand the following drag and resize behavior on android, but am not being able to track down. I have the following window launched in multi window free form mode [scree shot below], where if I click just outside the edge (any of…