當前位置: 首頁>>代碼示例>>Java>>正文


Java ReactProp類代碼示例

本文整理匯總了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();
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:20,代碼來源:LayoutShadowNode.java

示例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);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:18,代碼來源:ReactTextInputManager.java

示例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);

}
 
開發者ID:2534290808,項目名稱:react-native-pili-live,代碼行數:17,代碼來源:PiliStreamingViewManager.java

示例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);
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:19,代碼來源:RCTVirtualText.java

示例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();
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:20,代碼來源:LayoutShadowNode.java

示例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);
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:23,代碼來源:RCTVirtualText.java

示例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);
}
 
開發者ID:entria,項目名稱:react-native-camera-face-detector,代碼行數:12,代碼來源:RCTCameraViewManager.java

示例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();
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:9,代碼來源:ReactPropAnnotationSetterSpecTest.java

示例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();
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:9,代碼來源:ARTGroupShadowNode.java

示例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);
  }
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:9,代碼來源:BaseViewManager.java

示例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);
}
 
開發者ID:2534290808,項目名稱:react-native-pili-live,代碼行數:8,代碼來源:PiliStreamingViewManager.java

示例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);
}
 
開發者ID:entria,項目名稱:react-native-camera-face-detector,代碼行數:8,代碼來源:RCTCameraViewManager.java

示例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();
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:9,代碼來源:ReactPropAnnotationSetterSpecTest.java

示例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


注:本文中的com.facebook.react.uimanager.annotations.ReactProp類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。