| | |
| | | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | |
| | | @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); |
| | | } |
| | | } |