本文整理匯總了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);
}