public class PhotoUtils extends Object
Constructor and Description |
---|
PhotoUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
alertNeedStoragePermission(android.content.Context ctx) |
static void |
copyStream(InputStream is,
OutputStream os) |
static String |
downloadFile(String url,
String name) |
static String |
extractFilenameFromUri(android.net.Uri uri,
android.app.Activity activity) |
static String |
getDateFromTime(String value)
Creates a date with format dd/MM/yyyy hh:mm from the given timestamp
|
static String |
getExtension(String name)
Extract the extension from the given filename
|
static String |
getFileFromUri(android.net.Uri uri,
android.app.Activity activity) |
static String |
getImageFileName()
Name the image captured when posting an activity
PhotoUtils.MOBILE_IMAGE + date + .jpg |
static String |
getParentImagePath(android.content.Context context) |
static android.graphics.Bitmap |
getRoundedCornerBitmap(android.graphics.Bitmap bitmap,
int pixels) |
static android.graphics.Bitmap |
makeRadGrad(int width,
int height)
Make radial gradient bitmap
|
static void |
pickPhotoForActivity(android.app.Activity caller)
Send a pick photo intent on behalf of the given activity.
The result is passed to the calling activity via onActivityResult with the requestCode ExoConstants.REQUEST_ADD_PHOTO . |
static android.graphics.Bitmap |
resizeImage(android.graphics.Bitmap originalImage,
int newW) |
static android.graphics.Bitmap |
resizeImageBitmap(android.content.Context context,
android.graphics.Bitmap bm) |
static File |
reziseFileImage(File file) |
static android.graphics.Bitmap |
shrinkBitmap(String file,
int width,
int height) |
static String |
startImageCapture(android.app.Activity caller)
Take a photo and store it into /sdcard/eXo/DocumentCache
|
public static String getParentImagePath(android.content.Context context)
public static String startImageCapture(android.app.Activity caller)
caller
- the activity requesting an image capturepublic static void pickPhotoForActivity(android.app.Activity caller)
ExoConstants.REQUEST_ADD_PHOTO
.caller
- the activity requesting a photopublic static void alertNeedStoragePermission(android.content.Context ctx)
ctx
- public static String getExtension(String name)
name
- File's namepublic static String getDateFromTime(String value)
value
- the time, as a Stringpublic static String getImageFileName()
PhotoUtils.MOBILE_IMAGE
+ date + .jpgpublic static android.graphics.Bitmap shrinkBitmap(String file, int width, int height)
public static android.graphics.Bitmap resizeImage(android.graphics.Bitmap originalImage, int newW)
public static android.graphics.Bitmap getRoundedCornerBitmap(android.graphics.Bitmap bitmap, int pixels)
public static String getFileFromUri(android.net.Uri uri, android.app.Activity activity)
public static String extractFilenameFromUri(android.net.Uri uri, android.app.Activity activity)
public static android.graphics.Bitmap resizeImageBitmap(android.content.Context context, android.graphics.Bitmap bm)
public static void copyStream(InputStream is, OutputStream os) throws IOException
IOException
public static android.graphics.Bitmap makeRadGrad(int width, int height)
Copyright © 2003–2016 eXo Platform SAS. All rights reserved.