Skip to content

Commit 8ae3ba8

Browse files
committed
backup
1 parent 2b1e9c4 commit 8ae3ba8

4 files changed

Lines changed: 116 additions & 72 deletions

File tree

README.md

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,97 @@
11
# AndroidPicturePicker
22

3-
## Usage
3+
4+
##Thanks for :
5+
[Laevatein](https://github.com/nohana/Laevatein):Photo image selection activity set library. Currently under development.
6+
[Picasso](https://github.com/square/picasso):A powerful image downloading and caching library for Android
7+
[Glide](https://github.com/bumptech/glide):An image loading and caching library for Android focused on smooth scrolling
8+
[Android-Universal-Image-Loader](https://github.com/nostra13/Android-Universal-Image-Loader):Powerful and flexible library for loading, caching and displaying images on Android.
9+
10+
##Screen Shot
11+
![gallery](http://7sby47.com5.z0.glb.clouddn.com/screenshot1.jpg-xhdpi)
12+
![gallery](http://7sby47.com5.z0.glb.clouddn.com/screenshot2.jpg-xhdpi)
13+
14+
15+
## Usage
16+
17+
Call photo image selection activity by the following code snipet.
18+
```java
19+
public void onClickButton(View view) {
20+
Picker.from(this)
21+
.count(3)
22+
.enableCamera(true)
23+
.setEngine(new GlideEngine())
24+
.forResult(REQUEST_CODE_CHOOSE);
25+
}
26+
```
27+
You can use different Image Loader, Picker provide 3 Loader Engine:
28+
1.GlideEngine
29+
2.PicassoEngine
30+
3.ImageLoaderEngine
31+
32+
or you can use custom engine , just like:
33+
34+
public static class CustomEngine implements LoadEngine {
35+
36+
@Override
37+
public void displayImage(String path, ImageView imageView) {
38+
Log.i("picture", path);
39+
}
40+
41+
@Override
42+
public void displayCameraItem(ImageView imageView) {
43+
44+
}
45+
46+
@Override
47+
public void scrolling(GridView view) {
48+
49+
}
50+
51+
@Override
52+
public int describeContents() {
53+
return 0;
54+
}
55+
56+
@Override
57+
public void writeToParcel(Parcel dest, int flags) {
58+
}
59+
60+
public CustomEngine() {
61+
62+
}
63+
64+
protected CustomEngine(Parcel in) {
65+
}
66+
67+
public static final Creator<CustomEngine> CREATOR = new Creator<CustomEngine>() {
68+
public CustomEngine createFromParcel(Parcel source) {
69+
return new CustomEngine(source);
70+
}
71+
72+
public CustomEngine[] newArray(int size) {
73+
return new CustomEngine[size];
74+
}
75+
};
76+
}
77+
78+
@Override
79+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
80+
super.onActivityResult(requestCode, resultCode, data);
81+
if (requestCode == REQUEST_CODE_CHOOSE && resultCode == RESULT_OK) {
82+
mSelected = PicturePickerUtils.obtainResult(data);
83+
for (Uri u : mSelected) {
84+
Log.i("picture", u.getPath());
85+
}
86+
}
87+
}
88+
89+
90+
91+
Please note that LoadEngine is extends Parcelable.
92+
93+
##Download
94+
Gradle
495
```gradle
596
repositories {
697
maven { url "https://jitpack.io" }
@@ -11,3 +102,21 @@
11102
compile 'com.github.ValuesFeng:AndroidPicturePicker:1.0_alpha'
12103
}
13104
```
105+
106+
##License
107+
108+
109+
Licensed under the Apache License, Version 2.0 (the "License");
110+
you may not use this file except in compliance with the License.
111+
You may obtain a copy of the License at
112+
113+
http://www.apache.org/licenses/LICENSE-2.0
114+
115+
Unless required by applicable law or agreed to in writing, software
116+
distributed under the License is distributed on an "AS IS" BASIS,
117+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
118+
See the License for the specific language governing permissions and
119+
limitations under the License.
120+
121+
122+

app/src/main/java/io/valuesfeng/demo/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
4040
}
4141

4242
public void onClickButton(View view) {
43-
Picker.from(this,MimeType.of(MimeType.JPEG,MimeType.PNG))
43+
Picker.from(this)
4444
.count(3)
4545
.enableCamera(true)
4646
.setEngine(new GlideEngine())
47-
.quality(30000, Integer.MAX_VALUE) // minimum = 30000px, max = Integer.MAX_VALUEpx, so 30000px <= count <= Integer.MAX_VALUEpx;
4847
// .setEngine(new PicassoEngine())
4948
// .setEngine(new ImageLoaderEngine())
5049
// .setEngine(new CustomEngine())
@@ -77,6 +76,7 @@ public void writeToParcel(Parcel dest, int flags) {
7776
}
7877

7978
public CustomEngine() {
79+
8080
}
8181

8282
protected CustomEngine(Parcel in) {

gallery/src/main/java/io/valuesfeng/picker/Picker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
import io.valuesfeng.picker.model.SelectionSpec;
3636

3737
/**
38+
*
39+
* thanks for:
40+
*
41+
* https://github.com/nohana/Laevatein
3842
*/
3943
public final class Picker {
4044
private static final String INITIALIZE_PICKER_ERROR = "Try to initialize Picker which had already been initialized before";

gallery/src/main/java/io/valuesfeng/picker/utils/AlbumHelper.java

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)