Commit Graph

845 Commits

Author SHA1 Message Date
Sunny Goyal f4b457709f Removing the logic around closeSystemDialog on ACTION_CLOSE_SYSTEM_DIALOGS
Launcher does not use any panels which need closing & system sends an
onActivityResult(RESULT_CANCELLED), we do  not need special handling for
waitingForResult

Bug: 32127718
Change-Id: Iff5161444bc909442f6acbe52cb3fb5a2d9ae4da
2016-10-18 00:17:54 +01:00
Tony Wickham 0fed55bf03 Add feature flag to disable light status bar
Bug: 32085545
Change-Id: I4860145b00893c20f7e37817e9659ccd90409966
2016-10-12 16:14:36 -07:00
Tony Wickham f0fc3c4674 Merge "Some minor fixes for extracted status bar." into ub-launcher3-calgary-polish 2016-09-29 01:27:07 +00:00
Tony Wickham 345bff3ce6 Some minor fixes for extracted status bar.
- setLightStatusBar() is now updateStatusBar(), with a forceLight
  parameter. We set the status bar to be light if forceLight or
  shouldBeLightStatusBar() (based on wallpaper).
- Force status bar to be light if all apps is open.
- Default to dark status bar, not light (light == dark icons)

Bug: 29452834
Change-Id: I7b102ceff2f1ef2ab8defd4a46c698df4feaf2a5
2016-09-28 16:53:17 -07:00
Sunny Goyal 7bb7ead9f7 Merge "Fixing the newIntent logic to check the state before it has been reset." into ub-launcher3-calgary-polish 2016-09-28 22:57:56 +00:00
Tony Wickham 9311387a22 Enable light status bar when top of wallpaper is light.
(Light status bar = dark icons)

Bug: 29452834
Change-Id: I9f61a05d80158827761c8b62ab40fc50971e27a6
2016-09-28 14:16:11 -07:00
Sunny Goyal 85313735fa Fixing the newIntent logic to check the state before it has been reset.
When home button is pressed, we reset all active state (close all-apps,
folder, shortcuts menu). But we do not go to the default screen if the
active state was non-zero (any of the containers were open).

Change-Id: Ia9a06729d65767124471c5b793323a55d822210a
2016-09-28 12:42:55 -07:00
Tony Wickham 6e74e899d3 Refactor shortcuts drag and drop.
- Instead of creating our own drag view within the container, and
  handling logic to determine when to start a real drag, we start
  the drag immediately and just defer onDragStart().
- To determine when the deferred drag should start, we add a
  DeferDragCondition to DragOptions. The default DeferDragCondition
  never defers a drag, but is overridden for apps with shortcuts
  to defer until the icon is dragged a given distance.
- Because the drag is handled in DragController, including checking
  when to start the deferred drag, DeepShortcutsContainer no longer
  needs to handle touch events and ShortcutsContainerListener has
  been removed.

This change has several immediate benefits:
- The code is much cleaner, because it allows touch handling to be
  done by the DragController through the normal drag flow, without
  recreating logic in ShortcutsContainerListener/DeepShortcutContainer.
- The janky second haptic feedback has been removed (now it vibrates
  when you long press, like everywhere else, but not again when the
  shortcuts close after dragging a distance).
- Drops are animated, instead of just popping the icon back into place.

Bug: 30769920
Bug: 30465972
Bug: 31533078
Change-Id: I679b412b72fbf6c3895d76963311eb5010c8e8db
2016-09-23 18:44:47 -07:00
Hyunyoung Song ea045e7532 Fixing two critical bugs in all apps transition controller
am: 0a9c092c89

Change-Id: I115b7bc6d165dc9d5e73e1878b96d194bfc62da7
2016-09-22 18:17:25 +00:00
Hyunyoung Song 0a9c092c89 Fixing two critical bugs in all apps transition controller
bug#1: if long press from page indicator region, you can pull up all apps
even though the workspace is in overview state.

bug#2: all apps should not intercept touch not only in overview mode
but also in any modal state.

Change-Id: I91c0a181f037f6c2465a983825da3a2da7e2920f
2016-09-20 22:50:06 -07:00
Sunny Goyal 6f28e71e94 Simplifying the startSearch call in launcher callbacks
Change-Id: I722e110903cced237f05667c4d711468d7cd3daa
2016-09-13 14:22:31 -07:00
Sunny Goyal acd0c4204b Merge "Preventing a shortcut which requires permissions from being added to homescreen" into ub-launcher3-calgary-polish 2016-09-10 00:04:51 +00:00
Hyunyoung Song 915d56abc7 Merge "Show IME when search query != null after rotation" into ub-launcher3-calgary-polish 2016-09-09 22:13:33 +00:00
Hyunyoung Song c2fe1147f9 Show IME when search query != null after rotation
Change-Id: Ia35fba140a5addc21bf347cd63b72dc4e357421e
2016-09-09 15:02:20 -07:00
Sunny Goyal fb5096d07b Preventing a shortcut which requires permissions from being added to
homescreen

A shortcut can be added by any app as INSTALL_SHORTCUT is a normal
level permission. But the intent is actually launched by the launcher
app which can have other permission as well.

> When adding a shortcut from the broadcast, verify that the intent does
not require any permission
> When adding a shortcut using the two-step drop process, verify that
the source app also has the permission to create such a shortcut

Bug: 30778130
Change-Id: I710a490d69019dc25709db5a97020c20d9325007
2016-09-08 14:41:01 -07:00
Sunny Goyal add78abb98 Merge "Launcher restore state fixes:" into ub-launcher3-calgary-polish 2016-09-08 21:30:45 +00:00
Sunny Goyal 2100c78bd9 Launcher restore state fixes:
> Creating PendingRequestArgs to store generic request info across
activity instances
> Storing the CALL_PHONE request in PendingRequestArgs

> Handling onActivityResult only after the workspace has loaded.
onActivityResult sometimes modifies launcher db when removing empty
screens, and any add action is also deferred until bindComplete.
This simplifies this logic.

> Always binding the restored page irrespective of pending result.
Before starting a request activity (bind widget permission, or
widget config activity or shortcut picker), workspace commits the
pending screen id to the DB. Hence the restore page is valid when
restore is called (onResume loads with currentPage instead of
restored page)

Bug: 28573143
Change-Id: I34be603cbeb2145f5caf0d18e016f50029e07df8
2016-09-06 15:24:36 -07:00
Sunny Goyal 52851aa3fd Fixing topView not being considered in all places when calculating accessible
and focusable views

Bug: 30563273
Change-Id: I6253ce33ee5c328efdde2ea733029975b31e5eb8
2016-09-02 10:52:07 -07:00
Sunny Goyal 94b510cc68 Some drag and drop code refactor:
1) Adding DragOptions to easily extend drap functionality
2) Changing onDragStarted signature to send more information
3) Updating states for dropTargetButton based on drag event directly
4) Removing folder item based on onDragStarted and not startDrag

Change-Id: I65b684e092ddc081d086bfe2c8c1973ed170eaeb
2016-09-01 15:55:13 -07:00
Hyunyoung Song c8b997a21c Merge "ComponentName null check MUST proceed before creating ComponentKey." into ub-launcher3-calgary-polish 2016-08-31 18:30:00 +00:00
Tony Wickham def6e474da Use promisedIntent instead of intent when deep shortcuts are restored.
This ensures that the intent has the package corresponding to the
shortcut publisher, rather than a market intent. It also ensures that
the intent has the EXTRA_SHORTCUT_ID attached.

Bug: 31123204

Change-Id: I05d56396b629880322e915f52bfc0605b921b0b1
(cherry picked from commit fc02c1b446)
2016-08-30 00:09:11 +00:00
Tony Wickham fc02c1b446 Use promisedIntent instead of intent when deep shortcuts are restored.
This ensures that the intent has the package corresponding to the
shortcut publisher, rather than a market intent. It also ensures that
the intent has the EXTRA_SHORTCUT_ID attached.

Bug: 31123204

Change-Id: I05d56396b629880322e915f52bfc0605b921b0b1
2016-08-29 15:59:28 -07:00
Hyunyoung Song d3bf9803f5 ComponentName null check MUST proceed before creating ComponentKey.
Change-Id: I2460561b62d77d3f2f17dc2a7db765785b46a8c6
2016-08-29 14:43:53 -07:00
Sunny Goyal 2fb1356be6 Merge "Moving the scrim to draglayer" into ub-launcher3-calgary-polish 2016-08-25 22:49:24 +00:00
Sunny Goyal f3a09f9757 Starting the settings activity with same animation as wallpaper (and widgets tray)
Change-Id: I7744d50c9762200eb2ffea37d8435c9bc221c526
2016-08-25 09:46:39 -07:00
Sunny Goyal 65ceb5aa55 Moving the scrim to draglayer
> This causes the scrim to animate with the content on first launch
> Also removing the logic to disable scrim based on state. That
logic was only executing onResume which could lead to an invalid state

Bug: 30972956
Bug: 30576826

Change-Id: Ia8386b303ce260f69e3b3b93041226f409301a01
2016-08-23 19:04:23 -07:00
Sunny Goyal 112ce42926 Adding a resource pointer to the app name so that derived projects can
easily modify app name

Change-Id: I3f301e1b2ba38d0a45d220bb628dcfdf3906246c
2016-08-22 16:45:58 -07:00
Sunny Goyal e2b2fb79fc Merge "Adding support for pending widgets in AutoInstall layout" into ub-launcher3-calgary-polish 2016-08-17 23:02:42 +00:00
Sunny Goyal 86df138d9f Adding support for pending widgets in AutoInstall layout
> Pending widgets whill show a loading progress while the app
is being installed.
> Extra bind options can be defined using the tub tags
    <extra key="key-name" value="key-value" />
  These are sent as widget options when the widget is bound.
> If the widget has any config activity, it is not shown
> Required attributes:
   className, packageName, x, y, spanY, spanY & screen

Bug: 30279609
Change-Id: I1338618bfa5d86967339dffb68c12b1add6eb5d7
2016-08-16 12:37:29 -07:00
Sunny Goyal 06e21a2587 Moving the state changes during drag-n-drop from startDrag to onDragStart
This will allow drag controller to optinally defer drag, based on some
threshold, by simply deferring the callback onDragStart

Change-Id: I17c06a15e2092b9797c7e57529b12a53d2acae6e
2016-08-15 10:08:16 -07:00
Sunny Goyal 95f3d6ba2c Reloading workspace when the shortcuts permission changes
> Check for permission on every onResume
> If the permission is different than last known permission,
reload and rebind workspace.

Bug: 30789422
Change-Id: Idfa445815e29e2336505779545507d106b33a253
2016-08-10 17:00:15 -07:00
Tony Wickham 4efffc5ba6 Use shortcut disabled message if available.
Bug: 30681210
Change-Id: Ibb5fd58e5fc9557b63730bc1e3c3977133769466
2016-08-05 10:40:12 -07:00
Sunny Goyal f8d2a70e0f Merge "Adding quiet mode support for shortcuts" into ub-launcher3-calgary 2016-08-01 22:04:11 +00:00
Sunny Goyal d3b87ef196 Adding quiet mode support for shortcuts
> LauncherApps returns empty list when the user is locked. Not relying on
LauncherApps in this case
> When the user is locked, removing all dynamic shortcuts
> Loading shortcuts from DB when the user is locked
> Verifying the shortcuts again when the user is available

Bug: 30411561
Change-Id: Ib6eb372c5b009cadb86a8f6e781f3f3cbf787ceb
2016-07-29 16:10:31 -07:00
Hyunyoung Song 72dc60c576 Merge "Cancel exit spring loaded runnable when launcher state is set to APPS or WIDGETS b/29645452" into ub-launcher3-calgary 2016-07-29 21:32:48 +00:00
Hyunyoung Song 06ca7568c6 Cancel exit spring loaded runnable when launcher state is set to APPS or WIDGETS
b/29645452

By cancelling the runnable, we are enabling transition:
state1 -> state3 instead of state1-> state2-> state3.
Transition state1->state3 is a viable transition that is
supported by our model.

        Launcher           Workspace
--------------------------------------------
state1  APPS_SPRING_LOADED SPRING_LOADED
state2  WORKSPACE          NORMAL
state3  APPS               NORMAL_HIDDEN


Change-Id: If27905567efe439324494e0091a4b42fcbf01448
2016-07-29 13:03:54 -07:00
Winson Chung c42087e5c0 Merge changes I33da0d7f,I36c31609 into ub-launcher3-calgary
* changes:
  Working around incorrect wallpaper offsets being calculated in RTL.
  Fixing RTL wallpaper scrolling.
2016-07-29 05:49:20 +00:00
Winson c7d2e83c15 Working around incorrect wallpaper offsets being calculated in RTL.
- When launcher starts up, onCreate() triggers the launcher model loader
  to start, which calls bindScreens() to add the workspace pages.  
  However, layout does not happen until the device is unlocked, which 
  means that even though the default screen index and children are there
  the page scrolls are calculated incorrectly, and even in RTL, the 
  page scroll for the 0th screen is zero (it should be at the right
  most edge of the workspace).  This CL works around this by deferring 
  until the first layout after bindScreens() to unlock the wallpaper
  offset from its default bounds.  The workaround is only applied when 
  the launcher activity is first created.

Bug: 28795125
Change-Id: I33da0d7f934f5337d26e69f068f579a32897a837
2016-07-28 16:21:20 -07:00
Sunny Goyal 55f5bd730c Merge "Showing the shortcuts in the disabled state and removing ti from the menu when its disabled" into ub-launcher3-calgary 2016-07-28 19:23:29 +00:00
Sunny Goyal 70a7c9b700 Showing the shortcuts in the disabled state and removing ti from the menu
when its disabled

Bug: 30315906
Change-Id: Ice747e7be955d8bb2dd65191f7613e2afd4abc1c
2016-07-28 12:22:51 -07:00
Sunny Goyal b5b9ad68b7 Fading in the first screen, when launcher loads for the first time
Bug: 29007436
Bug: 27705838
Change-Id: I95891d0bad19a67985b689bb96d6068dcd85004a
2016-07-28 10:13:30 -07:00
Sunny Goyal a2454ad2d8 Launcher shortcuts animations update.
> The shortcut container closes with an animation
> When opening/closing the animation only the icon scales
and not the title and drag handle
> When dragging the icon, it starts from the original icon position and
moves under the user finger. The container grows to follow the drag view.

Bug: 28980830
Change-Id: Ic0353c30b682d1f018cbf4d62e8a6e8e7d7d4664
2016-07-27 17:37:23 -07:00
Tony Wickham 71538da6e2 Merge "Cleanup deferred drag when closing deep shortcuts container." into ub-launcher3-calgary 2016-07-28 00:29:45 +00:00
Hyunyoung Song dd60ce41b3 Remove two redundant layout pass in AllAppsTransitionController.
Change-Id: I48d043820db962c58e97a09d7888303c1d5bf4ad
2016-07-27 17:08:38 -07:00
Tony Wickham b9da46275b Cleanup deferred drag when closing deep shortcuts container.
This fixes those states where a drag view dangles on the screen
forever until launcher restarts. For instance, long press
Settings and press home before letting go.

Bug: 30291280

Change-Id: Ib8c403a02a17f35ba170c21f78f41bdc3b48d096
2016-07-27 23:44:53 +00:00
Hyunyoung Song 9dcf0a3ef7 AllAppsTransitionController always use LauncherStateTransitionAnimation
b/30375760

Change-Id: Iee2f8060e4d272d276ddd5d40b4bc6053e8c7778
2016-07-27 10:55:51 -07:00
Hyunyoung Song 68f98ac102 Long press on the caret should start search on all apps container
Change-Id: I87e6b8a9b43bf8a84bcf4d39302bc5c6f6a5f3fd
2016-07-22 14:26:14 -07:00
Sunny Goyal 58368b1515 Merge "Increasing the size of the drag icon when a shortcut is dragged" into ub-launcher3-calgary 2016-07-22 17:47:50 +00:00
Hyunyoung Song c001cf5620 Animate discovery bounce for all apps pull up interaction
b/30221381

> Will not support landscape case. If the user knows how to enable
rotation, it's very unlikely they don't know how to bring up apps drawer
> If unlocked using finger unlock immediately after screen is turned
off, bounce is not shown due to delay in ACTION_SCREEN_OFF broadcast

Change-Id: Ia8b7e572eaa4aeab8b1add1e5660fee3a63ba21c
2016-07-21 17:32:43 -07:00
Sunny Goyal 157793dda4 Increasing the size of the drag icon when a shortcut is dragged
Change-Id: I7d768657300d3229e05d1eb18aec3720a9098ffc
2016-07-21 15:18:24 -07:00