diff options
| author | 2020-08-14 04:00:11 +0000 | |
|---|---|---|
| committer | 2020-08-19 23:02:09 +0000 | |
| commit | ce6371395599eea49038c4c6a1ba5b86d55be86e (patch) | |
| tree | 2a2b714b1c501e84d8513b15e6305cba6ab4d7ea /libs/input/TouchSpotController.h | |
| parent | f623c1e2c2a7f2ff71f0360f74c93d4ef799ab39 (diff) | |
Switch to callback animation
Modified current animation logic to use callbacks from the controllers
to further clean and modularize code.
Test: Pixel 3XL device, atest PointerController_test, compile
Change-Id: I1073bd78687cca491663c0349751dab4b30aa8e2
Diffstat (limited to 'libs/input/TouchSpotController.h')
| -rw-r--r-- | libs/input/TouchSpotController.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/input/TouchSpotController.h b/libs/input/TouchSpotController.h index f3b355010bee..703de3603f48 100644 --- a/libs/input/TouchSpotController.h +++ b/libs/input/TouchSpotController.h @@ -17,6 +17,8 @@ #ifndef _UI_TOUCH_SPOT_CONTROLLER_H #define _UI_TOUCH_SPOT_CONTROLLER_H +#include <functional> + #include "PointerControllerContext.h" namespace android { @@ -34,7 +36,7 @@ public: void clearSpots(); void reloadSpotResources(); - bool doFadingAnimation(nsecs_t timestamp, bool keepAnimating); + bool doAnimations(nsecs_t timestamp); private: struct Spot { @@ -76,6 +78,8 @@ private: std::vector<Spot*> displaySpots; std::vector<sp<Sprite>> recycledSprites; + bool animating{false}; + } mLocked GUARDED_BY(mLock); Spot* getSpot(uint32_t id, const std::vector<Spot*>& spots); @@ -84,6 +88,8 @@ private: void releaseSpotLocked(Spot* spot); void fadeOutAndReleaseSpotLocked(Spot* spot); void fadeOutAndReleaseAllSpotsLocked(); + bool doFadingAnimationLocked(nsecs_t timestamp); + void startAnimationLocked(); }; } // namespace android |