Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Leaqi committed Mar 15, 2023
1 parent 82569ac commit 6f1270b
Show file tree
Hide file tree
Showing 44 changed files with 1,533 additions and 135 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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")
# 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")
#### 中文 README | [English README](https://github.com/Leaqi/SwipeDrawer/blob/main/README_en.md "English README")
Android SwipeDrawer滑动抽屉库,可同时添加上下左右四个方向抽屉布局,抽屉打开模式有抽屉模式、覆盖模式、固定模式三种,支持无限嵌套,支持边缘滑动打开等,SwipeDrawer还可以当做下拉刷新布局使用,支持ListView、RecyclerView、GridView、ScrollView等。
#### 中文:
Expand All @@ -21,7 +21,7 @@ Android SwipeDrawer滑动抽屉库,可同时添加上下左右四个方向抽

dependencies {
...
implementation 'cn.Leaqi:SwipeDrawer:1.4'
implementation 'cn.Leaqi:SwipeDrawer:1.5'
}

在布局文件中加入 `SwipeDrawer`
Expand Down
4 changes: 2 additions & 2 deletions README_en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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")
# 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")
#### English README | [中文 README](https://github.com/Leaqi/SwipeDrawer/ "中文 README")
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.

Expand All @@ -22,7 +22,7 @@ Add `SwipeDrawer` dependencies:

dependencies {
...
implementation 'cn.Leaqi:SwipeDrawer:1.4'
implementation 'cn.Leaqi:SwipeDrawer:1.5'
}

Add `SwipeDrawer` to the layout file :
Expand Down
6 changes: 5 additions & 1 deletion apk/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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")
# 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")
## 图片预览 · [![查看更多](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 "查看更多")
### Demo Home:
[![Demo Home](https://p.ssl.qhimg.com/t01b36f1353d11068a0.jpg "Demo Home")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo Home")
Expand Down Expand Up @@ -30,3 +30,7 @@
[![Demo 13](https://p.ssl.qhimg.com/t01fedfa4a1f176dc57.jpg "Demo 13")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 13")
### Demo 14:
[![Demo 14](https://p.ssl.qhimg.com/t012f200826d70e56be.jpg "Demo 14")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 14")
### Demo 15:
[![Demo 15](https://p.ssl.qhimg.com/t01e44b3fa6c35c4016.jpg "Demo 15")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 15")
### Demo 16:
[![Demo 16](https://p.ssl.qhimg.com/t01687da37e1098a505.jpg "Demo 16")](https://Leaqi.github.io/SwipeDrawer/pics.html "Demo 16")
Binary file modified apk/demo-app.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "cn.leaqi.drawerapp"
minSdkVersion 16
targetSdkVersion 29
versionCode 4
versionName "1.4"
versionCode 5
versionName "1.5"
}
buildTypes {
release {
Expand Down
79 changes: 62 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,45 @@
android:name=".Utils.AppData"
android:allowBackup="false"
android:icon="@mipmap/icon"
android:roundIcon="@mipmap/icon"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/icon_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name=".Demo14Activity"
<activity
android:name=".Demo16Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="leaqi.cn"
android:path="/Demo16"
android:scheme="drawer" />
</intent-filter></activity>
<activity
android:name=".Demo15Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="leaqi.cn"
android:path="/Demo15"
android:scheme="drawer" />
</intent-filter>
</activity>
<activity
android:name=".Demo14Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -32,7 +64,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo13Activity"
<activity
android:name=".Demo13Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -47,7 +80,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo12Activity"
<activity
android:name=".Demo12Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -62,7 +96,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo11Activity"
<activity
android:name=".Demo11Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -79,9 +114,9 @@
</activity>
<activity
android:name=".Demo10Activity"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

Expand All @@ -94,7 +129,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo9Activity"
<activity
android:name=".Demo9Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -109,7 +145,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo8Activity"
<activity
android:name=".Demo8Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -124,7 +161,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo7Activity"
<activity
android:name=".Demo7Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -139,7 +177,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo6Activity"
<activity
android:name=".Demo6Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -154,7 +193,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo5Activity"
<activity
android:name=".Demo5Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -169,7 +209,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo4Activity"
<activity
android:name=".Demo4Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -184,7 +225,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo3Activity"
<activity
android:name=".Demo3Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -199,7 +241,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo2Activity"
<activity
android:name=".Demo2Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -214,7 +257,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".Demo1Activity"
<activity
android:name=".Demo1Activity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand All @@ -229,7 +273,8 @@
android:scheme="drawer" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|smallestScreenSize"
android:exported="true">
<intent-filter>
Expand Down
98 changes: 98 additions & 0 deletions app/src/main/java/cn/leaqi/drawerapp/Demo15Activity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package cn.leaqi.drawerapp;


import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;

import cn.leaqi.drawer.OnDrawerState;
import cn.leaqi.drawer.SwipeDrawer;
import cn.leaqi.drawerapp.Utils.Common;
import cn.leaqi.drawerapp.Views.TopBar;

public class Demo15Activity extends Activity {
TopBar topBar = null;
SwipeDrawer rootDrawer = null;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_demo15);
rootDrawer = findViewById(R.id.rootDrawer);
topBar = new TopBar(this); // 头部操作类
topBar.setTitle("");
topBar.showLeftBack(true);
topBar.setNavigationBar();
topBar.setNavigationColor();
AppInit();
}

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) { // 监听返回键
if (rootDrawer.getShow()) { // 如果是打开状态
rootDrawer.closeDrawer(); // 关闭
return true; // 拦截
}
}
return super.onKeyDown(keyCode, event);
}

private void AppInit() {
final ScrollView subScroll = findViewById(R.id.subScroll);
final View moreList = findViewById(R.id.moreList);
final View titleList = findViewById(R.id.titleList);
final View bottomList = findViewById(R.id.bottomList);
final ImageView subIcon = findViewById(R.id.subIcon);

// 监听 SwipeDrawer 状态
rootDrawer.setOnDrawerState(new OnDrawerState() {
@Override
public void onStart(int type) {}
@Override
public void onMove(int type, float progress) {
// 根据进度设置布局透明度
moreList.setAlpha(progress);
titleList.setAlpha(progress);
// 根据进度设置布局高度
Common.setHeight(moreList, 135 * progress);
Common.setHeight(titleList, 40 * progress);
}
@Override
public void onOpen(int type) {
subIcon.setImageResource(R.mipmap.btn_bottom); //更改图标
Common.animShow(bottomList, 1000); //显示动画
}
@Override
public void onClose(int type) {
subIcon.setImageResource(R.mipmap.btn_mid); //更改图标
subScroll.smoothScrollTo(0, 0);
Common.animHide(bottomList, 1000); //隐藏动画
}
@Override
public void onCancel(int type) {}
});
//点击图标关闭
subIcon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (rootDrawer.getShow()) {
rootDrawer.closeDrawer(SwipeDrawer.DIRECTION_BOTTOM);
}
}
});
}

public void showTag(View view) {
Common.showToast(view.getTag().toString());
}

public void showText(View view) {
Common.showToast(((TextView)view).getText().toString());
}

}
Loading

0 comments on commit 6f1270b

Please sign in to comment.