mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-16 00:01:41 +08:00
Summary: This diff implements Modal for Android in Fabric Reviewed By: JoshuaGross Differential Revision: D15069863 fbshipit-source-id: 4171c9590a4a7a1f4f80cf9b08ea9a9e94b9097a
46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <react/core/StateData.h>
|
|
#include <react/graphics/Float.h>
|
|
#include <react/graphics/Geometry.h>
|
|
#include <react/graphics/conversions.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* State for <BottomSheetView> component.
|
|
*/
|
|
class ModalHostViewState : public StateData {
|
|
public:
|
|
using Shared = std::shared_ptr<const ModalHostViewState>;
|
|
|
|
ModalHostViewState(){};
|
|
ModalHostViewState(Size screenSize_) : screenSize(screenSize_){};
|
|
virtual ~ModalHostViewState() = default;
|
|
|
|
#ifdef ANDROID
|
|
ModalHostViewState(folly::dynamic data)
|
|
: screenSize(Size{(Float)data["screenWidth"].getDouble(),
|
|
(Float)data["screenHeight"].getDouble()}){};
|
|
#endif
|
|
|
|
const Size screenSize{};
|
|
|
|
#ifdef ANDROID
|
|
virtual const folly::dynamic getDynamic() const override;
|
|
#endif
|
|
|
|
#pragma mark - Getters
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|