gesture

Fling Gesture and Webview in Android

眉间皱痕 提交于 2019-11-27 14:06:24
I have a webview control that needs to support the fling gesture in Android in order to bring up a new record (load new data). This is occuring in a class that extends Activity. All the examples I've seen show how to implement gesture support for a textview, but nothing for webview. I need to execute different actions for both left and right flings. Any code help would be appreciated as this totally has me stumped. Here's my basic onCreate and my class import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.database.SQLException; import

How to generate zoom/pinch gesture for testing for Android

烈酒焚心 提交于 2019-11-27 12:26:09
I'm trying to generate zoom/pinch gesture for testing, I have tried to use the Android API MotionEvent.obtain(), but found it is hard to implement the zoom/pinch events. I referenced the API from MotionEvent.obtain . Can you tell me the correct method? Here is my implementation: //for zoom, we need four points coordinations: start0, start1, end0, end1 Instrumentation inst; // action down event MotionEvent event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, 1, prop_start0, pointerCoords_start0, 0, 0, 0, 0, 0, 0, 0, 0 ); inst.sendPointerSync(event); // action pointer 2 down

Android TextView Linkify intercepts with parent View gestures

别说谁变了你拦得住时间么 提交于 2019-11-27 12:15:05
The problem is that if i Linkify the textView the underliyng ScrollView don't listen the sweep Gestures I've setted.Is there a way to have Linkify without messing with the underliyng view's gestures? I tried to override ontouchEvent and return false to ACTION_MOVE but the scrollview's gesture needs the ACTION_DOWN and ACTION_UP event to function. Is there a way to achieve that? Linkify applies to a movementMethod to the textView LinkMovementMethod . That movement method thought it implements a scrolling vertically method it overrides any other scrolling method the parent has. Although

How to detect a swipe gesture on webview

▼魔方 西西 提交于 2019-11-27 11:50:55
i'm developing a simple android application with a RelativeLayout and a WebView inside. I have to detect swipe from bottom to top done only in the 20% of the left part of the screen. So when user swipe in that space from bottom to top i have to show a custom dialog. What i try is: import android.app.Activity; import android.view.MotionEvent; import android.view.View; public class ActivitySwipeDetector implements View.OnTouchListener { static final String logTag = "ActivitySwipeDetector"; private Activity activity; static final int MIN_DISTANCE = 100; private float downY, upY; public

How to mimic two-finger scroll/drag gesture on ios simulator?

老子叫甜甜 提交于 2019-11-27 09:57:27
问题 I have a scroll page that I specified two fingers minimum. It works on my device, but don't know how to mimic this gesture on Simulator. I can mimic one-finger scroll without problem. I've tried option/ctrl/shift etc, but couldn't get it work. Maybe my combination is wrong. Anyone knows how? Thanks. 回答1: Holding the "Alt/Option" key and dragging simulates multi-touch pinch-to-zoom. Holding "Alt/Option + Shift" and dragging simulates multi-touch scrolling. 回答2: There is a nice table with all

Multi-touch gesture in Sprite Kit

我的梦境 提交于 2019-11-27 09:31:45
I'm working in Swift with Sprite-Kit using XCode 6, and I have many different nodes but for the moment I only manage to detect one finger and move one node at the same time. I want to know how could I manage to detect multiple fingers in order to move multiple nodes at the same time. My actual code is : var location = CGFloat() // finger position var actualNode = -1 // node touched by the finger, -1 means no node touched override func touchesBegan(touches: NSSet, withEvent event: UIEvent) // when a finger touch the screen { for touch: AnyObject in touches { location = touch.locationInNode(self

Animate the keyboard in sync with the UIView while edge-swiping back in iOS7

风格不统一 提交于 2019-11-27 09:29:48
问题 I'd like to get the behavior similar to Messages app (also common in most texting apps) in iOS7, where in a conversation view swiping right from the left edge of the screen would behave like the back button in a UINavigationController. I have managed to implement this behavior, however, if the keyboard is open in the presenting view, when I start swiping back, the keyboard gets stuck and does not animate with the view to the right as I move my finger. I'd like to animate keyboard and the

Flutter: How to move, rotate and zoom the container?

試著忘記壹切 提交于 2019-11-27 08:27:59
问题 I want to make a container which can be dragged around, zoom and rotate. I am able to achieve a zoom. Below is my code: //variable declaration double _scale = 1.0; double _previousScale; var yOffset = 400.0; var xOffset = 50.0; var rotation = 0.0; var lastRotation = 0.0; //build method @override Widget build(BuildContext context) { return Scaffold( body: Center( child: Center( child: GestureDetector( onScaleStart: (scaleDetails) { _previousScale = _scale; print(' scaleStarts = ${scaleDetails

how to implement both ontouch and also onfling in a same listview?

感情迁移 提交于 2019-11-27 08:22:37
i have a listview and implemented onclick and also onfling.problem is when i do fling(swipe left to right), onclick event of listview is also getting executed.How to overCome this problem? how to differentiate touch(tap) and fling(swipe) in listview? listClickListener = new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v,int position, long id) { //Job of Onclick Listener } }; mContactList.setOnItemClickListener(listClickListener); mContactList.setAdapter(adapter); // Gesture detection gestureDetector = new GestureDetector(new MyGestureDetector(prosNos));

UISwipeGestureRecognizer Swipe length

落花浮王杯 提交于 2019-11-27 06:40:57
Any idea if there is a way to get the length of a swipe gesture or the touches so that i can calculate the distance? It's impossible to get a distance from a swipe gesture, because the SwipeGesture triggers the method where you could access the location exactly one time, when the gesture has ended. Maybe you want to use a UIPanGestureRecognizer. If it possible for you to use pan gesture you would save the starting point of the pan, and if the pan has ended calculate the distance. - (void)panGesture:(UIPanGestureRecognizer *)sender { if (sender.state == UIGestureRecognizerStateBegan) {