https://github.com/ko-devhong/android-multi-pickers
https://github.com/LuckSiege/PictureSelector fork project
https://github.com/ko-devhong/android-multi-pickers
Last synced: 12 days ago
JSON representation
https://github.com/LuckSiege/PictureSelector fork project
- Host: GitHub
- URL: https://github.com/ko-devhong/android-multi-pickers
- Owner: ko-devHong
- License: apache-2.0
- Created: 2022-07-18T10:37:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-06T08:24:03.000Z (over 3 years ago)
- Last Synced: 2025-03-01T14:18:03.280Z (over 1 year ago)
- Language: Java
- Size: 9.33 MB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PictureSelector 2.0
A Picture Selector for Android platform, support from the album to obtain pictures, video, audio & photo, support crop (single picture or multi-picture crop), compression, theme custom configuration and other functions, support dynamic access & adapt to Android 5.0+ system of open source picture selection framework。
# This is https://github.com/LuckSiege/PictureSelector Fork Project
[](https://jitpack.io/#LuckSiege/PictureSelector)
[](https://github.com/LuckSiege)
[](http://blog.csdn.net/luck_mw)
[](https://github.com/ko-devHong/android-multi-pickers/issues)
[](https://github.com/LuckSiege/PictureSelector)
## Directory
-[Or use Gradle](#Version)
-[Update Log](https://github.com/ko-devHong/android-multi-pickers/releases/tag/v2.8.8)
-[Style Configuration-Xml](https://github.com/LuckSiege/PictureSelector/wiki/%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%BB%E9%A2%98-Xml%E6%96%B9%E5%BC%8F)
-[Style Configuration-Code]()
-[Demo Effect](#Effect)
-[Api Explain](https://github.com/LuckSiege/PictureSelector/wiki/PictureSelector-Api)
-[PictureSelector Path Desc](https://github.com/LuckSiege/PictureSelector/wiki/PictureSelector-%E8%B7%AF%E5%BE%84%E8%AF%B4%E6%98%8E)
-[Open Photo Album](#Photo)
-[Open Camera](#Camera)
-[Custom Camera](#CustomCamera)
-[Results Callback](https://github.com/LuckSiege/PictureSelector/wiki/Result-Callback)
-[Cache Clear](#CacheClear)
-[Confusion](#Confusion)
-[License](#License)
## Deploy
```sh
./gradlew assembleRelease
./gradlew publish
```
## Version
```sh
repositories {
google()
mavenCentral()
}
dependencies {
implementation 'io.github.ko-devHong:pictureselector:v2.8.8'
}
```
Or Maven:
```sh
io.github.ko-devHong
pictureselector
v2.8.0
```
## Photo
Quick call, more functions [More](https://github.com/ko-devHong/android-multi-pickers/wiki/PictureSelector-Api)
1、onActivityResult
```sh
PictureSelector.create(this)
.openGallery(PictureMimeType.ofImage())
.imageEngine(GlideEngine.createGlideEngine()) // Please refer to the Demo GlideEngine.java
.forResult(PictureConfig.CHOOSE_REQUEST);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case PictureConfig.CHOOSE_REQUEST:
// onResult Callback
List result = PictureSelector.obtainMultipleResult(data);
break;
default:
break;
}
}
```
2、Callback
```sh
PictureSelector.create(this)
.openGallery(PictureMimeType.ofAll())
.imageEngine(GlideEngine.createGlideEngine())
.forResult(new OnResultCallbackListener() {
@Override
public void onResult(List result) {
// onResult Callback
}
@Override
public void onCancel() {
// onCancel Callback
}
});
```
## Camera
Quick Use, separately start the photo or video according to PictureMimeType automatic recognition [More](https://github.com/ko-devHong/PictureSelector/wiki/PictureSelector-Api)
onActivityResult
```sh
PictureSelector.create(this)
.openCamera(PictureMimeType.ofImage())
.imageEngine(GlideEngine.createGlideEngine()) // Please refer to the Demo GlideEngine.java
.forResult(PictureConfig.REQUEST_CAMERA);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK) {
switch (requestCode) {
case PictureConfig.REQUEST_CAMERA:
// onResult Callback
List result = PictureSelector.obtainMultipleResult(data);
break;
default:
break;
}
}
```
Callback
```sh
PictureSelector.create(this)
.openCamera(PictureMimeType.ofImage())
.imageEngine(GlideEngine.createGlideEngine())
.forResult(new OnResultCallbackListener() {
@Override
public void onResult(List result) {
// onResult Callback
}
@Override
public void onCancel() {
// onCancel Callback
}
});
```
## CustomCamera
If you need to use a custom camera you need to set up
```
.isUseCustomCamera(true);
```
Application implementing interface
```sh
public class App extends Application implements CameraXConfig.Provider {
private static final String TAG = App.class.getSimpleName();
@Override
public void onCreate() {
super.onCreate();
}
@NonNull
@Override
public CameraXConfig getCameraXConfig() {
return Camera2Config.defaultConfig();
}
}
```
## CacheClear
```sh
// Include clipped and compressed cache, to be called upon successful upload, type refers to the image or video cache depending on which ofImage or ofVideo you set up note: system sd card permissions are required
PictureCacheManager.deleteCacheDirFile(this,type);
// Clear all temporary files generated by caching such as compression, clipping, video, and audio
PictureCacheManager.deleteAllCacheDirFile(this);
// Clear the cache and refresh the gallery
PictureCacheManager.deleteAllCacheDirRefreshFile(this);
// Clear the cache and refresh the gallery
PictureCacheManager.deleteAllCacheDirFile(this, new OnCallbackListener() {
@Override
public void onCall(String absolutePath) {
// Refresh the photo album
}
});
```
## Preview Image
```
// Preview picture can be customized length press save path
*Prompt .themeStyle(R.style.theme);Inside the parameters can not be deleted, otherwise crash...
PictureSelector.create(this)
.themeStyle(R.style.picture_default_style)
.isNotPreviewDownload(true)
.imageEngine(GlideEngine.createGlideEngine())
.openExternalPreview(position, result);
```
## Preview Video
```sh
PictureSelector.create(this).externalPictureVideo(video_path);
```
## Project use libraries
- PhotoView
- luban
- ucrop
## Confusion
```sh
#PictureSelector 2.0
-keep class com.luck.picture.lib.** { *; }
#Ucrop
-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }
```
## License
```sh
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.
```
## Contact
Android Group [662320389]()
Android Group 1 [619458861]() (biggest)
Android Group 2 [679824206]() (biggest)
Android Group 3 [854136996]() (biggest)
QQ [893855882]()
## Effect
| Single Mode | Mixed Mode |
| :-----------------: | :-----------------------: |
|  |  |
| Default Style | Preview | Multiple Crop |
| :------------------------------------: | :--------------------------------------------: | :----------------------------------------: |
|  |
|  |
| Digital Style | Preview | Multiple Crop |
| :------------------------------------: | :------------------------------------: | :------------------------------------: |
|  |  |  |
| White Style | Preview | Single Crop |
| :---------------------------------: | :-------------------------------------: | :-------------------------------------: |
|  |  |  |
| New Style | Preview | Multiple Crop |
| :-----------------------------------: | :-----------------------------------: | :---------------------------------------: |
|  |  |  |
| Photo Album Directory | Single Mode | Circular Crop |
| :---------------------------------------: | :------------------------------------------: | :--------------------------------------------: |
|  |  |  |
| White Style | Video | Audio |
| :---------------------------------: | :--------------------------: | :--------------------------: |
|  |  |  |