// Path: library/src/main/java/co/jasonwyatt/srml/SRMLImageLoader.java
// public interface SRMLImageLoader {
//     /**
//      * Load the image at the given url and return it as a Bitmap.
//      * @param context The current context.
//      * @param url The image's url.
//      * @return A bitmap of the image.
//      */
//     Bitmap loadImage(Context context, String url);
// 
//     /**
//      * Load the image at the given url and return it as a Bitmap in the provided size..
//      * @param context The current context.
//      * @param url The image's url.
//      * @param width Requested width of the image.
//      * @param height Requested height of the image.
//      * @return A bitmap.
//      */
//     Bitmap loadImage(Context context, String url, int width, int height);
// }
// 
// Path: library/src/main/java/co/jasonwyatt/srml/tags/BadParameterException.java
// public class BadParameterException extends RuntimeException {
//     public BadParameterException(String message) {
//         super(message);
//     }
// 
//     public BadParameterException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.util.DisplayMetrics;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import co.jasonwyatt.srml.SRMLImageLoader;
import co.jasonwyatt.srml.tags.BadParameterException;
     * @param height Requested height of the image.
     * @return The loaded image, or null if no {@link SRMLImageLoader} is associated via
     *      {@link #setImageLoader(SRMLImageLoader)}
     */
    public static Bitmap loadImage(Context context, String url, int width, int height) {
        if (sImageLoader == null) {
            throw new IllegalStateException("No SRMLImageLoader specified, please pass one to SRML.setImageLoader().");
        }

        if (width >= 0 && height >= 0) {
            return sImageLoader.loadImage(context, url, width, height);
        }
        return sImageLoader.loadImage(context, url);
    }

    /**
     * Transform the provided size string into a pixel size.<br/>
     * Supported formats:
     * <ul>
     *   <li>"32dp"</li>
     *   <li>"32sp"</li>
     *   <li>"32px"</li>
     *   <li>"32" (interpreted as pixels)</li>
     * </ul>
     * @param context The current context.
     * @param size String representation of the size.
     * @return The resolved size.
     */
    public static int getPixelSize(Context context, String size) {
        if (size == null) {
// Path: library/src/main/java/co/jasonwyatt/srml/SRMLImageLoader.java
// public interface SRMLImageLoader {
//     /**
//      * Load the image at the given url and return it as a Bitmap.
//      * @param context The current context.
//      * @param url The image's url.
//      * @return A bitmap of the image.
//      */
//     Bitmap loadImage(Context context, String url);
// 
//     /**
//      * Load the image at the given url and return it as a Bitmap in the provided size..
//      * @param context The current context.
//      * @param url The image's url.
//      * @param width Requested width of the image.
//      * @param height Requested height of the image.
//      * @return A bitmap.
//      */
//     Bitmap loadImage(Context context, String url, int width, int height);
// }
// 
// Path: library/src/main/java/co/jasonwyatt/srml/tags/BadParameterException.java
// public class BadParameterException extends RuntimeException {
//     public BadParameterException(String message) {
//         super(message);
//     }
// 
//     public BadParameterException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }


// Path: library/src/main/java/co/jasonwyatt/srml/utils/Utils.java
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.util.DisplayMetrics;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import co.jasonwyatt.srml.SRMLImageLoader;
import co.jasonwyatt.srml.tags.BadParameterException;

     * @param height Requested height of the image.
     * @return The loaded image, or null if no {@link SRMLImageLoader} is associated via
     *      {@link #setImageLoader(SRMLImageLoader)}
     */
    public static Bitmap loadImage(Context context, String url, int width, int height) {
        if (sImageLoader == null) {
            throw new IllegalStateException("No SRMLImageLoader specified, please pass one to SRML.setImageLoader().");
        }

        if (width >= 0 && height >= 0) {
            return sImageLoader.loadImage(context, url, width, height);
        }
        return sImageLoader.loadImage(context, url);
    }

    /**
     * Transform the provided size string into a pixel size.<br/>
     * Supported formats:
     * <ul>
     *   <li>"32dp"</li>
     *   <li>"32sp"</li>
     *   <li>"32px"</li>
     *   <li>"32" (interpreted as pixels)</li>
     * </ul>
     * @param context The current context.
     * @param size String representation of the size.
     * @return The resolved size.
     */
    public static int getPixelSize(Context context, String size) {
        if (size == null) {
            return -1;