Migrate RCTAxialGradientView to JS codegen

Summary:
This diff migrates `RCTAxialGradientView` to use generated `RCTAxialGradientViewManagerDelegate` for setting its props. The following base properties have been added to `BaseViewManager`:

```
  protected void setBorderRadius(T view, float borderRadius) {}

  protected void setBorderBottomLeftRadius(T view, float borderRadius) {}

  protected void setBorderBottomRightRadius(T view, float borderRadius) {}

  protected void setBorderTopLeftRadius(T view, float borderRadius) {}

  protected void setBorderTopRightRadius(T view, float borderRadius) {}
```

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D16784173

fbshipit-source-id: f3971985efee2b6e0a5fb248b89c4809305e670c
This commit is contained in:
Oleksandr Melnykov
2019-08-14 04:40:23 -07:00
committed by Facebook Github Bot
parent 71d7d6883c
commit a5aaca7d4f
5 changed files with 60 additions and 15 deletions
@@ -4,6 +4,7 @@ import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.yoga.YogaConstants;
/**
* This is a base implementation of {@link ViewManagerDelegate} which supports setting properties
@@ -45,6 +46,26 @@ public abstract class BaseViewManagerDelegate<
case ViewProps.BACKGROUND_COLOR:
mViewManager.setBackgroundColor(view, value == null ? 0 : ((Double) value).intValue());
break;
case ViewProps.BORDER_RADIUS:
mViewManager.setBorderRadius(
view, value == null ? YogaConstants.UNDEFINED : ((Double) value).floatValue());
break;
case ViewProps.BORDER_BOTTOM_LEFT_RADIUS:
mViewManager.setBorderBottomLeftRadius(
view, value == null ? YogaConstants.UNDEFINED : ((Double) value).floatValue());
break;
case ViewProps.BORDER_BOTTOM_RIGHT_RADIUS:
mViewManager.setBorderBottomRightRadius(
view, value == null ? YogaConstants.UNDEFINED : ((Double) value).floatValue());
break;
case ViewProps.BORDER_TOP_LEFT_RADIUS:
mViewManager.setBorderTopLeftRadius(
view, value == null ? YogaConstants.UNDEFINED : ((Double) value).floatValue());
break;
case ViewProps.BORDER_TOP_RIGHT_RADIUS:
mViewManager.setBorderTopRightRadius(
view, value == null ? YogaConstants.UNDEFINED : ((Double) value).floatValue());
break;
case ViewProps.ELEVATION:
mViewManager.setElevation(view, value == null ? 0.0f : ((Double) value).floatValue());
break;