gesture

How to make long press gesture in Xamarin Forms?

﹥>﹥吖頭↗ 提交于 2019-11-26 20:29:04
问题 Could you please let me know how can I recognize long press gesture in Xamarin Forms application? A few days before I used TapGestureRecognizer TapGestureRecognizer imageTap = new TapGestureRecognizer(); imageTap.Tapped += (sender, args) => this.OnClickImage; image.GestureRecognizers.Add(imageTap); But I don't know how to make long press gesture according to this thread from xamarin forum It should looks something like this, but it does not work. var dumpParam = new RelayGesture((g, x) =>

disable the swipe gesture that opens the navigation drawer in android

霸气de小男生 提交于 2019-11-26 18:54:21
问题 I've been following the navigation drawer guide by Google and I'd like to add it to an Activity with tabs and gestures. I'd like to disable the gesture to open the navigation drawer, does anyone have any idea how to do this? 回答1: You should use: mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); It worked for me, the swipe to open the drawer was disabled. If it still won't work, check out the answer provided here. 回答2: for locking you can do this: mDrawerLayout

Android TextView Linkify intercepts with parent View gestures

纵饮孤独 提交于 2019-11-26 18:10:07
问题 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? 回答1: Linkify applies to a movementMethod to the textView LinkMovementMethod . That movement method thought it

How can a service listen for touch gestures/events?

血红的双手。 提交于 2019-11-26 17:35:11
问题 I'm wondering how apps like SwipePad and Wave Launcher are able to detect touch gestures/events simply through a service. These apps are able to detect a touch gestures even though it is not in their own Activity. I've looked all over the Internet and haven't found how they can do that. My main question is how a service can listen in on touch guestures/events just as a regular Activity may receive MotionEvents even though it may not be in the original Activity or context. I'm essentially

Fling Gesture and Webview in Android

寵の児 提交于 2019-11-26 16:35:59
问题 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

How to generate zoom/pinch gesture for testing for Android

和自甴很熟 提交于 2019-11-26 16:03:50
问题 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,

Multi-touch gesture in Sprite Kit

孤者浪人 提交于 2019-11-26 14:47:27
问题 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) //

Gesture in listview android

假如想象 提交于 2019-11-26 12:55:23
问题 hi i have to add a gesture to my listview,i want to implement the same functionality of contact application. when i left swipe it should send a message,right swipe it should call. can anyone help me how to do those gesture detection... i have implemented it in various other views... but i couldn\'t do for listView... i don\'t what going worng... my code is` /** Called when the activity is first created. */ public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout

Gesture detection and ScrollView issue

妖精的绣舞 提交于 2019-11-26 12:11:22
问题 I\'m trying to create a layout with a ViewFlipper containing ScrollViews. The idea is to detect horizontal swipes to move to previous/next ScrollView. Moreover, the ScrollView contains another ViewFlipper containing ImageView with a vertical swipe detector to go to previous/next ImageView. When I replace the ScrollView by a LinearLayout both gesture detectors work properly, but with the ScrollView, none work (the gesture listeners are not even triggers). Why does using a ScrollView disable my

UISwipeGestureRecognizer Swipe length

為{幸葍}努か 提交于 2019-11-26 12:06:48
问题 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? 回答1: 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