![API](https://camo.githubusercontent.com/4bbf901ae20a0594bdcb119cd5935ce7a4ad449ba6a9847826ad0cbbb8b7cb96/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4150492d31302532422d627269676874677265656e2e7376673f7374796c653d666c6174)
![](https://camo.githubusercontent.com/d800ee93e01dbbcb11a4b6f207ecbaf0249011ce4c0df6a1848dbf642f2e623c/687474703a2f2f7777332e73696e61696d672e636e2f6c617267652f35653961383164626777316574726136713265647a6a3230367a3063656467672e6a7067)
dependencies {
compile 'me.iwf.photopicker:PhotoPicker:0.9.0@aar'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
}
appcompat-v7
version >= 23.0.0
[![GO HOME](https://camo.githubusercontent.com/ef31d59b1ddf8b88e487447d565b8f28404cdb6107ddae48977d64ac388aed05/687474703a2f2f7777342e73696e61696d672e636e2f6c617267652f3565396138316462677731657539306d30387638366a323064773039613379752e6a7067)
PhotoPicker.builder()
.setPhotoCount(9)
.setShowCamera(true)
.setShowGif(true)
.setPreviewEnabled(false)
.start(this, PhotoPicker.REQUEST_CODE);
ArrayList<String> photoPaths = ...;
PhotoPreview.builder()
.setPhotos(selectedPhotos)
.setCurrentItem(position)
.start(MainActivity.this);
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == PhotoPicker.REQUEST_CODE) {
if (data != null) {
ArrayList<String> photos =
data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
}
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA" />
<application
...
>
...
<activity android:name="me.iwf.photopicker.PhotoPickerActivity"
android:theme="@style/Theme.AppCompat.NoActionBar"
/>
<activity android:name="me.iwf.photopicker.PhotoPagerActivity"
android:theme="@style/Theme.AppCompat.NoActionBar"/>
</application>
</manifest>
<style name="actionBarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">@android:color/primary_text_light</item>
<item name="actionBarSize">@dimen/actionBarSize</item>
</style>
<style name="customTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="actionBarTheme">@style/actionBarTheme</item>
<item name="colorPrimary">#FFA500</item>
<item name="actionBarSize">@dimen/actionBarSize</item>
<item name="colorPrimaryDark">#CCa500</item>
</style>
# Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
# nineoldandroids
-keep interface com.nineoldandroids.view.** { *; }
-dontwarn com.nineoldandroids.**
-keep class com.nineoldandroids.** { *; }
# support-v7-appcompat
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
# support-design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
Copyright 2015 Huang Donglu
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.