From a38f32a5a6880a5429d1c57dd530b8ad9f0dc79e Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 10 Apr 2018 12:45:43 -0700 Subject: [PATCH] Fabric: Couple of ViewProps fields were exposed as getters Summary: We have to have getters for all props/fields. Reviewed By: mdvacca Differential Revision: D7467792 fbshipit-source-id: 1492aad2d3398e6c14e0e354047730cf91201175 --- ReactCommon/fabric/view/ViewProps.cpp | 12 ++++++++++++ ReactCommon/fabric/view/ViewProps.h | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/ReactCommon/fabric/view/ViewProps.cpp b/ReactCommon/fabric/view/ViewProps.cpp index e3f9f6fdd..725c2014b 100644 --- a/ReactCommon/fabric/view/ViewProps.cpp +++ b/ReactCommon/fabric/view/ViewProps.cpp @@ -45,6 +45,18 @@ void ViewProps::apply(const RawProps &rawProps) { } } +#pragma mark - Getters + +SharedColor ViewProps::getForegroundColor() const { + return foregroundColor_; +} + +SharedColor ViewProps::getBackgroundColor() const { + return backgroundColor_; +} + +#pragma mark - DebugStringConvertible + SharedDebugStringConvertibleList ViewProps::getDebugProps() const { ViewProps defaultProps = {}; diff --git a/ReactCommon/fabric/view/ViewProps.h b/ReactCommon/fabric/view/ViewProps.h index 89b20dec7..365d469f7 100644 --- a/ReactCommon/fabric/view/ViewProps.h +++ b/ReactCommon/fabric/view/ViewProps.h @@ -28,6 +28,11 @@ class ViewProps: public: void apply(const RawProps &rawProps) override; +#pragma mark - Getters + + SharedColor getForegroundColor() const; + SharedColor getBackgroundColor() const; + private: int zIndex_ {0}; float opacity_ {1.0};