本文整理汇总了Java中android.content.res.TypedArray.getNonResourceString方法的典型用法代码示例。如果您正苦于以下问题:Java TypedArray.getNonResourceString方法的具体用法?Java TypedArray.getNonResourceString怎么用?Java TypedArray.getNonResourceString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.res.TypedArray
的用法示例。
在下文中一共展示了TypedArray.getNonResourceString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AnimationPNGSequence
import android.content.res.TypedArray; //导入方法依赖的package包/类
public AnimationPNGSequence(Context context, AttributeSet attrs) {
super(context, attrs);
if (!isInEditMode()) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AnimationPNGSequence);
AnimationDetails details = new AnimationDetails();
details.sequenceName = a.getNonResourceString(R.styleable.AnimationPNGSequence_sequence);
details.oneShot = Boolean.valueOf(a.getBoolean( R.styleable.AnimationPNGSequence_one_shot, details.oneShot.booleanValue()));
details.delay = (long) a.getInt( R.styleable.AnimationPNGSequence_delay, (int) details.delay);
details.loopCount = a.getInt( R.styleable.AnimationPNGSequence_loopCount, details.loopCount);
details.loopEnd = a.getInt( R.styleable.AnimationPNGSequence_loopEnd, details.loopEnd);
details.loopStart = a.getInt( R.styleable.AnimationPNGSequence_loopStart, details.loopStart);
Log.d(TAG, "AnimationPNGSequence: "+details.toString());
if (details.sequenceName != null) {
playAnimation(details);
}
a.recycle();
}
}
示例2: SlidingPanelLinear
import android.content.res.TypedArray; //导入方法依赖的package包/类
/**
* Default constructor for this custom view class.
*
* @param context - activity or application context for obtaining custom attributes.
* @param attrs - AttributeSet parameter which allows to obtain attributes and use them in java code.
*/
public SlidingPanelLinear(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
TypedArray typedArray = context.obtainStyledAttributes(attrs,
R.styleable.SettingsPanel,
0, 0);
attrSpeed = typedArray.getInt(R.styleable.SettingsPanel_speed, Utilities.DEFAULT_ANIMATION_SPEED);
attrInterpolator = typedArray.getNonResourceString(R.styleable.SettingsPanel_interpolator);
attrDirection = typedArray.getNonResourceString(R.styleable.SettingsPanel_direction);
typedArray.recycle();
fadeAnimation = AnimationUtils.loadAnimation(context, R.anim.fade);
}