Skip to content

Commit 964cebd

Browse files
committed
see 03/27 log
1 parent 18cc0f9 commit 964cebd

File tree

7 files changed

+596
-146
lines changed

7 files changed

+596
-146
lines changed

config.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ext {
2626
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version",
2727
"com.github.dcendents:android-maven-gradle-plugin:2.1",// 上传到 maven
2828
"com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4",// 上传到 bintray
29-
"tech.harmonysoft:traute-gradle:1.1.8",// 注解转非空判断
29+
"tech.harmonysoft:traute-gradle:1.1.10",// 注解转非空判断
3030
"com.blankj:bus-gradle-plugin:$bus.version",// 组件化 Static Bus
3131
],
3232

@@ -43,7 +43,7 @@ ext {
4343
android_no_op : "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version",
4444
support_fragment: "com.squareup.leakcanary:leakcanary-support-fragment:$leakcanary_version"
4545
],
46-
free_proguard: "com.blankj:free-proguard:0.0.7",
46+
free_proguard: "com.blankj:free-proguard:1.0.0",
4747
adapt_screen : "com.blankj:adapt-screen:0.0.3",
4848

4949
gson : "com.google.code.gson:gson:2.8.2",

lib/base/src/main/java/com/blankj/lib/base/BaseActivity.java

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
import android.support.v7.app.AppCompatActivity;
1717
import android.view.LayoutInflater;
1818
import android.view.View;
19+
import android.view.ViewGroup;
1920

21+
import com.blankj.lib.base.slideBack.SlideBackLayout;
2022
import com.blankj.utilcode.util.AntiShakeUtils;
2123
import com.blankj.utilcode.util.AppUtils;
2224
import com.blankj.utilcode.util.ToastUtils;
2325
import com.blankj.utilcode.util.Utils;
24-
import com.r0adkll.slidr.Slidr;
2526

2627
/**
2728
* <pre>
@@ -53,10 +54,8 @@ protected void onCreate(Bundle savedInstanceState) {
5354
findViewById(android.R.id.content).setBackgroundColor(getResources().getColor(R.color.mediumGray));
5455
initView(savedInstanceState, mContentView);
5556
doBusiness();
57+
initSwipeBack();
5658

57-
if (isSwipeBack()) {
58-
Slidr.attach(this);
59-
}
6059
AppUtils.registerAppStatusChangedListener(this, new Utils.OnAppStatusChangedListener() {
6160
@Override
6261
public void onForeground() {
@@ -89,5 +88,29 @@ protected void onDestroy() {
8988
super.onDestroy();
9089
AppUtils.unregisterAppStatusChangedListener(this);
9190
}
91+
92+
private void initSwipeBack() {
93+
if (isSwipeBack()) {
94+
SlideBackLayout slideBackLayout = new SlideBackLayout(this);
95+
96+
ViewGroup decorView = (ViewGroup) getWindow().getDecorView();
97+
View oldScreen = decorView.getChildAt(0);
98+
decorView.removeViewAt(0);
99+
100+
slideBackLayout.addView(oldScreen);
101+
decorView.addView(slideBackLayout, 0);
102+
slideBackLayout.setSwipeBackListener(new SlideBackLayout.OnSwipeBackListener() {
103+
@Override
104+
public void completeSwipeBack() {
105+
// finish();
106+
ToastUtils.showLong("haha");
107+
}
108+
});
109+
110+
111+
}
112+
}
113+
114+
92115
}
93116

0 commit comments

Comments
 (0)