Skip to content

Commit 103b7e7

Browse files
committed
see 04/24 log
1 parent 964cebd commit 103b7e7

File tree

35 files changed

+431
-1126
lines changed

35 files changed

+431
-1126
lines changed

config.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ext {
4444
support_fragment: "com.squareup.leakcanary:leakcanary-support-fragment:$leakcanary_version"
4545
],
4646
free_proguard: "com.blankj:free-proguard:1.0.0",
47-
adapt_screen : "com.blankj:adapt-screen:0.0.3",
47+
swipe_panel: "com.blankj:swipe-panel:1.0",
4848

4949
gson : "com.google.code.gson:gson:2.8.2",
5050
glide : "com.github.bumptech.glide:glide:4.7.1",

launcher/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
android:name="com.blankj.launcher.pkg.MainActivity"
1414
android:configChanges="orientation|keyboardHidden|screenSize"
1515
android:screenOrientation="user"
16-
android:theme="@style/MainActivityTheme"
1716
android:windowSoftInputMode="stateHidden">
1817
<intent-filter>
1918
<action android:name="android.intent.action.MAIN" />

launcher/pkg/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
android:name=".MainActivity"
77
android:configChanges="orientation|keyboardHidden|screenSize"
88
android:screenOrientation="user"
9-
android:theme="@style/MainActivityTheme"
109
android:windowSoftInputMode="stateHidden" />
1110
</application>
1211

launcher/pkg/src/main/java/com/blankj/launcher/pkg/MainActivity.kt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import android.support.v7.app.ActionBarDrawerToggle
66
import android.view.View
77
import android.widget.ImageView
88
import com.blankj.lib.base.BaseDrawerActivity
9-
import com.blankj.utilcode.util.ActivityUtils
10-
import com.blankj.utilcode.util.BarUtils
11-
import com.blankj.utilcode.util.BusUtils
9+
import com.blankj.utilcode.constant.PermissionConstants
10+
import com.blankj.utilcode.util.*
1211
import kotlinx.android.synthetic.main.activity_main.*
1312

1413

@@ -22,7 +21,19 @@ import kotlinx.android.synthetic.main.activity_main.*
2221
*/
2322
class MainActivity : BaseDrawerActivity() {
2423

25-
override fun initData(bundle: Bundle?) {}
24+
override fun initData(bundle: Bundle?) {
25+
26+
PermissionUtils.permission(PermissionConstants.CALENDAR)
27+
.callback(object : PermissionUtils.SimpleCallback {
28+
override fun onGranted() {
29+
LogUtils.e()
30+
}
31+
32+
override fun onDenied() {
33+
LogUtils.e()
34+
}
35+
})
36+
}
2637

2738
override fun bindLayout(): Int {
2839
return R.layout.activity_main

lib/base/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies {
1313
api dep.constraint
1414
api dep.kotlin
1515
api dep.free_proguard
16-
api 'com.r0adkll:slidableactivity:2.0.6'
16+
api dep.swipe_panel
1717
compileOnly dep.leakcanary.android_no_op
1818
// api 'com.blankj:utilcode:1.23.7'
1919
}

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

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
11
package com.blankj.lib.base;
22

3-
/**
4-
* <pre>
5-
* author: blankj
6-
* blog : http://blankj.com
7-
* time : 2019/03/14
8-
* desc :
9-
* </pre>
10-
*/
11-
123
import android.annotation.SuppressLint;
134
import android.app.Activity;
145
import android.os.Bundle;
156
import android.support.annotation.LayoutRes;
167
import android.support.v7.app.AppCompatActivity;
178
import android.view.LayoutInflater;
189
import android.view.View;
19-
import android.view.ViewGroup;
2010

21-
import com.blankj.lib.base.slideBack.SlideBackLayout;
11+
import com.blankj.swipepanel.SwipePanel;
2212
import com.blankj.utilcode.util.AntiShakeUtils;
2313
import com.blankj.utilcode.util.AppUtils;
14+
import com.blankj.utilcode.util.SizeUtils;
2415
import com.blankj.utilcode.util.ToastUtils;
2516
import com.blankj.utilcode.util.Utils;
2617

@@ -91,26 +82,18 @@ protected void onDestroy() {
9182

9283
private void initSwipeBack() {
9384
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() {
85+
final SwipePanel swipeLayout = new SwipePanel(this);
86+
swipeLayout.setLeftDrawable(R.drawable.base_back);
87+
swipeLayout.setLeftEdgeSize(SizeUtils.dp2px(100));
88+
swipeLayout.wrapView(mContentView);
89+
swipeLayout.setOnFullSwipeListener(new SwipePanel.OnFullSwipeListener() {
10390
@Override
104-
public void completeSwipeBack() {
105-
// finish();
106-
ToastUtils.showLong("haha");
91+
public void onFullSwipe(int direction) {
92+
finish();
93+
swipeLayout.close(direction);
10794
}
10895
});
109-
110-
11196
}
11297
}
113-
114-
11598
}
11699

0 commit comments

Comments
 (0)