某次点击打开一个新页面后,在屏幕任意位置(微信需在屏幕左边边缘)向右滑动,即可实现返回的功能,同时还可以实时看到滑动状态。
请问这是如何实现的?
巴扎黑2017-04-17 14:25:36
Phew, I just finished writing this function, please stay tuned for the release of SegmentFault for Android 2.6~
The solution I used is this ikew0ng/SwipeBackLayout
PHP中文网2017-04-17 14:25:36
There are many ways to implement it.
One is to monitor gestures directly in the activity and move the DecorView.
One is to add a layer of defined views between DecorView and its subviews to handle gestures and effects. That's the one upstairs.
https://github.com/Jude95/SwipeBackHelper
Here are some improvements I made to ikew0ng/SwipeBackLayout.