当前位置: 首页>>代码示例>>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;未经允许,请勿转载。