实现效果:

Android图片相册选择与拍照?_androidAndroid图片相册选择与拍照?_maven_02Android图片相册选择与拍照?_项目源码_03

/**
 * 照相或者选择图片
 * 引用ImageSelector框架,
 * 1.需要在Project的build.gradle在添加以下代码:
 * allprojects {
 * repositories {
 * ...
 * maven { url 'https://jitpack.io' }
 * maven { url 'https://maven.google.com' }
 * }
 * }
 * 2.在Module的build.gradle在添加以下代码:
 * implementation 'com.github.donkingliang:ImageSelector:2.1.1'
 * <p>
 * 3.xml文件中声明三个相关Activity
 *  添加相应的权限
 * <!-- 图片选择Activity -->
 * <activity
 * android:name="com.donkingliang.imageselector.ImageSelectorActivity"
 * android:screenOrientation="portrait" />
 * <p>
 * <!-- 图片预览Activity -->
 * <activity
 * android:name="com.donkingliang.imageselector.PreviewActivity"
 * android:screenOrientation="portrait" />
 * <p>
 * <!-- 图片剪切Activity -->
 * <activity
 * android:name="com.donkingliang.imageselector.ClipImageActivity"
 * android:screenOrientation="portrait" />
 */