swipe

Swipe and OnClick events in RecyclerView

只谈情不闲聊 提交于 2019-12-02 18:14:35
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 OnClickListener and handle all clicks in the TouchListener but if I have multiple buttons in a child view of the RecycleView than that will be a lot of code and this doesn't look like a right way. In my RecyleView I'm setting Swipe to dismiss listeners ( similar to this ): setOnTouchListener(touchListener); setOnScrollListener(touchListener.makeScrollListener()); It works in the ListView, but in the

PagerAdapter start position

时间秒杀一切 提交于 2019-12-02 17:24:03
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 position, the default starting position is 0. Basically I wan't to be able to control if there is an available view on its left or the right. Is there any way to control center's View current position? is there a better way to do it? is it possible to make it circular? I've found a way to set it's position, which is done outside of the class: awesomePager = (ViewPager) findViewById(R.id.awesomepager);

Left-right arrow indicators over a ViewPager

落爺英雄遲暮 提交于 2019-12-02 16:48:37
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". I also want presses on those arrows to trigger the fragment to change accordingly. In short: The ImageButtons should not interfere with swiping but they should register pressing. How can I achieve this? Thanks! The code below worked for me perfectly well. NB: Use FrameLayout as it allows overlapping views <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"

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

喜欢而已 提交于 2019-12-02 16:21:24
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 on the dial increases the amount by $1 steps Swiping a finger counter-clockwise on the dial decreases the amount by $1 steps I did some research but couldn't find a working implementation of something to do this. How could you create such a circular control driven by swipes? I've modified the source of circularseekbar to work as you want. You can get the mofidied class from modified cirucularseekbar

Snapchat-like swipe navigation between views in Xcode 6 and Swift)

限于喜欢 提交于 2019-12-02 14:57:14
I've been trying to implement swipe navigation between View Controllers in my app using the Swipe Gesture Recognizer and embeded Navigation Controller, but it doesn't look even close to the Snapchat's nav. What would be the most efficient and appropiate way to implement such functionality? I'm quite a newbie to Swift and programming really, and I would appreciate every helpful comment. The short version is to use a container view controller with a scrollview inside the controller. You then create separate view controllers for each screen you want in the application, and make those view

手机滑动touchSwipe

非 Y 不嫁゛ 提交于 2019-12-02 13:28:48
jQuery.touchswipe插件 TouchSwipe一款专门为移动设备设计的jquery插件,用于监听单个和多个手指触摸等事件。 一、特点: 1、监听滑动的4个方向:上、下、左、右; 2、监听多个手指收缩还是外张; 3、支持单手指或双手指触摸事件; 4、支持单击事件touchSwipe对象和它的子对象; 5、可定义临界值和最大时间来判断手势的实际滑动; 6、滑动事件有4个触发点:“开始”,“移动”,“结束”和“取消”; 7、结束事件可以在触摸释放或是达到临界值时触发; 8、允许手指刷和页面滚屏; 9、可禁止用户通过输入元素(如:按钮、表单、文本框等)触发事件; 二、安装 1、NPM npm install jquery-touchswipe --save 2、Bower bower install jquery-touchswipe --save 3、将压缩文件添加到你的项目里 <script src="js/jquery.touchSwipe.min.js" type="text/javascript"></script> 4、使用 1 2 3 4 5 6 7 8 9 10 11 $( function () { $( "#test" ).swipe( { //Generic swipe handler for all directions swipe: function

Qt for android触摸手势事件QGestureEvent

青春壹個敷衍的年華 提交于 2019-12-02 13:10:43
在触摸设备上可以使用Qt的手势事件 要激活 手势事件,需要执行以下操作: 第一步, 为QWidget控件注册手势事件 QList < Qt :: GestureType > gestures ; gestures << Qt :: PanGesture ; gestures << Qt :: PinchGesture ; gestures << Qt :: SwipeGesture ; gestures << Qt :: TapGesture ; gestures << Qt :: TapAndHoldGesture ; MainWindow w ; w . grabGestures ( gestures ); 第二步,在QWidget控件类中过滤事件 bool MainWindow :: event ( QEvent * event ) { if ( event -> type () == QEvent :: Gesture ) return gestureEvent ( static_cast < QGestureEvent *>( event )); return QWidget :: event ( event ); } bool MainWindow :: gestureEvent ( QGestureEvent * event ) { qCDebug (

Airtest中swipe方法兼容不同分辨率的解决方法

北城以北 提交于 2019-12-02 13:03:13
使用Airtest中swipe方法由于不同分辨率的手机上滑动的坐标位置不同,所以想要兼容所有的手机,仅仅靠固定坐标就会出现问题 想要兼容所有的手机,可以按照如下思路进行 1、首先获取手机的分辨率,可以使用Airtest中的poco模块的get_screen_size()方法 poco.get_screen_size() 此时获取到了手机的分辨率,可以看出屏幕宽等于900,长度等于1600 2、将屏幕的宽度和长度分别赋值为x和y, 注意屏幕左上角的坐标为(0,0),所以左下角的坐标为(0,1600),右上角的坐标为(900,0),右下角的坐标为(900,1600) xy = poco.get_screen_size() x = xy[0] y = xy[1] 3、按照屏幕的比例进行滑动,我想要从屏幕的右侧向左侧滑动,就可以按照如下方法进行,从(0.9*x,0.5*y)的坐标移动到(0.1*x,0.5y)的坐标,也就是从(810,800)的坐标移动到(90,800)的坐标 swipe((0.9*x,0.5*y),(0.1*x,0.5*y),duration=1) 4、完整代码运行 # -*- encoding=utf8 -*- __author__ = "fengruishou" from airtest.core.api import * from poco.drivers

'drag' move a uibutton so it acts like uiScrollView

左心房为你撑大大i 提交于 2019-12-02 07:40:08
问题 I need to slide a uibutton up and down the screen (Y only). It needs to be confined to an area. I want to be able to click on it and drag or flick it, just like a uiScrollView. The reason it is different to a uiScrollView is that you have to start on the button, as opposed to anywhere inside a uiScrollView! 回答1: You can move a view by using touch moved event. There is a sample tutorial MoveMe by Apple which drags a view and after releasing the touch animate the view. Check specially the touch

'drag' move a uibutton so it acts like uiScrollView

僤鯓⒐⒋嵵緔 提交于 2019-12-02 07:19:59
I need to slide a uibutton up and down the screen (Y only). It needs to be confined to an area. I want to be able to click on it and drag or flick it, just like a uiScrollView. The reason it is different to a uiScrollView is that you have to start on the button, as opposed to anywhere inside a uiScrollView! You can move a view by using touch moved event. There is a sample tutorial MoveMe by Apple which drags a view and after releasing the touch animate the view. Check specially the touch events (touchesBegan, touchesMoved, touchesEnded) in MoveMeView.m to get the idea how they have moved