Originally there was a bug in a method (isTextClippedVertically) in ButtonDropTarget. While attempting to write a unit test it became necessary to refactor ButtonDropTarget and DeleteDropTarget to decouple them from their dependency on launcher in order to allow for a unit test to be written
The pattern we are introducing here is to decouple Launcher from a controller, in order to facilitate easier testing.
Instead of calling Launcher.getLauncher() we call the method through ActivityContext, which has a testing wrapper already defined. Here is a diagram that explains the old and new pattern
Design Pattern: https://screenshot.googleplex.com/7apiE2DaGDrFzy9.png
Test: isTextClippedVerticallyTest
Bug: b/274402490
Change-Id: I1f3003d0b62dddbceb6e492b15aa5d7352d3a293
The wrapper class is created for further changes that will run the wrapped host in the background.
Test: N/A
Bug: 235358918
Change-Id: I9bd6fc2749c5d4a4d3391fb75d0c3ff1e13d17bf
- In LauncherAccessibilityDelegate.getsupportedActions, it calls supportsAccessibilityDrop on each button regardless if DropTargetBar is visible or not. SecondaryDropTarget.supportsAccessibilityDrop attempts to setupUi which causes measure/layout of DropTargetBar (as well as DragLayer) each time LauncherAccessibilityDelegate.getsupportedActions is called
- To avoid this, only setupUi in onDragStart. In other cases don't call setUi.
- Also fixed a bug that when accessibility is on, upon dragging a suggested app, the secondary action suddenly changed to Uninstall
Fix: 233383721
Test: Enable accessibility, observe no excessive amount of onLayout is called on DropTargetBar
Change-Id: I4d1a00d320cceed81fa1312b5fc5f1081637bea8
Bug: 200841778
Test: Hard-coded the flag to be true, and verified that the snack bar
is shown with the correct text. Also verified that talkback announces
"Item Removed" properly and that the correct log event is produced by
the AppEventProducer which AiAi needs to process the user action.
Change-Id: Ifbb9cf7aecf26cd4bcebf48d4fb07fb3d5af46bb
Test: Add a configurable widget to the home screen, drag it to the
Setup drop target, and swipe up to home from the setup page
Fixes: 187839837
Change-Id: I0912317248a33764d4f2a49db73b8fba44dfeca1
I will use the newly created LauncherAppWidgetProviderInfoTest in a follow-up CL to add tests for the newly added widget sizing APIs.
Test: Automatic: Ran all robolectric tests in launcher3,
Manual: Added a widget, edited the widget, removed the widget
Bug: 179807199
Change-Id: I540b2dbe284c6eb5aa2466a1d13a9581ee59425b
These do not work well with gesture-nav and can potentially
block the Launcher UI.
Instead exposing on custom actions with keyboard accelerator and
using thee internal arrowPopup for resize options
Fixing SecondoryDropTarget not sending appropriate stats log
Bug: 179854703
Test: Verified on device
Change-Id: I268690f8a937896e4350496128a38959003f8939
> Adding a listener in StartsLogManager for listening to events.
This allows events to be directored to the predictor only if
it is already running, instead of creating it.
> Unifying the event format to be same as hotseat predictor
Bug: 160748731
Change-Id: Ib00e6249ff642c030f00bcad5b748255e704d16a
Instead of creating a fixed number of targets, we now pass an ArrayList
of targets to. Any class implementing
LogContainerProviders#fillInLogContainerData can setup it's own target
and add it to the ArrayList, It can also pass the ArrayList to other
LogContainerProvider to capture full Target hierarchy.
Bug: 147305863
Change-Id: I0063c692120fb9e1cff2d8902c5da972d0623418
This is done to avoid shortcuts being crowded when a predicted app is
long pressed.
Bug: 148707493
Test: Manual
Change-Id: I356a2cebfcc329478d96ee815fd641179359a572
Some users are affected by a bug that keeps orphaned app icons after a
package is uninstalled. Since we are unable to pinpoint to what exactly
is causing this, we're adding logs so we could tell where exactly things
are failing.
Bug: 124817089
Change-Id: If168935115a7d323fd60c2b19426c1dbd43dbce3
- Defer starting the activity when an activity is paused, and finish
the current animation to trigger launcher to be resumed
Bug: 132811175
Test: Swipe up and launch a new app
Change-Id: I78b76800052512eb93f69ccf0523f4d752a82ece
Removing a separate table for workspace screens. List of screens are
automatically parsed using the items in the favorites DB. Order of the
screen based on the screen id and rearranging screens is no longer
supported. In case the screens need to be rearranged, all the items
in the favorites db will need to be updated with new screen ids.
This makes backing up the DB (in the same database) easier as only
one table needs to be duplicates.
Change-Id: I8ba947a898f637d780e2f49925e78604263126e8
- Add methods to ModelWriter to prepareForUndoDelete, then
enqueueDeleteRunnable, followed by commitDelete or abortDelete.
- Add Snackbar floating view
- Show Undo snackbar when dropping or flinging to delete target; if the
undo action is clicked, we abort the delete, otherwise we commit it.
Bug: 24238108
Change-Id: I9997235e1f8525cbb8b1fa2338099609e7358426
Also fixes a bug where DeleteDropTarget was logging Remove instead of
Cancel.
Bug: 78793340
Test: Enable verbose logging and manual test
Change-Id: I0f0cfff070eab003ebb745292630bc6ce3243f4d
> Removing AppInfo target
> Switching between uninstall and setup based on the drag view
Bug: 63931362
Change-Id: Iccd6f965fa3d61992244a365efc242122292c0ca