pin-shortcut: Tracks hotseat states and adds unpin option for taskbar
This cl adds the unpin option by tracking the hotseat/taskbar state. The option shown is determined by the following conditions: 1. If the target non-predicted item is on the taskbar, shows "Unpin from taskbar" 2. If the taskbar is not full, that is, reaching the limit of the available spaces, and the target item is anywhere outside of the taskbar, including All apps, shows "Pin to taskbar". 3. If the taskbar is full, simply don't show any shortcut option. This cl also removes the option that will be shown on Launcher homescreen or hotseat, as further UX alignment is needed. One note about why the pin shortcut is not implemented in the getShortcuts(). The reason is that getShortcuts does not have the ItemInfo of the triggered item, while the SystemShortcut.Factory doesn't have the hotseat/taskbar information. The simplest way at this point is to check all the conditions in the controller and then manually add the shortcut into the list. Bug: 375648361 Test: Manual, Recording uploaded to buganizer Flag: com.android.launcher3.enable_pinning_app_with_context_menu Change-Id: I7d048bcb1b00f78651e909fbfcd911052a4cd4ef
Loading
Please register or sign in to comment