mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8643b5560e
Summary: $title Now that the codegen handles the new PlatformColors, regenerating the checked in native component files. Changelog: [Internal] (Note: this ignores all push blocking failures!) Reviewed By: mdvacca Differential Revision: D20175914 fbshipit-source-id: fa7b8e5139dcfe06f49582d7810fae12e1e1fb4b
53 lines
1.9 KiB
Java
53 lines
1.9 KiB
Java
/**
|
|
* 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.ColorPropConverter;
|
|
import com.facebook.react.bridge.ReadableArray;
|
|
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
|
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
|
|
public class SegmentedControlManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & SegmentedControlManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
public SegmentedControlManagerDelegate(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, ColorPropConverter.getColor(value, view.getContext()));
|
|
break;
|
|
case "textColor":
|
|
mViewManager.setTextColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
break;
|
|
case "backgroundColor":
|
|
mViewManager.setBackgroundColor(view, ColorPropConverter.getColor(value, view.getContext()));
|
|
break;
|
|
case "momentary":
|
|
mViewManager.setMomentary(view, value == null ? false : (boolean) value);
|
|
break;
|
|
default:
|
|
super.setProperty(view, propName, value);
|
|
}
|
|
}
|
|
}
|