Commit Graph

4 Commits

Author SHA1 Message Date
Tony Wickham
b87f3cdc1c Add support for having more hotseat icons in the DB than we show
Split InvariantDeviceProfile#numHotseatIcons into two variables:
numDatabaseHotseatIcons and numShownHotseatIcons. These are generally
the same, but different DisplayOptions within the same GridOption
can choose to show different numbers of hotseat icons while sharing
the same database.

numDatabaseHotseatIcons is used for all reading/writing/migrating
purposes, while numShownHotseatIcons determines how many Hotseat
icons to show in the UI.

Test: Existing tests pass, added two new migration tests
Bug: 184789479
Bug: 171917176

Change-Id: I54583504f61a47a4444b6a637ebb7e3ab31528b7
2021-04-12 16:08:15 -07:00
Tony Wickham
bc08503e0b Ensure taskbar hotseat array index is in bounds
Test: switch from 5x5 grid to 4x4 grid, ensure no crash
Fixes: 181981906
Change-Id: Ic23e3d5f1debcfd2307e48c6aaac38d143fd95c3
2021-03-09 11:01:02 -08:00
Tony Wickham
afd0d81a70 Fix some issues with taskbar
- Update Hotseat items in init() to ensure they are reloaded
- Don't update Recent items if we get the new tasks after cleanup()

Test: Fold and unfold, ensure Taskbar disappears/reappears without
crashing

Bug: 171917176
Change-Id: I1c2ae1022ae56cddece655b22db187684f691bf8
2021-02-08 21:54:01 +00:00
Tony Wickham
794fe4f58e Add Hotseat items to Taskbar
- Currently supports WorkspaceItemInfo (e.g. normal app icons
  including hotseat predictions and pinned deep shortcuts).
- Currently doesn't support Folders, Notification dots, or
  long press.

Some technical details:
- Always allow HotseatPredictionController updates given the
  Hotseat is always showing even when Launcher is stopped.
- Represent Taskbar Hotseat items as BubbleTextViews, to
  allow for normal click handling etc. When the hotseat is
  updated, we reuse the same BubbleTextViews that were
  initially inflated, and just reapply the new info.
- Add new BubbleTextView iconDisplay for Taskbar, to allow
  for different treatment such as icon size.

Bug: 171917176
Change-Id: I325eb39051f2dc69228b39b5c40ed0cbdad8e200
2021-02-01 18:29:06 -08:00