public static class ImagePicker.Builder
extends java.lang.Object
构造器和说明 |
---|
Builder(android.app.Activity activity)
创建实例
|
限定符和类型 | 方法和说明 |
---|---|
ImagePicker |
build()
构建选择器
|
ImagePicker.Builder |
fromCamera(java.io.File file)
从相机选择
|
ImagePicker.Builder |
fromCamera(java.io.File file,
int requestCode)
从相机选择
|
ImagePicker.Builder |
fromDocument()
从文档UI选择
|
ImagePicker.Builder |
fromDocument(int requestCode)
从文档UI选择
|
ImagePicker.Builder |
fromGallery()
从图库UI选择
|
ImagePicker.Builder |
fromGallery(int requestCode)
从图库UI选择
|
ImagePicker.Builder |
permissionRequestCode(int requestCode)
设置权限请求码
|
ImagePicker.Builder |
withCrop(com.lancewu.imagepicker.crop.Crop crop,
ImagePicker.CropConfigBuilder cropConfigBuilder,
int requestCode)
设置选择完照片需要裁剪,采用自定义裁剪器
|
ImagePicker.Builder |
withCrop(ImagePicker.CropConfigBuilder cropConfigBuilder)
设置选择完照片需要裁剪,采用系统裁剪器
|
public ImagePicker.Builder fromGallery()
public ImagePicker.Builder fromGallery(int requestCode)
requestCode
- 开启图库页面请求码,出现请求码重复时可设置,默认值ImagePicker.REQUEST_CODE_GALLERY
public ImagePicker.Builder fromDocument()
public ImagePicker.Builder fromDocument(int requestCode)
requestCode
- 开启文档页面请求码,出现请求码重复时可设置,默认值ImagePicker.REQUEST_CODE_DOCUMENT
public ImagePicker.Builder fromCamera(@NonNull java.io.File file)
file
- 拍照的图片要存储的文件public ImagePicker.Builder fromCamera(@NonNull java.io.File file, int requestCode)
file
- 拍照的图片要存储的文件requestCode
- 开启相机页面请求码,出现请求码重复时可设置,默认值ImagePicker.REQUEST_CODE_CAMERA
public ImagePicker.Builder withCrop(@NonNull ImagePicker.CropConfigBuilder cropConfigBuilder)
cropConfigBuilder
- 裁剪参数构造器public ImagePicker.Builder withCrop(@NonNull com.lancewu.imagepicker.crop.Crop crop, @NonNull ImagePicker.CropConfigBuilder cropConfigBuilder, int requestCode)
crop
- 裁剪器cropConfigBuilder
- 裁剪参数构造器requestCode
- 开启裁剪页面请求码,出现请求码重复时可设置,默认值ImagePicker.REQUEST_CODE_CROP
public ImagePicker.Builder permissionRequestCode(int requestCode)
requestCode
- 开启权限请求码,出现请求码重复时可设置,默认值ImagePicker.REQUEST_CODE_PERMISSION
public ImagePicker build()