1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef OHOS_ROSEN_ANIMATION_CONFIG_H 16 #define OHOS_ROSEN_ANIMATION_CONFIG_H 17 18 #include "animation/rs_animation_timing_curve.h" 19 #include "animation/rs_animation_timing_protocol.h" 20 #include "common/rs_vector3.h" 21 #include "common/rs_vector4.h" 22 23 namespace OHOS { 24 namespace Rosen { 25 struct AnimationConfig { 26 struct WindowAnimationConfig { 27 struct AnimationTiming { 28 RSAnimationTimingProtocol timingProtocol_ = 200; 29 RSAnimationTimingCurve timingCurve_ = RSAnimationTimingCurve::EASE_OUT; 30 } animationTiming_; 31 float opacity_ = 0; 32 Vector3f scale_ { 0.7f, 0.7f, 1.0f }; 33 Vector3f translate_ { 0, 0, 0 }; 34 Vector4f rotation_ { 0, 0, 1, 0 }; 35 } windowAnimationConfig_; 36 struct KeyboardAnimation { 37 RSAnimationTimingCurve curve_ = RSAnimationTimingCurve::CreateCubicCurve(0.2f, 0.0f, 0.2f, 1.0f); 38 RSAnimationTimingProtocol duration_ = 500; 39 } keyboardAnimationIn_, keyboardAnimationOut_; 40 41 struct StartWindowTransitionAnimationConfig { 42 RSAnimationTimingProtocol timingProtocol_ = 200; 43 RSAnimationTimingCurve timingCurve_ = RSAnimationTimingCurve::LINEAR; 44 float opacityStart_ = 1.0; 45 float opacityEnd_ = 0.0; 46 } startWinAnimationConfig_; 47 }; 48 } // namespace Rosen 49 } // namespace OHOS 50 #endif // OHOS_ROSEN_ANIMATION_CONFIG_H