Skip to content

Commit 6f1270b

Browse files
committed
Update
1 parent 82569ac commit 6f1270b

44 files changed

Lines changed: 1533 additions & 135 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SwipeDrawer · [![Star](https://img.shields.io/github/stars/Leaqi/SwipeDrawer?color=fb6698&label=Star "Star")](https://github.com/Leaqi/SwipeDrawer/stargazers "Star") [![Fork](https://img.shields.io/github/forks/Leaqi/SwipeDrawer?color=2196f3&label=Fork "Fork")](https://github.com/Leaqi/SwipeDrawer/network/members "Fork") [![API](https://img.shields.io/badge/API-14%2B-04d8bb "API")](https://github.com/Leaqi/SwipeDrawer/ "API") [![JitPack](https://jitpack.io/v/Leaqi/SwipeDrawer.svg "JitPack")](https://jitpack.io/#cn.Leaqi/SwipeDrawer "JitPack") [![Release](https://img.shields.io/github/v/release/Leaqi/SwipeDrawer?label=Release&color=06da47 "Release")](https://github.com/Leaqi/SwipeDrawer/releases "Release") [![License](https://img.shields.io/badge/License-Apache--2.0-e0b003 "License")](https://github.com/Leaqi/SwipeDrawer/blob/main/LICENSE "License") [![Download Demo Apk](https://img.shields.io/badge/Download-Demo%20Apk-45c703 "Download Demo Apk")](https://github.com/Leaqi/SwipeDrawer/releases/download/1.4/demo.apk "Download Demo Apk")
1+
# SwipeDrawer · [![Star](https://img.shields.io/github/stars/Leaqi/SwipeDrawer?color=fb6698&label=Star "Star")](https://github.com/Leaqi/SwipeDrawer/stargazers "Star") [![Fork](https://img.shields.io/github/forks/Leaqi/SwipeDrawer?color=2196f3&label=Fork "Fork")](https://github.com/Leaqi/SwipeDrawer/network/members "Fork") [![API](https://img.shields.io/badge/API-14%2B-04d8bb "API")](https://github.com/Leaqi/SwipeDrawer/ "API") [![JitPack](https://jitpack.io/v/Leaqi/SwipeDrawer.svg "JitPack")](https://jitpack.io/#cn.Leaqi/SwipeDrawer "JitPack") [![Release](https://img.shields.io/github/v/release/Leaqi/SwipeDrawer?label=Release&color=06da47 "Release")](https://github.com/Leaqi/SwipeDrawer/releases "Release") [![License](https://img.shields.io/badge/License-Apache--2.0-e0b003 "License")](https://github.com/Leaqi/SwipeDrawer/blob/main/LICENSE "License") [![Download Demo Apk](https://img.shields.io/badge/Download-Demo%20Apk-45c703 "Download Demo Apk")](https://github.com/Leaqi/SwipeDrawer/releases/download/1.5/demo.apk "Download Demo Apk")
22
#### 中文 README | [English README](https://github.com/Leaqi/SwipeDrawer/blob/main/README_en.md "English README")
33
Android SwipeDrawer滑动抽屉库,可同时添加上下左右四个方向抽屉布局,抽屉打开模式有抽屉模式、覆盖模式、固定模式三种,支持无限嵌套,支持边缘滑动打开等,SwipeDrawer还可以当做下拉刷新布局使用,支持ListView、RecyclerView、GridView、ScrollView等。
44
#### 中文:
@@ -21,7 +21,7 @@ Android SwipeDrawer滑动抽屉库,可同时添加上下左右四个方向抽
2121

2222
dependencies {
2323
...
24-
implementation 'cn.Leaqi:SwipeDrawer:1.4'
24+
implementation 'cn.Leaqi:SwipeDrawer:1.5'
2525
}
2626

2727
在布局文件中加入 `SwipeDrawer`

README_en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SwipeDrawer · [![Star](https://img.shields.io/github/stars/Leaqi/SwipeDrawer?color=fb6698&label=Star "Star")](https://github.com/Leaqi/SwipeDrawer/stargazers "Star") [![Fork](https://img.shields.io/github/forks/Leaqi/SwipeDrawer?color=2196f3&label=Fork "Fork")](https://github.com/Leaqi/SwipeDrawer/network/members "Fork") [![API](https://img.shields.io/badge/API-14%2B-04d8bb "API")](https://github.com/Leaqi/SwipeDrawer/ "API") [![JitPack](https://jitpack.io/v/Leaqi/SwipeDrawer.svg "JitPack")](https://jitpack.io/#cn.Leaqi/SwipeDrawer "JitPack") [![Release](https://img.shields.io/github/v/release/Leaqi/SwipeDrawer?label=Release&color=06da47 "Release")](https://github.com/Leaqi/SwipeDrawer/releases "Release") [![License](https://img.shields.io/badge/License-Apache--2.0-e0b003 "License")](https://github.com/Leaqi/SwipeDrawer/blob/main/LICENSE "License") [![Download Demo Apk](https://img.shields.io/badge/Download-Demo%20Apk-45c703 "Download Demo Apk")](https://github.com/Leaqi/SwipeDrawer/releases/download/1.4/demo.apk "Download Demo Apk")
1+
# SwipeDrawer · [![Star](https://img.shields.io/github/stars/Leaqi/SwipeDrawer?color=fb6698&label=Star "Star")](https://github.com/Leaqi/SwipeDrawer/stargazers "Star") [![Fork](https://img.shields.io/github/forks/Leaqi/SwipeDrawer?color=2196f3&label=Fork "Fork")](https://github.com/Leaqi/SwipeDrawer/network/members "Fork") [![API](https://img.shields.io/badge/API-14%2B-04d8bb "API")](https://github.com/Leaqi/SwipeDrawer/ "API") [![JitPack](https://jitpack.io/v/Leaqi/SwipeDrawer.svg "JitPack")](https://jitpack.io/#cn.Leaqi/SwipeDrawer "JitPack") [![Release](https://img.shields.io/github/v/release/Leaqi/SwipeDrawer?label=Release&color=06da47 "Release")](https://github.com/Leaqi/SwipeDrawer/releases "Release") [![License](https://img.shields.io/badge/License-Apache--2.0-e0b003 "License")](https://github.com/Leaqi/SwipeDrawer/blob/main/LICENSE "License") [![Download Demo Apk](https://img.shields.io/badge/Download-Demo%20Apk-45c703 "Download Demo Apk")](https://github.com/Leaqi/SwipeDrawer/releases/download/1.5/demo.apk "Download Demo Apk")
22
#### English README | [中文 README](https://github.com/Leaqi/SwipeDrawer/ "中文 README")
33
Android SwipeDrawer sliding drawer library can add up, down, left and right drawer layouts at the same time. There are three drawer opening modes: drawer mode, overlay mode and fixed mode. It supports unlimited nesting and edge sliding opening. Swipedrawer can also be used as a drop-down refresh layout, and supports listview, recyclerview, GridView, Scrollview, etc.
44

@@ -22,7 +22,7 @@ Add `SwipeDrawer` dependencies:
2222

2323
dependencies {
2424
...
25-
implementation 'cn.Leaqi:SwipeDrawer:1.4'
25+
implementation 'cn.Leaqi:SwipeDrawer:1.5'
2626
}
2727

2828
Add `SwipeDrawer` to the layout file :

apk/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Demo-App · [![下载APK](https://img.shields.io/badge/Download-Demo%20Apk-45c703 "下载APK")](https://github.com/Leaqi/SwipeDrawer/releases/download/1.4/demo.apk "下载APK")
1+
# Demo-App · [![下载APK](https://img.shields.io/badge/Download-Demo%20Apk-45c703 "下载APK")](https://github.com/Leaqi/SwipeDrawer/releases/download/1.5/demo.apk "下载APK")
22
## 图片预览 · [![查看更多](https://img.shields.io/badge/More-%E6%9F%A5%E7%9C%8B%E6%9B%B4%E5%A4%9A-blue "查看更多")](https://Leaqi.github.io/SwipeDrawer/pics.html "查看更多")
33
### Demo Home:
44
[![Demo Home](https://p.ssl.qhimg.com/t01b36f1353d11068a0.jpg "Demo Home")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo Home")
@@ -30,3 +30,7 @@
3030
[![Demo 13](https://p.ssl.qhimg.com/t01fedfa4a1f176dc57.jpg "Demo 13")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 13")
3131
### Demo 14:
3232
[![Demo 14](https://p.ssl.qhimg.com/t012f200826d70e56be.jpg "Demo 14")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 14")
33+
### Demo 15:
34+
[![Demo 15](https://p.ssl.qhimg.com/t01e44b3fa6c35c4016.jpg "Demo 15")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 15")
35+
### Demo 16:
36+
[![Demo 16](https://p.ssl.qhimg.com/t01687da37e1098a505.jpg "Demo 16")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 16")

apk/demo-app.apk

824 KB
Binary file not shown.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "cn.leaqi.drawerapp"
88
minSdkVersion 16
99
targetSdkVersion 29
10-
versionCode 4
11-
versionName "1.4"
10+
versionCode 5
11+
versionName "1.5"
1212
}
1313
buildTypes {
1414
release {

app/src/main/AndroidManifest.xml

Lines changed: 62 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,45 @@
1111
android:name=".Utils.AppData"
1212
android:allowBackup="false"
1313
android:icon="@mipmap/icon"
14-
android:roundIcon="@mipmap/icon"
1514
android:label="@string/app_name"
1615
android:networkSecurityConfig="@xml/network_security_config"
16+
android:roundIcon="@mipmap/icon_round"
1717
android:supportsRtl="true"
1818
android:theme="@style/AppTheme"
1919
android:usesCleartextTraffic="true">
20-
<activity android:name=".Demo14Activity"
20+
<activity
21+
android:name=".Demo16Activity"
22+
android:configChanges="orientation|screenSize|smallestScreenSize"
23+
android:exported="true">
24+
<intent-filter>
25+
<action android:name="android.intent.action.VIEW" />
26+
27+
<category android:name="android.intent.category.DEFAULT" />
28+
<category android:name="android.intent.category.BROWSABLE" />
29+
30+
<data
31+
android:host="leaqi.cn"
32+
android:path="/Demo16"
33+
android:scheme="drawer" />
34+
</intent-filter></activity>
35+
<activity
36+
android:name=".Demo15Activity"
37+
android:configChanges="orientation|screenSize|smallestScreenSize"
38+
android:exported="true">
39+
<intent-filter>
40+
<action android:name="android.intent.action.VIEW" />
41+
42+
<category android:name="android.intent.category.DEFAULT" />
43+
<category android:name="android.intent.category.BROWSABLE" />
44+
45+
<data
46+
android:host="leaqi.cn"
47+
android:path="/Demo15"
48+
android:scheme="drawer" />
49+
</intent-filter>
50+
</activity>
51+
<activity
52+
android:name=".Demo14Activity"
2153
android:configChanges="orientation|screenSize|smallestScreenSize"
2254
android:exported="true">
2355
<intent-filter>
@@ -32,7 +64,8 @@
3264
android:scheme="drawer" />
3365
</intent-filter>
3466
</activity>
35-
<activity android:name=".Demo13Activity"
67+
<activity
68+
android:name=".Demo13Activity"
3669
android:configChanges="orientation|screenSize|smallestScreenSize"
3770
android:exported="true">
3871
<intent-filter>
@@ -47,7 +80,8 @@
4780
android:scheme="drawer" />
4881
</intent-filter>
4982
</activity>
50-
<activity android:name=".Demo12Activity"
83+
<activity
84+
android:name=".Demo12Activity"
5185
android:configChanges="orientation|screenSize|smallestScreenSize"
5286
android:exported="true">
5387
<intent-filter>
@@ -62,7 +96,8 @@
6296
android:scheme="drawer" />
6397
</intent-filter>
6498
</activity>
65-
<activity android:name=".Demo11Activity"
99+
<activity
100+
android:name=".Demo11Activity"
66101
android:configChanges="orientation|screenSize|smallestScreenSize"
67102
android:exported="true">
68103
<intent-filter>
@@ -79,9 +114,9 @@
79114
</activity>
80115
<activity
81116
android:name=".Demo10Activity"
82-
android:windowSoftInputMode="adjustResize"
83117
android:configChanges="orientation|screenSize|smallestScreenSize"
84-
android:exported="true">
118+
android:exported="true"
119+
android:windowSoftInputMode="adjustResize">
85120
<intent-filter>
86121
<action android:name="android.intent.action.VIEW" />
87122

@@ -94,7 +129,8 @@
94129
android:scheme="drawer" />
95130
</intent-filter>
96131
</activity>
97-
<activity android:name=".Demo9Activity"
132+
<activity
133+
android:name=".Demo9Activity"
98134
android:configChanges="orientation|screenSize|smallestScreenSize"
99135
android:exported="true">
100136
<intent-filter>
@@ -109,7 +145,8 @@
109145
android:scheme="drawer" />
110146
</intent-filter>
111147
</activity>
112-
<activity android:name=".Demo8Activity"
148+
<activity
149+
android:name=".Demo8Activity"
113150
android:configChanges="orientation|screenSize|smallestScreenSize"
114151
android:exported="true">
115152
<intent-filter>
@@ -124,7 +161,8 @@
124161
android:scheme="drawer" />
125162
</intent-filter>
126163
</activity>
127-
<activity android:name=".Demo7Activity"
164+
<activity
165+
android:name=".Demo7Activity"
128166
android:configChanges="orientation|screenSize|smallestScreenSize"
129167
android:exported="true">
130168
<intent-filter>
@@ -139,7 +177,8 @@
139177
android:scheme="drawer" />
140178
</intent-filter>
141179
</activity>
142-
<activity android:name=".Demo6Activity"
180+
<activity
181+
android:name=".Demo6Activity"
143182
android:configChanges="orientation|screenSize|smallestScreenSize"
144183
android:exported="true">
145184
<intent-filter>
@@ -154,7 +193,8 @@
154193
android:scheme="drawer" />
155194
</intent-filter>
156195
</activity>
157-
<activity android:name=".Demo5Activity"
196+
<activity
197+
android:name=".Demo5Activity"
158198
android:configChanges="orientation|screenSize|smallestScreenSize"
159199
android:exported="true">
160200
<intent-filter>
@@ -169,7 +209,8 @@
169209
android:scheme="drawer" />
170210
</intent-filter>
171211
</activity>
172-
<activity android:name=".Demo4Activity"
212+
<activity
213+
android:name=".Demo4Activity"
173214
android:configChanges="orientation|screenSize|smallestScreenSize"
174215
android:exported="true">
175216
<intent-filter>
@@ -184,7 +225,8 @@
184225
android:scheme="drawer" />
185226
</intent-filter>
186227
</activity>
187-
<activity android:name=".Demo3Activity"
228+
<activity
229+
android:name=".Demo3Activity"
188230
android:configChanges="orientation|screenSize|smallestScreenSize"
189231
android:exported="true">
190232
<intent-filter>
@@ -199,7 +241,8 @@
199241
android:scheme="drawer" />
200242
</intent-filter>
201243
</activity>
202-
<activity android:name=".Demo2Activity"
244+
<activity
245+
android:name=".Demo2Activity"
203246
android:configChanges="orientation|screenSize|smallestScreenSize"
204247
android:exported="true">
205248
<intent-filter>
@@ -214,7 +257,8 @@
214257
android:scheme="drawer" />
215258
</intent-filter>
216259
</activity>
217-
<activity android:name=".Demo1Activity"
260+
<activity
261+
android:name=".Demo1Activity"
218262
android:configChanges="orientation|screenSize|smallestScreenSize"
219263
android:exported="true">
220264
<intent-filter>
@@ -229,7 +273,8 @@
229273
android:scheme="drawer" />
230274
</intent-filter>
231275
</activity>
232-
<activity android:name=".MainActivity"
276+
<activity
277+
android:name=".MainActivity"
233278
android:configChanges="orientation|screenSize|smallestScreenSize"
234279
android:exported="true">
235280
<intent-filter>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
package cn.leaqi.drawerapp;
2+
3+
4+
import android.app.Activity;
5+
import android.os.Bundle;
6+
import android.view.KeyEvent;
7+
import android.view.View;
8+
import android.widget.ImageView;
9+
import android.widget.ScrollView;
10+
import android.widget.TextView;
11+
12+
import cn.leaqi.drawer.OnDrawerState;
13+
import cn.leaqi.drawer.SwipeDrawer;
14+
import cn.leaqi.drawerapp.Utils.Common;
15+
import cn.leaqi.drawerapp.Views.TopBar;
16+
17+
public class Demo15Activity extends Activity {
18+
TopBar topBar = null;
19+
SwipeDrawer rootDrawer = null;
20+
21+
@Override
22+
protected void onCreate(Bundle savedInstanceState) {
23+
super.onCreate(savedInstanceState);
24+
setContentView(R.layout.activity_demo15);
25+
rootDrawer = findViewById(R.id.rootDrawer);
26+
topBar = new TopBar(this); // 头部操作类
27+
topBar.setTitle("");
28+
topBar.showLeftBack(true);
29+
topBar.setNavigationBar();
30+
topBar.setNavigationColor();
31+
AppInit();
32+
}
33+
34+
@Override
35+
public boolean onKeyDown(int keyCode, KeyEvent event) {
36+
if (keyCode == KeyEvent.KEYCODE_BACK) { // 监听返回键
37+
if (rootDrawer.getShow()) { // 如果是打开状态
38+
rootDrawer.closeDrawer(); // 关闭
39+
return true; // 拦截
40+
}
41+
}
42+
return super.onKeyDown(keyCode, event);
43+
}
44+
45+
private void AppInit() {
46+
final ScrollView subScroll = findViewById(R.id.subScroll);
47+
final View moreList = findViewById(R.id.moreList);
48+
final View titleList = findViewById(R.id.titleList);
49+
final View bottomList = findViewById(R.id.bottomList);
50+
final ImageView subIcon = findViewById(R.id.subIcon);
51+
52+
// 监听 SwipeDrawer 状态
53+
rootDrawer.setOnDrawerState(new OnDrawerState() {
54+
@Override
55+
public void onStart(int type) {}
56+
@Override
57+
public void onMove(int type, float progress) {
58+
// 根据进度设置布局透明度
59+
moreList.setAlpha(progress);
60+
titleList.setAlpha(progress);
61+
// 根据进度设置布局高度
62+
Common.setHeight(moreList, 135 * progress);
63+
Common.setHeight(titleList, 40 * progress);
64+
}
65+
@Override
66+
public void onOpen(int type) {
67+
subIcon.setImageResource(R.mipmap.btn_bottom); //更改图标
68+
Common.animShow(bottomList, 1000); //显示动画
69+
}
70+
@Override
71+
public void onClose(int type) {
72+
subIcon.setImageResource(R.mipmap.btn_mid); //更改图标
73+
subScroll.smoothScrollTo(0, 0);
74+
Common.animHide(bottomList, 1000); //隐藏动画
75+
}
76+
@Override
77+
public void onCancel(int type) {}
78+
});
79+
//点击图标关闭
80+
subIcon.setOnClickListener(new View.OnClickListener() {
81+
@Override
82+
public void onClick(View view) {
83+
if (rootDrawer.getShow()) {
84+
rootDrawer.closeDrawer(SwipeDrawer.DIRECTION_BOTTOM);
85+
}
86+
}
87+
});
88+
}
89+
90+
public void showTag(View view) {
91+
Common.showToast(view.getTag().toString());
92+
}
93+
94+
public void showText(View view) {
95+
Common.showToast(((TextView)view).getText().toString());
96+
}
97+
98+
}

0 commit comments

Comments
 (0)