DynamicAnimation.java revision 987ee64612e2510004fdf08536746c87234d01c1
1/* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.camera.ui.motion; 18 19import android.graphics.Canvas; 20 21/** 22 * Rendering object that can be driven by an animator instance. 23 */ 24public interface DynamicAnimation { 25 26 /** 27 * Check to determine if this animation is currently in a stable state. 28 * 29 * @return true if the animation is stable, false if it should continue to be redrawn. 30 */ 31 boolean isActive(); 32 33 /** 34 * Update and draw the animation onto the given canvas. 35 * 36 * @param t current animation frame time. 37 * @param dt delta since the last update. 38 * @param canvas the canvas to draw the animation onto. 39 */ 40 void draw(long t, long dt, Canvas canvas); 41} 42