图片选择器使用场合比较多,第三方的框架也有不少,这个算是比较优秀的
接入方法:
gradle
compile 'cn.finalteam:galleryfinal:1.4.8.7'
compile 'com.android.support:support-v4:23.1.1'
application
private void initGalleryFinal(){
ThemeConfig theme = new ThemeConfig.Builder() .setTitleBarBgColor(Color.rgb(0xFF, 0x57, 0x22)) .setTitleBarTextColor(Color.BLACK) .setTitleBarIconColor(Color.BLACK) .setFabNornalColor(Color.RED) .setFabPressedColor(Color.BLUE) .setCheckNornalColor(Color.WHITE) .setCheckSelectedColor(Color.BLACK) .setIconBack(R.mipmap.ic_action_previous_item) .setIconRotate(R.mipmap.ic_action_repeat) .setIconCrop(R.mipmap.ic_action_crop) .setIconCamera(R.mipmap.ic_action_camera) .build(); //配置功能 FunctionConfig functionConfig = new FunctionConfig.Builder() .setEnableCamera(true) .setEnableEdit(false) .setEnableCrop(false) .setEnableRotate(true) .setCropSquare(true) .setEnablePreview(true) .build(); initImageLoader(context); CoreConfig coreConfig = new CoreConfig.Builder(this, new UILImageLoader(), theme) .setFunctionConfig(functionConfig) .setPauseOnScrollListener(new UILPauseOnScrollListener(false, true)) .build(); GalleryFinal.init(coreConfig); } private void initImageLoader(Context context) { // This configuration tuning is custom. You can tune every option, you may tune some of them, // or you can create default configura