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
7
votes
2 answers

Simultaneous touch events handling on multiple views in Android

Considering the example from the below image, I'm looking for a solution to pass the touch events from the canvas View to the Viewpager. This is necessary for applying the same amount of zoom on both views at the same time. Here's the technical…
7
votes
1 answer

Add Recyclerview in RecyclerViewPager

I added a Recyclerview in one item of RecyclerViewPager(https://github.com/lsjwzh/RecyclerViewPager). And I want to scroll the RecyclerView when I touch on it. I have tried : View.OnTouchListener listener = new View.OnTouchListener() { …
6
votes
1 answer

How to revoke `requestDisallowInterceptTouchEvent(false)` without lifting finger (Action.UP or Cancel)?

I have WebView(s) inside the RecyclerView. In order to get smooth scrolling experience such that when user scrolls, the RecyclerView will be responsible for scrolling (WebView should not scroll) I called…
6
votes
3 answers

How to implement right swipe in ListFragment with Custom Item Adapter?

What I need is to detect the right swipe of the item and display some activity. I did prev. investigation but it not seems to obvious to catch correct solution. Please, help me. My code is following. public class FragmentTwo extends ListFragment …
NoWar
  • 36,338
  • 80
  • 323
  • 498
5
votes
3 answers

The meaning of returning false from OnGestureListener.onDown()

According to android training if you extend GestureDetector.SimpleOnGestureListener, and return false from onDown(...) than the other methods of GestureDetector.SimpleOnGestureListener will never get called: Whether or not you use…
Presen
  • 1,809
  • 4
  • 31
  • 46
4
votes
0 answers

How can I pass touch events to underlying components with Compose?

I'm looking to create a debug feature. Here's a simplified representation: @Composable fun DebugLogOverlay(logs: List){ LazyColumn( modifier = Modifier .background( color = Colors.White.copy(alpha =…
4
votes
2 answers

How does the Google Maps app let you drag the BottomSheet when it's behind the BottomNavigationView?

See this video so you know what I'm talking about. Notice how the BottomSheet can be dragged even when it's behind the BottomNavigationView: https://streamable.com/balbx I want to do the same thing but with a LinearLayout containing Buttons instead.…
Gavin Wright
  • 3,124
  • 3
  • 14
  • 35
4
votes
1 answer

How to listen to touch events and soft keyboard events simultaneously

I would like to listen to three different events at the same time on an EditText Text changed events Touch events softKeyboard event I am using a touch screen with a soft keyboard. Specifically, I would like to log these events to a file for…
4
votes
0 answers

Android velocity tracker giving wrong values of velocity

I am writing an application with an element like facebook chat head that freely moves on the screen using finger. I'm trying to find out the velocity of the view so that I can decide the final location of the view once the ACTION_UP is called. The…
penduDev
  • 4,743
  • 35
  • 37
4
votes
2 answers

Android Espresso How do I perform touch events

How can I test a view with simple touch events such as ACTION_DOWN and ACTION_MOVE?
RCB
  • 2,253
  • 2
  • 25
  • 49
4
votes
2 answers

Android change recycler view column no. on pinch zoom

I have in my layout recycler view for gallery application. I want to incorporate a pinch touch event listner such that the recycler view column no. increases or decreases on pich in and out. I have seen this type of interface in many gallery…
3
votes
0 answers

Handling drag-n-drop with shadow offset

I want to implement drag-n-drop with shadow offset, but there is a problem with Android framework's touch point calculation. I've set a vertical offset with drag shadow builder: override fun onProvideShadowMetrics(outShadowSize: Point,…
artem
  • 16,382
  • 34
  • 113
  • 189
3
votes
1 answer

How to implement Touch listener and pinch zoom on the same view?

I want to implement touch listener for moving the view and pinch zoom for zoom it, but when I touch the view with fingers for pinch zoom, only touch listener works. I can't handle pinch zoom properly. Please help me as I have no clue how to…
Ashraful Haque
  • 1,588
  • 1
  • 13
  • 13
3
votes
0 answers

ViewPager touch event conflicts with Draggable view in its Fragment

I've implemented drag to close and zoomable view in Fragment of a ViewPager. Now, it's swiping wasn't smooth because the touches of ViewPager and view in Fragment conflict with each other. So, i wrote a CustomViewPager class to override…
3
votes
1 answer

Handling TouchEvents on RecyclerView

I have this code which implements a RecyclerView and I want to add to it some gestures. I want 2 things to do and I don't know because I'm new to this. When someone clicks on RecyclerView I want to catch the event from the Activity before goes down…
Nick
  • 2,818
  • 5
  • 42
  • 60
1
2
3
12 13