package com.alexstyl.specialdates.images;

import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.provider.ContactsContract;

import com.nostra13.universalimageloader.core.download.BaseImageDownloader;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class ImageDownloader extends BaseImageDownloader {

    public ImageDownloader(Context context) {
        super(context);
    }

    @Override
    public InputStream getStream(String imageUri, Object extra) throws IOException {
        // Collage example
        return super.getStream(imageUri, extra);
    }

    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    @Override
    protected InputStream getStreamFromContent(String imageUri, Object extra) throws FileNotFoundException {
        ContentResolver res = context.getContentResolver();
        Uri uri = Uri.parse(imageUri);

        if (imageUri.startsWith("content://com.android.contacts/")) {
            return ContactsContract.Contacts.openContactPhotoInputStream(res, uri, true);
        }

        return res.openInputStream(uri);

    }
}

@@ -40,45 +40,8 @@
 s;%0A%0A
-import android.annotation.TargetApi;%0A
 impo
@@ -136,33 +136,8 @@
 ri;%0A
-import android.os.Build;%0A
 impo
@@ -294,36 +294,8 @@
 on;%0A
-import java.io.IOException;%0A
 impo
@@ -319,23 +319,16 @@
 tream;%0A%0A
-public 
 class Im
@@ -376,23 +376,16 @@
  %7B%0A%0A    
-public 
 ImageDow
@@ -446,245 +446,8 @@
  %7D%0A%0A
-    @Override%0A    public InputStream getStream(String imageUri, Object extra) throws IOException %7B%0A        // Collage example%0A        return super.getStream(imageUri, extra);%0A    %7D%0A%0A    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)%0A
     

Remove unused keywords