2018-05-23 17:03:41 +00:00
|
|
|
/**
|
2018-09-11 22:27:47 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2018-05-23 17:03:41 +00:00
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-07-15 23:46:33 +00:00
|
|
|
#include <fabric/components/activityindicator/primitives.h>
|
2018-05-23 17:03:41 +00:00
|
|
|
#include <folly/dynamic.h>
|
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
|
|
|
inline void fromDynamic(const folly::dynamic &value, ActivityIndicatorViewSize &result) {
|
|
|
|
auto string = value.asString();
|
|
|
|
if (string == "large") { result = ActivityIndicatorViewSize::Large; return; }
|
|
|
|
if (string == "small") { result = ActivityIndicatorViewSize::Small; return; }
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline std::string toString(const ActivityIndicatorViewSize &value) {
|
|
|
|
switch (value) {
|
|
|
|
case ActivityIndicatorViewSize::Large: return "large";
|
|
|
|
case ActivityIndicatorViewSize::Small: return "small";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace react
|
|
|
|
} // namespace facebook
|