当前位置: 首页>>代码示例>>Java>>正文


Java ImagePicker.RESULT_CODE_ITEMS属性代码示例

本文整理汇总了Java中com.lzy.imagepicker.ImagePicker.RESULT_CODE_ITEMS属性的典型用法代码示例。如果您正苦于以下问题:Java ImagePicker.RESULT_CODE_ITEMS属性的具体用法?Java ImagePicker.RESULT_CODE_ITEMS怎么用?Java ImagePicker.RESULT_CODE_ITEMS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.lzy.imagepicker.ImagePicker的用法示例。

在下文中一共展示了ImagePicker.RESULT_CODE_ITEMS属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            //noinspection unchecked
            imageItems = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            if (imageItems != null && imageItems.size() > 0) {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < imageItems.size(); i++) {
                    if (i == imageItems.size() - 1) sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path);
                    else sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path).append("\n");
                }
                tvImages.setText(sb.toString());
            } else {
                tvImages.setText("--");
            }
        } else {
            Toast.makeText(this, "没有选择图片", Toast.LENGTH_SHORT).show();
            tvImages.setText("--");
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:RxFormUploadActivity.java


示例2: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            imageItems = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            if (imageItems != null && imageItems.size() > 0) {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < imageItems.size(); i++) {
                    if (i == imageItems.size() - 1) sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path);
                    else sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path).append("\n");
                }
                tvImages.setText(sb.toString());
            } else {
                tvImages.setText("--");
            }
        } else {
            Toast.makeText(this, "没有选择图片", Toast.LENGTH_SHORT).show();
            tvImages.setText("--");
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:FormUploadActivity.java


示例3: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            //noinspection unchecked
            List<ImageItem> imageItems = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            if (imageItems != null && imageItems.size() > 0) {
                imageItem = imageItems.get(0);
                tvImages.setText(imageItem.path);
            } else {
                tvImages.setText("--");
            }
        } else {
            Toast.makeText(this, "没有选择图片", Toast.LENGTH_SHORT).show();
            tvImages.setText("--");
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:UpActivity.java


示例4: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        //添加图片返回
        if (data != null && requestCode == REQUEST_CODE_SELECT) {
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            if (images != null) {
                selImageList.addAll(images);
                adapter.setImages(selImageList);
            }
        }
    } else if (resultCode == ImagePicker.RESULT_CODE_BACK) {
        //预览图片返回
        if (data != null && requestCode == REQUEST_CODE_PREVIEW) {
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_IMAGE_ITEMS);
            if (images != null) {
                selImageList.clear();
                selImageList.addAll(images);
                adapter.setImages(selImageList);
            }
        }
    }
}
 
开发者ID:jeasonlzy,项目名称:ImagePicker,代码行数:24,代码来源:WxDemoActivity.java


示例5: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            imageItems = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            if (imageItems != null && imageItems.size() > 0) {
                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < imageItems.size(); i++) {
                    if (i == imageItems.size() - 1)
                        sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path);
                    else sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path).append("\n");
                }
                tvImages.setText(sb.toString());
            } else {
                tvImages.setText("--");
            }
        } else {
            Toast.makeText(this, "没有选择图片", Toast.LENGTH_SHORT).show();
            tvImages.setText("--");
        }
    }
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:23,代码来源:FormUploadActivity.java


示例6: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            //noinspection unchecked
            List<ImageItem> images = (List<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            tasks = adapter.updateData(images);
        } else {
            showToast("没有数据");
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:UploadListActivity.java


示例7: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            List<ImageItem> images = (List<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            onStartUploadMethodTest(images);
        }
    }
}
 
开发者ID:CodingCodersCode,项目名称:EvolvingNetLib,代码行数:10,代码来源:MainActivity.java


示例8: uploadImage

private void uploadImage(int requestCode, int resultCode, Intent data) {
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == REQS_IMAGE_PICKER) {
            ArrayList<ImageItem> images = null;
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            ImageItem imageItem = images.get(0);
            Glide.with(BikeDamageReportActivity.this).load(imageItem.path).into(mIvPick);
           // if (bmobFile == null)
            bmobFile = new BmobFile(new File(imageItem.path));
            bmobFile.setUrl(imageItem.path);
        } else {
            Toast.makeText(this, "没有数据", Toast.LENGTH_SHORT).show();
        }
    }
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:15,代码来源:BikeDamageReportActivity.java


示例9: uploadImage

private void uploadImage(int requestCode, int resultCode, Intent data) {
    Log.d("uploadImage", "uploadImage: " + requestCode);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == REQS_IMAGE_PICKER) {
            ArrayList<ImageItem> images = null;
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            ImageItem imageItem = images.get(0);
            final BmobFile bmobFile = new BmobFile(new File(imageItem.path));
            bmobFile.upload(new UploadFileListener() {
                @Override
                public void done(BmobException e) {
                    if (e == null) {
                        MyUser NMyUser = new MyUser();
                        NMyUser.setPicUser(bmobFile);
                        mMyUser.setPicUser(bmobFile);
                        MyApplication.getInstance().upDataUser(mMyUser, NMyUser);
                        Glide.with(UserDetailActivity.this).load(bmobFile.getUrl()).into(mTvHead.getRigtImageView());
                    } else {
                        ToastUtils.show(UserDetailActivity.this, "上传失败");
                    }
                }
            });

        } else {
            Toast.makeText(this, "没有数据", Toast.LENGTH_SHORT).show();
        }
    }
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:28,代码来源:UserDetailActivity.java


示例10: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            MyAdapter adapter = new MyAdapter(images);
            gridView.setAdapter(adapter);
        } else Toast.makeText(mContext, "没有数据", Toast.LENGTH_SHORT).show();
    }
    if (requestCode == PHOTO_REQUEST_GALLERY) {
        if (data != null) {
            // 得到图片的全路径
            Uri uri = data.getData();
            crop(uri);
        } else mSelectPicPopupWindow.dismiss();
    } else if (requestCode == PHOTO_REQUEST_CAMERA) {
        if (hasSdcard()) {
            tempFile = new File(Environment.getExternalStorageDirectory(),
                    PHOTO_FILE_NAME);
            crop(Uri.fromFile(tempFile));
        } else {
            mSelectPicPopupWindow.dismiss();
            ToastUtil.show(mContext, "未找到存储卡,无法存储照片!");
        }

    } else if (requestCode == PHOTO_REQUEST_CUT) {
        try {
            mSelectPicPopupWindow.dismiss();//在此处为选择图片正确使用后关闭
            bitmap = data.getParcelableExtra("data");
            if (null != tempFile) {
                boolean delete = tempFile.delete();
            }
            sendImage(bitmap);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:liuhui19991,项目名称:CloudMusicLH,代码行数:39,代码来源:PersonalRecommendationFragment.java


示例11: onActivityResult

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            MyAdapter adapter = new MyAdapter(images);
            gridView.setAdapter(adapter);
        } else {
            Toast.makeText(this, "没有数据", Toast.LENGTH_SHORT).show();
        }
    }
}
 
开发者ID:jeasonlzy,项目名称:ImagePicker,代码行数:13,代码来源:ImagePickerActivity.java


示例12: onActivityResult

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
            String imgs = "";
            if (data != null && requestCode == 100) {
                imageItems = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
                if (imageItems != null && imageItems.size() > 0) {
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < imageItems.size(); i++) {
                        if (i == imageItems.size() - 1)
                            sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path);
                        else
                            sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path).append("\n");
                    }
                    imgs = sb.toString();
                } else {
                    imgs = "--";
                }
            } else {
                Toastor.showToast(getContext(), "没有选择图片");
                imgs = "--";
            }
            getView().selectImageResult(imgs);
//            getView().ro();

        }
    }
 
开发者ID:lujianzhao,项目名称:AndroidBase,代码行数:27,代码来源:UploadPresenter.java


示例13: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
        if (data != null && requestCode == 100) {
            images = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
            MyAdapter adapter = new MyAdapter(images);
            gridView.setAdapter(adapter);
        } else {
            Toast.makeText(getContext(), "没有数据", Toast.LENGTH_SHORT).show();
        }
    }
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:13,代码来源:UploadFragment.java



注:本文中的com.lzy.imagepicker.ImagePicker.RESULT_CODE_ITEMS属性示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。