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


Java TypedArray.getValue方法代码示例

本文整理汇总了Java中android.content.res.TypedArray.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TypedArray.getValue方法的具体用法?Java TypedArray.getValue怎么用?Java TypedArray.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.res.TypedArray的用法示例。


在下文中一共展示了TypedArray.getValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
 
开发者ID:smartbeng,项目名称:PaoMovie,代码行数:23,代码来源:GifTextureView.java

示例2: applyFixedSizeWindow

import android.content.res.TypedArray; //导入方法依赖的package包/类
private void applyFixedSizeWindow() {
    ContentFrameLayout cfl = (ContentFrameLayout) this.mSubDecor.findViewById(16908290);
    View windowDecor = this.mWindow.getDecorView();
    cfl.setDecorPadding(windowDecor.getPaddingLeft(), windowDecor.getPaddingTop(), windowDecor.getPaddingRight(), windowDecor.getPaddingBottom());
    TypedArray a = this.mContext.obtainStyledAttributes(R.styleable.AppCompatTheme);
    a.getValue(R.styleable.AppCompatTheme_windowMinWidthMajor, cfl.getMinWidthMajor());
    a.getValue(R.styleable.AppCompatTheme_windowMinWidthMinor, cfl.getMinWidthMinor());
    if (a.hasValue(R.styleable.AppCompatTheme_windowFixedWidthMajor)) {
        a.getValue(R.styleable.AppCompatTheme_windowFixedWidthMajor, cfl.getFixedWidthMajor());
    }
    if (a.hasValue(R.styleable.AppCompatTheme_windowFixedWidthMinor)) {
        a.getValue(R.styleable.AppCompatTheme_windowFixedWidthMinor, cfl.getFixedWidthMinor());
    }
    if (a.hasValue(R.styleable.AppCompatTheme_windowFixedHeightMajor)) {
        a.getValue(R.styleable.AppCompatTheme_windowFixedHeightMajor, cfl.getFixedHeightMajor());
    }
    if (a.hasValue(R.styleable.AppCompatTheme_windowFixedHeightMinor)) {
        a.getValue(R.styleable.AppCompatTheme_windowFixedHeightMinor, cfl.getFixedHeightMinor());
    }
    a.recycle();
    cfl.requestLayout();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:AppCompatDelegateImplV7.java


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