touch-event

ScrollView with children view, how to intercept scroll conditionally

妖精的绣舞 提交于 2019-12-03 03:26:27
I have a container ViewGroup , lets call it screen inside a ScrollView . This container view hosts a number of other Views let's call them widgets , and some of them are interested in preventing the ScrollView from scrolling and using the MotionEvent theirselves (for example a pannable image) I can't figure out the proper event intercept strategy to use. ScrollView always processes the event before the children, or the children process the event but scrollview is disabled. I read about issuing getParent().requestDisableInterceptTouchEvent() in the child views if this view wants to capture the

Touch event handled by multiple views

China☆狼群 提交于 2019-12-03 03:03:43
I have a subclass of UIView on top of a UITableView . I am using the UITableView to display some data and, at the same time, I would like to overlay an animation that follows the finger (for instance, leaving a trail). If I get it right, I need the touch events to be handled both by the UIView subclass and the UITableView . How can I do that? Is it possible to have, ie, touchesMoved being triggered on the UIView subclass and then on UITableView ? Thank you so much for any help. The way I have solved this problem is in a way that is not that clean, but it works. Please let me know if there's a

iOS Web App touch gestures

折月煮酒 提交于 2019-12-03 00:47:07
I've searched all across the web to find a simple way of adding touch gestures to a simple button. Basically I'm trying to find a simple way of getting the back button (which you usually see on the task-bar at the top of an iOS device) to change CSS classes from 'normal' state to 'pressed' state when pressed. Although I'm very new to Javascript, I would prefer to use standard DOM methods rather than jQuery (or any other library). Would anyone have some complete code and explain how the JavaScript code reads an ontouchstart and ontouchend event and how these functions could be used to change

touchend event in ios webkit not firing?

感情迁移 提交于 2019-12-03 00:23:37
I'm trying to implement a menu for a ios webkit based app in which the user touches/clicks and holds a menu button ('.menu_item'), after 500ms the sub menu opens (div.slide_up_sub_menu), and a user should be able to slide their finger/mouse up to a submenu li item and release. <li class="menu_item"> ASSET MANAGEMENT <div class="slide_up_sub_menu hidden_menu"> <ul class="submenu"> <li>Unified Naming Convention</li> <li>Version Control</li> </ul> </div> </li> The application should then be able to detect which submenu item the touchend/mouseup event happened on. I'm binding a touchstart event to

fingerpaint within a horizontalscrollview

夙愿已清 提交于 2019-12-02 22:00:10
问题 I am combining some pieces of code which I have found on stackoverflow and in the android development kit. I want to put the fingerpaint canvas within a lockable horizontalscrollview. However whenever I atempt to draw in a horizontal direction the scrollview scrolls rather than painting on the canvas. It did not have this problem when I had an imageview in the place of the custom view from fingerpaint. I think that perhaps the overriding of the onTouchEvent in both the custom

checking if touchend comes after a drag

南笙酒味 提交于 2019-12-02 17:54:34
I have some code which changes the class of a table. On a phone, sometimes the table will be too wide for the screen and the user will drag/scroll about to see the contents. However, when they touch and drag the table around, it triggers touchend on every drag. How do I test to see whether the touchend came as a result of a touch-drag? I tried tracking dragstart and dragend but I couldn't get that to work and it seems an inelegant approach. Is there something I could add to below which would essentially determine, "Did this touchend come at the end of a drag?" $("#resultTable").on("touchend","

Detect every touch events without overriding dispatchTouchEvent()?

穿精又带淫゛_ 提交于 2019-12-02 16:00:06
I am developing Android library which needs to track all touch events on app that uses it. For now Users should override theirs Activity’s dispatchTouchEvent() on their’s every activity. as shown below @Override public boolean dispatchTouchEvent(MotionEvent event) { MyLib.dispatchTouchEvent(event); return super.dispatchTouchEvent(event); } But Appsee detects touch events with Appsee.start(“key”); on onCreate method integrated in First activity where app starts. How is this possible. Any help?? Answering as this may be helpful to others. Answer will be helpful for library that requires to

Unable to implement onTouchEvent (Drag & Drop) with Osmdroid

[亡魂溺海] 提交于 2019-12-02 05:14:05
问题 I had been trying to implement OnTouchEvent so I can react when an user move (drag & drop) an overlayitem. I found something similar on the Osmdroid site: http://code.google.com/p/osmdroid/issues/detail?id=225. I am using the code there as reference but still is not working for me and then my application is crashing when it get to the hitTest. Any suggestion? Thanks. public boolean onTouchEvent(MotionEvent event, MapView mapView) { final int action = event.getAction(); final int x = (int)

Why my Mouse Event Handlers are not working when I have Touch Event Handlers?

你离开我真会死。 提交于 2019-12-02 03:32:54
问题 Some of my end users have touch screens, and others have PCs. On touch screens, PreviewMouseUp/Down fire along with the touch event handlers, causing duplicate behavior (functions written in PreviewMousUp/Down get executed twice). So my sample Button XAML: <Button x:Name="Whatever" Background="Transparent" MouseUp="Whatever_MouseUp" MouseDown="Whatever_MouseDown" TouchUp="Whatever_TouchUp" TouchDown="Whatever_TouchDown"> <StackPanel> <TextBlock x:Name="WhateverText" Text="Soemthing" FontSize=

Unable to implement onTouchEvent (Drag & Drop) with Osmdroid

爱⌒轻易说出口 提交于 2019-12-02 01:47:29
I had been trying to implement OnTouchEvent so I can react when an user move (drag & drop) an overlayitem. I found something similar on the Osmdroid site: http://code.google.com/p/osmdroid/issues/detail?id=225 . I am using the code there as reference but still is not working for me and then my application is crashing when it get to the hitTest. Any suggestion? Thanks. public boolean onTouchEvent(MotionEvent event, MapView mapView) { final int action = event.getAction(); final int x = (int) event.getX(); final int y = (int) event.getY(); final Projection pj = mapView.getProjection(); boolean