Exemplo n.º 1
0
 private void modifyHasDotView() {
   if (null != imageListAdapter) {
     if (imageListAdapter.getImagePathList().size() > 0) {
       hasDotImageView.setVisibility(View.VISIBLE);
     } else {
       hasDotImageView.setVisibility(View.GONE);
     }
   }
 }
Exemplo n.º 2
0
  private void gotoSelectImage() {
    Intent intent = new Intent(context, MultiImageSelectorActivity.class);

    // whether show camera
    intent.putExtra(MultiImageSelectorActivity.EXTRA_SHOW_CAMERA, true);

    // max select image amount
    intent.putExtra(MultiImageSelectorActivity.EXTRA_SELECT_COUNT, 4);

    // select mode (MultiImageSelectorActivity.MODE_SINGLE OR MultiImageSelectorActivity.MODE_MULTI)
    intent.putExtra(
        MultiImageSelectorActivity.EXTRA_SELECT_MODE, MultiImageSelectorActivity.MODE_MULTI);

    if (imageListAdapter != null) {
      if (imageListAdapter.getImagePathList().size() > 0) {
        intent.putExtra(
            MultiImageSelectorActivity.EXTRA_DEFAULT_SELECTED_LIST,
            imageListAdapter.getImagePathList());
      }
    }

    ((Activity) context).startActivityForResult(intent, REQUEST_IMAGE_CODE);
  }
Exemplo n.º 3
0
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   switch (requestCode) {
     case REQUEST_IMAGE_CODE:
       if (resultCode == Activity.RESULT_OK) {
         // Get the result list of select image paths
         List<String> path = data.getStringArrayListExtra(MultiImageSelectorActivity.EXTRA_RESULT);
         // do your logic ....
         if (null != imageListAdapter) {
           imageListAdapter.setImagePathList(path);
           modifyHasDotView();
         }
       }
       break;
   }
 }