本文整理匯總了Java中com.facebook.react.uimanager.annotations.ReactProp類的典型用法代碼示例。如果您正苦於以下問題:Java ReactProp類的具體用法?Java ReactProp怎麽用?Java ReactProp使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ReactProp類屬於com.facebook.react.uimanager.annotations包,在下文中一共展示了ReactProp類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setMaxHeight
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = ViewProps.MAX_HEIGHT)
public void setMaxHeight(Dynamic maxHeight) {
if (isVirtual()) {
return;
}
mTempYogaValue.setFromDynamic(maxHeight);
switch (mTempYogaValue.unit) {
case POINT:
case UNDEFINED:
setStyleMaxHeight(mTempYogaValue.value);
break;
case PERCENT:
setStyleMaxHeightPercent(mTempYogaValue.value);
break;
}
maxHeight.recycle();
}
示例2: setKeyboardType
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "keyboardType")
public void setKeyboardType(ReactEditText view, @Nullable String keyboardType) {
int flagsToSet = InputType.TYPE_CLASS_TEXT;
if (KEYBOARD_TYPE_NUMERIC.equalsIgnoreCase(keyboardType)) {
flagsToSet = INPUT_TYPE_KEYBOARD_NUMBERED;
} else if (KEYBOARD_TYPE_EMAIL_ADDRESS.equalsIgnoreCase(keyboardType)) {
flagsToSet = InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS | InputType.TYPE_CLASS_TEXT;
} else if (KEYBOARD_TYPE_PHONE_PAD.equalsIgnoreCase(keyboardType)) {
flagsToSet = InputType.TYPE_CLASS_PHONE;
}
updateStagedInputTypeFlag(
view,
INPUT_TYPE_KEYBOARD_NUMBERED | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS |
InputType.TYPE_CLASS_TEXT,
flagsToSet);
checkPasswordType(view);
}
示例3: setProfile
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "profile")
public void setProfile(AspectFrameLayout view, @Nullable ReadableMap profile) {
ReadableMap video = profile.getMap("video");
ReadableMap audio = profile.getMap("audio");
int encodingSize = profile.getInt("encodingSize");
StreamingProfile.AudioProfile aProfile =
new StreamingProfile.AudioProfile(audio.getInt("rate"), audio.getInt("bitrate")); //audio sample rate, audio bitrate
StreamingProfile.VideoProfile vProfile =
new StreamingProfile.VideoProfile(video.getInt("fps"), video.getInt("bps"), video.getInt("maxFrameInterval"));//fps bps maxFrameInterval
StreamingProfile.AVProfile avProfile = new StreamingProfile.AVProfile(vProfile, aProfile);
mProfile.setAVProfile(avProfile);
mProfile.setEncodingSizeLevel(encodingSize);
mMediaStreamingManager.setStreamingProfile(mProfile);
}
示例4: setTextShadowOffset
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = PROP_SHADOW_OFFSET)
public void setTextShadowOffset(@Nullable ReadableMap offsetMap) {
float dx = 0;
float dy = 0;
if (offsetMap != null) {
if (offsetMap.hasKey("width")) {
dx = PixelUtil.toPixelFromDIP(offsetMap.getDouble("width"));
}
if (offsetMap.hasKey("height")) {
dy = PixelUtil.toPixelFromDIP(offsetMap.getDouble("height"));
}
}
if (!mShadowStyleSpan.offsetMatches(dx, dy)) {
getShadowSpan().setOffset(dx, dy);
notifyChanged(false);
}
}
示例5: setMinHeight
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = ViewProps.MIN_HEIGHT)
public void setMinHeight(Dynamic minHeight) {
if (isVirtual()) {
return;
}
mTempYogaValue.setFromDynamic(minHeight);
switch (mTempYogaValue.unit) {
case POINT:
case UNDEFINED:
setStyleMinHeight(mTempYogaValue.value);
break;
case PERCENT:
setStyleMinHeightPercent(mTempYogaValue.value);
break;
}
minHeight.recycle();
}
示例6: setFontWeight
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = ViewProps.FONT_WEIGHT)
public void setFontWeight(@Nullable String fontWeightString) {
final int fontWeight;
if (fontWeightString == null) {
fontWeight = -1;
} else if (BOLD.equals(fontWeightString)) {
fontWeight = Typeface.BOLD;
} else if (NORMAL.equals(fontWeightString)) {
fontWeight = Typeface.NORMAL;
} else {
int fontWeightNumeric = parseNumericFontWeight(fontWeightString);
if (fontWeightNumeric == -1) {
throw new RuntimeException("invalid font weight " + fontWeightString);
}
fontWeight = fontWeightNumeric >= 500 ? Typeface.BOLD : Typeface.NORMAL;
}
if (mFontStylingSpan.getFontWeight() != fontWeight) {
getSpan().setFontWeight(fontWeight);
notifyChanged(true);
}
}
示例7: setBarCodeTypes
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "barCodeTypes")
public void setBarCodeTypes(RCTCameraView view, ReadableArray barCodeTypes) {
if (barCodeTypes == null) {
return;
}
List<String> result = new ArrayList<String>(barCodeTypes.size());
for (int i = 0; i < barCodeTypes.size(); i++) {
result.add(barCodeTypes.getString(i));
}
view.setBarCodeTypes(result);
}
示例8: testUnsupportedPropValueType
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@Test(expected = RuntimeException.class)
public void testUnsupportedPropValueType() {
new BaseViewManager() {
@ReactProp(name = "prop")
public void setterWithUnsupportedValueType(View v, Date value) {
}
}.getNativeProps();
}
示例9: setClipping
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "clipping")
public void setClipping(@Nullable ReadableArray clippingDims) {
float[] clippingData = PropHelper.toFloatArray(clippingDims);
if (clippingData != null) {
mClipping = createClipping(clippingData);
markUpdated();
}
}
示例10: setTransform
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = PROP_TRANSFORM)
public void setTransform(T view, ReadableArray matrix) {
if (matrix == null) {
resetTransformProperty(view);
} else {
setTransformProperty(view, matrix);
}
}
示例11: setZoom
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "zoom")
public void setZoom(AspectFrameLayout view, int zoom) {
mCurrentZoom = zoom;
mCurrentZoom = Math.min(mCurrentZoom, mMaxZoom);
mCurrentZoom = Math.max(0, mCurrentZoom);
mMediaStreamingManager.setZoomValue(zoom);
}
示例12: setSource
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "source")
public void setSource(final CrosswalkWebView view, @Nullable ReadableMap source) {
Activity _activity = reactContext.getCurrentActivity();
if (_activity != null) {
if (source != null) {
if (source.hasKey("html")) {
final String html = source.getString("html");
_activity.runOnUiThread(new Runnable() {
@Override
public void run () {
view.load(null, html);
}
});
return;
}
if (source.hasKey("uri")) {
final String url = source.getString("uri");
_activity.runOnUiThread(new Runnable() {
@Override
public void run () {
view.load(url, null);
}
});
return;
}
}
}
setUrl(view, BLANK_URL);
}
開發者ID:KingBarbarian,項目名稱:react-native-android-new-crosswalk,代碼行數:30,代碼來源:CrosswalkWebViewGroupManager.java
示例13: setCaptureMode
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "captureMode")
public void setCaptureMode(RCTCameraView view, final int captureMode) {
// Note that this in practice only performs any additional setup necessary for each mode;
// the actual indication to capture a still or record a video when capture() is called is
// still ultimately decided upon by what it in the options sent to capture().
view.setCaptureMode(captureMode);
}
示例14: testSetterWIthNonViewParam
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@Test(expected = RuntimeException.class)
public void testSetterWIthNonViewParam() {
new BaseViewManager() {
@ReactProp(name = "prop")
public void setterWithNonViewParam(Object v, boolean value) {
}
}.getNativeProps();
}
示例15: setExpandedTitleMargin
import com.facebook.react.uimanager.annotations.ReactProp; //導入依賴的package包/類
@ReactProp(name = "expandedTitleMargin")
public void setExpandedTitleMargin(CollapsingToolbarLayoutView view, ReadableMap margin) {
int start = margin.getInt("start");
int top = margin.getInt("top");
int end = margin.getInt("end");
int bottom = margin.getInt("bottom");
view.setExpandedTitleMargin(
(int) PixelUtil.toPixelFromDIP(start),
(int) PixelUtil.toPixelFromDIP(top),
(int) PixelUtil.toPixelFromDIP(end),
(int) PixelUtil.toPixelFromDIP(bottom)
);
}
開發者ID:cesardeazevedo,項目名稱:react-native-collapsing-toolbar,代碼行數:14,代碼來源:CollapsingToolbarLayoutManager.java