本文整理汇总了Java中com.facebook.react.uimanager.BaseViewPropertyApplicator类的典型用法代码示例。如果您正苦于以下问题:Java BaseViewPropertyApplicator类的具体用法?Java BaseViewPropertyApplicator怎么用?Java BaseViewPropertyApplicator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseViewPropertyApplicator类属于com.facebook.react.uimanager包,在下文中一共展示了BaseViewPropertyApplicator类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateView
import com.facebook.react.uimanager.BaseViewPropertyApplicator; //导入依赖的package包/类
@Override
public void updateView(final CircleProgressView view,
final CatalystStylesDiffMap props) {
BaseViewPropertyApplicator.applyCommonViewProperties(view, props);
if (props.hasKey(PROP_SHOW_TEXT_WHILE_SPINNING)) {
view.setShowTextWhileSpinning(props.getBoolean(PROP_SHOW_TEXT_WHILE_SPINNING, false));
}
if (props.hasKey(PROP_AUTO_TEXT_SIZE)) {
view.setAutoTextSize(props.getBoolean(PROP_AUTO_TEXT_SIZE, false));
}
if (props.hasKey(PROP_AUTO_TEXT_COLOR)) {
view.setAutoTextColor(props.getBoolean(PROP_AUTO_TEXT_COLOR, false));
}
if (props.hasKey(PROP_SHOW_UNIT)) {
view.setShowUnit(props.getBoolean(PROP_SHOW_UNIT, true));
}
if (props.hasKey(PROP_TEXT_SIZE)) {
view.setTextSize(props.getInt(PROP_TEXT_SIZE, 10));
}
if (props.hasKey(PROP_UNIT_SIZE)) {
view.setUnitSize(props.getInt(PROP_UNIT_SIZE, 10));
}
if (props.hasKey(PROP_CONTOUR_SIZE)) {
view.setContourSize(props.getFloat(PROP_CONTOUR_SIZE, 1));
}
if (props.hasKey(PROP_BAR_WIDTH)) {
view.setBarWidth(props.getInt(PROP_BAR_WIDTH, 1));
}
if (props.hasKey(PROP_RIM_WIDTH)) {
view.setRimWidth(props.getInt(PROP_RIM_WIDTH, 1));
}
if (props.hasKey(PROP_MAX_VALUE)) {
view.setMaxValue(props.getInt(PROP_MAX_VALUE, 100));
}
if (props.hasKey(PROP_VALUE)) {
view.setValue(props.getInt(PROP_VALUE, 0));
}
if (props.hasKey(PROP_VALUE_ANIMATED)) {
view.setValueAnimated(props.getInt(PROP_VALUE_ANIMATED, 42));
}
if (props.hasKey(PROP_СONTOUR_COLOR)) {
view.setContourColor(Color.parseColor(props.getString(PROP_СONTOUR_COLOR)));
}
if (props.hasKey(PROP_RIM_COLOR)) {
view.setRimColor(Color.parseColor(props.getString(PROP_RIM_COLOR)));
}
if (props.hasKey(PROP_BAR_COLOR)) {
int size = props.getArray(PROP_BAR_COLOR).size();
int[] colors = new int[size];
for (int i = 0; i < size; i++) {
colors[i] = Color.parseColor(props.getArray(PROP_BAR_COLOR).getString(i));
}
view.setBarColor(colors);
}
Log.i("CircleProgressView", "updateview finish");
super.updateView(view, props);
}