Introduce `mTaskViewCount` inside the RecentsView
Add a member property `mTaskViewCount` inside the RecentsView to track
the number of TaskView inside it. Its value will be increased
`onViewAdded` and decreased `onViewRemoved`.
- Then `getTaskViewCount()` can just return this variable directly.
- Invalidate the `PagedView.mPageScrolls` on a view addition and
removal util they have been updated on next `onLayout`. This is done
to guarantee that `mOnPageScrollsInitializedCallbacks` is run with
up to date `mPageScrolls`.
Flag: EXEMPT as no functionality changes
Bug: 379942019
Test: Tested on Tangor, ensure `mTaskViewCount` is correct in the
following scenarios:
1. Adding more tasks and enter overview
2. Dismissing one and more tasks
3. Dismissing all tasks
Change-Id: I32407e77dd2a9b3d8200efc334c1eadea1336b31
2 files changed