#pragma once #include #include namespace UI { class Animation { public: Animation(std::function aAnimator, int32_t aAnimationTime, int32_t aStart = 0, int32_t aEnd = 100); virtual ~Animation(); void HandleAnimationComplete(std::function onAnimationComplete); void Start(); void Reverse(); private: lv_anim_t mAnimation; std::function mAnimator = nullptr; std::function mOnComplete = nullptr; bool onCompleteCalled = false; int32_t mStart = 0; int32_t mEnd = 0; static void AnimatorImpl(lv_anim_t *aSelf, int32_t aNextValue); }; } // namespace UI