mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
Adding @CountEnum to simple enums in xplat/js
Summary: Using The Count to transform enums to ints in production builds: https://our.intern.facebook.com/intern/wiki/Android-java-transforms/the-count/ Reviewed By: achen1 Differential Revision: D9614432 fbshipit-source-id: 1b1a197ad8f4962712d6006ab07b3beb3eaf2432
This commit is contained in:
committed by
Facebook Github Bot
parent
01d5eff425
commit
06bf7b1f00
@@ -35,6 +35,7 @@ rn_android_library(
|
||||
],
|
||||
deps = [
|
||||
YOGA_TARGET,
|
||||
react_native_dep("java/com/facebook/thecount:thecount"),
|
||||
react_native_dep("libraries/fresco/fresco-react-native:fbcore"),
|
||||
react_native_dep("libraries/fresco/fresco-react-native:fresco-drawee"),
|
||||
react_native_dep("libraries/fresco/fresco-react-native:fresco-react-native"),
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
package com.facebook.react.views.image;
|
||||
|
||||
import com.facebook.thecount.api.CountEnum;
|
||||
|
||||
@CountEnum
|
||||
public enum ImageResizeMethod {
|
||||
AUTO,
|
||||
RESIZE,
|
||||
|
||||
@@ -11,6 +11,7 @@ rn_android_library(
|
||||
],
|
||||
deps = [
|
||||
YOGA_TARGET,
|
||||
react_native_dep("java/com/facebook/thecount:thecount"),
|
||||
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
|
||||
react_native_dep("third-party/java/jsr-305:jsr-305"),
|
||||
react_native_target("java/com/facebook/react/bridge:bridge"),
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
|
||||
package com.facebook.react.views.scroll;
|
||||
|
||||
import com.facebook.thecount.api.CountEnum;
|
||||
|
||||
/**
|
||||
* Scroll event types that JS module RCTEventEmitter can understand
|
||||
*/
|
||||
@CountEnum
|
||||
public enum ScrollEventType {
|
||||
BEGIN_DRAG("topScrollBeginDrag"),
|
||||
END_DRAG("topScrollEndDrag"),
|
||||
|
||||
@@ -8,6 +8,7 @@ rn_android_library(
|
||||
],
|
||||
deps = [
|
||||
YOGA_TARGET,
|
||||
react_native_dep("java/com/facebook/thecount:thecount"),
|
||||
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
|
||||
react_native_dep("third-party/java/jsr-305:jsr-305"),
|
||||
react_native_target("java/com/facebook/react/bridge:bridge"),
|
||||
|
||||
@@ -27,11 +27,13 @@ import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.modules.i18nmanager.I18nUtil;
|
||||
import com.facebook.react.uimanager.FloatUtil;
|
||||
import com.facebook.react.uimanager.Spacing;
|
||||
import com.facebook.thecount.api.CountEnum;
|
||||
import com.facebook.yoga.YogaConstants;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
/**
|
||||
* A subclass of {@link Drawable} used for background of {@link ReactViewGroup}. It supports drawing
|
||||
* background color and borders (including rounded borders) by providing a react friendly API
|
||||
@@ -111,6 +113,7 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
||||
private final Context mContext;
|
||||
private int mLayoutDirection;
|
||||
|
||||
@CountEnum
|
||||
public enum BorderRadiusLocation {
|
||||
TOP_LEFT,
|
||||
TOP_RIGHT,
|
||||
|
||||
Reference in New Issue
Block a user