Android Image Picker v1.12.0 Release Notes

Release Date: 2018-01-17 // over 6 years ago
  • BREAKING CHANGES!!!

    • [New] Return Mode API returnMode

      Define the ImagePicker return behaviour

      1. ReturnMode.NONE -> When image is picked, ImagePickerActivity will not dismissed even in Single Mode
      2. ReturnMode.ALL -> When image is picked dismiss then deliver result
      3. ReturnMode.CAMERA_ONLY -> When image is picked with Camera, dismiss then deliver the result
      4. ReturnMode.GALLERY_ONLY -> Same as CAMERA_ONLY but with Gallery

    So if you want to mimic the setReturnAfterFirst behavior, all you have to do is

    ImagePicker.create(activity).setReturnMode(ReturnMode.ALL).start()
    
    • setReturnAfterFirst is now obsolete
    • [New] set toolbar arrow color with toolbarArrowColor(int color)
    • ๐Ÿ“‡ Rename ImagePicker methods
      • folderTitle -> toolbarFolderTitle
      • imageTitle -> toolbarImageTitle
    • โž• Add capability to start without a request code

    So instead of this

    ImagePicker.cameraOnly().start(RC_CAMERA /* int */);
    

    Now you can do this

    ImagePicker.cameraOnly().start()
    

    BUT, you have to handle the result with the helper method from ImagePicker

     @Overrideprotected void onActivityResult(int requestCode, final int resultCode, Intent data) { if (ImagePicker.shouldHandle(requestCode, resultCode, data)) { // do your things } super.onActivityResult(requestCode, resultCode, data); }
    

    You can still use the usual result check if you define the request code by yourself.

    • โž• Add convenience method ImagePicker.getFirstImageOrNull(Intent data) to fetch only first image from the result or return null