-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add isAlternateCacheKey to a new ExperimentalRequestListener interface.
PiperOrigin-RevId: 319301011
- Loading branch information
1 parent
85868bd
commit d84034d
Showing
10 changed files
with
195 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
library/src/main/java/com/bumptech/glide/request/ExperimentalRequestListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.bumptech.glide.request; | ||
|
||
import com.bumptech.glide.load.DataSource; | ||
import com.bumptech.glide.request.target.Target; | ||
|
||
/** | ||
* An extension of {@link RequestListener} with additional parameters. | ||
* | ||
* <p>All equivalent methods are called at the relevant time by Glide. Implementations therefore | ||
* should only implement one version of each method. | ||
* | ||
* @param <ResourceT> The type of resource that will be loaded for the request. | ||
* @deprecated Not ready for public consumption, avoid using this class. It may be removed at any | ||
* time. | ||
*/ | ||
@Deprecated | ||
public abstract class ExperimentalRequestListener<ResourceT> implements RequestListener<ResourceT> { | ||
|
||
/** | ||
* Identical to {@link #onResourceReady(Object, Object, Target, DataSource, boolean)} except that | ||
* {@code isAlternateCacheKey} is provided. | ||
* | ||
* @param isAlternateCacheKey True if the data was obtained from the disk cache using an alternate | ||
* cache key provided by a {@link com.bumptech.glide.load.model.ModelLoader} via {@link | ||
* com.bumptech.glide.load.model.ModelLoader.LoadData#alternateKeys}. Valid only if {@code | ||
* dataSource} is {@link DataSource#DATA_DISK_CACHE} or {@link | ||
* DataSource#RESOURCE_DISK_CACHE}. | ||
*/ | ||
public abstract boolean onResourceReady( | ||
ResourceT resource, | ||
Object model, | ||
Target<ResourceT> target, | ||
DataSource dataSource, | ||
boolean isFirstResource, | ||
boolean isAlternateCacheKey); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.