summaryrefslogtreecommitdiff
path: root/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java
AgeCommit message (Collapse)Author
2021-08-31Fix some taskbar stashing issuesTony Wickham
- Don't allow long press to stash between taskbar icons - Ensure taskbar_icon_touch_size is respected; previously it wasn't, because BubbleTextView@shouldIgnoreTouchDown() was returning true in the padding region. For taskbar, we want the whole icon size to be touchable. - Cancel long press when passing touch slop to avoid swipe down being detected as long press Test: long press on taskbar background, both between icons and not; swipe down on taskbar Fixes: 198305464 Change-Id: I36f1d792e91da9a3bf57a2bef1e974b299c4e25c
2021-08-26Merge changes Ib2bc8419,Ia41cb0e3,I43bfbc41 into sc-v2-devAndroid Build Prod User
* changes: Animate PredictedAppIcon when its icon changes Add "wave" animation when entering taskbar edu Add slot machine animation for PredictedAppIcon
2021-08-26Animate PredictedAppIcon when its icon changesTony Wickham
Reuses the slot machine animation to slide in the new icon. Additionally, staggers based on other icons changing before it. Test: open apps, watch predictions change Bug: 197780290 Change-Id: Ib2bc84193a9e350c915dd3486b6c98c6c88d3f83
2021-08-26Add "wave" animation when entering taskbar eduTony Wickham
Each icon scales and translates up, then back down. If the icon is predicted, it also plays a "slot machine" animation through random icons from AllAppsList. Test: Visual Bug: 180605356 Change-Id: Ia41cb0e340347eea6b580d23c8a2386837e9c399
2021-08-26Fix taskbar folder leave-behind not being drawnTony Wickham
I guess FrameLayout has willNotDraw=true by default, so we need to set it to false in order to get onDraw(). Test: open a folder on taskbar Bug: 197866264 Change-Id: Ia521bc3da28527b9c3f1fa7bcdaf5d9ffb7feccf
2021-07-21Merge "Move NavButtons to end of taskbar" into sc-v2-devVinit Nayak
2021-07-20Move NavButtons to end of taskbarVinit Nayak
* Layout hotseat icons from the end instead of the start * IME down and system back arrow are now separate views Bug: 191399224 Test: Tested w/ RTL + LTR in gesture and 3 button nav w/ and w/o IME Change-Id: I4d0ecd0bee0c519892c63eeefef45055b26d349b
2021-07-19Add taskbar stashing feedforward, i.e. hint at upcoming stash/unstashTony Wickham
Also fix unstashing not working in 3P launchers by moving the unstash call from LauncherTaskbarUIController to TaskbarActivityContext Test: long press taskbar background and stashed handle, watch it hint towards the new stashed/unstashed state respectively and then complete the animation when the long press is triggered Fixes: 193926311 Fixes: 192926350 Change-Id: I0e538be9129bf5c600d07f360b8106d7077862ad
2021-06-18Initial commit of taskbar stashingTony Wickham
- Added StashedHandleViewController to provide properties such as ViewOutlineProvider to animate the handle that's shown in place of taskbar while it's stashed - Added TaskbarStashController to coordinate the stashed state, including orchestrating the animation across taskbar controllers - Added TaskbarStashInput consumer to detect long press in the nav region when taskbar is stashed Behavior: - Long pressing taskbar background animates to the stashed state by morphing the TaskbarView into the stashed handle view and offsetting the background offscreen - We persist the stashed state across app launches and reboot; to unstash, long press the stashed handle - We also visually unstash when going back home Test: long press tasbkar background when in an app to stash it, long press the resulting stashed handle to unstash; while stashed, swipe up to home to also unstash until launching another app Bug: 189503603 Change-Id: I698eff785388dff1ef717c76879719d6af236c2d
2021-06-16Updating taskbar icon alignment stateSunny Goyal
Icon alignment is only tied to Launcher paused/resumed state Creating two separate states for this: 1) Launcher paused/resumed 2) Active gesture interaction (live-titles can affect paused state) Removing state handler dependency on taskbar visibility Bug: 190170303 Bug: 187353581 Bug: 187919439 Test: Manual Change-Id: Ia97cdf43cec1d9213f5dc2af8d66258b34c57514
2021-06-15Only inflating taskbar views for valid itemsSunny Goyal
Also enabling view cache for folders Bug: 187353581 Test: Manual Change-Id: I5bc695fd86475f30611bc6b362b4ae93c48c26bb
2021-06-09Reorganize taskbar controllersTony Wickham
Organize existing properties as follows: - TaskbarViewController contains properties affecting TaskbarView (though child icons are still supplied by TaskbarHotseatController) - TaskbarDragLayerController contains properties related to TaskbarDragLayer itself - Renamed NavbarButtonUiController to NavbarButtonsViewController, following the pattern of TaskbarViewController and TaskbarDragLayerController - TaskbarControllers contains the different controllers to make it easier to construct, initialize, destroy, and pass them around - Removed TaskbarIconController as its responsibilities were moved to more specific controllers Test: compiles and runs, manually tested Bug: 187353581 Change-Id: Idccd95d47117101bf9617e5532a5b87635d2b8f6
2021-06-03Taskbar layout updateSunny Goyal
> Calculating the hotseat padding statically > Animating taskbar views individually when animating to home instead of a layout animation > Moving all navbar buttons to a separate layout/controller and independent of Launcher > Fixing RTL layout for taskbar and nav bar Bug: 187353581 Test: Manual Change-Id: If21696f38beee328f553e467394776a8e8ed4c3e
2021-06-01Initial commit of rotation contextual button.Vinit Nayak
UI fixing todo: b/187754252 Bug: 180046394 Test: Works in basic cases with on home and in app taskbar. Change-Id: I69985b57e38a9fdb7935fcafb097b1e6da73a6b9
2021-05-25Taskbar drag starts internal pre-drag before system dragTony Wickham
- TaskbarDragController now extends DragController. - Currently there is no pre-drag condition, so we immediately get onDragStart(), which starts the system global drag (which cancels the original internal drag). - Make the original view invisible during the drag and drop operation, across both internal and system drag events. - No longer handle onDragEvent() in TaskbarView, as TaskbarDragController handles all of it now. Test: Drag and drop from taskbar still works (bonus: starts from the correct registration point that you touched down on). Locally added a PreDragCondition and verified a seamless handoff to system drag and drop when the pre drag end condition was met. Bug: 182981908 Change-Id: I6bf48141a5eedfc6db6f461258e880ef8146e733
2021-05-21Revert^2 "Moving taskbar lifecycle to TouchInteractionService"Sunny Goyal
430465a3d5ff0dcdd0c2e263d862049d93075a07 Bug: 187353581 Change-Id: I7b2280d16adfafd3e85ffc1d22e32d0c00d12b67
2021-05-20Revert "Moving taskbar lifecycle to TouchInteractionService"Kholoud Mohamed
This reverts commit e215fb730bb3d4a357a2c4bf0c082d3c0ad69495. Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/tests/view?invocationId=I13700009003387451&testResultId=TR89423459137251402, bug https://buganizer.corp.google.com/issues/188755902 Bug: 188755902 Change-Id: I4650136975b60f311499ee6ff5b27ab9a32d23d6
2021-05-17Moving taskbar lifecycle to TouchInteractionServiceSunny Goyal
> Inflating taskbar views with a non-launcher window context > Removing separate taskbar view in Launcher > Handling taskbar icon clicks directly instead of going via launcher > Fixing some relayouts during show/hide animation Bug: 187353581 Test: Manual Change-Id: Ia7d44acbb770bf0345922234b3daa5cc040a5843
2021-05-05Add IME switcher/hide button bar when IME showingVinit Nayak
Bug: 180046394 Change-Id: Ic2bd919ab3d27e0a430b081c771ea8dc5827be81
2021-05-05Initial commit of 3 button workVinit Nayak
Home, Back and Recents basic functionality working Fixes: 180046394 Change-Id: Ifc5c767e35e88183500d14d14736eb40df436369
2021-04-13Move taskbar to be closer to QSBTony Wickham
- Offset taskbar to be halfway between QSB and bottom of the screen. - Add taskbar translationY state property to animate when going between launcher and an app. - Draw the taskbar background in TaskbarContainerView instead of TaskbarView so it stays pinned to the bottom as TaskbarView translates up. If we want to have a background behind the taskbar on home, this should move back to TaskbarView so that the drawing can be shared by mTaskbarViewOnHome. Test: visually on home screen, translates when entering and exiting an app Bug: 182981881 Bug: 171917176 Change-Id: I44f8b2c770074f7f015dcccbc2befd3453811193
2021-04-12Update taskbar to add extra hotseat items instead of recent appsTony Wickham
Removes recents-related code including the divider between it and hotseat. Test: manually on device Fixes: 184366189 Bug: 184789479 Bug: 171917176 Change-Id: I7776c98659ded70f53a49befddcd23c8353c6440
2021-03-23Fix taskbar crash after cleanupTony Wickham
- Set LayoutTransition after adding initial views - End running transitions in cleanup - Only run update listener if LayoutTransition is active Test: No crash after taskbar cleanup() Bug: 182512211 Change-Id: I1049857935d09235388c1ef1fe4d89ef53b79aa5
2021-03-22Add TaskbarView as a child of HotseatTony Wickham
Instead of keeping the Taskbar window showing above the home screen, we now integrate a copy of TaskbarView directly into Launcher's view hierarchy. Most TaskbarController calls apply to both TaskbarViews (mTaskbarViewInApp and mTaskbarViewOnHome), except for calls related to Hotseat, which only apply to mTasbkarViewInApp given the real Hotseat will be showing with mTaskbarViewOnHome. More cleanup will follow this change. Test: All taskbar interactions (e.g. drag and drop) continue to work Bug: 182512211 Bug: 171917176 Change-Id: I0f0b124f652daa85f866e1df8f9e2981540331a0
2021-03-12Replace taskbar hotseat with real hotseat when folder is openTony Wickham
- Seamlessly show real hotseat and hide taskbar hotseat, while keeping rest of taskbar visible - Update MultiValueAlpha to allow for taking max alpha instead of blending, and use that for Hotseat - Fix folder open bounds on home screen when taskbar is present Test: Open folder from taskbar on home, can drag out items Bug: 182079330 Bug: 171917176 Change-Id: I7c1983e3219b1341cf233260f0ccac9051c4dc14
2021-03-05Nullify taskbar hotseatView tag when the cell is emptyTony Wickham
This ensures that a removed view becomes invisible. Test: turn off hotseat suggestions, drag an item out and verify it's removed from taskbar as well Bug: 179886115 Bug: 171917176 Change-Id: Iec509c2f0c420cee6f86feb293419bb2249a8dc4
2021-03-04Space out empty taskbar hotseat views when on home screenTony Wickham
This ensures the taskbar hotseat aligns with the home screen hotseat, as the latter supports empty cells. When in apps, the taskbar still collapses the empty cells. Test: Turn off hotseat predictions, remove some hotseat items, and ensure the taskbar hotseat spreads out when on home. Bug: 179886115 Bug: 171917176 Change-Id: I6047c3c5691685edcd8b3519e0305812b1295550
2021-03-03Align real hotseat with taskbar hotseat during drag and dropTony Wickham
Remove hotseat space from workspace in DeviceProfile if taskbar is present, and instantly swap between taskbar and hotseat when entering SpringLoadedMode. To allow for an exact handoff, we also scale up the TaskbarView such that its icons match the hotseat icon size when on the home screen. Note that this CL only supports dragging to the taskbar, not out of it (which still triggers system drag and drop instead). Test: In RTL and LTR, drag a workspace item and ensure hotseat seamlessly swaps with the taskbar hotseat and allows drops. Bug: 179886115 Bug: 171917176 Change-Id: Id6462075b9b0b66b06d51a78c9c0b3e11e83e84d
2021-02-16Draw folder leave-behind when opening folder in taskbarTony Wickham
Previously there was only support for CellLayout to draw the leave-behind. Added FolderIconParent interface so any parent can draw the leave-behind, and implement that by TaskbarView. Test: Open folder in Taskber, ensure leave-behind draws Bug: 171917176 Change-Id: I08d1d939a34f971f893994fe05cac972d165ef53
2021-02-16Folder support in TaskbarTony Wickham
- Add TaskbarActivityContext which allows shared Launcher elements to "just work" using existing generic ActivityContext. - TaskbarContainerView extends BaseDragLayer<TaskbarActivityContext>. - Inflate FolderIcon and Folder using TaskbarActivityContext to be shown in TaskbarContainerView. - Use TaskbarActivityContext's DeviceProfile to determine icon size instead of overriding in styles. This also ensures that normal BubbleTextView icons have the same size as FolderIcons. Test: Place a folder in home screen hotseat, ensure it shows up in taskbar and can be opened, and that apps inside it can be launched or dragged. Bug: 171917176 Change-Id: Ic25d2f84bcd7e3399c88989305ea565497c030d9
2021-02-03Add recent tasks to TaskbarTony Wickham
- Also adds a divider between Hotseat and Recents - Dedupes Recents from Hotseat Test: Open some recent tasks, ensure they are deduped from Hotseat and also handle < 2 tasks. Bug: 171917176 Change-Id: Ia782c6ccbcda94cfd844aad04dc3d25a3f072c2b
2021-02-01Support drag and drop from TaskbarTony Wickham
- Long clicking a BubbleTextView in Taskbar will start a system drag and drop operation, setting the original view invisible meanwhile. - Defer gesture navigation when starting over a Taskbar item, and cancel any started gesture if a Taskbar drag and drop starts. Bug: 171917176 Change-Id: If5049071fbf1755f545ee937daa4edabd869f00d
2021-02-01Delegate Taskbar touches to nearest view to ensure 48x48dp touch sizeTony Wickham
In TaskbarView#onTouchEvent(), which is only reached if a Taskbar icon didn't already consuem the event, check each child to see if the event occurs within a 48x48dp bounding box, and delegate the event and subsequent events to it until UP or CANCEL. Bug: 171917176 Change-Id: I7afafe0835828ab9213ec6abfe4e88ad7b9af3c4
2021-02-01Add Hotseat items to TaskbarTony Wickham
- 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-01-29Animate taskbar background alpha and visibility alphaTony Wickham
Setup codepath to animate the Taskbar when going to and from Launcher, primarily by listening for pause/resume signals but also hints from gesture nav and AppToOverviewAnimationProvider. Additionally, add TaskbarStateHandler to listen for Launcher state changes if Taskbar is enabled. Combined, the end behavior is: - Background alpha is 0 when Launcher is resumed, and 1 when Launcher is paused (we can make this animation more interesting later). - Taskbar is always visible when Launcher is paused, otherwise its visibility is determined by multiple factors: LauncherState and whether the IME is showing. Bug: 171917176 Change-Id: I7856fc979931c9d12d714dee11d179fd1b5a6968
2021-01-22Add empty Taskbar views and initial TaskbarControllerTony Wickham
Guarded by a FeatureFlag. Bug: 171917176 Change-Id: I7145c7ae68282bf53552502798fe758c8c0e285d