2018-05-23 10:03:41 -07:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2018-05-23 10:03:41 -07: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
|
|
|
|
|
|
|
|
#include <folly/dynamic.h>
|
2018-11-10 14:19:08 -08:00
|
|
|
#include <react/components/activityindicator/primitives.h>
|
2018-05-23 10:03:41 -07:00
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace react {
|
|
|
|
|
2018-10-05 11:01:08 -07:00
|
|
|
inline void fromDynamic(
|
|
|
|
const folly::dynamic &value,
|
|
|
|
ActivityIndicatorViewSize &result) {
|
2018-05-23 10:03:41 -07:00
|
|
|
auto string = value.asString();
|
2018-10-05 11:01:08 -07:00
|
|
|
if (string == "large") {
|
|
|
|
result = ActivityIndicatorViewSize::Large;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (string == "small") {
|
|
|
|
result = ActivityIndicatorViewSize::Small;
|
|
|
|
return;
|
|
|
|
}
|
2018-05-23 10:03:41 -07:00
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
inline std::string toString(const ActivityIndicatorViewSize &value) {
|
|
|
|
switch (value) {
|
2018-10-05 11:01:08 -07:00
|
|
|
case ActivityIndicatorViewSize::Large:
|
|
|
|
return "large";
|
|
|
|
case ActivityIndicatorViewSize::Small:
|
|
|
|
return "small";
|
2018-05-23 10:03:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace react
|
|
|
|
} // namespace facebook
|