swipe

Swipe/Fling tab-changing in conjunction with ScrollView?

一个人想着一个人 提交于 2019-11-26 15:24:30
问题 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

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

ViewPager inside ViewPager

China☆狼群 提交于 2019-11-26 12:34:59
问题 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] ViewPager2[1] ViewPager1[1] ViewPager2[0] ViewPager1[1] ViewPager2[1] ViewPager1[2] ViewPager2[0] ViewPager1[2] ViewPager2[1] How would that be possible? 回答1: override canScroll in the parent ViewPager: @Override protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) { if(v != this && v

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

混江龙づ霸主 提交于 2019-11-26 11:49:53
问题 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 animation like you see on the home screen and such. I have no idea how to code such a transition, and the animation style isn\'t an available modal transition style. Can anyone give me an example of the code? It doesn\'t need to be a modal model or anything, I just found that easiest. 回答1: Since

Android PagerView between Activities

我怕爱的太早我们不能终老 提交于 2019-11-26 10:59:56
问题 I have five activities/screens that I would like to be able to swipe between, each has a different function but are interrelated hence the UI concept of swiping between each. I have found many discussions around ViewPager and PagerAdapters etc. but cannot seem to find one where swiping switches between different activity screens. Is this even possible? Could someone point me towards an example project of this with source code? Or show me how to adapt an existing tutorial to do what I wish?

How to recognize swipe gesture in UIScrollView

五迷三道 提交于 2019-11-26 10:19:04
问题 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 do not get called. Why? How can I reliably get swiping left/right to work? Can I use the gesture recognizers or do I have to somehow handle it myself in touchesBegan/Ended Thanks 回答1: Figured it out. In my case, my UIScrollView contained a UIImage that I allowed zooming. Apparently that meant

Setting direction for UISwipeGestureRecognizer

时间秒杀一切 提交于 2019-11-26 04:59:42
问题 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 UISwipeGestureRecognizer: You may specify multiple directions by specifying multiple UISwipeGestureRecognizerDirection constants using bitwise-OR operands. The default direction is UISwipeGestureRecognizerDirectionRight. However for me it doesn\'t work. When all four directions are OR\'ed only left and right

How to recognize swipe in all 4 directions

孤街醉人 提交于 2019-11-26 04:30:36
问题 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.. 回答1: You need to have one UISwipeGestureRecognizer for each direction. It's a little weird because the UISwipeGestureRecognizer.direction property is an options-style bit mask, but each recognizer can only handle one direction. You can send them all to the same handler if you want, and sort it

Detect a finger swipe through JavaScript on the iPhone and Android

╄→尐↘猪︶ㄣ 提交于 2019-11-26 01:55:31
问题 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 Android phone. 回答1: Simple vanilla JS code sample: document.addEventListener('touchstart', handleTouchStart, false); document.addEventListener('touchmove', handleTouchMove, false); var xDown = null; var yDown = null; function getTouches(evt) { return evt.touches || // browser API evt.originalEvent

dynamically add and remove view to viewpager

谁说我不能喝 提交于 2019-11-26 01:03:13
问题 (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 views as desired. How do I do this? (I dont\' want to use the FragmentPagerAdapter.) I\'ve read countless posts and overviews but am still missing something. Here\'s what I think I understand: MainActivity creates a ViewPager and PagerAdapter: ViewPager pager = null; MainPagerAdapter adapter =