Questions tagged [swipe]

A quick motion gesture across the touchscreen.

swipe
Filter by
Sorted by
Tagged with
500 votes
22 answers
496k views

Android: How to handle right to left swipe gestures

I want my app to recognize when a user swipes from right to left on the phone screen. How to do this?
endryha's user avatar
  • 7,216
441 votes
28 answers
462k views

Detect a finger swipe through JavaScript on the iPhone and Android

How can you detect that a user swiped his finger in some direction over a web page with JavaScript? I was wondering if there was one solution that would work for websites on both the iPhone and an ...
827's user avatar
  • 5,032
166 votes
8 answers
189k views

dynamically add and remove view to viewpager

(I figured out a solution - please see my post in the Answer section below.) In my app, the user will start with a single view of his data. I'd like to add a ViewPager and allow the user to add more ...
Peri Hartman's user avatar
  • 19.4k
145 votes
20 answers
144k views

How to recognize swipe in all 4 directions

I need to use swipe to recognize swipe gesture down and then right. But on swift UISwipeGestureRecognizer has predeterminate Right direction.. And I don't know how make this for use other directions..
user3739367's user avatar
  • 4,281
131 votes
12 answers
91k views

Setting direction for UISwipeGestureRecognizer

I want to add simple swipe gesture recognition to my view based iPhone project. Gestures in all directions (right, down, left, up) should be recognized. It is stated in the docs for ...
sandisn's user avatar
  • 1,313
91 votes
3 answers
48k views

catch on swipe to dismiss event

I'm using an android notification to alert the user once a service is finished (success or failure), and I want to delete local files once the process is done. My problem is that in the event of ...
Dror Fichman's user avatar
  • 1,559
81 votes
13 answers
135k views

Custom edit view in UITableViewCell while swipe left. Objective-C or Swift

How to make a custom edit view in iOS7 UITableView with Objective C like the Evernote or the Apple Reminders app while swipe left. I have tried to set an custom editingAccessoryView, but this didn't ...
ugoarangino's user avatar
80 votes
13 answers
40k views

Android RecyclerView ItemTouchHelper revert swipe and restore view holder

Is there a way to revert a swipe action and restore the view holder to its initial position after the swipe is completed and onSwiped is called on the ItemTouchHelper.Callback instance? I got the ...
kukabi's user avatar
  • 1,293
79 votes
9 answers
90k views

PagerAdapter start position

I'm using the following example to impliment my viewPager: http://code.google.com/p/viewpagerexample/issues/list The problem with this example is that I can't figure out how to set my starting ...
Kirill Kulakov's user avatar
72 votes
13 answers
107k views

How to detect swipe in flutter

I've tried using the swipe detector plugin for flutter to achieve navigating to a new screen on swipe right but it's not working, no errors are thrown and the breakpoint is never hit when I debug it. ...
Sam Cromer's user avatar
  • 2,123
69 votes
5 answers
57k views

Set default page for ViewPager in Android

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 ...
dcanh121's user avatar
  • 4,685
66 votes
10 answers
40k views

How to detect Swiping UP, DOWN, LEFT and RIGHT with SwiftUI on a View

I'm getting into building Apple Watch apps. What I'm currently working on will require me to make use of detecting swipes in the four main directions (UP, DOWN, LEFT and RIGHT) The problem is I have ...
Barry Michael Doyle's user avatar
63 votes
5 answers
26k views

React Navigation: Swipe on drawer does not work in Android

I have been searching for a solution for a long time, but surprisingly, I think nobody has faced it yet. So I am posting it. I have created a simple Drawer Navigator with React Navigation V3. I have ...
Sadman Muhib Samyo's user avatar
49 votes
8 answers
111k views

How to implement swipe gestures for mobile devices?

I have an application made in AngularJS which has arrow key navigation to switch views. I want to implement this navigation using swipe for touch devices. I tried jGestures library but it doesn't go ...
fotuzlab's user avatar
  • 1,446
48 votes
11 answers
32k views

Stop chrome back/forward two finger swipe

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 ...
andrei's user avatar
  • 8,422
48 votes
4 answers
32k views

Android Swipe on List

Does anyone have a simple example of a ListActivity displaying Textviews in a column and when you swipe left to right you see that row in a new view? This would be to say edit the data for that row ...
JPM's user avatar
  • 9,217
45 votes
9 answers
50k views

ViewPager inside ViewPager

I would like to create a ViewPager (with three items) where each of its view is another ViewPager (with two items). User then swipe items like this: ViewPager1[0] ViewPager2[0] ViewPager1[0] ...
xpepermint's user avatar
  • 35.6k
42 votes
3 answers
52k views

Disable gesture recognizer

I have two types of recognizer, one for tap and one for swipe UIGestureRecognizer *recognizer; //TAP recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap1:)]; [(...
Vins's user avatar
  • 1,864
42 votes
2 answers
34k views

Android "swipe" vs "fling"

In the Android Developers gesture design section, the term "swipe" is used. In the developer section, the term "fling" is used. Are these terms synonymous? From what I have found, I believe they are, ...
Sean Beach's user avatar
  • 2,050
42 votes
11 answers
21k views

Swipe Back like Pinterest or Tumblr

Does anybody has an idea how Pinterest or Tumblr has implemented there "swipe back" method. i.e. on Pinterest you can click on a post on the news feed. Than the DetailActivity is started and displays ...
sockeqwe's user avatar
  • 15.8k
38 votes
4 answers
38k views

Method onTouchEvent not being called

I'm having a problem that my method @Override public boolean onTouchEvent(MotionEvent event) { return gestureDetector.onTouchEvent(event); } is never called. Any ideas why is that so? I'm ...
gabrjan's user avatar
  • 3,040
35 votes
4 answers
25k views

How to disable ViewPager from swiping in one direction

I want to allow the user swipe in a ViewPager only from right to left. So once he passed a page he can't come back to it. How can this be done? I tried this solution: public class CustomViewPager ...
Emil Adz's user avatar
  • 40.9k
33 votes
3 answers
44k views

How to detect Swipe Gesture in iOS?

In my iPhone app, I require to recognize the swipe gesture made by the user on the view. I want the swipe gestures to be recognized and perform a function on swipe. I need that the view should ...
Parth Bhatt's user avatar
  • 19.5k
32 votes
4 answers
80k views

How to use Hammer to swipe

I've found an interesting resource: Hammer.js. I tried to swipe with Hammer and jQuery. 1) I've downloaded the code here 2) I've put that code in a document. I put a link to that code in the head of ...
Nrc's user avatar
  • 9,667
31 votes
5 answers
55k views

Detect left/right-swipe on touch-devices, but allow up/down-scrolling

I need to detect and react to left/right-swipes, but want to give the user the ability to scroll on the same element, so as long as he moves his finger only left/right with a maximum up/down movement ...
Raphael Jeger's user avatar
30 votes
3 answers
55k views

Android - Gesture Detection (Swipe up/down) on particular view

I am trying to implement the OnGestureListener in Android. I have three TextViews in my layout. What i am trying to achieve is to set Gesture Listener for two of the textViews . Here is the layout - ...
Anukool's user avatar
  • 5,361
30 votes
1 answer
29k views

Android list view Right / Left swipes like call logs [duplicate]

I have an Android application in which there is List View Like this one Now I want to perform two different activities on right/Left swipe of the List Items in the same way How native call log works ...
Nikhil Agrawal's user avatar
29 votes
7 answers
23k views

SwiftUI - Custom Swipe Actions In List

How can I use custom Swipe Actions in SwiftUI? I tried to use the UIKit Framework to get these working in SwiftUI. But that doesn't work for me. import SwiftUI import UIKit init() { ...
Max's user avatar
  • 723
28 votes
4 answers
46k views

How to recognize swipe gesture in UIScrollView

I'm trying to recognize left/right swipe gesture in a UIScrollView. I've tried to create UISwipeGestureRecognizers and associate them with the scroll view. It works but very rarely. Most of the time I ...
David's user avatar
  • 2,790
28 votes
3 answers
66k views

How can I implement a swiping/sliding animation between views?

I have a few views between which I want to swipe in an iOS program. Right now, I'm swiping between them using a modal style, with a cross dissolve animation. However, I want to have a swiping/sliding ...
user1368136's user avatar
26 votes
6 answers
12k views

End up activity on swipe right?

I have to finish Activity when user offer a right swipe anywhere in the screen. I have tried with GestureDetector and that is works fine if there is neither ScrollView nor RescyclerView exists in the ...
Stella's user avatar
  • 1,817
25 votes
4 answers
29k views

how detect swipe gesture direction?

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] ...
Tomasz Szulc's user avatar
  • 4,217
25 votes
2 answers
48k views

Touch Events in Vue 2.0 [closed]

I'm using Vue 2.0 and I should work with swipe gestures. I have checked that there is one official plugin (named vue-touch) but as they say, Vue 2.0 is not supported yet. Which libraries are ...
Asqan's user avatar
  • 4,429
24 votes
7 answers
35k views

ViewPager disable swiping to a certain direction

I want to disable the swiping, but only to the right side. I found a working solution in this answer. Unfortunately, this copies the whole ViewPager source to achieve the goal. Is there any methods ...
WonderCsabo's user avatar
  • 12.1k
24 votes
4 answers
31k views

Android: How to recreate Action bar when fragment changed

I have an activity showing a few fragments. Activity view contains only ViewPager initialized with custom FragmentPagerAdapter. This adapter provide navigation among 3 fragments. All seems to work ...
mc.dev's user avatar
  • 2,705
24 votes
3 answers
19k views

Swipe/Fling tab-changing in conjunction with ScrollView?

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 ...
Codemonkey's user avatar
  • 3,412
23 votes
5 answers
28k views

Left-right arrow indicators over a ViewPager

I want to show left and right arrows over my ViewPager, to indicate swiping. I added two ImageButtons over the ViewPager-element but those areas then block the ViewPager from triggering the "swiping"....
distractedhamster's user avatar
23 votes
1 answer
25k views

Swipe and OnClick events in RecyclerView

I'm trying to implement a swipe to dismiss action in a RecyclerView but when I set an OnClickListener on any View in a ViewHolder it overrides all OnTouch events on that view. I can abandon ...
Ivan Fork's user avatar
  • 822
23 votes
2 answers
2k views

Swipe smoothness differ between divs

I am using react-swipeable-views in my project to enable touch swipe events. I can swipe between different div, which are inside <SwipeableViews/>. I have three different divs, out of which, in ...
Benjamin Smith Max's user avatar
21 votes
10 answers
34k views

Swipe Direction in ViewPager

I have an Android app that uses ViewPager and FragmentStatePagerAdapter. I however need to add a new feature in which I have to know the swipe direction to move from one fragment view to another, left ...
Greeso's user avatar
  • 7,870
21 votes
3 answers
6k views

Android webview: prevent touch gestures being passed to parent viewpager

I have a viewpager that contains many child views; each child view is a webview. Each webview has some HTML objects that user can interact with; for instance, a slideshow that works on swipe gestures ...
Hoang Huynh's user avatar
  • 1,393
21 votes
6 answers
20k views

Swipe detection for each row of listview

I have a list of videos located in the sd-card. At this point, I just need help in creating gestures or swipe detection for each row in the list view. Thanks to this question at stackoverflow Fling ...
Farhan Khurshid's user avatar
20 votes
1 answer
11k views

ItemTouchHelper : Limit swipe width of ItemTouchHelper.SimpleCallBack on RecyclerView

I have successfully implemented swipe behavior and performed some actions with it. The problem now I have is I want to limit the swipe width when I swipe the item. Currently this is what is happening ...
viper's user avatar
  • 1,866
20 votes
2 answers
9k views

How do I disable the full swipe on a tableview cell in iOS11

UITableViewDelegate.h // Swipe actions // These methods supersede -editActionsForRowAtIndexPath: if implemented // return nil to get the default swipe actions - (nullable UISwipeActionsConfiguration ...
Megan Moreno's user avatar
20 votes
10 answers
5k views

How would I implement a swipe-based circular control like this?

I am working on an Android application, and I have a TextView where I display a price (for example 50$). I would like to have a circular control similar to this picture: Swiping a finger clockwise ...
Y2theZ's user avatar
  • 10.3k
20 votes
3 answers
46k views

ios simulator: simulate swipe and drag

I have a UIView within a UIScrollView. When i want to simulate the drag event on the UIView, swipe event on the UIScrollView is being triggered. As per the documentation , there isn't much of a ...
Srisa's user avatar
  • 1,007
20 votes
5 answers
32k views

Simulate swipe with mouse in javascript

I'm trying to make an image rotator that works on mobile devices using swipe for navigation. I'm also trying to make the same rotator to work on PC browsers but to be able to use the mouse drag to ...
gabitzish's user avatar
  • 9,603
19 votes
1 answer
18k views

Tutorial to implement the use of TabHost in Android 2.2 + ViewPager and Fragments

A short tutorial for people like me who had some trouble finding a way to implement TabHost and ViewPager, including page swiping with fingers and tab click to change pages. The shown solution is ...
ᗩИᎠЯƎᗩ's user avatar
19 votes
8 answers
11k views

How to disable snackbar's swipe-to-dismiss behavior

Is there a way to prevent the user from dismissing a snackbar by swiping on it? I have an app that shows a snack bar during network login, I want to avoid it to be dismissed. According to Nikola ...
Paolone's user avatar
  • 485
18 votes
5 answers
24k views

Adding a simple left/right swipe gesture

I need to add a simple left/right swipe gesture so that the 'selected' image cycles when swiped on mobile, similar to clicking the buttons in the hero component, also similar to pressing the left/...
James Bameron's user avatar

1
2 3 4 5
57