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

how to get a SurfaceView in an android fragment to display its content before any user action occurs

Here's a challenge for all you android master programmers out there! I am currently putting 2 surface views into a fragment (LeftPanel and MySurfaceView), below a 'banner' edit text area and with 1 button below the two surface views in a 'footer '…
0
votes
1 answer

Android View.getLayoutParams() leftMargin and topMargin give 0

I have a View in a RelativeLayout with layout_alignParentBottom and layout_alignParentRight attributes set to true like this :
nayakasu
  • 889
  • 1
  • 11
  • 32
0
votes
1 answer

convert touch event to mouse events only works every second time

I am using the following script, to convert touch events to mouse events. It works pretty fine, however between two touch events (for example with panning through data of a diagram) the second event is not triggered. Then the next event is…
threxx
  • 1,213
  • 1
  • 31
  • 59
0
votes
2 answers

OnTouchEvent constantly firing when scrolling in RecyclerView

I have a recyclerview displaying a simple list of items. On long pressing a particular item, a piece of audio associated with this item (stored in the assets folder) is played. On releasing, the audio is paused, and can be returned to at the paused…
0
votes
1 answer

touchend trigger many times

I've written a slider component demo in mobile web.The event of a touched trigger once when I first swipe, but the second time you swipe,'touchend' triggers twice, and the third time, it's triggered three times. Here's my code:
Yile
  • 47
  • 5
0
votes
2 answers

OnTouchEvent detect click not working on my Asus Zenfone

I use the onTouchEvent method to be able to have a drag&drop event and a click event. I test the result on my Nexus 7 (2012), it's working really great but on my smarphone a Asus Zenfone, it's not and I can't see why, here is my code…
zed13
  • 357
  • 4
  • 21
0
votes
0 answers

know pointer number on screen

I develop a simple Android app, and I want to know how many fingers is touching the screen. It's simple with OnTouch event but this solution doesn't work if the user touch the keyboard software (for security and privacy issues) I have tried to use a…
Dany Sousa
  • 229
  • 2
  • 16
0
votes
1 answer

Android : Touch event from dropdown menu within url loaded via webview

I have a webview in my activity which loads a url. The url has a dropdown menu within it (created using "select"). I want to receive the touch events which occur when I touch on the webview. I am able to get the touch event from the webview but when…
0
votes
1 answer

Android Capturing touches on LinearLayout: Cannot Resolve Symbol setOnTouchListener.

I have a (seemingly) simple problem: I'm trying to set an onTouchListener on a child linear layout but I can't get my code to compile. I get the error "Cannot Resolve Symbol setOnTouchListener" when I try to use setOnTouchListener() on my chosen…
Cody
  • 1,801
  • 3
  • 28
  • 53
0
votes
1 answer

Xamarin ListActivity onTouchEvent (or any other touch listener)

I'm trying to learn Xamarin and as a very basic first app I'm trying to play around with a list adapter. the lists shows just well but I want to do things with the items in it like swiping etc. I tried the following code below but it seems like the…
user2717954
  • 1,822
  • 2
  • 17
  • 28
0
votes
1 answer

How to get the height of the action bar and the notification bar

I want to set the coordinates of my button equal to the coordinates of the point I touch on mobile. I am using the method getRawX() and getRawY(). button.setY(event.getRawY() - actionBarHeight - notificationBarHeight); How can I get height of my…
Aman
  • 23
  • 8
0
votes
1 answer

Button isn't following my touch

I have used On touch method to make a button follow my touch. My code is b.setX(event.getX()); b.setY(event.getY()); My button shivers when I drag it and my starting point is inside the button. But it doesn't do so when the starting point is…
Aman
  • 23
  • 8
0
votes
1 answer

set up UITouch's moving range

I create a touch moving event for a label which size is (30, 50). here is the code - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; UIView *superView =…
Rambo Li
  • 307
  • 1
  • 3
  • 16
0
votes
0 answers

I want to know how to disable touch interface in broadcastreceiver when the device is charging

public class MyReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { try { IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); Intent batteryStatus =…
0
votes
0 answers

I have implemented this code to detect incoming call and charging... how can I disable touch for this functionality?

public class MyReceiver extends BroadcastReceiver { private Context mcontext; TelephonyManager telephonyManager = (TelephonyManager) mcontext.getSystemService(Context.TELEPHONY_SERVICE); public void onReceive(Context context,…