13336904776 / PictureSelector

Picture Selector Library for Android or 图片选择器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PictureSelector 2.0

一款针对Android平台下的图片选择器,支持从相册获取图片、视频、音频&拍照,支持裁剪(单图or多图裁剪)、压缩、主题自定义配置等功能,支持动态获取权限&适配Android 5.0+系统的开源图片选择框架。
 
项目一直维护(有bug修复完一般会在周末更新),如果有bug请描述清楚并可以提Issues,个人QQ 893855882 希望用得着的朋友点个star。
Android开发交流 群一 619458861 (已满)
Android开发交流 群二 679824206 (已满)
Android开发交流 群三 854136996

我的博客地址

Apk下载

PRs Welcome CSDN I Star

目录

-用前需知
-功能特点
-最新版本 v2.4.2
-更新日志
-主题配置-Xml方式
-主题配置-Code方式
-演示效果
-集成方式
-启动相册
-单独拍照
-结果回调
-常见错误
-缓存清除
-混淆配置
-LICENSE
-兼容性测试
-打赏

最新版本

implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.4.2'

启动相册

快捷调用,更多功能 请查看

 PictureSelector.create(this)
   .openGallery(PictureMimeType.ofImage())
   .loadImageEngine(GlideEngine.createGlideEngine())
   .forResult(PictureConfig.CHOOSE_REQUEST);   

单独拍照

快捷调用,单独启动拍照或视频 根据PictureMimeType自动识别 更多功能 请查看

 PictureSelector.create(this)
   .openCamera(PictureMimeType.ofImage())
   .loadImageEngine(GlideEngine.createGlideEngine())
   .forResult(PictureConfig.REQUEST_CAMERA);   

缓存清除

 //包括裁剪和压缩后的缓存,要在上传成功后调用,type 指的是图片or视频缓存取决于你设置的ofImage或ofVideo 注意:需要系统sd卡权限  
 PictureFileUtils.deleteCacheDirFile(this,type);
 // 清除所有缓存 例如:压缩、裁剪、视频、音频所生成的临时文件
 PictureFileUtils.deleteAllCacheDirFile(this);

预览图片

// 预览图片 可自定长按保存路径
*注意 .themeStyle(R.style.theme);里面的参数不可删,否则闪退...

PictureSelector.create(this)
 .themeStyle(R.style.picture_default_style)
 .isNotPreviewDownload(true)
 .loadImageEngine(GlideEngine.createGlideEngine())
 .openExternalPreview(position, selectList);

预览视频

PictureSelector.create(this).externalPictureVideo(video_path);

项目使用第三方库:

  • PhotoView
  • luban
  • ucrop

混淆配置

#PictureSelector 2.0
-keep class com.luck.picture.lib.** { *; }

-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }

LICENSE

   Copyright 2017 Luck

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

打赏

~如果您觉得好,对你有帮助,可以给我一点打赏当做鼓励,蚊子再小也是肉呀(^__^) 嘻嘻……

image

兼容性测试

腾讯优测-深度测试-通过率达到100%

image

演示效果

功能项&单一模式 功能项&混选模式
默认样式 默认样式预览 默认样式多图裁剪
数字风格 数字风格预览 数字风格多图裁剪
白色主题风格 白色主题风格预览 白色主题风格单图裁剪
仿微信风格 仿微信风格预览 仿微信风格多图裁剪
相册目录 仿微信风格单选模式 单图圆形头像裁剪
白色主题风格 视频 音频

About

Picture Selector Library for Android or 图片选择器

License:Apache License 2.0


Languages

Language:Java 100.0%