當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。