1
0
mirror of https://github.com/wasabeef/glide-transformations.git synced 2025-06-30 13:24:34 +08:00

fix leak code and constractor

This commit is contained in:
wasabeef 2015-11-27 17:11:58 +09:00
parent 71255edcd0
commit aef7541ea3
2 changed files with 16 additions and 3 deletions

View File

@ -47,8 +47,12 @@ public class MaskTransformation implements Transformation<Bitmap> {
* same make file name. If you have a good idea please tell us, thanks. * same make file name. If you have a good idea please tell us, thanks.
*/ */
public MaskTransformation(Context context, int maskId) { public MaskTransformation(Context context, int maskId) {
mBitmapPool = Glide.get(context).getBitmapPool(); this(context, Glide.get(context).getBitmapPool(), maskId);
mContext = context; }
public MaskTransformation(Context context, BitmapPool pool, int maskId) {
mBitmapPool = pool;
mContext = context.getApplicationContext();
mMaskId = maskId; mMaskId = maskId;
} }

View File

@ -49,9 +49,18 @@ public class RoundedCornersTransformation implements Transformation<Bitmap> {
this(context, radius, margin, CornerType.ALL); this(context, radius, margin, CornerType.ALL);
} }
public RoundedCornersTransformation(BitmapPool pool, int radius, int margin) {
this(pool, radius, margin, CornerType.ALL);
}
public RoundedCornersTransformation(Context context, int radius, int margin, public RoundedCornersTransformation(Context context, int radius, int margin,
CornerType cornerType) { CornerType cornerType) {
mBitmapPool = Glide.get(context).getBitmapPool(); this(Glide.get(context).getBitmapPool(), radius, margin, cornerType);
}
public RoundedCornersTransformation(BitmapPool pool, int radius, int margin,
CornerType cornerType) {
mBitmapPool = pool;
mRadius = radius; mRadius = radius;
mDiameter = mRadius * 2; mDiameter = mRadius * 2;
mMargin = margin; mMargin = margin;