Skip to content

Instantly share code, notes, and snippets.

@rndstr
Created May 9, 2016 09:40
Show Gist options
  • Save rndstr/e6768fa7a6da5eec9b1af07e63418b82 to your computer and use it in GitHub Desktop.
Save rndstr/e6768fa7a6da5eec9b1af07e63418b82 to your computer and use it in GitHub Desktop.
PreventIpViolationProcessor for UniversalImageLoader (Android)
package me.schilter.faactors.service;
import android.graphics.Bitmap;
import com.nostra13.universalimageloader.core.process.BitmapProcessor;
/**
* Replaces an image with a single color version. To create screnshots
* for the Google Play Store listing with images you don't own the IP for.
*
* <code>
* DisplayImageOptions options = new DisplayImageOptions.Builder()
* …
* .postProcessor(new PreventIpViolationProcessor())
* …
* </code>
*/
public class PreventIpViolationProcessor implements BitmapProcessor {
@Override
public Bitmap process(Bitmap bitmap) {
return Bitmap.createScaledBitmap(bitmap, 1, 1, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment