Skip to content

Commit

Permalink
Implement Image in Fabric C++ Android
Browse files Browse the repository at this point in the history
Summary: This diff adds support for image views in Android

Reviewed By: shergin

Differential Revision: D9757712

fbshipit-source-id: 8d33e04c8ac4a670af6ca49bb3b9dccc69d52e40
  • Loading branch information
mdvacca authored and facebook-github-bot committed Sep 18, 2018
1 parent c97faa2 commit ade04d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ImageComponentDescriptor final:
public:
ImageComponentDescriptor(SharedEventDispatcher eventDispatcher, const SharedContextContainer &contextContainer):
ConcreteComponentDescriptor(eventDispatcher),
imageManager_(contextContainer->getInstance<SharedImageManager>()) {}
imageManager_(contextContainer ? contextContainer->getInstance<SharedImageManager>() : nullptr) {}

void adopt(UnsharedShadowNode shadowNode) const override {
ConcreteComponentDescriptor::adopt(shadowNode);
Expand Down
2 changes: 2 additions & 0 deletions ReactCommon/fabric/imagemanager/ImageRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class ImageRequest::ImageNoLongerNeededException:
std::logic_error("Image no longer needed.") {}
};

ImageRequest::ImageRequest() {}

ImageRequest::ImageRequest(const ImageSource &imageSource, folly::Future<ImageResponse> &&responseFuture):
imageSource_(imageSource),
responseFutureSplitter_(folly::splitFuture(std::move(responseFuture))) {}
Expand Down
2 changes: 2 additions & 0 deletions ReactCommon/fabric/imagemanager/ImageRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class ImageRequest final {
*/
ImageRequest(const ImageSource &imageSource, folly::Future<ImageResponse> &&responseFuture);

ImageRequest();

/*
* The move constructor.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ImageManager::~ImageManager() {

ImageRequest ImageManager::requestImage(const ImageSource &imageSource) const {
// Not implemented.
return {};
}

} // namespace react
Expand Down

0 comments on commit ade04d0

Please sign in to comment.