Exemple #1
0
 @Override
 public void available(RenderingRequest request) {
   clearBitmap();
   mImage = request.getBitmap();
   /// M: [BUG.ADD] @{
   if (mIsAddVersionOperation && mImage != null) {
     mHasFinishAppliedFilterOperation = true;
   }
   /// @}
   if (mImage == null) {
     mImageFrame = null;
     return;
   }
   if (mRepresentation.getOverlayId() != 0 && mOverlayBitmap == null) {
     mOverlayBitmap =
         BitmapFactory.decodeResource(mContext.getResources(), mRepresentation.getOverlayId());
   }
   if (mOverlayBitmap != null) {
     if (getRepresentation().getFilterType() == FilterRepresentation.TYPE_BORDER) {
       Canvas canvas = new Canvas(mImage);
       canvas.drawBitmap(
           mOverlayBitmap,
           new Rect(0, 0, mOverlayBitmap.getWidth(), mOverlayBitmap.getHeight()),
           new Rect(0, 0, mImage.getWidth(), mImage.getHeight()),
           new Paint());
     } else {
       Canvas canvas = new Canvas(mImage);
       canvas.drawARGB(128, 0, 0, 0);
       drawCenteredImage(mOverlayBitmap, mImage, false);
     }
   }
   if (mAdapter != null) {
     mAdapter.notifyDataSetChanged();
   }
 }
Exemple #2
0
 private void postNewIconRenderRequest(int w, int h) {
   if (mRepresentation != null) {
     ImagePreset preset = new ImagePreset();
     preset.addFilter(mRepresentation);
     RenderingRequest.postIconRequest(mContext, w, h, preset, this);
   }
 }