Skip to content

Commit

Permalink
migrating added
Browse files Browse the repository at this point in the history
  • Loading branch information
amitshekhariitbhu committed Jun 21, 2016
1 parent 0540c04 commit 1805e05
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,29 @@ GlideBitmapPool.trimMemory(level);

### Migrating to Glide Bitmap Pool
```java
// ------ decoding -------
// old code
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.test1);
// new code
Bitmap bitmap = GlideBitmapFactory.decodeResource(getResources(), R.drawable.test1);
// ------ recycling -------
// old code
bitmap.recycle();
// new code
GlideBitmapPool.putBitmap(bitmap);
// ------ creating a bitmap -------
// old code
Bitmap bitmap = Bitmap.create(width, height, config);
// new code
Bitmap bitmap = GlideBitmapPool.getBitmap(width, height, config);
// ------ decoding -------

// old code
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.test1);

// new code
Bitmap bitmap = GlideBitmapFactory.decodeResource(getResources(), R.drawable.test1);

// ------ recycling -------

// old code
bitmap.recycle();

// new code
GlideBitmapPool.putBitmap(bitmap);

// ------ creating a bitmap -------

// old code
Bitmap bitmap = Bitmap.create(width, height, config);

// new code
Bitmap bitmap = GlideBitmapPool.getBitmap(width, height, config);
```

### Important
Expand Down

0 comments on commit 1805e05

Please sign in to comment.