touch-event

How can I avoid animation artifacts on my touch-draggable border-radius element on iPad?

自古美人都是妖i 提交于 2019-12-09 11:28:25
问题 I’ve written a little example page with elements that are draggable on touch devices (based on code by Peter-Paul Koch). My example page I have two draggable <div> elements: a green block, and a red ball (made ball-shaped with border-radius ). The dragging is implemented with ontouchstart , ontouchmove and ontouchend , and the "animation" is done by changing the top and left CSS properties of these elements. When I drag the green one, all is roses and ponycorns. But when I drag the red one in

WebDriver simulate touch events in Desktop Browser

微笑、不失礼 提交于 2019-12-09 07:45:31
I'm trying to simulate some touch events like swap, tap in web-based application using Chrome and Firefox browsers. I've tried to simulate touch events with Actions , Hummber.js , " Yahoo " lib(YUI) but none of them works for me. What is the best way to simulate touch events with webdriver in desktop browsers? I'm using phantom limb which transforms mouse events to touch events. It worked for me. I thing the best way to simulate touch events in Chrome is to use built-in emulations mechanism. Like in this article. Unfortunately I can't find the way to turn on this feature by webdriver. Found

Drawing a line following finger - motionevent.getX() and getY() incorrect UPDATE

廉价感情. 提交于 2019-12-09 02:05:04
问题 UPDATE: please read entire question again :-) Background: I have created a grid of dots by creating a custom view and then adding these views to a TableLayout . The aim is for me to be able to draw a line from one of these dots to another dot in a way so that when a dot is pressed, a line is started from the center of the pressed dot to the point where the finger is currently touching. When the finger is dragged over another dot, the line then finishes at the center of that dot. The result

android drawing on touch event

故事扮演 提交于 2019-12-09 00:50:27
问题 I'm trying to make an application which enables user to touch the screen and draw image based on users' finger coordinates. Here's my code : public class DrawingBoard extends View { Drawable editIcon = getResources().getDrawable(R.drawable.icon); Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.background); float xPos = 0; float yPos = 0; public DrawingBoard (Context context) { // TODO Auto-generated constructor stub super (context); } @Override protected void onDraw

jQuery (Swipe vs. Touch) pageX and pageY keep returning 0

大兔子大兔子 提交于 2019-12-08 23:03:17
问题 I'm playing with touchstart and touchend events on my iPhone. I built a sample page that has div that if you touch it and scroll the page, it should return the y coordinates of the start and end positions. link: http://jsbin.com/ibemom/2 the jQuery: var touchStartPos; $('.theDiv') .bind('touchstart', function(e){ touchStartPos = e.pageY; }) .bind('touchend', function(e){ alert(touchStartPos + ' | ' + e.pageY) }) When I load that page on my iPhone, however, the alert keeps reporting both

Misplaced clickable area due to class toggle / height change on touch event

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 19:47:47
问题 There's a strange behavior on touch devices regarding the clickable area of a link, if you toggle the height of an element placed above. If you run the following snippet (e.g. save it locally and use chrome to emulate touch events), you will notice that the hash #mylink is added to the url in some cases you did not click on the red link area. And sometimes you clicked the red area, it won't be added. E.g. If you click the upper grey area (first 200px), the grey area toggles the height. => Ok.

how to fix the wrong coordinates of zoomed canvas in Android

醉酒当歌 提交于 2019-12-08 11:33:42
问题 I have a custom paint_view that extends image_view and is zoommalble with matrix. i set this matrix for canvas and scale it and drag it by this matrix, but after canvas scale or translate, paths or drawable objects were drew in wrong coordinates. i have trid to set the coordinates, but i dont know optimized way to it set. here is my code: public class PaintView extends View { private Path drawPath; private Paint drawPaint; private Paint rect_paint; public boolean zoomMode = false; private

Animation ist only smooth when ontouchevent is called

跟風遠走 提交于 2019-12-08 09:29:07
问题 i'm making my first 2d sidescroller game using a surfaceview and a canvas to draw things on (a lot of primitives put in different path objects). my game loop uses fixed timesteps with linear interpolation. i don't create any objects during the game. i've been improving my code for 3 weeks now, but my animation is still not all the time smooth. it's ok, but every few seconds there are a lot of little hicks for about 1 or 2 seconds. what i recognized is when i move my player (this means

WebDriver simulate touch events in Desktop Browser

China☆狼群 提交于 2019-12-08 08:37:14
问题 I'm trying to simulate some touch events like swap, tap in web-based application using Chrome and Firefox browsers. I've tried to simulate touch events with Actions, Hummber.js, "Yahoo" lib(YUI) but none of them works for me. What is the best way to simulate touch events with webdriver in desktop browsers? 回答1: I'm using phantom limb which transforms mouse events to touch events. It worked for me. I thing the best way to simulate touch events in Chrome is to use built-in emulations mechanism.

Simulating touches onto an activity of another application

若如初见. 提交于 2019-12-08 08:22:58
问题 Is it possible to simulate touch events in Android from one app to another app? Perhaps use a service or an invisible activity with SYSTEM_ALERT property to receive the input touches then simulate them to another activity of another application which is directly below the transparent activity of your application. Is this possible? [UPDATE] Taking FoamyGuy's answer into account, is it possible to have an invisible SYSTEM_ALERT activity to filter out certain touch events? I know you can revoke