Generate OSS view manager interfaces and delegates

Summary: This diff checks in the OSS view manager interfaces and delegates generated by the JS codegen. This is a temporary workaround since we don't have the JS codegen running in open source.

Reviewed By: fkgozali

Differential Revision: D17104816

fbshipit-source-id: 848afc081785c9a78891d3dc0740ebe858eb8891
This commit is contained in:
Oleksandr Melnykov
2019-08-29 16:08:48 -07:00
committed by Facebook Github Bot
parent 9d5d2549e3
commit 3d3db71763
29 changed files with 947 additions and 0 deletions
@@ -0,0 +1,41 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class ActivityIndicatorViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ActivityIndicatorViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public ActivityIndicatorViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "hidesWhenStopped":
mViewManager.setHidesWhenStopped(view, value == null ? false : (boolean) value);
break;
case "animating":
mViewManager.setAnimating(view, value == null ? false : (boolean) value);
break;
case "color":
mViewManager.setColor(view, value == null ? null : ((Double) value).intValue());
break;
case "size":
mViewManager.setSize(view, (String) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,20 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
public interface ActivityIndicatorViewManagerInterface<T extends View> {
void setHidesWhenStopped(T view, boolean value);
void setAnimating(T view, boolean value);
void setColor(T view, @Nullable Integer value);
void setSize(T view, @Nullable String value);
}
@@ -0,0 +1,59 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class AndroidDrawerLayoutManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & AndroidDrawerLayoutManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public AndroidDrawerLayoutManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "keyboardDismissMode":
mViewManager.setKeyboardDismissMode(view, (String) value);
break;
case "drawerBackgroundColor":
mViewManager.setDrawerBackgroundColor(view, value == null ? null : ((Double) value).intValue());
break;
case "drawerPosition":
mViewManager.setDrawerPosition(view, (String) value);
break;
case "drawerWidth":
mViewManager.setDrawerWidth(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "drawerLockMode":
mViewManager.setDrawerLockMode(view, (String) value);
break;
case "statusBarBackgroundColor":
mViewManager.setStatusBarBackgroundColor(view, value == null ? null : ((Double) value).intValue());
break;
default:
super.setProperty(view, propName, value);
}
}
public void receiveCommand(AndroidDrawerLayoutManagerInterface<T> viewManager, T view, String commandName, ReadableArray args) {
switch (commandName) {
case "openDrawer":
viewManager.openDrawer(view);
break;
case "closeDrawer":
viewManager.closeDrawer(view);
break;
}
}
}
@@ -0,0 +1,24 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
public interface AndroidDrawerLayoutManagerInterface<T extends View> {
void setKeyboardDismissMode(T view, @Nullable String value);
void setDrawerBackgroundColor(T view, @Nullable Integer value);
void setDrawerPosition(T view, @Nullable String value);
void setDrawerWidth(T view, float value);
void setDrawerLockMode(T view, @Nullable String value);
void setStatusBarBackgroundColor(T view, @Nullable Integer value);
void openDrawer(T view);
void closeDrawer(T view);
}
@@ -0,0 +1,50 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class AndroidProgressBarManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & AndroidProgressBarManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public AndroidProgressBarManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "styleAttr":
mViewManager.setStyleAttr(view, value == null ? null : (String) value);
break;
case "typeAttr":
mViewManager.setTypeAttr(view, value == null ? null : (String) value);
break;
case "indeterminate":
mViewManager.setIndeterminate(view, value == null ? false : (boolean) value);
break;
case "progress":
mViewManager.setProgress(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "animating":
mViewManager.setAnimating(view, value == null ? true : (boolean) value);
break;
case "color":
mViewManager.setColor(view, value == null ? null : ((Double) value).intValue());
break;
case "testID":
mViewManager.setTestID(view, value == null ? "" : (String) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,23 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
public interface AndroidProgressBarManagerInterface<T extends View> {
void setStyleAttr(T view, @Nullable String value);
void setTypeAttr(T view, @Nullable String value);
void setIndeterminate(T view, boolean value);
void setProgress(T view, float value);
void setAnimating(T view, boolean value);
void setColor(T view, @Nullable Integer value);
void setTestID(T view, @Nullable String value);
}
@@ -0,0 +1,48 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class AndroidSwipeRefreshLayoutManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & AndroidSwipeRefreshLayoutManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public AndroidSwipeRefreshLayoutManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "enabled":
mViewManager.setEnabled(view, value == null ? false : (boolean) value);
break;
case "colors":
mViewManager.setColors(view, (ReadableArray) value);
break;
case "progressBackgroundColor":
mViewManager.setProgressBackgroundColor(view, value == null ? null : ((Double) value).intValue());
break;
case "size":
mViewManager.setSize(view, value == null ? 1 : ((Double) value).intValue());
break;
case "progressViewOffset":
mViewManager.setProgressViewOffset(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "refreshing":
mViewManager.setRefreshing(view, value == null ? false : (boolean) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,23 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
public interface AndroidSwipeRefreshLayoutManagerInterface<T extends View> {
void setEnabled(T view, boolean value);
void setColors(T view, @Nullable ReadableArray value);
void setProgressBackgroundColor(T view, @Nullable Integer value);
void setSize(T view, int value);
void setProgressViewOffset(T view, float value);
void setRefreshing(T view, boolean value);
}
@@ -0,0 +1,17 @@
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_target", "rn_android_library")
rn_android_library(
name = "viewmanagers",
srcs = glob(["*.java"]),
is_androidx = True,
provided_deps = [
react_native_dep("third-party/android/androidx:annotation"),
],
visibility = [
"PUBLIC",
],
deps = [
react_native_target("java/com/facebook/react/bridge:bridge"),
react_native_target("java/com/facebook/react/uimanager:uimanager"),
],
)
@@ -0,0 +1,51 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class ModalHostViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ModalHostViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public ModalHostViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "animationType":
mViewManager.setAnimationType(view, (String) value);
break;
case "presentationStyle":
mViewManager.setPresentationStyle(view, (String) value);
break;
case "transparent":
mViewManager.setTransparent(view, value == null ? false : (boolean) value);
break;
case "hardwareAccelerated":
mViewManager.setHardwareAccelerated(view, value == null ? false : (boolean) value);
break;
case "animated":
mViewManager.setAnimated(view, value == null ? false : (boolean) value);
break;
case "supportedOrientations":
mViewManager.setSupportedOrientations(view, (ReadableArray) value);
break;
case "identifier":
mViewManager.setIdentifier(view, value == null ? 0 : ((Double) value).intValue());
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,24 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
public interface ModalHostViewManagerInterface<T extends View> {
void setAnimationType(T view, @Nullable String value);
void setPresentationStyle(T view, @Nullable String value);
void setTransparent(T view, boolean value);
void setHardwareAccelerated(T view, boolean value);
void setAnimated(T view, boolean value);
void setSupportedOrientations(T view, @Nullable ReadableArray value);
void setIdentifier(T view, int value);
}
@@ -0,0 +1,41 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class PullToRefreshViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PullToRefreshViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public PullToRefreshViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "tintColor":
mViewManager.setTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "titleColor":
mViewManager.setTitleColor(view, value == null ? null : ((Double) value).intValue());
break;
case "title":
mViewManager.setTitle(view, value == null ? null : (String) value);
break;
case "refreshing":
mViewManager.setRefreshing(view, value == null ? false : (boolean) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,20 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
public interface PullToRefreshViewManagerInterface<T extends View> {
void setTintColor(T view, @Nullable Integer value);
void setTitleColor(T view, @Nullable Integer value);
void setTitle(T view, @Nullable String value);
void setRefreshing(T view, boolean value);
}
@@ -0,0 +1,32 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class RCTInputAccessoryViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTInputAccessoryViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public RCTInputAccessoryViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "backgroundColor":
mViewManager.setBackgroundColor(view, value == null ? null : ((Double) value).intValue());
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,17 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
public interface RCTInputAccessoryViewManagerInterface<T extends View> {
void setBackgroundColor(T view, @Nullable Integer value);
}
@@ -0,0 +1,26 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class RCTMaskedViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTMaskedViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public RCTMaskedViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
super.setProperty(view, propName, value);
}
}
@@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
public interface RCTMaskedViewManagerInterface<T extends View> {
// No props
}
@@ -0,0 +1,48 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class RCTProgressViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTProgressViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public RCTProgressViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "progressViewStyle":
mViewManager.setProgressViewStyle(view, (String) value);
break;
case "progress":
mViewManager.setProgress(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "progressTintColor":
mViewManager.setProgressTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "trackTintColor":
mViewManager.setTrackTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "progressImage":
mViewManager.setProgressImage(view, (ReadableMap) value);
break;
case "trackImage":
mViewManager.setTrackImage(view, (ReadableMap) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,23 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
public interface RCTProgressViewManagerInterface<T extends View> {
void setProgressViewStyle(T view, @Nullable String value);
void setProgress(T view, float value);
void setProgressTintColor(T view, @Nullable Integer value);
void setTrackTintColor(T view, @Nullable Integer value);
void setProgressImage(T view, @Nullable ReadableMap value);
void setTrackImage(T view, @Nullable ReadableMap value);
}
@@ -0,0 +1,32 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class RCTSafeAreaViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTSafeAreaViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public RCTSafeAreaViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "emulateUnlessSupported":
mViewManager.setEmulateUnlessSupported(view, value == null ? false : (boolean) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
public interface RCTSafeAreaViewManagerInterface<T extends View> {
void setEmulateUnlessSupported(T view, boolean value);
}
@@ -0,0 +1,45 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class RCTSegmentedControlManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RCTSegmentedControlManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public RCTSegmentedControlManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "values":
mViewManager.setValues(view, (ReadableArray) value);
break;
case "selectedIndex":
mViewManager.setSelectedIndex(view, value == null ? 0 : ((Double) value).intValue());
break;
case "enabled":
mViewManager.setEnabled(view, value == null ? true : (boolean) value);
break;
case "tintColor":
mViewManager.setTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "momentary":
mViewManager.setMomentary(view, value == null ? false : (boolean) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,22 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableArray;
public interface RCTSegmentedControlManagerInterface<T extends View> {
void setValues(T view, @Nullable ReadableArray value);
void setSelectedIndex(T view, int value);
void setEnabled(T view, boolean value);
void setTintColor(T view, @Nullable Integer value);
void setMomentary(T view, boolean value);
}
@@ -0,0 +1,72 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class SliderManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & SliderManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public SliderManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "disabled":
mViewManager.setDisabled(view, value == null ? false : (boolean) value);
break;
case "enabled":
mViewManager.setEnabled(view, value == null ? false : (boolean) value);
break;
case "maximumTrackImage":
mViewManager.setMaximumTrackImage(view, (ReadableMap) value);
break;
case "maximumTrackTintColor":
mViewManager.setMaximumTrackTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "maximumValue":
mViewManager.setMaximumValue(view, value == null ? 1f : ((Double) value).floatValue());
break;
case "minimumTrackImage":
mViewManager.setMinimumTrackImage(view, (ReadableMap) value);
break;
case "minimumTrackTintColor":
mViewManager.setMinimumTrackTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "minimumValue":
mViewManager.setMinimumValue(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "step":
mViewManager.setStep(view, value == null ? 0f : ((Double) value).floatValue());
break;
case "testID":
mViewManager.setTestID(view, value == null ? "" : (String) value);
break;
case "thumbImage":
mViewManager.setThumbImage(view, (ReadableMap) value);
break;
case "thumbTintColor":
mViewManager.setThumbTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "trackImage":
mViewManager.setTrackImage(view, (ReadableMap) value);
break;
case "value":
mViewManager.setValue(view, value == null ? 0f : ((Double) value).floatValue());
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,31 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.ReadableMap;
public interface SliderManagerInterface<T extends View> {
void setDisabled(T view, boolean value);
void setEnabled(T view, boolean value);
void setMaximumTrackImage(T view, @Nullable ReadableMap value);
void setMaximumTrackTintColor(T view, @Nullable Integer value);
void setMaximumValue(T view, float value);
void setMinimumTrackImage(T view, @Nullable ReadableMap value);
void setMinimumTrackTintColor(T view, @Nullable Integer value);
void setMinimumValue(T view, float value);
void setStep(T view, float value);
void setTestID(T view, @Nullable String value);
void setThumbImage(T view, @Nullable ReadableMap value);
void setThumbTintColor(T view, @Nullable Integer value);
void setTrackImage(T view, @Nullable ReadableMap value);
void setValue(T view, float value);
}
@@ -0,0 +1,53 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class SwitchManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & SwitchManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public SwitchManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "disabled":
mViewManager.setDisabled(view, value == null ? false : (boolean) value);
break;
case "value":
mViewManager.setValue(view, value == null ? false : (boolean) value);
break;
case "tintColor":
mViewManager.setTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "onTintColor":
mViewManager.setOnTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "thumbTintColor":
mViewManager.setThumbTintColor(view, value == null ? null : ((Double) value).intValue());
break;
case "thumbColor":
mViewManager.setThumbColor(view, value == null ? null : ((Double) value).intValue());
break;
case "trackColorForFalse":
mViewManager.setTrackColorForFalse(view, value == null ? null : ((Double) value).intValue());
break;
case "trackColorForTrue":
mViewManager.setTrackColorForTrue(view, value == null ? null : ((Double) value).intValue());
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,24 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
public interface SwitchManagerInterface<T extends View> {
void setDisabled(T view, boolean value);
void setValue(T view, boolean value);
void setTintColor(T view, @Nullable Integer value);
void setOnTintColor(T view, @Nullable Integer value);
void setThumbTintColor(T view, @Nullable Integer value);
void setThumbColor(T view, @Nullable Integer value);
void setTrackColorForFalse(T view, @Nullable Integer value);
void setTrackColorForTrue(T view, @Nullable Integer value);
}
@@ -0,0 +1,32 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaDelegate.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
import com.facebook.react.uimanager.BaseViewManager;
import com.facebook.react.uimanager.BaseViewManagerDelegate;
import com.facebook.react.uimanager.LayoutShadowNode;
public class UnimplementedNativeViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & UnimplementedNativeViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
public UnimplementedNativeViewManagerDelegate(U viewManager) {
super(viewManager);
}
@Override
public void setProperty(T view, String propName, @Nullable Object value) {
switch (propName) {
case "name":
mViewManager.setName(view, value == null ? "" : (String) value);
break;
default:
super.setProperty(view, propName, value);
}
}
}
@@ -0,0 +1,17 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by codegen project: GeneratePropsJavaInterface.js
*/
package com.facebook.react.viewmanagers;
import android.view.View;
import androidx.annotation.Nullable;
public interface UnimplementedNativeViewManagerInterface<T extends View> {
void setName(T view, @Nullable String value);
}