/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include The way that AnimationSet inherits behavior from Animation is important to
* understand. Some of the Animation attributes applied to AnimationSet affect the
* AnimationSet itself, some are pushed down to the children, and some are ignored,
* as follows:
*
*
* Starting with {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH},
* the behavior of these properties is the same in XML resources and at runtime (prior to that
* release, the values set in XML were ignored for AnimationSet). That is, calling
* setDuration(500)
on an AnimationSet has the same effect as declaring
* android:duration="500"
in an XML resource for an AnimationSet object.
Sets the duration of every child animation.
* * @param durationMillis the duration of the animation, in milliseconds, for * every child in this set */ void setDuration(long durationMillis); /** * Add a child animation to this animation set. * The transforms of the child animations are applied in the order * that they were added * @param a Animation to add. */ void addAnimation(IAnimation *a); /** * The duration of an AnimationSet is defined to be the * duration of the longest child animation. * * @see android.view.animation.Animation#getDuration() */ long getDuration() const; /** * The transformation of an animation set is the concatenation of all of its * component animations. * * @see android.view.animation.Animation#getTransformation */ bool getTransformation(int64_t currentTime, STransformation &t); /** * @see android.view.animation.Animation#scaleCurrentDuration(float) */ void scaleCurrentDuration(float scale); /** * @see android.view.animation.Animation#initialize(int, int, int, int) */ void initialize(int width, int height, int parentWidth, int parentHeight); virtual void copy(const IAnimation* src); protected: BOOL InitFromXml(pugi::xml_node xmlNode); HRESULT OnAttrDuration(const SStringW & value, BOOL bLoading); HRESULT OnAttrFillBefore(const SStringW & value, BOOL bLoading); HRESULT OnAttrFillAfter(const SStringW & value, BOOL bLoading); HRESULT OnAttrStartOffset(const SStringW & value, BOOL bLoading); SOUI_ATTRS_BEGIN() ATTR_BIT(L"shareInterpolator", mFlags, PROPERTY_SHARE_INTERPOLATOR_MASK, FALSE) ATTR_CUSTOM(L"duration", OnAttrDuration) ATTR_CUSTOM(L"fillBefore", OnAttrFillBefore) ATTR_CUSTOM(L"fillAfter", OnAttrFillAfter) ATTR_CUSTOM(L"startOffset", OnAttrStartOffset) SOUI_ATTRS_END() }; }