com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe.IntKeyframe Java Examples

The following examples show how to use com.actionbarsherlock.internal.nineoldandroids.animation.Keyframe.IntKeyframe. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KeyframeSet.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
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);
    }
}
 
Example #2
Source File: IntKeyframeSet.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
@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;
}
 
Example #3
Source File: KeyframeSet.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
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);
    }
}
 
Example #4
Source File: KeyframeSet.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
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);
}
 
Example #5
Source File: IntKeyframeSet.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #6
Source File: KeyframeSet.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
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);
    }
}
 
Example #7
Source File: KeyframeSet.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #8
Source File: IntKeyframeSet.java    From zen4android with MIT License 5 votes vote down vote up
@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;
}
 
Example #9
Source File: KeyframeSet.java    From zen4android with MIT License 5 votes vote down vote up
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);
    }
}
 
Example #10
Source File: KeyframeSet.java    From zen4android with MIT License 5 votes vote down vote up
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);
}
 
Example #11
Source File: IntKeyframeSet.java    From android-apps with MIT License 5 votes vote down vote up
@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;
}
 
Example #12
Source File: KeyframeSet.java    From android-apps with MIT License 5 votes vote down vote up
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);
    }
}
 
Example #13
Source File: KeyframeSet.java    From android-apps with MIT License 5 votes vote down vote up
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);
}
 
Example #14
Source File: IntKeyframeSet.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example #15
Source File: KeyframeSet.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
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);
}
 
Example #16
Source File: IntKeyframeSet.java    From zen4android with MIT License 4 votes vote down vote up
public IntKeyframeSet(IntKeyframe... keyframes) {
    super(keyframes);
}
 
Example #17
Source File: IntKeyframeSet.java    From android-apps with MIT License 4 votes vote down vote up
public IntKeyframeSet(IntKeyframe... keyframes) {
    super(keyframes);
}
 
Example #18
Source File: IntKeyframeSet.java    From zhangshangwuda with Apache License 2.0 4 votes vote down vote up
public IntKeyframeSet(IntKeyframe... keyframes) {
    super(keyframes);
}
 
Example #19
Source File: IntKeyframeSet.java    From CSipSimple with GNU General Public License v3.0 4 votes vote down vote up
public IntKeyframeSet(IntKeyframe... keyframes) {
    super(keyframes);
}
 
Example #20
Source File: IntKeyframeSet.java    From Libraries-for-Android-Developers with MIT License 4 votes vote down vote up
public IntKeyframeSet(IntKeyframe... keyframes) {
    super(keyframes);
}