Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.koushikdutta.ion;
 
 import  android.graphics.Bitmap;
 
 
class TransformBitmap extends BitmapCallback implements FutureCallback<BitmapInfo> {
    static class PostProcessNullTransform implements Transform {
        String key;
        public PostProcessNullTransform(String key) {
            this. = key;
        }
        @Override
        public Bitmap transform(Bitmap b) {
            return b;
        }
        @Override
        public String key() {
            return ;
        }
    }
    public TransformBitmap(Ion ionString transformKeyString downloadKeyArrayList<TransformtransformsArrayList<PostProcesspostProcess) {
        super(iontransformKeytrue);
        this. = transforms;
        this. = downloadKey;
        this. = postProcess;
    }
    @Override
    public void onCompleted(Exception efinal BitmapInfo result) {
        if (e != null) {
            report(enull);
            return;
        }
        if (..tag() != this) {
//            Log.d("IonBitmapLoader", "Bitmap transform cancelled (no longer needed)");
            return;
        }
        Ion.getBitmapLoadExecutorService().execute(new Runnable() {
            @Override
            public void run() {
                if (..tag() != TransformBitmap.this) {
//            Log.d("IonBitmapLoader", "Bitmap transform cancelled (no longer needed)");
                    return;
                }
                BitmapInfo info;
                try {
                    Bitmap bitmap = result.bitmap;
                    for (Transform transform : ) {
                        bitmap = transform.transform(bitmap);
                        if (bitmap == null)
                            throw new Exception("failed to transform bitmap");
                    }
                    info = new BitmapInfo(result.mimeTypebitmapresult.originalSize);
                    info.servedFrom = result.servedFrom;
                    if ( != null) {
                        for (PostProcess p) {
                            p.postProcess(info);
                        }
                    }
                    report(nullinfo);
                }
                catch (OutOfMemoryError e) {
                    report(new Exception(e), null);
                }
                catch (Exception e) {
                    report(enull);
                }
            }
        });
    }
New to GrepCode? Check out our FAQ X