當前位置: 首頁>>代碼示例>>Java>>正文


Java TypedArray.getNonResourceString方法代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:19,代碼來源:AnimationPNGSequence.java

示例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);
}
 
開發者ID:RELEX-Group,項目名稱:SlidingPanel,代碼行數:22,代碼來源:SlidingPanelLinear.java


注:本文中的android.content.res.TypedArray.getNonResourceString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。