当前位置: 首页>>代码示例>>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;未经允许,请勿转载。