.. java:import:: android.app Activity .. java:import:: android.content Context .. java:import:: android.graphics Bitmap .. java:import:: android.graphics BitmapFactory .. java:import:: android.graphics Matrix .. java:import:: android.net Uri .. java:import:: android.os AsyncTask .. java:import:: android.util Base64 .. java:import:: android.widget ImageView .. java:import:: com.bumptech.glide Glide .. java:import:: com.google.common.io ByteStreams .. java:import:: org.springframework.http.converter StringHttpMessageConverter .. java:import:: org.springframework.web.client HttpClientErrorException .. java:import:: org.springframework.web.client HttpServerErrorException .. java:import:: org.springframework.web.client ResourceAccessException .. java:import:: org.springframework.web.client RestTemplate .. java:import:: java.io File .. java:import:: java.io FileInputStream .. java:import:: java.io FileNotFoundException .. java:import:: java.io FileOutputStream .. java:import:: java.io IOException .. java:import:: java.util HashMap .. java:import:: java.util Locale .. java:import:: java.util.concurrent CountDownLatch ImageResourcesHandler ===================== .. java:package:: ar.uba.fi.drtinder :noindex: .. java:type:: public final class ImageResourcesHandler Resource Handler that manages requests and cache of image resources Fields ------ RES_INTEREST_IMG ^^^^^^^^^^^^^^^^ .. java:field:: public static final int RES_INTEREST_IMG :outertype: ImageResourcesHandler Interest image resource type RES_USER_IMG ^^^^^^^^^^^^ .. java:field:: public static final int RES_USER_IMG :outertype: ImageResourcesHandler User image resource type Methods ------- clearCache ^^^^^^^^^^ .. java:method:: public static void clearCache(Context context) :outertype: ImageResourcesHandler Clears all the cached files :param context: Context of the calling activity fillImageResource ^^^^^^^^^^^^^^^^^ .. java:method:: public static void fillImageResource(String imageId, int resourceType, String token, ImageView imgView, Context context) :outertype: ImageResourcesHandler Fills the parameter image view with the server image resourve :param imageId: Image id :param resourceType: Type of the resource (one of the listed RES_* constants) :param token: Session token :param imgView: Imageview to fill with the resource :param context: Context of the calling activity freeCachedResource ^^^^^^^^^^^^^^^^^^ .. java:method:: public static void freeCachedResource(String imageId, int resourceType, Context context) :outertype: ImageResourcesHandler Removes from cache an specific resource (Helpful when a certain resource is never going to be used again for sure) :param imageId: Image id :param resourceType: Type of the resource (one of the listed RES_* constants) :param context: Context of the calling activity prefetch ^^^^^^^^ .. java:method:: public static void prefetch(String imageId, int resourceType, String token, Context context) :outertype: ImageResourcesHandler Prefetch resources from server (if needed) in order to improve network resources use. :param imageId: Server id of the fetching resource :param resourceType: Type of the resource (One of listed const types) :param context: Context of the calling activity :param token: User token needed by the server to auth client