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


Java IntKeyframe类代码示例

本文整理汇总了Java中com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe.IntKeyframe的典型用法代码示例。如果您正苦于以下问题:Java IntKeyframe类的具体用法?Java IntKeyframe怎么用?Java IntKeyframe使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IntKeyframe类属于com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe包,在下文中一共展示了IntKeyframe类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ofInt

import com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe.IntKeyframe; //导入依赖的package包/类
public static KeyframeSet ofInt(int... values) {
    int numKeyframes = values.length;
    IntKeyframe keyframes[] = new IntKeyframe[Math.max(numKeyframes,2)];
    if (numKeyframes == 1) {
        keyframes[0] = (IntKeyframe) Keyframe.ofInt(0f);
        keyframes[1] = (IntKeyframe) Keyframe.ofInt(1f, values[0]);
    } else {
        keyframes[0] = (IntKeyframe) Keyframe.ofInt(0f, values[0]);
        for (int i = 1; i < numKeyframes; ++i) {
            keyframes[i] = (IntKeyframe) Keyframe.ofInt((float) i / (numKeyframes - 1), values[i]);
        }
    }
    return new IntKeyframeSet(keyframes);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:15,代码来源:KeyframeSet.java

示例2: ofKeyframe

import com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe.IntKeyframe; //导入依赖的package包/类
public static KeyframeSet ofKeyframe(Keyframe... keyframes) {
    // if all keyframes of same primitive type, create the appropriate KeyframeSet
    int numKeyframes = keyframes.length;
    boolean hasFloat = false;
    boolean hasInt = false;
    boolean hasOther = false;
    for (int i = 0; i < numKeyframes; ++i) {
        if (keyframes[i] instanceof FloatKeyframe) {
            hasFloat = true;
        } else if (keyframes[i] instanceof IntKeyframe) {
            hasInt = true;
        } else {
            hasOther = true;
        }
    }
    if (hasFloat && !hasInt && !hasOther) {
        FloatKeyframe floatKeyframes[] = new FloatKeyframe[numKeyframes];
        for (int i = 0; i < numKeyframes; ++i) {
            floatKeyframes[i] = (FloatKeyframe) keyframes[i];
        }
        return new FloatKeyframeSet(floatKeyframes);
    } else if (hasInt && !hasFloat && !hasOther) {
        IntKeyframe intKeyframes[] = new IntKeyframe[numKeyframes];
        for (int i = 0; i < numKeyframes; ++i) {
            intKeyframes[i] = (IntKeyframe) keyframes[i];
        }
        return new IntKeyframeSet(intKeyframes);
    } else {
        return new KeyframeSet(keyframes);
    }
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:32,代码来源:KeyframeSet.java

示例3: clone

import com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe.IntKeyframe; //导入依赖的package包/类
@Override
public IntKeyframeSet clone() {
    ArrayList<Keyframe> keyframes = mKeyframes;
    int numKeyframes = mKeyframes.size();
    IntKeyframe[] newKeyframes = new IntKeyframe[numKeyframes];
    for (int i = 0; i < numKeyframes; ++i) {
        newKeyframes[i] = (IntKeyframe) keyframes.get(i).clone();
    }
    IntKeyframeSet newSet = new IntKeyframeSet(newKeyframes);
    return newSet;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:12,代码来源:IntKeyframeSet.java

示例4: ofInt

import com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe.IntKeyframe; //导入依赖的package包/类
public static KeyframeSet ofInt(int... values) {
    int numKeyframes = values.length;
    IntKeyframe keyframes[] = new IntKeyframe[Math.max(numKeyframes, 2)];
    if (numKeyframes == 1) {
        keyframes[0] = (IntKeyframe) Keyframe.ofInt(0f);
        keyframes[1] = (IntKeyframe) Keyframe.ofInt(1f, values[0]);
    } else {
        keyframes[0] = (IntKeyframe) Keyframe.ofInt(0f, values[0]);
        for (int i = 1; i < numKeyframes; ++i) {
            keyframes[i] = (IntKeyframe) Keyframe.ofInt((float) i / (numKeyframes - 1), values[i]);
        }
    }
    return new IntKeyframeSet(keyframes);
}
 
开发者ID:ivanovpv,项目名称:darksms,代码行数:15,代码来源:KeyframeSet.java


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