forked from LuckSiege/PictureSelectorLight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from LuckSiege/master
更新
- Loading branch information
Showing
48 changed files
with
1,596 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# PictureSelectorLight 2.0 无裁剪功能版 | ||
一款针对android平台下的图片选择器,支持从相册或拍照选择图片或视频,支持动态权限获取、压缩、主题自定义配置等功能、适配android 6.0+系统的开源图片选择框架。 | ||
# PictureSelectorLight 2.0 无裁剪功能版 | ||
一款针对android平台下的图片选择器,支持从相册或拍照选择图片或视频、音频,支持动态权限获取、压缩、主题自定义配置等功能、适配android 6.0+系统的开源图片选择框架。 | ||
|
||
|
||
项目会一直维护(有bug修复完成,一般周末会更新),发现问题欢迎提出会第一时间修复,QQ交流群 619458861,个人QQ [email protected] 希望用得着的朋友点个start。 | ||
项目会一直维护(有bug修复完成,一般周末会更新),发现问题欢迎提出会第一时间修复,QQ交流群 [619458861](http://shang.qq.com/wpa/qunwpa?idkey=91eb68229f9106b90ae9fa12d01b74815dd86b26c6c8d1dcbc9a27c1d87c42a0),个人QQ [email protected] 希望用得着的朋友点个star。 | ||
|
||
[PictureSelector 2.0完整版](https://github.com/LuckSiege/PictureSelector) | ||
|
||
|
@@ -13,29 +13,42 @@ | |
[![CSDN](https://img.shields.io/twitter/url/http/blog.csdn.net/luck_mw.svg?style=social)](http://blog.csdn.net/luck_mw) | ||
[![I](https://img.shields.io/github/issues/LuckSiege/PictureSelector.svg)](https://github.com/LuckSiege/PictureSelector/issues) | ||
|
||
******功能特点:****** | ||
``` | ||
1.适配android6.0+系统 | ||
2.解决图片过大oom闪退问题 | ||
3.动态获取系统权限,避免闪退 | ||
4.支持相片or视频的单选和多选 | ||
5.支持视频预览 | ||
6.支持gif图片 | ||
7.支持.webp格式图片 | ||
8.支持一些常用场景设置:如:是否预览图片、是否显示相机等 | ||
9.新增自定义主题设置 | ||
10.新增图片勾选样式设置 | ||
11.新增图片压缩处理 | ||
12.新增录视频最大时间设置 | ||
13.新增视频清晰度设置 | ||
14.新增QQ选择风格,带数字效果 | ||
15.新增自定义 文字颜色 背景色让风格和项目更搭配 | ||
16.新增LuBan多图压缩 | ||
17.新增单独拍照功能 | ||
18.新增压缩大小设置 | ||
19.新增Luban压缩档次设置 | ||
``` | ||
## 目录 | ||
-[功能特点](#功能特点)<br> | ||
-[集成方式](#集成方式)<br> | ||
-[常见错误](#常见错误)<br> | ||
-[功能配置](#功能配置)<br> | ||
-[缓存清除](#缓存清除)<br> | ||
-[主题配置](#主题配置)<br> | ||
-[常用功能](#常用功能)<br> | ||
-[结果回调](#结果回调)<br> | ||
-[更新日志](#更新日志)<br> | ||
-[混淆配置](#混淆配置)<br> | ||
-[兼容性测试](#兼容性测试)<br> | ||
-[演示效果](#演示效果)<br> | ||
|
||
### 功能特点 | ||
|
||
* 1.适配android6.0+系统 | ||
* 2.解决图片过大oom闪退问题 | ||
* 3.动态获取系统权限,避免闪退 | ||
* 4.支持相片or视频的单选和多选 | ||
* 5.支持视频预览 | ||
* 6.支持gif图片 | ||
* 7.支持.webp格式图片 | ||
* 8.支持一些常用场景设置:如:是否预览图片、是否显示相机等 | ||
* 9.新增自定义主题设置 | ||
* 10.新增图片勾选样式设置 | ||
* 11.新增图片压缩处理 | ||
* 12.新增录视频最大时间设置 | ||
* 13.新增视频清晰度设置 | ||
* 14.新增QQ选择风格,带数字效果 | ||
* 15.新增自定义 文字颜色 背景色让风格和项目更搭配 | ||
* 16.新增LuBan多图压缩 | ||
* 17.新增单独拍照功能 | ||
* 18.新增压缩大小设置 | ||
* 19.新增Luban压缩档次设置 | ||
* 20.新增音频功能查询 | ||
|
||
******那些遇到拍照闪退问题的同学,请记得看清下面适配6.0的配置~****** | ||
|
||
|
@@ -63,13 +76,13 @@ | |
``` | ||
|
||
******集成步骤****** | ||
## 集成方式 | ||
|
||
方式一 compile引入 | ||
|
||
``` | ||
dependencies { | ||
compile 'com.github.LuckSiege:PictureSelectorLight:v2.0.4' | ||
compile 'com.github.LuckSiege:PictureSelectorLight:v2.1.0' | ||
} | ||
``` | ||
|
@@ -101,13 +114,13 @@ step 2. | |
<dependency> | ||
<groupId>com.github.LuckSiege</groupId> | ||
<artifactId>PictureSelectorLight</artifactId> | ||
<version>v2.0.4</version> | ||
<version>v2.1.0</version> | ||
</dependency> | ||
``` | ||
|
||
******常见错误******* | ||
## 常见错误 | ||
``` | ||
问题一: | ||
rxjava冲突:在app build.gradle下添加 | ||
|
@@ -157,7 +170,7 @@ if (savedInstanceState == null) { | |
``` | ||
|
||
******相册启动构造方法****** | ||
## 功能配置 | ||
``` | ||
// 进入相册 以下是例子:不需要的api可以不写 | ||
PictureSelector.create(MainActivity.this) | ||
|
@@ -169,9 +182,13 @@ if (savedInstanceState == null) { | |
.selectionMode()// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE | ||
.previewImage()// 是否可预览图片 true or false | ||
.previewVideo()// 是否可预览视频 true or false | ||
.compressGrade()// luban压缩档次,默认3档 Luban.THIRD_GEAR、Luban.FIRST_GEAR、Luban.CUSTOM_GEAR | ||
.enablePreviewAudio() // 是否可播放音频 true or false | ||
.compressGrade()// luban压缩档次,默认3档 Luban.THIRD_GEAR、Luban.FIRST_GEAR、Luban.CUSTOM_GEAR | ||
.isCamera()// 是否显示拍照按钮 ture or false | ||
.compress()// 是否压缩 true or false | ||
.isZoomAnim(true)// 图片列表点击 缩放效果 默认true | ||
.sizeMultiplier(0.5f)// glide 加载图片大小 0~1之间 如设置 .glideOverride()无效 | ||
.setOutputCameraPath("/Chinayie/App")// 自定义拍照保存路径,可不填 | ||
.compress()// 是否压缩 true or false | ||
.compressMode()//系统自带 or 鲁班压缩 PictureConfig.SYSTEM_COMPRESS_MODE or LUBAN_COMPRESS_MODE | ||
.glideOverride()// glide 加载宽高,越小图片列表越流畅,但会影响列表图片浏览的清晰度 int | ||
.isGif()// 是否显示gif图片 true or false | ||
|
@@ -181,17 +198,17 @@ if (savedInstanceState == null) { | |
.compressMaxKB()//压缩最大值kb compressGrade()为Luban.CUSTOM_GEAR有效 int | ||
.compressWH() // 压缩宽高比 compressGrade()为Luban.CUSTOM_GEAR有效 int | ||
.videoQuality()// 视频录制质量 0 or 1 int | ||
.videoSecond()//显示多少秒以内的视频 int | ||
.videoSecond()//显示多少秒以内的视频or音频也可适用 int | ||
.recordVideoSecond()//录制视频秒数 默认60s int | ||
.forResult(PictureConfig.CHOOSE_REQUEST);//结果回调onActivityResult code | ||
``` | ||
******清除PictureSelector 2.0缓存****** | ||
## 缓存清除 | ||
``` | ||
//包括压缩后的缓存,要在上传成功后调用,注意:需要系统sd卡权限 | ||
PictureFileUtils.deleteCacheDirFile(MainActivity.this); | ||
``` | ||
******PictureSelector 2.0 主题配置****** | ||
## 主题配置 | ||
|
||
``` | ||
<!--默认样式 注意* 样式只可修改,不能删除任何一项 否则报错--> | ||
|
@@ -252,6 +269,7 @@ if (savedInstanceState == null) { | |
</style> | ||
``` | ||
## 常用功能 | ||
|
||
******启动相册并拍照****** | ||
``` | ||
|
@@ -277,7 +295,7 @@ PictureSelector.create(MainActivity.this).externalPicturePreview(position, selec | |
``` | ||
PictureSelector.create(MainActivity.this).externalPictureVideo(video_path); | ||
``` | ||
******图片回调完成结果返回****** | ||
## 结果回调 | ||
``` | ||
@Override | ||
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | ||
|
@@ -300,45 +318,34 @@ PictureSelector.create(MainActivity.this).externalPictureVideo(video_path); | |
``` | ||
|
||
# 更新日志: | ||
|
||
# 当前版本: | ||
###### 版本 v2.0.4 | ||
###### 重构预览图片代码 | ||
###### 修复几处bug | ||
|
||
# 历史版本: | ||
|
||
###### 版本 v2.0.3 | ||
###### 修复部分手机拍照重复2张问题 | ||
###### 修复内存不足导致activity被回收引发的问题 | ||
###### 修复PopWindow弹出卡顿一下的问题 | ||
###### 修复部分相片显示不全问题 | ||
###### 修复部分已知bug | ||
|
||
###### 版本 v2.0.1 | ||
###### 修复图片排序问题 | ||
###### 修复设置预览图片为false时,单选无效问题 | ||
###### 过滤已损坏图片or视频 | ||
###### 修改启动动画 | ||
###### 移除isRemove() api | ||
|
||
###### 版本 v2.0.0 | ||
###### PictureSelector 2.0 UI界面大改版 | ||
###### PictureSelector 2.0 新增全部模式查询 包括图片or视频 | ||
###### PictureSelector 2.0 启动模式由单例模式,改为链式调用 | ||
###### UI主题 改为style.xml 配置,各界面随意定制更加方便 | ||
###### 优化部分代码和体验去除多余逻辑 | ||
###### 修复1.0版本在fragment不回调onActivityResult() | ||
|
||
# 项目使用第三方库: | ||
###### 1.glide:3.7.0 | ||
###### 2.rxjava:2.0.5 | ||
###### 3.rxandroid:2.0.1 | ||
###### 4.PhotoView:1.2.4 | ||
###### 5.luban | ||
|
||
# 混淆配置 | ||
## 更新日志 | ||
|
||
### 当前版本: | ||
* v2.1.0 | ||
* 修复android 7.1.1系统 PopupWindow弹出位置不对问题 | ||
* 删除多余代码 | ||
* 修复全部模式下设置查询视频秒数无效问题 | ||
|
||
### 历史版本: | ||
* v2.0.9 | ||
* 修复直接播放视频闪退bug | ||
* 升级glide为4.0.0 rc1 | ||
* 新增图片列表点击缩放效果api | ||
|
||
* v2.0.7 | ||
* 修复已知bug | ||
|
||
* v2.0.6 | ||
* 新增拍照自定义保存路径 | ||
|
||
### 项目使用第三方库: | ||
* glide:4.0.0 RC1 | ||
* rxjava:2.0.5 | ||
* rxandroid:2.0.1 | ||
* PhotoView:1.2.4 | ||
* luban | ||
|
||
## 混淆配置 | ||
``` | ||
#PictureSelector 2.0 | ||
-keep class com.luck.picture.lib.** { *; } | ||
|
@@ -371,27 +378,5 @@ PictureSelector.create(MainActivity.this).externalPictureVideo(video_path); | |
#glide | ||
-keep public class * implements com.bumptech.glide.module.GlideModule | ||
-keep public class * extends com.bumptech.glide.AppGlideModule | ||
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { | ||
**[] $VALUES; | ||
public *; | ||
} | ||
``` | ||
|
||
# 兼容性测试: | ||
******腾讯优测-深度测试-通过率达到100%****** | ||
|
||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/test.png) | ||
|
||
# 演示效果: | ||
|
||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/1.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/2.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/3.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/4.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/white.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/blue.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/7.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/8.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/9.jpg) | ||
![image](https://github.com/LuckSiege/PictureSelectorLight/blob/master/image/10.jpg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.