com.nineoldandroids.util.Property Java Examples

The following examples show how to use com.nineoldandroids.util.Property. 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: ObjectAnimator.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
public void setProperty(Property property)
{
    if (k != null)
    {
        PropertyValuesHolder propertyvaluesholder = k[0];
        String s = propertyvaluesholder.getPropertyName();
        propertyvaluesholder.setProperty(property);
        l.remove(s);
        l.put(p, propertyvaluesholder);
    }
    if (q != null)
    {
        p = property.getName();
    }
    q = property;
    j = false;
}
 
Example #2
Source File: ObjectAnimator.java    From Mover with Apache License 2.0 6 votes vote down vote up
/**
 * Sets the property that will be animated. Property objects will take precedence over
 * properties specified by the {@link #setPropertyName(String)} method. Animations should
 * be set up to use one or the other, not both.
 *
 * @param property The property being animated. Should not be null.
 */
public void setProperty(Property property) {
    // mValues could be null if this is being constructed piecemeal. Just record the
    // propertyName to be used later when setValues() is called if so.
    if (mValues != null) {
        PropertyValuesHolder valuesHolder = mValues[0];
        String oldName = valuesHolder.getPropertyName();
        valuesHolder.setProperty(property);
        mValuesMap.remove(oldName);
        mValuesMap.put(mPropertyName, valuesHolder);
    }
    if (mProperty != null) {
        mPropertyName = property.getName();
    }
    mProperty = property;
    // New property/values/target should cause re-initialization prior to starting
    mInitialized = false;
}
 
Example #3
Source File: PropertyValuesHolder.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
public static transient PropertyValuesHolder ofKeyframe(Property property, Keyframe akeyframe[])
{
    k k1 = com.nineoldandroids.animation.k.a(akeyframe);
    if (k1 instanceof g)
    {
        return new B(property, (g)k1);
    }
    if (k1 instanceof f)
    {
        return new A(property, (f)k1);
    } else
    {
        PropertyValuesHolder propertyvaluesholder = new PropertyValuesHolder(property);
        propertyvaluesholder.d = k1;
        propertyvaluesholder.c = akeyframe[0].getType();
        return propertyvaluesholder;
    }
}
 
Example #4
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 5 votes vote down vote up
public FloatPropertyValuesHolder(Property property, float... values) {
    super(property);
    setFloatValues(values);
    if (property instanceof  FloatProperty) {
        mFloatProperty = (FloatProperty) mProperty;
    }
}
 
Example #5
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 5 votes vote down vote up
public FloatPropertyValuesHolder(Property property, FloatKeyframeSet keyframeSet) {
    super(property);
    mValueType = float.class;
    mKeyframeSet = keyframeSet;
    mFloatKeyframeSet = (FloatKeyframeSet) mKeyframeSet;
    if (property instanceof FloatProperty) {
        mFloatProperty = (FloatProperty) mProperty;
    }
}
 
Example #6
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 5 votes vote down vote up
public IntPropertyValuesHolder(Property property, int... values) {
    super(property);
    setIntValues(values);
    if (property instanceof  IntProperty) {
        mIntProperty = (IntProperty) mProperty;
    }
}
 
Example #7
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 5 votes vote down vote up
public IntPropertyValuesHolder(Property property, IntKeyframeSet keyframeSet) {
    super(property);
    mValueType = int.class;
    mKeyframeSet = keyframeSet;
    mIntKeyframeSet = (IntKeyframeSet) mKeyframeSet;
    if (property instanceof  IntProperty) {
        mIntProperty = (IntProperty) mProperty;
    }
}
 
Example #8
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 5 votes vote down vote up
/**
 * Internal utility constructor, used by the factory methods to set the property.
 * @param property The property for this holder.
 */
private PropertyValuesHolder(Property property) {
    mProperty = property;
    if (property != null) {
        mPropertyName = property.getName();
    }
}
 
Example #9
Source File: A.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public transient A(Property property, float af[])
{
    super(property, null);
    setFloatValues(af);
    if (property instanceof FloatProperty)
    {
        i = (FloatProperty)mProperty;
    }
}
 
Example #10
Source File: A.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public A(Property property, f f1)
{
    super(property, null);
    c = Float.TYPE;
    d = f1;
    g = (f)d;
    if (property instanceof FloatProperty)
    {
        i = (FloatProperty)mProperty;
    }
}
 
Example #11
Source File: PropertyValuesHolder.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public static transient PropertyValuesHolder ofObject(Property property, TypeEvaluator typeevaluator, Object aobj[])
{
    PropertyValuesHolder propertyvaluesholder = new PropertyValuesHolder(property);
    propertyvaluesholder.setObjectValues(aobj);
    propertyvaluesholder.setEvaluator(typeevaluator);
    return propertyvaluesholder;
}
 
Example #12
Source File: ObjectAnimator.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public static transient ObjectAnimator ofObject(Object obj, Property property, TypeEvaluator typeevaluator, Object aobj[])
{
    ObjectAnimator objectanimator = new ObjectAnimator(obj, property);
    objectanimator.setObjectValues(aobj);
    objectanimator.setEvaluator(typeevaluator);
    return objectanimator;
}
 
Example #13
Source File: PropertyValuesHolder.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
private PropertyValuesHolder(Property property)
{
    b = null;
    g = null;
    d = null;
    e = new ReentrantReadWriteLock();
    f = new Object[1];
    mProperty = property;
    if (property != null)
    {
        a = property.getName();
    }
}
 
Example #14
Source File: ObjectAnimator.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
private ObjectAnimator(Object obj, Property property)
{
    o = obj;
    setProperty(property);
}
 
Example #15
Source File: ObjectAnimator.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public static transient ObjectAnimator ofFloat(Object obj, Property property, float af[])
{
    ObjectAnimator objectanimator = new ObjectAnimator(obj, property);
    objectanimator.setFloatValues(af);
    return objectanimator;
}
 
Example #16
Source File: ObjectAnimator.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public static transient ObjectAnimator ofInt(Object obj, Property property, int ai[])
{
    ObjectAnimator objectanimator = new ObjectAnimator(obj, property);
    objectanimator.setIntValues(ai);
    return objectanimator;
}
 
Example #17
Source File: PropertyValuesHolder.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
PropertyValuesHolder(Property property, PropertyValuesHolder propertyvaluesholder)
{
    this(property);
}
 
Example #18
Source File: PropertyValuesHolder.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public static transient PropertyValuesHolder ofFloat(Property property, float af[])
{
    return new A(property, af);
}
 
Example #19
Source File: PropertyValuesHolder.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public static transient PropertyValuesHolder ofInt(Property property, int ai[])
{
    return new B(property, ai);
}
 
Example #20
Source File: PropertyValuesHolder.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void setProperty(Property property)
{
    mProperty = property;
}
 
Example #21
Source File: ObjectAnimator.java    From Mover with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs and returns an ObjectAnimator that animates between float values. A single
 * value implies that that value is the one being animated to. Two values imply a starting
 * and ending values. More than two values imply a starting value, values to animate through
 * along the way, and an ending value (these values will be distributed evenly across
 * the duration of the animation).
 *
 * @param target The object whose property is to be animated.
 * @param property The property being animated.
 * @param values A set of values that the animation will animate between over time.
 * @return An ObjectAnimator object that is set up to animate between the given values.
 */
public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> property,
        float... values) {
    ObjectAnimator anim = new ObjectAnimator(target, property);
    anim.setFloatValues(values);
    return anim;
}
 
Example #22
Source File: ObjectAnimator.java    From Mover with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs and returns an ObjectAnimator that animates between Object values. A single
 * value implies that that value is the one being animated to. Two values imply a starting
 * and ending values. More than two values imply a starting value, values to animate through
 * along the way, and an ending value (these values will be distributed evenly across
 * the duration of the animation).
 *
 * @param target The object whose property is to be animated.
 * @param property The property being animated.
 * @param evaluator A TypeEvaluator that will be called on each animation frame to
 * provide the necessary interpolation between the Object values to derive the animated
 * value.
 * @param values A set of values that the animation will animate between over time.
 * @return An ObjectAnimator object that is set up to animate between the given values.
 */
public static <T, V> ObjectAnimator ofObject(T target, Property<T, V> property,
        TypeEvaluator<V> evaluator, V... values) {
    ObjectAnimator anim = new ObjectAnimator(target, property);
    anim.setObjectValues(values);
    anim.setEvaluator(evaluator);
    return anim;
}
 
Example #23
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs and returns a PropertyValuesHolder with a given property and
 * set of Object values. This variant also takes a TypeEvaluator because the system
 * cannot automatically interpolate between objects of unknown type.
 *
 * @param property The property being animated. Should not be null.
 * @param evaluator A TypeEvaluator that will be called on each animation frame to
 * provide the necessary interpolation between the Object values to derive the animated
 * value.
 * @param values The values that the property will animate between.
 * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
 */
public static <V> PropertyValuesHolder ofObject(Property property,
        TypeEvaluator<V> evaluator, V... values) {
    PropertyValuesHolder pvh = new PropertyValuesHolder(property);
    pvh.setObjectValues(values);
    pvh.setEvaluator(evaluator);
    return pvh;
}
 
Example #24
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 3 votes vote down vote up
/**
 * Constructs and returns a PropertyValuesHolder object with the specified property and set
 * of values. These values can be of any type, but the type should be consistent so that
 * an appropriate {@link android.animation.TypeEvaluator} can be found that matches
 * the common type.
 * <p>If there is only one value, it is assumed to be the end value of an animation,
 * and an initial value will be derived, if possible, by calling the property's
 * {@link android.util.Property#get(Object)} function.
 * Also, if any value is null, the value will be filled in when the animation
 * starts in the same way. This mechanism of automatically getting null values only works
 * if the PropertyValuesHolder object is used in conjunction with
 * {@link com.nineoldandroids.animation.ObjectAnimator}, since otherwise PropertyValuesHolder has
 * no way of determining what the value should be.
 * @param property The property associated with this set of values. Should not be null.
 * @param values The set of values to animate between.
 */
public static PropertyValuesHolder ofKeyframe(Property property, Keyframe... values) {
    KeyframeSet keyframeSet = KeyframeSet.ofKeyframe(values);
    if (keyframeSet instanceof IntKeyframeSet) {
        return new IntPropertyValuesHolder(property, (IntKeyframeSet) keyframeSet);
    } else if (keyframeSet instanceof FloatKeyframeSet) {
        return new FloatPropertyValuesHolder(property, (FloatKeyframeSet) keyframeSet);
    }
    else {
        PropertyValuesHolder pvh = new PropertyValuesHolder(property);
        pvh.mKeyframeSet = keyframeSet;
        pvh.mValueType = ((Keyframe)values[0]).getType();
        return pvh;
    }
}
 
Example #25
Source File: ObjectAnimator.java    From Mover with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs and returns an ObjectAnimator that animates between int values. A single
 * value implies that that value is the one being animated to. Two values imply a starting
 * and ending values. More than two values imply a starting value, values to animate through
 * along the way, and an ending value (these values will be distributed evenly across
 * the duration of the animation).
 *
 * @param target The object whose property is to be animated.
 * @param property The property being animated.
 * @param values A set of values that the animation will animate between over time.
 * @return An ObjectAnimator object that is set up to animate between the given values.
 */
public static <T> ObjectAnimator ofInt(T target, Property<T, Integer> property, int... values) {
    ObjectAnimator anim = new ObjectAnimator(target, property);
    anim.setIntValues(values);
    return anim;
}
 
Example #26
Source File: ObjectAnimator.java    From Mover with Apache License 2.0 2 votes vote down vote up
/**
 * Private utility constructor that initializes the target object and property being animated.
 *
 * @param target The object whose property is to be animated.
 * @param property The property being animated.
 */
private <T> ObjectAnimator(T target, Property<T, ?> property) {
    mTarget = target;
    setProperty(property);
}
 
Example #27
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs and returns a PropertyValuesHolder with a given property and
 * set of int values.
 * @param property The property being animated. Should not be null.
 * @param values The values that the property will animate between.
 * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
 */
public static PropertyValuesHolder ofInt(Property<?, Integer> property, int... values) {
    return new IntPropertyValuesHolder(property, values);
}
 
Example #28
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs and returns a PropertyValuesHolder with a given property and
 * set of float values.
 * @param property The property being animated. Should not be null.
 * @param values The values that the property will animate between.
 * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
 */
public static PropertyValuesHolder ofFloat(Property<?, Float> property, float... values) {
    return new FloatPropertyValuesHolder(property, values);
}
 
Example #29
Source File: PropertyValuesHolder.java    From Mover with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the property that will be animated.
 *
 * <p>Note that if this PropertyValuesHolder object is used with ObjectAnimator, the property
 * must exist on the target object specified in that ObjectAnimator.</p>
 *
 * @param property The property being animated.
 */
public void setProperty(Property property) {
    mProperty = property;
}