mirror of
https://github.com/wasabeef/glide-transformations.git
synced 2025-06-30 05:12:45 +08:00
format
This commit is contained in:
parent
f1246ff9ee
commit
f2f1229c8d
@ -43,8 +43,8 @@ public class MaskTransformation implements Transformation<Bitmap> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param maskId If you change the mask file, please also rename the mask file, or Glide will get
|
* @param maskId If you change the mask file, please also rename the mask file, or Glide will get
|
||||||
* the cache with the old mask. Because getId() return the same values if using the
|
* the cache with the old mask. Because getId() return the same values if using the
|
||||||
* 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();
|
mBitmapPool = Glide.get(context).getBitmapPool();
|
||||||
@ -55,6 +55,7 @@ public class MaskTransformation implements Transformation<Bitmap> {
|
|||||||
@Override
|
@Override
|
||||||
public Resource<Bitmap> transform(Resource<Bitmap> resource, int outWidth, int outHeight) {
|
public Resource<Bitmap> transform(Resource<Bitmap> resource, int outWidth, int outHeight) {
|
||||||
Bitmap source = resource.get();
|
Bitmap source = resource.get();
|
||||||
|
|
||||||
int width = source.getWidth();
|
int width = source.getWidth();
|
||||||
int height = source.getHeight();
|
int height = source.getHeight();
|
||||||
|
|
||||||
@ -73,9 +74,8 @@ public class MaskTransformation implements Transformation<Bitmap> {
|
|||||||
return BitmapResource.obtain(result, mBitmapPool);
|
return BitmapResource.obtain(result, mBitmapPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override public String getId() {
|
||||||
public String getId() {
|
return "MaskTransformation(maskId=" + mContext.getResources().getResourceEntryName(mMaskId)
|
||||||
return "MaskTransformation(maskId="
|
+ ")";
|
||||||
+ mContext.getResources().getResourceEntryName(mMaskId) + ")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user