Image - maddog05/MaddogUtilities GitHub Wiki

ImageLoader

Interface to abstract image library implementation with Builder pattern. With this you can change your image library without change all your project.

ImageLoader with(Context context);

ImageLoader placeholder(@DrawableRes int resDrawable);

ImageLoader callback(Callback<Boolean> callback);

ImageLoader load(String path);

ImageLoader target(ImageView imageView);

void start();

Images

Generic class to manage capture image from camera or gallery

public static class InputPhoto {
     public String path;
     public Uri uri;
}

public static class OutputPhoto {
     public String path;
     public Bitmap bitmap;
}

public static InputPhoto getInputPhotoCamera(Context context, String fileProvider)

public static OutputPhoto getOutputPhotoGallery(Context context, Intent data)

public static OutputPhoto getOutputPhotoGalleryCompressed(Context context, Intent data, int maxDimensionPixels)

public static OutputPhoto getOutputPhotoCamera(Context context, Intent data, String photoPath)

public static OutputPhoto getOutputPhotoCameraCompressed(Context context, Intent data, String photoPath, int maxDimensionPixels)

`public static Bitmap getBitmapFromVectorDrawable(Context context, int drawableId)``

You need to override onPostExecute to recover encoded result

new Images.EncodeBitmapBase64AsyncTask(bitmap) {
                @Override
                protected void onPostExecute(String encoded64) {
                    //encodingComplete
                }
            }.execute();
⚠️ **GitHub.com Fallback** ⚠️