swipe

Swipe to switch tab selection

陌路散爱 提交于 2019-11-29 02:33:50
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. It's certainly possible; you'll need to write a custom layout and override onTouchEvent and onInterceptTouchEvent to decide whether to dispatch gestures through

Disable gesture recognizer

て烟熏妆下的殇ゞ 提交于 2019-11-29 02:10:33
问题 I have two types of recognizer, one for tap and one for swipe UIGestureRecognizer *recognizer; //TAP recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap1:)]; [(UITapGestureRecognizer *)recognizer setNumberOfTouchesRequired:1]; [self.view addGestureRecognizer:recognizer]; self.tapRecognizer = (UITapGestureRecognizer *)recognizer; recognizer.delegate = self; [recognizer release]; //SWIPE RIGHT recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget

ViewPager disable swiping to a certain direction

▼魔方 西西 提交于 2019-11-29 01:24:30
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 just inheriting the existing class and not duplicating? I'm not sure this is exactly what you need: I needed a viewpager for a wizard with a max page that the user can't pass it. At the end the solution was in the adapter. I changed the count of the PagerAdapter and this way blocks the user from passing the max page: @Override public int getCount() { return mProgress; //max page + 1 } When the user

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

假如想象 提交于 2019-11-28 22:55:31
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 - <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rlMain" android:layout_width="wrap_content" android:layout_height="wrap_content" > <TextView android:id="@+id/tvOne" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginBottom="10dp" android:layout_marginTop="5dp" android:gravity

add swipe effect for the jquery fancybox lightbox [closed]

丶灬走出姿态 提交于 2019-11-28 22:05:00
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 item, one to show the navigation arrow ( :hover ) and other to actually advance to the next/prev item.

Swipe half page in a ViewPager (from compatibility pack)

允我心安 提交于 2019-11-28 21:59:46
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 boxes are an abstraction. In fact each box is a ListView and I create different pages just changing

LibGDX - Get Swipe Up or swipe right etc.?

偶尔善良 提交于 2019-11-28 21:35:26
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 GestureDetector. I looked at the code, but no clue how can I use the swipe part. I know a little bit how to

RecyclerView ItemTouchHelper swipe remove animation

旧巷老猫 提交于 2019-11-28 21:25:40
I've got a remove on swipe, that draws a background (much like the Inbox app), implemented by an ItemTouchHelper - by overriding the onChilDraw method and drawing a rectangle on the provided canvas: ItemTouchHelper mIth = new ItemTouchHelper( new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { remove(viewHolder.getAdapterPosition()); } public boolean onMove(RecyclerView recyclerview, RecyclerView.ViewHolder v, RecyclerView.ViewHolder target) { return false; } @Override public void onChildDraw(Canvas c,

Twitter for Android like swipe-to-side quick menu

浪子不回头ぞ 提交于 2019-11-28 19:56:13
ScreenShot http://dl.dropbox.com/u/33331786/swipedemo.png I would like to know how to setup the animation where, for in example in the latest Twitter for Android App, you can swipe a tweet to the side, and a quick menu will appear(not the old popup one). Thanks.. Since this is a really cool feature and I didn't find an implementation for that I created it myself. I started a project which will contain this feature (besides other dev tools). Update : The project has moved to GitHub ( android-toolbox ) The project contains that feature and meanwhile has some good bugfixes since I used it in

add additional buttons in UITableView swipe

房东的猫 提交于 2019-11-28 19:33:38
Currently I am using NSFetchedResultsController to handle tableviews. I am wondering is there any way to add additional buttons like the delete button in swipe operation? I am thinking about to subclass it. But find nothing relevant in help docs to my problems. Thanks in advance. soulshined Your title is misleading. NSFetchedResultsController has no relevance to your end goal. Subclassing would just create more work than necessary, what you want to look into is UITableViewRowAction . This handles very easily & similarly to the new UIAlertController , so you should feel extremely comfortable