swipe

Android - combine swipe and pinch-to-zoom

孤街醉人 提交于 2019-11-27 17:02:51
问题 We have the Gallery, which support swiping. We also have 3rd-party components that support pinch-to-zoom on ImageView, such as ImageViewTouch in ImageViewZoom. Now I would like to combine them both. The problem is that the swipe events get consumed by the ImageViewTouch and missed by the Gallery. How can consume events by both components? That would solve my problem, because, eventually, after a few events, each component will know how to react accordingly. For example, if the first event is

Swipe to switch tab selection

烂漫一生 提交于 2019-11-27 16:53:01
问题 I have an application that is a Tab activity with various tabs that load an Activity. I would like to add swipe gesturing to switch between tabs, on both the tab control itself and each activity loaded in a tab. Is something like this possible? I'm not sure at what "depth" the gesture is listened to when you're making gestures on an Activity hosted in the tab control, or if the inner activities would have to pass data to the Tab Host. 回答1: It's certainly possible; you'll need to write a

Stop chrome back/forward two finger swipe

浪子不回头ぞ 提交于 2019-11-27 14:29:13
I want to disable the two finger swipe that causes Chrome going back or forward. I have a website where the user might lose progress on his work if he doesn't specifically saves. I have tried using window.onbeforeunload but that doesn't seem to work if I have hashes in the url (back forward would change between www.example.com/work/#step1#unsaved www.example.com/work/#step0) and the event doesn't seem to trigger. I was about to switch to another solution but today I noticed that in Google Docs it's completely disabled. How did they achieve that? You're looking at the problem at the wrong level

Swipe half page in a ViewPager (from compatibility pack)

对着背影说爱祢 提交于 2019-11-27 14:22:11
问题 I am using a ViewPager with a PageAdapter (from the compatibility pack v4) to swipe among a horizontal list of boxes. The problem is that my second box from the first page is the first box in the second page (visually and conceptually). Something like this: The way I am doing now it works. However, this becomes kinda weird because at the middle of the swipe there is a situation that the same box appears twice (like it is shown in the image). There is a way to swipe only "half" page? EDIT: The

add swipe effect for the jquery fancybox lightbox [closed]

£可爱£侵袭症+ 提交于 2019-11-27 14:12:15
问题 Fancybox has a full support and works fine on desktop platforms, however mobile/touch devices don't support the :hover state property therefore, if displaying a fancybox gallery like : <a class="fancybox" rel="gallery" href="image01.jpg">01</a> <a class="fancybox" rel="gallery" href="image02.jpg">02</a> <a class="fancybox" rel="gallery" href="image03.jpg">03</a> ... etc. and this simple code : $(".fancybox").fancybox(); fancybox navigation arrows would need a double-click to move to the next

LibGDX - Get Swipe Up or swipe right etc.?

若如初见. 提交于 2019-11-27 14:00:00
问题 touch area http://imageshack.us/a/img836/2909/swipe1.png In the green area the user can swipe up, right, down, left. How can I now get e.g. swipe Up? or swipe Down? or swipe right or swipe left? e.g. how to get a String -> input = getSwiped(); -> input is then Up, or right, or down, or left And the user can touch two buttons. 1 or 2. 1 is for duck and 2 is for jump. I want to check this inputs at the same time. The user can touch and also swipe Up at the same moment. I know there is a

how detect swipe gesture direction?

谁都会走 提交于 2019-11-27 12:26:20
i need to detect direction of my swipe gesture and i've got problem with it. gesture is working, but i don't know how to detect direction. ... swipeGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(detectSwipe:)]; [swipeGesture setNumberOfTouchesRequired:1]; [swipeGesture setDirection:UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp]; [appView addGestureRecognizer:swipeGesture]; -(void)detectSwipe:(UISwipeGestureRecognizer *)recognizer { switch (recognizer.direction) { case UISwipeGestureRecognizerDirectionUp: NSLog(@"smth1"); break;

Set default page for ViewPager in Android

泄露秘密 提交于 2019-11-27 11:52:34
I am using the following code, MAX is 2 pages. By default the position is 0 and adds a new page to the right. I inflate two layout files. How can I show the page1 when the app starts and add a new page to the left ? Thanks. main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <android.support.v4.view.ViewPager android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/pagerView" /> <

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

Swipe/Fling tab-changing in conjunction with ScrollView?

不想你离开。 提交于 2019-11-27 11:03:21
The best I could find on this particular issue (although I do not use a Gallery): ScrollView and Gallery interfering - doesn't really give a specific answer though. And my implementation does not use a Gallery, obviously. Jump down to the next bold part for the interesting part So I got Fling/Swipe/Flick/whatever you want to call it to work a while ago on my application. Inspiration was gathered from a couple of different places, some of them being "basic gesture detection" here on Stack Overflow ( Fling gesture detection on grid layout ), Code Shogun ( http://www.codeshogun.com/blog/2009/04