java.lang.Object | |
↳ | com.pspdfkit.document.image.ImagePicker |
A helper class for launching gallery image picker or a camera for taking a picture.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | ImagePicker.OnImagePickedListener | Interface for listening for image picker results. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImagePicker(FragmentManager fragmentManager, String fragmentTag)
Creates an image picker object, start image picking or capturing by using
startImageCapture() or startImageGallery() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static boolean |
deleteTemporaryFile(Context context, Uri imageUri)
Deletes temporary file previously created by capturing image through camera.
| ||||||||||
void |
setOnImagePickedListener(ImagePicker.OnImagePickedListener onImagePickedListener)
Sets on image picked listener.
| ||||||||||
void |
startImageCapture()
Starts camera application for capturing photos. | ||||||||||
void |
startImageGallery()
Starts image gallery for picking images. | ||||||||||
boolean |
wasStarted()
Returns
true if an image picker request (for gallery or camera) was started and is running or false if none has been started. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates an image picker object, start image picking or capturing by using startImageCapture()
or startImageGallery()
fragmentManager | Fragment manager, supplied by the calling activity for fragment stack control. |
---|---|
fragmentTag | Tag to be given to the fragment once added to the layout |
Deletes temporary file previously created by capturing image through camera.
context | The context to use. |
---|---|
imageUri | Uri of file that should be removed. |
true
if file was removed, false otherwise.
Sets on image picked listener. If set after some image picking events have already happened, the corresponding
method will be called again. Calling this method will replace any previously set listener. You may provide null
to clear the listener.
onImagePickedListener | ImagePicker.OnImagePickedListener that should be notified, or null to clear the
listener.
|
---|
Starts camera application for capturing photos. Result can be observed by setting listener via
setOnImagePickedListener(OnImagePickedListener)
.
This method adds this fragment instance to fragmentManager
with tag fragmentTag
.
Starts image gallery for picking images. Result can be observed by setting listener via setOnImagePickedListener(OnImagePickedListener)
.
This method adds this fragment instance to fragmentManager
with tag fragmentTag
.
Returns true
if an image picker request (for gallery or camera) was started and is running or false
if none has been started. This method is useful to let the application determine if another request should
be started or not (e.g. after a configuration change).
true
if a request was already started by the application and is still running, or false
if no request is running.