Android Activity 滑动返回。支持微信滑动返回样式、横屏滑动返回、全屏滑动返回
强烈建议与 StatusBarUtil 结合着一起使用
保证栈底 Activity 的主题是不透明的。例如 demo 中的首个 Activity 是 SplashActivity,进入主界面后 SplashActivity 就销毁了,此时 MainActivity 就是栈底 Activity,需保证 MainActivity 的主题不透明
把该崩溃界面里比较特殊的 View 的 class 添加到集合中作为「BGASwipeBackHelper.init」的第2个参数,例如地图控件。目前在库中已经添加了 WebView 和 SurfaceView,不用再次添加这两个了
点击下载 BGASwipeBackLayoutDemo.apk 或扫描下面的二维码安装
maven { url 'https://jitpack.io' } 添加到 root build.gradle 的 repositories 中implementation 'com.github.bingoogolapple:BGASwipeBackLayout-Android:latestVersion'
// 换成己工程里依赖的 support-v4 的版本
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
/**
* 必须在 Application 的 onCreate 方法中执行 BGASwipeBackHelper.init 来初始化滑动返回
* 第一个参数:应用程序上下文
* 第二个参数:如果发现滑动返回后立即触摸界面时应用崩溃,请把该界面里比较特殊的 View 的 class 添加到该集合中,目前在库中已经添加了 WebView 和 SurfaceView
*/
BGASwipeBackHelper.init(this, null);
}
}
…
如果您觉得 BGA 系列开源库或工具软件帮您节省了大量的开发时间,可以扫描下方的二维码打赏支持。您的支持将鼓励我继续创作,打赏后还可以加我微信免费开通一年 上帝小助手浏览器扩展/插件开发平台 的会员服务
微信 QQ 支付宝Copyright (C) 2012 The Android Open Source Project
Copyright 2016 bingoogolapple
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
暂无开放 Issues,或尚未同步最近议题。