Skip to content

Commit

Permalink
//fbandroid/libraries/fresco/animated-base/src/main/java/com/facebook…
Browse files Browse the repository at this point in the history
…/fresco/animation/bitmap:bitmap

Reviewed By: ermattt

Differential Revision: D64037023

fbshipit-source-id: bd5ddedf36e7dd0ca22948aa26b9f8be5a054cde
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Oct 9, 2024
1 parent cc1dcc6 commit 93cfbe6
Show file tree
Hide file tree
Showing 8 changed files with 380 additions and 458 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.fresco.animation.bitmap.cache

import android.net.Uri
import com.facebook.cache.common.CacheKey

/* Frame cache key for animation */

class AnimationFrameCacheKey
@JvmOverloads
constructor(imageId: Int, private val deepEquals: Boolean = false) : CacheKey {

private val animationUriString: String = URI_PREFIX + imageId

override fun containsUri(uri: Uri): Boolean = uri.toString().startsWith(animationUriString)

override fun getUriString(): String = animationUriString

override fun isResourceIdForDebugging(): Boolean = false

override fun equals(o: Any?): Boolean {
if (!deepEquals) {
return super.equals(o)
}

if (this === o) {
return true
}
if (o == null || javaClass != o.javaClass) {
return false
}

val that = o as AnimationFrameCacheKey
return animationUriString == that.animationUriString
}

override fun hashCode(): Int {
if (!deepEquals) {
return super.hashCode()
}
return animationUriString.hashCode()
}

companion object {
private const val URI_PREFIX = "anim://"
}
}

This file was deleted.

Loading

0 comments on commit 93cfbe6

Please sign in to comment.