本文整理匯總了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);
}