admin
2021-03-27 214f9edd2fe20c20e32630e9b5380cc6271c1eb7
library-common/src/com/lcjian/library/util/glide/GlideRoundTransform.java
@@ -11,8 +11,10 @@
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
import com.bumptech.glide.util.Util;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
/**
@@ -72,11 +74,23 @@
    @Override
    public int hashCode() {
        return ID.hashCode();
        return Util.hashCode(ID.hashCode(),
                Util.hashCode(radius));
    }
    @Override
    public boolean equals(Object o) {
        if (o instanceof GlideRoundTransform) {
            GlideRoundTransform other = (GlideRoundTransform) o;
            return radius == other.radius;
        }
        return false;
    }
    @Override
    public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {
        messageDigest.update(ID_BYTES);
        byte[] radiusData = ByteBuffer.allocate(4).putInt((int) radius).array();
        messageDigest.update(radiusData);
    }
}