mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
9d5d2549e3
commit
3d3db71763
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user