当前位置: 首页>>代码示例>>Java>>正文


Java IllegalViewOperationException类代码示例

本文整理汇总了Java中com.facebook.react.uimanager.IllegalViewOperationException的典型用法代码示例。如果您正苦于以下问题:Java IllegalViewOperationException类的具体用法?Java IllegalViewOperationException怎么用?Java IllegalViewOperationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IllegalViewOperationException类属于com.facebook.react.uimanager包,在下文中一共展示了IllegalViewOperationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAnimationImpl

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@Override
Animation createAnimationImpl(View view, int x, int y, int width, int height) {
  float fromValue = isReverse() ? 1.0f : 0.0f;
  float toValue = isReverse() ? 0.0f : 1.0f;
  if (mAnimatedProperty != null) {
    switch (mAnimatedProperty) {
      case OPACITY:
        return new OpacityAnimation(view, fromValue, toValue);
      case SCALE_XY:
        return new ScaleAnimation(
            fromValue,
            toValue,
            fromValue,
            toValue,
            Animation.RELATIVE_TO_SELF,
            .5f,
            Animation.RELATIVE_TO_SELF,
            .5f);
      default:
        throw new IllegalViewOperationException(
            "Missing animation for property : " + mAnimatedProperty);
    }
  }
  throw new IllegalViewOperationException("Missing animated property from animation config");
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:26,代码来源:BaseLayoutAnimation.java

示例2: set

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void set( final boolean disabled, final Promise promise ) {
    try {
        mActivity.runOnUiThread( new Runnable() {
            @Override
            public void run() {
                WritableMap result = new WritableNativeMap();
                Window window = mActivity.getWindow();
                if ( disabled ) {
                    window.addFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
                } else {
                    window.clearFlags( WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON );
                }
                promise.resolve( result );
            }
        } );
    } catch ( IllegalViewOperationException e ) {
        promise.reject( e.getMessage() );
    }
}
 
开发者ID:yadi-social,项目名称:react-native-dimmer,代码行数:21,代码来源:ReactNativeDimmerModule.java

示例3: getDailyStepCountSamples

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void getDailyStepCountSamples(double startDate,
                                     double endDate,
                                     Callback errorCallback,
                                     Callback successCallback) {
    
    try {
        successCallback.invoke(mGoogleFitManager.getStepHistory().aggregateDataByDate((long)startDate, (long)endDate));
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:13,代码来源:GoogleFitModule.java

示例4: getDailyDistanceSamples

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void getDailyDistanceSamples(double startDate,
                                    double endDate,
                                    Callback errorCallback,
                                    Callback successCallback) {
    
    try {
        successCallback.invoke(mGoogleFitManager.getDistanceHistory().aggregateDataByDate((long)startDate, (long)endDate));
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:13,代码来源:GoogleFitModule.java

示例5: getWeightSamples

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void getWeightSamples(double startDate,
                             double endDate,
                             Callback errorCallback,
                             Callback successCallback) {
    
    try {
        successCallback.invoke(mGoogleFitManager.getWeightsHistory().displayLastWeeksData((long)startDate, (long)endDate));
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:13,代码来源:GoogleFitModule.java

示例6: getDailyCalorieSamples

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void getDailyCalorieSamples(double startDate,
                                   double endDate,
                                   Callback errorCallback,
                                   Callback successCallback) {
    
    try {
        successCallback.invoke(mGoogleFitManager.getCalorieHistory().aggregateDataByDate((long)startDate, (long)endDate));
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:13,代码来源:GoogleFitModule.java

示例7: saveWeight

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void saveWeight(ReadableMap weightSample,
                       Callback errorCallback,
                       Callback successCallback) {
    
    try {
        successCallback.invoke(mGoogleFitManager.getWeightsHistory().saveWeight(weightSample));
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:12,代码来源:GoogleFitModule.java

示例8: deleteWeight

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void deleteWeight(ReadableMap weightSample, Callback errorCallback, Callback successCallback) {
    try {
        successCallback.invoke(mGoogleFitManager.getWeightsHistory().deleteWeight(weightSample));
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:9,代码来源:GoogleFitModule.java

示例9: isAvailable

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void isAvailable(Callback errorCallback, Callback successCallback) { // true if GoogleFit installed
    try {
        successCallback.invoke(isAvailableCheck());
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:9,代码来源:GoogleFitModule.java

示例10: isEnabled

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@ReactMethod
public void isEnabled(Callback errorCallback, Callback successCallback) { // true if permission granted
    try {
        successCallback.invoke(isEnabledCheck());
    } catch (IllegalViewOperationException e) {
        errorCallback.invoke(e.getMessage());
    }
}
 
开发者ID:StasDoskalenko,项目名称:react-native-google-fit,代码行数:9,代码来源:GoogleFitModule.java

示例11: getFilePath

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
/**
 * Function to return the file path of the folder where the converter will look for files
 *
 * @param promise - promise to return file path
 */
@ReactMethod
public void getFilePath(Promise promise) {
    try {
        promise.resolve(Environment.getExternalStorageDirectory().toString());
    } catch (IllegalViewOperationException e) {
        promise.reject(e);
    }
}
 
开发者ID:SovTech,项目名称:ReactNativeAndroidAudioConverter,代码行数:14,代码来源:ReactNativeAndroidAudioConverterModule.java

示例12: initializeFromConfig

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
public void initializeFromConfig(ReadableMap data, int globalDuration) {
  mAnimatedProperty = data.hasKey("property") ?
      AnimatedPropertyType.fromString(data.getString("property")) : null;
  mDurationMs = data.hasKey("duration") ? data.getInt("duration") : globalDuration;
  mDelayMs = data.hasKey("delay") ? data.getInt("delay") : 0;
  if (!data.hasKey("type")) {
    throw new IllegalArgumentException("Missing interpolation type.");
  }
  mInterpolator = getInterpolator(InterpolatorType.fromString(data.getString("type")));

  if (!isValid()) {
    throw new IllegalViewOperationException("Invalid layout animation : " + data);
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:15,代码来源:AbstractLayoutAnimation.java

示例13: initializeFromConfig

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
public void initializeFromConfig(ReadableMap data, int globalDuration) {
  mAnimatedProperty = data.hasKey("property") ?
      AnimatedPropertyType.fromString(data.getString("property")) : null;
  mDurationMs = data.hasKey("duration") ? data.getInt("duration") : globalDuration;
  mDelayMs = data.hasKey("delay") ? data.getInt("delay") : 0;
  mInterpolator = data.hasKey("type") ?
      getInterpolator(InterpolatorType.fromString(data.getString("type"))) : null;

  if (!isValid()) {
    throw new IllegalViewOperationException("Invalid layout animation : " + data);
  }
}
 
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:13,代码来源:AbstractLayoutAnimation.java

示例14: receiveCommand

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
@Override
public void receiveCommand(TabLayoutView root, int commandId, @Nullable ReadableArray args) {
	Assertions.assertNotNull(root);
	Assertions.assertNotNull(args);

	switch (commandId) {
		case COMMAND_SETUPWITHVIEWPAGER:
			ViewPager viewPager = (ViewPager) root.getRootView().findViewById(args.getInt(0));
			if (viewPager != null) {
				root.setupWithViewPager(viewPager);
				ReadableArray tabsSettingsArray = args.getArray(1);
				if (!this.addTabs(root, tabsSettingsArray)) {
					throw new IllegalViewOperationException(
							"One or more tabs was/were not created: an error occurred (ReadableArray null and/or TabLayoutView null) in " +
									getClass().getSimpleName()
					);
				}
			} else {
				throw new IllegalViewOperationException(
						"Nonexistent ViewPager instance. Null value received by " +
								getClass().getSimpleName()
				);
			}
			break;
		default:
			throw new IllegalArgumentException(
					String.format(
							"Unsupported command %d received by %s.",
							commandId,
							getClass().getSimpleName()
					)
			);
	}
}
 
开发者ID:adbayb,项目名称:react-native-android-kit,代码行数:35,代码来源:TabLayoutManager.java

示例15: buildSpannedFromTextCSSNode

import com.facebook.react.uimanager.IllegalViewOperationException; //导入依赖的package包/类
private static void buildSpannedFromTextCSSNode(
    ReactTextShadowNode textShadowNode,
    SpannableStringBuilder sb,
    List<SetSpanOperation> ops) {
  int start = sb.length();
  if (textShadowNode.mText != null) {
    sb.append(textShadowNode.mText);
  }
  for (int i = 0, length = textShadowNode.getChildCount(); i < length; i++) {
    ReactShadowNode child = textShadowNode.getChildAt(i);
    if (child instanceof ReactTextShadowNode) {
      buildSpannedFromTextCSSNode((ReactTextShadowNode) child, sb, ops);
    } else if (child instanceof ReactTextInlineImageShadowNode) {
      // We make the image take up 1 character in the span and put a corresponding character into
      // the text so that the image doesn't run over any following text.
      sb.append(INLINE_IMAGE_PLACEHOLDER);
      ops.add(
        new SetSpanOperation(
          sb.length() - INLINE_IMAGE_PLACEHOLDER.length(),
          sb.length(),
          ((ReactTextInlineImageShadowNode) child).buildInlineImageSpan()));
    } else {
      throw new IllegalViewOperationException("Unexpected view type nested under text node: "
              + child.getClass());
    }
    child.markUpdateSeen();
  }
  int end = sb.length();
  if (end >= start) {
    if (textShadowNode.mIsColorSet) {
      ops.add(new SetSpanOperation(start, end, new ForegroundColorSpan(textShadowNode.mColor)));
    }
    if (textShadowNode.mIsBackgroundColorSet) {
      ops.add(new SetSpanOperation(
              start,
              end,
              new BackgroundColorSpan(textShadowNode.mBackgroundColor)));
    }
    if (textShadowNode.mFontSize != UNSET) {
      ops.add(new SetSpanOperation(start, end, new AbsoluteSizeSpan(textShadowNode.mFontSize)));
    }
    if (textShadowNode.mFontStyle != UNSET ||
        textShadowNode.mFontWeight != UNSET ||
        textShadowNode.mFontFamily != null) {
      ops.add(new SetSpanOperation(
              start,
              end,
              new CustomStyleSpan(
                  textShadowNode.mFontStyle,
                  textShadowNode.mFontWeight,
                  textShadowNode.mFontFamily,
                  textShadowNode.getThemedContext().getAssets())));
    }
    if (textShadowNode.mIsUnderlineTextDecorationSet) {
      ops.add(new SetSpanOperation(start, end, new UnderlineSpan()));
    }
    if (textShadowNode.mIsLineThroughTextDecorationSet) {
      ops.add(new SetSpanOperation(start, end, new StrikethroughSpan()));
    }
    if (textShadowNode.mTextShadowOffsetDx != 0 || textShadowNode.mTextShadowOffsetDy != 0) {
      ops.add(new SetSpanOperation(
              start,
              end,
              new ShadowStyleSpan(
                  textShadowNode.mTextShadowOffsetDx,
                  textShadowNode.mTextShadowOffsetDy,
                  textShadowNode.mTextShadowRadius,
                  textShadowNode.mTextShadowColor)));
    }
    if (!Float.isNaN(textShadowNode.getEffectiveLineHeight())) {
      ops.add(new SetSpanOperation(
              start,
              end,
              new CustomLineHeightSpan(textShadowNode.getEffectiveLineHeight())));
    }
    ops.add(new SetSpanOperation(start, end, new ReactTagSpan(textShadowNode.getReactTag())));
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:79,代码来源:ReactTextShadowNode.java


注:本文中的com.facebook.react.uimanager.IllegalViewOperationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。