Files
react-native/ReactAndroid/src/main/java/com/facebook/react/animation/AnimationPropertyUpdater.java
Martin Konicek 42eb5464fd Release React Native for Android
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.

See the Known Issues guide on the website.

We will work with the community to reach platform parity with iOS.
2015-09-14 18:13:39 +01:00

47 lines
1.6 KiB
Java

/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.facebook.react.animation;
import android.view.View;
/**
* Interface used to update particular property types during animation. While animation is in
* progress {@link Animation} instance will call {@link #onUpdate} several times with a value
* representing animation progress. Normally value will be from 0..1 range, but for spring animation
* it can slightly exceed that limit due to bounce effect at the start/end of animation.
*/
public interface AnimationPropertyUpdater {
/**
* This method will be called before animation starts.
*
* @param view view that will be animated
*/
public void prepare(View view);
/**
* This method will be called for each animation frame
*
* @param view view to update property
* @param progress animation progress from 0..1 range (may slightly exceed that limit in case of
* spring engine) retrieved from {@link Animation} engine.
*/
public void onUpdate(View view, float progress);
/**
* This method will be called at the end of animation. It should be used to set the final values
* for animated properties in order to avoid floating point inacurracy calculated in
* {@link #onUpdate} by passing value close to 1.0 or in a case some frames got dropped.
*
* @param view view to update property
*/
public void onFinish(View view);
}