parfoismeng / slideback Goto Github PK
View Code? Open in Web Editor NEW无需继承的Activity侧滑返回库 类全面屏返回手势效果 仿“即刻”侧滑返回
Home Page: https://github.com/ParfoisMeng/SlideBack
License: Other
无需继承的Activity侧滑返回库 类全面屏返回手势效果 仿“即刻”侧滑返回
Home Page: https://github.com/ParfoisMeng/SlideBack
License: Other
请问 haveScroll属性,是Builder配置上去的。
意思是 必须要知道 这个页面是否有可滑动布局?
Fragment没有起作用,应该是我用的不正确,能不能给个在fragment的列子?
看这个代码:
if (moveXLength / dragRate <= maxSlideLength) {
// 如果位移距离在可拉动距离内,更新SlideBackIconView的当前拉动距离并重绘,区分左右
if (isAllowEdgeLeft && isSideSlideLeft) {
slideBackIconViewLeft.updateSlideLength(moveXLength / dragRate);
} else if (isAllowEdgeRight && isSideSlideRight) {
slideBackIconViewRight.updateSlideLength(moveXLength / dragRate);
}
}
举个栗子,先只滑到一半,然后突然滑到超过maxSlideLength,SlideBackIconView是不是就没有更新了?状态还维持在一半的时候
想利用该库实现一个类似viewpager的左右滑的效果,不知道能否支持?
现象:开启 edgeMode(SlideBack.EDGE_BOTH) 后,右侧侧滑还是无法生效。
原因:SlideBackInterceptLayout 内。
@Override public boolean onInterceptTouchEvent(MotionEvent ev) { return ev.getAction() == MotionEvent.ACTION_DOWN && ev.getRawX() <= sideSlideLength; }
没有对右侧的手势做拦截。
Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (28.0.0) classpath. You should manually set the same version via DependencyResolution
如果剔除掉
//侧滑返回
api 'com.github.ParfoisMeng:SlideBack:1.0.6'{
exclude group: 'com.android.support', module: 'appcompat-v7'
}
就会如下错
Could not find method com.github.ParfoisMeng:SlideBack:1.0.6() for arguments [build_ozn05o2r6l8vp66zanhc2qoc$_run_closure3$_closure10@163af1d9] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
支持Fragment么?
在界面有 recycleView 和 scrollView , 地图, 等情况下无法显示侧滑ui 和侧滑返回,应该是被拦截了
感觉阻尼太大了吧, 用用力滑到右边才返回... 跟ios那种侧滑返回还是有点差距 感觉一般用户在浏览页面的时候都是轻轻一划的
问题:两个activity都注册了侧滑返回,都是自定义标题栏,且给标题栏设置蓝色背景,A页面跳转B页面时再退回A页面,重复几十次会出现B页面标题栏变成透明的(实际测试重复几次就出现了),手动触发一下侧滑功能,立即恢复蓝色背景;
原因:SlideBackIconView的初始拉动距离为0,绘制时alpha = slideLength / maxSlideLength - 0.2f,透明度为负值;
解决:透明度设置不为负数就不会出现了;
有个参数callBack: () -> Unit,java怎么传这个参数(没有引入Kotlin)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.