Java Code Examples for android.util.Property#get()

The following examples show how to use android.util.Property#get() . 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: RunningAnimationsManager.java    From android_additive_animations with Apache License 2.0 5 votes vote down vote up
Float getActualPropertyValue(Property<T, Float> property) {
    Float lastTarget = getLastTargetValue(property.getName());
    if (lastTarget == null) {
        lastTarget = property.get(mAnimationTarget);
    }
    return lastTarget;
}
 
Example 2
Source File: ViewPropertyObjectAnimator.java    From ViewPropertyObjectAnimator with Apache License 2.0 5 votes vote down vote up
private void animatePropertyBy(Property<View, Float> property, float byValue) {
    if (hasView()) {
        float fromValue = property.get(mView.get());
        float toValue = fromValue + byValue;
        animatePropertyBetween(property, fromValue, toValue);
    }
}
 
Example 3
Source File: AnimatorUtils.java    From Transitions-Everywhere with Apache License 2.0 5 votes vote down vote up
@Override
@Nullable
public ObjectAnimator ofFloat(@Nullable View view, @NonNull Property<View, Float> property,
                              float startFraction, float endFraction) {
    float start = property.get(view) * startFraction;
    float end = property.get(view) * endFraction;
    if (start == end) {
        return null;
    }
    property.set(view, start);
    return ObjectAnimator.ofFloat(view, property, end);
}
 
Example 4
Source File: AnimatorUtils.java    From Transitions-Everywhere with Apache License 2.0 5 votes vote down vote up
@Override
@Nullable
public ObjectAnimator ofInt(@Nullable View view, @NonNull Property<View, Integer> property,
                            float startFraction, float endFraction) {
    int start = (int) (property.get(view) * startFraction);
    int end = (int) (property.get(view) * endFraction);
    if (start == end) {
        return null;
    }
    property.set(view, start);
    return ObjectAnimator.ofInt(view, property, end);
}
 
Example 5
Source File: BaseAdditiveAnimator.java    From android_additive_animations with Apache License 2.0 4 votes vote down vote up
protected final AdditiveAnimation createAnimation(Property<V, Float> property, float targetValue) {
    AdditiveAnimation animation = new AdditiveAnimation<>(mCurrentTarget, property, property.get(mCurrentTarget), targetValue);
    animation.setCustomInterpolator(mCurrentCustomInterpolator);
    return animation;
}
 
Example 6
Source File: BaseAdditiveAnimator.java    From android_additive_animations with Apache License 2.0 4 votes vote down vote up
protected final AdditiveAnimation createAnimation(Property<V, Float> property, float targetValue, TypeEvaluator<Float> evaluator) {
    AdditiveAnimation animation = new AdditiveAnimation<>(mCurrentTarget, property, property.get(mCurrentTarget), targetValue);
    animation.setCustomTypeEvaluator(evaluator);
    animation.setCustomInterpolator(mCurrentCustomInterpolator);
    return animation;
}
 
Example 7
Source File: BaseAdditiveAnimator.java    From android_additive_animations with Apache License 2.0 4 votes vote down vote up
protected final AdditiveAnimation createAnimation(Property<V, Float> property, Path path, PathEvaluator.PathMode mode, PathEvaluator sharedEvaluator) {
    AdditiveAnimation animation = new AdditiveAnimation<>(mCurrentTarget, property, property.get(mCurrentTarget), path, mode, sharedEvaluator);
    animation.setCustomInterpolator(mCurrentCustomInterpolator);
    return animation;
}
 
Example 8
Source File: ViewPropertyObjectAnimator.java    From ViewPropertyObjectAnimator with Apache License 2.0 4 votes vote down vote up
private void animateProperty(Property<View, Float> property, float toValue) {
    if (hasView()) {
        float fromValue = property.get(mView.get());
        animatePropertyBetween(property, fromValue, toValue);
    }
}