GalleryFinal 第三方本地图片选择库

GalleryFinal 本地图库使用非常方便,支持单选、多选、裁剪、编辑、本地拍照

github地址:

studio集成:

需要借助图片加载工具,支持picasso、Glide、Fresco、UIL、Xutils

需要实现GalleryFinal.ImageLoader这个接口,根据你选择的图片加载库实现它的 displayImage方法

git上有以上五种的方式,都写好了的

使用:

1.初始化GralleryFinal

2.使用:

3.回调

所选择的图片信息都会在OnHanlderResultCallBack方法中得到

GalleryFinal.OnHanlderResultCallback galleryBack = new GalleryFinal.OnHanlderResultCallback() {
        @Override
        public void onHanlderSuccess(int reqeustCode, List<PhotoInfo> resultList) {
            Log.v("onHanlderSuccess", "reqeustCode: " + reqeustCode + "  resultList.size" + resultList.size());
            for (PhotoInfo info : resultList) {
                switch (reqeustCode) {
                    case 1:
                        result1.add(info.getPhotoPath());
                        break;
                    case 2:
                        result2.add(info.getPhotoPath());
                        break;
                }
            }
        }

        @Override
        public void onHanlderFailure(int requestCode, String errorMsg) {
            Toast.makeText(MainActivity.this, "requestCode: " + requestCode + "  " + errorMsg, Toast.LENGTH_LONG).show();

        }
    };

附上一些配置说明,都是git上有的,直接copy过来的

经验分享 程序员 微信小程序 职场和发展