ericxu1983 / AndroidPlayGround

Apache License 2.0
0 stars 0 forks source link

左右滑动手指,让窗口随着手指滑动而动 #1

Open ericxu1983 opened 9 years ago

ericxu1983 commented 9 years ago

例如抽屉效果

ericxu1983 commented 9 years ago

RoadMap: 先看懂DrawerLayout的用法 再取看DrawLayout的源码

ericxu1983 commented 9 years ago

官方的例子也写的太复杂了

ericxu1983 commented 9 years ago

ViewDragHelper http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/android/support/v4/widget/ViewDragHelper.java#ViewDragHelper.0STATE_SETTLING

ericxu1983 commented 9 years ago

github open source: https://github.com/SimonVT/android-menudrawer

ericxu1983 commented 9 years ago

郭霖的demo, 用leftMargin来做 http://blog.csdn.net/guolin_blog/article/details/8714621

ericxu1983 commented 9 years ago

VelocityTracker的用法

ericxu1983 commented 9 years ago

1000表示pixels/second?

ericxu1983 commented 9 years ago

什么时候有action_cancel?

ViewGroup中的OnInterceptTouchEvent,拦截了touch事件,child view还可以收到当次的touch事件,但是action是action_cancel了,后面当然收不到任何touch事件了

ericxu1983 commented 9 years ago

getX(),getY(), relative to view. getRawX, getRawY, relative to screen

getPointerId(), 多指触摸,每一个手指就是一个pointer

ericxu1983 commented 9 years ago

ViewDragHelper比较好的一篇文章: http://fedepaol.github.io/blog/2014/09/01/dragging-with-viewdraghelper/

ericxu1983 commented 9 years ago

突然想起了uber的选择人民优步等等的拖动效果,可以用这个来做啊

ericxu1983 commented 9 years ago

scroller类的说明: http://blog.sina.com.cn/s/blog_3e3fcadd0101bsx7.html

ericxu1983 commented 9 years ago

http://blog.csdn.net/c_weibin/article/details/7438323

scroller的example

ericxu1983 commented 9 years ago

思考: . 新版android可以使用属性动画来实现Scroller的动效 . 至于没有动效的移动,大小等,可以直接使用setTranslationX, setTranslationY等