-
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.
Added DataSourceImageSource and migrate Showcase sample to Vito
Summary: This adds a new `DataSourceImageSource that is specific to the Fresco ImagePipeline (due to DataSource, CloseableImage etc.), hence in the module that also has `ImagePipelineImageSource` that is similarly specific. This allows folks to use any data source supplier as an image source, such as the `RetainingDataSourceSupplier` Reviewed By: kartavya-ramnani Differential Revision: D68023529 fbshipit-source-id: d60f66b96953c3102b593eeb6772283b14e03ac6
- Loading branch information
1 parent
4035ab4
commit b7daf22
Showing
7 changed files
with
45 additions
and
34 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
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
19 changes: 19 additions & 0 deletions
19
...ava-impl/src/main/java/com/facebook/fresco/vito/core/impl/source/DataSourceImageSource.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,19 @@ | ||
/* | ||
* 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.vito.core.impl.source | ||
|
||
import com.facebook.common.internal.Supplier | ||
import com.facebook.common.references.CloseableReference | ||
import com.facebook.datasource.DataSource | ||
import com.facebook.fresco.vito.source.ImageSource | ||
import com.facebook.imagepipeline.image.CloseableImage | ||
|
||
/** ImageSource that directly supplies a DataSource */ | ||
class DataSourceImageSource( | ||
val dataSourceSupplier: Supplier<DataSource<CloseableReference<CloseableImage>>> | ||
) : ImageSource |