Questions tagged [touch-event]

An event that is triggered when a user 'touches' a GUI component

A TouchEvent is an event that is triggered when a user 'touches' a GUI component. This is most commonly associated with applications that are designed to run on smart phones and touch screens. Many programming languages will treat an TouchEvent the same as a MouseEvent, which helps to provide touch functionality to applications that haven't specifically been designed for touch interactions.

1935 questions
34
votes
3 answers

Add Marker on Android Google Map via touch or tap

I want to develop a Map Application using Google Map on Android. Now, I want to add marker on the map via Touch or Tap on the Map. How do I apply touch event to drop the marker on the map?
shiteru
  • 635
  • 3
  • 9
  • 15
33
votes
4 answers

Android overlay to grab ALL touch, and pass them on?

I'm basically trying to get all touch event data from something like a system overlay, move my sprites around based on this touch data, then allow the OS/homescreen/browser to act upon the data as it should(or vice versa). I have found similar…
While-E
  • 1,527
  • 2
  • 20
  • 37
32
votes
2 answers

View.onTouchEvent only registers ACTION_DOWN event

I'm implementing a custom TextView and I want to do some action when the view is touched. I figured the onTouchEvent method would give me the full range of touches on the view without having to use setOnTouchListener (I'm trying to do all my work…
Jason Robinson
  • 31,005
  • 19
  • 77
  • 131
31
votes
1 answer

Dynamically generated line with glow effective

I want to draw line with glow effect like this The problem - i must generate this line in program in dependence on user's interaction ( the form of line will be generated in onTouchEvent - ACTION_MOVE ). Can i generate this effect without xml…
sharl
  • 1,257
  • 1
  • 12
  • 17
30
votes
5 answers

Handling Intercept touch event without extending ViewGroup

I have a one RelativeLayout and this layout is having nearly 10 views in it. I have set OnTouchListener to this Layout and doing some work in it and returning true. this listener is working fine when I touch the layout where there are no View (mean…
RuntimeException
  • 1,201
  • 3
  • 14
  • 25
29
votes
4 answers

Android - Detect End of Long Press

I am working on application in which a user needs to press and hold a button for a long time. How can I detect the moment that the user: finishes the press or moves their touch position? Thanks
ItayM
  • 912
  • 2
  • 15
  • 36
28
votes
1 answer

React, tap events and material-ui

Im trying out material-ui and react and I'm running into an issue with events not firing. I have installed the react-tap-event-plugin and I call injectTapEventPlugin() while bootstrapping the application. toggleMenu is never called in the following…
oskbor
  • 1,592
  • 18
  • 35
27
votes
2 answers

Use a custom contextual action bar for WebView text selection

I have used this guide from Google and this tutorial to produce my own contextual action bar. private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() { // Called when the action mode is created; startActionMode() was called …
Sean Beach
  • 2,050
  • 4
  • 26
  • 35
26
votes
5 answers

Tap on screen 5 Times in 3 seconds in android

I am developing a kiosk and now in admin side. In order to go to the Admin, the user needs to tap the screen 5 times just in 3 seconds or else, nothing will happen.
androidBoomer
  • 3,357
  • 6
  • 32
  • 42
23
votes
2 answers

Get Canvas coordinates after scaling up/down or dragging in android

I'm developing an application in which I'm pasting images, doing drawing and painting on canvas. This app can also Scale up/down the canvas or drag it to different location. My problem is: I can't get the correct canvas coordinates after scaling or…
Awais Tariq
  • 7,724
  • 5
  • 31
  • 54
23
votes
1 answer

Preventing RecyclerView from consuming touch events

Problem I am attempting to simulate the exact behaviour of the Google Play application. Currently when you're scrolling through a category like 'Top Games' and you touch the list, that cell as well as the RecyclerView handles the touch event, you…
vguzzi
  • 2,420
  • 2
  • 15
  • 19
23
votes
3 answers

Android - How to circular zoom/magnify part of image?

I am trying to allow the user to touch the image and then basically a cirular magnifier will show that will allow the user to better select a certain area on the image. When the user releases the touch the magnified portion will dissapear. This is…
22
votes
3 answers

jquery touchstart in browser

As touchstart/touchend is yet not supported in most of the desktop browsers. How can I create touchstart event that will be the same as mousedown event (that is supported in all browsers). I want something like this $('obj').bind('touchstart',…
coure2011
  • 40,286
  • 83
  • 216
  • 349
21
votes
2 answers

Determine which view is currently being Touched while user Moves finger

I have a grid of 66 views and if a view is touched or dragged/moved over I'd like to change it's background color. I'm guessing I need to put a touch listener on the parent ViewGroup, but how do I determine which child view is being dragged/moved…
bgolson
  • 3,460
  • 5
  • 24
  • 41
21
votes
1 answer

Catch onTouch event by parent, handle it and pass to children

I tried to understand how Android handle touch event and got a little bit confused. From what I understand touch event are send to the root view and pass down to the children. I have a FrameLayout that is a container for Fragment. First fragment…
Elad92
  • 2,471
  • 4
  • 22
  • 36