-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showcase: Remove SimpleDraweeView reference for PartialRequestFragmen…
…t sample Reviewed By: defHLT, kartavya-ramnani Differential Revision: D63710287 fbshipit-source-id: 33037f79c5bc68aad38253b8b6da4de55b661613
- Loading branch information
1 parent
81b7d8d
commit 3868b25
Showing
3 changed files
with
58 additions
and
22 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
32 changes: 32 additions & 0 deletions
32
...src/main/java/com/facebook/fresco/samples/showcase/vito/source/ImageRequestImageSource.kt
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,32 @@ | ||
/* | ||
* 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.samples.showcase.vito.source | ||
|
||
import android.net.Uri | ||
import com.facebook.fresco.vito.core.ImagePipelineUtils | ||
import com.facebook.fresco.vito.core.impl.source.ImagePipelineImageSource | ||
import com.facebook.fresco.vito.options.ImageOptions | ||
import com.facebook.imagepipeline.request.ImageRequest | ||
import com.facebook.imagepipeline.request.ImageRequest.RequestLevel | ||
|
||
/** Custom ImageSource that takes an ImageRequest for the ImagePipeline */ | ||
data class ImageRequestImageSource(private val imageRequest: ImageRequest) : | ||
ImagePipelineImageSource { | ||
override fun maybeExtractFinalImageRequest( | ||
imagePipelineUtils: ImagePipelineUtils, | ||
imageOptions: ImageOptions | ||
): ImageRequest? { | ||
return imagePipelineUtils.wrapDecodedImageRequest(imageRequest, imageOptions) | ||
} | ||
|
||
override val imageUri: Uri = imageRequest.sourceUri | ||
|
||
override val extras: Map<String, Any> = emptyMap() | ||
|
||
override fun getRequestLevelForFetch(): RequestLevel = RequestLevel.FULL_FETCH | ||
} |
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