Android-Ultra-Photo-Selector

介绍:

图片选择器,可以预览图片,预览界面支持缩放。可以按照相册栏目选择。

运行效果:

使用说明:

image2.png

   Intent intent = new Intent(context, activity);
    intent.putExtra(PhotoSelectorActivity.KEY_MAX, maxImage);
    intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
    context.startActivityForResult(intent, requestCode);
@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode != RESULT_OK)
            return;
        if (requestCode == SELECT_IMAGE_CODE) {// selected image
            if (data != null && data.getExtras() != null) {
                @SuppressWarnings("unchecked")
                List<PhotoModel> photos = (List<PhotoModel>) data.getExtras().getSerializable("photos");
                if (photos == null || photos.isEmpty()) {
                    UIHelper.ToastMessage(this, R.string.no_photo_selected);
                } else {
                    Intent intent = new Intent(this, YourOwnLogic.class);
                    Bundle b = new Bundle();
                    b.putSerializable("album_pojo", albumPojo);
                    b.putSerializable("photos", (Serializable) photos);
                    intent.putExtras(b);
                    startActivity(intent);
                    finish();
                }
            }
        }
    }
已下载
0