GithubHelp home page GithubHelp logo

clwater / pictureselector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucksiege/pictureselector

0.0 1.0 0.0 54.47 MB

Picture Selector Library for Android or 图片选择器

License: Apache License 2.0

Java 100.00%

pictureselector's Introduction

PictureSelector 2.0

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

我的博客地址

体验Demo

PRs Welcome CSDN I Star

目录

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

最新版本

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

启动相册

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

 PictureSelector.create(this)
   .openGallery(PictureMimeType.ofImage())
   .loadImageEngine(GlideEngine.createGlideEngine()) // 请参考Demo GlideEngine.java
   .forResult(PictureConfig.CHOOSE_REQUEST);   

单独拍照

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

 PictureSelector.create(this)
   .openCamera(PictureMimeType.ofImage())
   .loadImageEngine(GlideEngine.createGlideEngine()) // 请参考Demo GlideEngine.java
   .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()) // 请参考Demo GlideEngine.java
 .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

演示效果

单一模式 混选模式
默认风格 预览 多图裁剪
数字风格 预览 多图裁剪
白色风格 预览 单图裁剪
全新风格 预览 多图裁剪
相册目录 单选模式 头像裁剪
白色风格 视频 音频

pictureselector's People

Contributors

lucksiege avatar luck1991 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.