本文整理汇总了Java中android.content.res.TypedArray.getResources方法的典型用法代码示例。如果您正苦于以下问题:Java TypedArray.getResources方法的具体用法?Java TypedArray.getResources怎么用?Java TypedArray.getResources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.res.TypedArray
的用法示例。
在下文中一共展示了TypedArray.getResources方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findSource
import android.content.res.TypedArray; //导入方法依赖的package包/类
private static InputSource findSource(final TypedArray textureViewAttributes) {
final TypedValue value = new TypedValue();
if (!textureViewAttributes.getValue(
R.styleable.GifTextureView_gifSource, value)) {
return null;
}
if (value.resourceId != 0) {
final String type = textureViewAttributes.getResources()
.getResourceTypeName(value.resourceId);
if ("drawable".equals(type) || "raw".equals(type)) {
return new InputSource.ResourcesSource(
textureViewAttributes.getResources(), value.resourceId);
} else if (!"string".equals(type)) {
throw new IllegalArgumentException(
"Expected string, drawable or raw resource, type "
+ type + " " + "cannot be converted to GIF");
}
}
return new InputSource.AssetSource(textureViewAttributes.getResources()
.getAssets(), value.string.toString());
}
示例2: init
import android.content.res.TypedArray; //导入方法依赖的package包/类
public static void init(final TypedArray mainKeyboardViewAttr, final TimerProxy timerProxy,
final DrawingProxy drawingProxy) {
sParams = new PointerTrackerParams(mainKeyboardViewAttr);
sGestureStrokeRecognitionParams = new GestureStrokeRecognitionParams(mainKeyboardViewAttr);
sGestureStrokeDrawingParams = new GestureStrokeDrawingParams(mainKeyboardViewAttr);
sTypingTimeRecorder = new TypingTimeRecorder(
sGestureStrokeRecognitionParams.mStaticTimeThresholdAfterFastTyping,
sParams.mSuppressKeyPreviewAfterBatchInputDuration);
final Resources res = mainKeyboardViewAttr.getResources();
sNeedsPhantomSuddenMoveEventHack = Boolean.parseBoolean(
ResourceUtils.getDeviceOverrideValue(res,
R.array.phantom_sudden_move_event_device_list, Boolean.FALSE.toString()));
BogusMoveEventDetector.init(res);
sTimerProxy = timerProxy;
sDrawingProxy = drawingProxy;
}
示例3: init
import android.content.res.TypedArray; //导入方法依赖的package包/类
public static void init(final TypedArray mainKeyboardViewAttr, final TimerProxy timerProxy,
final DrawingProxy drawingProxy) {
sParams = new PointerTrackerParams(mainKeyboardViewAttr);
final Resources res = mainKeyboardViewAttr.getResources();
BogusMoveEventDetector.init(res);
sTimerProxy = timerProxy;
sDrawingProxy = drawingProxy;
}