Commit Graph

60 Commits

Author SHA1 Message Date
Sunny Goyal
7ce471bdf6 Removing support for CustomContent screen
The supported way to customize Launcher and add a "-1 page" is by
using LauncherOverlays. Custom content screen is no longer supported.

Change-Id: I3f8a2734c287d1a69ae0c038ec1de1d45fa1b464
2017-09-08 14:06:30 -07:00
Sunny Goyal
3d706ad703 Separating the config and flags in different directories so that
it is easier to override one or the other

Bug: 36001650
Change-Id: I713f4f5dbcf902614ce9f6c7a73bdace7bdf1ea0
2017-03-07 09:30:51 -08:00
Tony Wickham
6982de2485 resolve merge conflicts of 2fd0208 to ub-launcher3-master
Change-Id: I20ad6eaace81786be080e28d6eb551908add6d90
2016-10-12 14:38:43 -07:00
Tony
2fd0208605 Use Launcher.getLauncher(Context) instead of type-casting.
Bug: 32010039
Change-Id: Icb80d3e547a706740b84df2cb80f99e4a7f81c43
2016-10-07 12:50:01 -07:00
Sunny Goyal
66b24572e4 Exposing custom actions using keyboard shortcut
Keyboard shortcuts:
  ctrl+A => Open all apps
  ctrl+S => shows deep shortcuts
  ctrl+O => shows custom actions popup

This also removes the direct delete/uninstall key shortcuts, making
actidental icon removal less likely

Bug: 24065447
Change-Id: Iae63370c0f33620628567cffd4df024064d4d02e
2016-09-23 15:57:08 -07:00
Sunny Goyal
bb011dad4e Adding a flag (enabled by default) to remove the all-apps button.
All apps can still be opened by clicking the caret.

Bug: 29398447
Change-Id: I61f1b05cea83a0a49d7cc16c518c5419618ba779
2016-06-17 08:17:22 -07:00
Sunny Goyal
47328fd53f Removing the SearchDropTarget bar as it no longer contains the QSB
> Renaming it to simply DropTargetBar
> Moving AppInfo to the top bar as well
> The workspace pages will extend to the top edge (minus some padding).
Since the QSB is no longer displayed on top of every page, there is
no reason to reserve the space.
> In spring-loaded mode, the workspace cell layout will scale enough
to make room for the drop target bar at the top

Change-Id: I2baf607310335dd576c9d9fcbb75ab708f47ac03
2016-06-06 16:15:46 -07:00
Sunny Goyal
261194387b Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage"
This reverts commit fc956e5a2a.

Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
2016-02-23 02:02:54 +00:00
Sunny Goyal
fc956e5a2a Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage
Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869
2016-02-17 13:27:13 -08:00
Adam Cohen
f9c184a619 Refactor FolderIcon to separate the preview effect into it's own class
-> Created com.android.launcher3.folder package to house most folder-related files
   (aside from the FolderInfo) which is more related to the model than the UI.

Change-Id: I767063e1e4c775c01a799a3bede30cd94ac48ade
2016-02-12 17:28:31 -08:00
Tony Wickham
9ec6d402fa Merge "Cleanup keyboard code." into ub-launcher3-burnaby-polish
am: b88d0bccbe

* commit 'b88d0bccbe997e5c45c930698e37f52865bd9210':
  Cleanup keyboard code.
2015-12-04 18:01:51 +00:00
Tony Wickham
329d8bfa04 Cleanup keyboard code.
This should be the last keyboard CL.
- Fix bug: couldn't focus All Apps button in some cases when the All
Apps column was skipped over. Also added test case for this.
- Stop explicitly passing countX and countY to handleKeyEvent, as
these had to match the matrix dimensions anyways.
- Rename createSparseMatrix() - there were 3 methods of the same name,
but all had different purposes. This is confusing both from a
readability standpoint and also when looking at stack traces.

Change-Id: I08ba8411674fcea43a608856c114dee8dbd22398
2015-12-04 09:48:17 -08:00
Tony Wickham
580ff475e0 Fullscreen pages (e.g. Now) are focusable via keyboard.
am: 0fa5ada226

* commit '0fa5ada2261a29ad9be7195c8cdb8cb50bdd0742':
  Fullscreen pages (e.g. Now) are focusable via keyboard.
2015-12-03 22:34:43 +00:00
Tony Wickham
0fa5ada226 Fullscreen pages (e.g. Now) are focusable via keyboard.
Change-Id: I962551651aeb9ac7b57bb51b195adc3140db30d8
2015-12-03 14:27:55 -08:00
Tony Wickham
b90a9761ae Make sure pages are always accessible via left/right arrow keys.
am: af78b59af1

* commit 'af78b59af19264105b8ce856defa5342d6fd584a':
  Make sure pages are always accessible via left/right arrow keys.
2015-12-03 22:23:11 +00:00
Tony Wickham
af78b59af1 Make sure pages are always accessible via left/right arrow keys.
- Handle NextPageFirstItem as first focusable item in reading order
- Handle PreviousPageLastItem as last focusable item in reading order
- Check the hotseat after the workspace in both cases above
- Dpad horizontal navigation (left/right) uses these as a last
  resort (Rule3) to guarantee an item takes focus if a page exists

Note that it is necessary to search for a focusable item because
widgets are not yet focusable.

Bug: 25591057
Change-Id: I953648bd76c657d660a38427fdd4108bf9963c23
2015-12-03 14:18:06 -08:00
Tony Wickham
800550d63f Merge "Add special column for All Apps button in FocusLogic\'s sparse matrix." into ub-launcher3-burnaby-polish
am: b879abd274

* commit 'b879abd2747c1c1473c8d2b9d9c97707da8218f3':
  Add special column for All Apps button in FocusLogic's sparse matrix.
2015-12-03 20:45:25 +00:00
Tony Wickham
b879abd274 Merge "Add special column for All Apps button in FocusLogic's sparse matrix." into ub-launcher3-burnaby-polish 2015-12-03 20:41:28 +00:00
Tony Wickham
9e163059bb Merge "Handle more cases in FocusHelper#handleHotseatButtonKeyEvent()." into ub-launcher3-burnaby-polish
am: a43f78fc4b

* commit 'a43f78fc4b70bf54b9c90758660b6155ef0257aa':
  Handle more cases in FocusHelper#handleHotseatButtonKeyEvent().
2015-11-11 17:19:53 +00:00
Tony Wickham
4fc8287c78 Handle more cases in FocusHelper#handleHotseatButtonKeyEvent().
The first of these cases seems like they should already have been
present, and the last couple allow you to switch pages by hitting
arrow keys on the edges of the hotseat.

Bug: 25589939
Change-Id: I9378b209250f7dc376fa97efde979bcee2979537
2015-11-10 16:52:14 -08:00
Tony Wickham
6cbd22279e Add special column for All Apps button in FocusLogic's sparse matrix.
The All Apps button creates a number of edge cases, mainly because it
causes the hotseat to sometimes have an extra column than the workspace.
Previously, we sort of swept these problems under the rug by simply
ignoring the All Apps button if other icons were present in the hotseat,
with the assumption that those other icons should get focus instead of
the All Apps button. (If possible, we want to stay in the same column
when moving from the workspace to the hotseat.) But this doesn't always
work, as in the attached bug where the hotseat doesn't get focus at all
when the All Apps button is an obvious candidate for it.

By adding a specialized column in the focus matrix for the All Apps
button, we ensure that moving down to the hotseat stays within the
original column when possible, while also allowing the focus to switch
to the All Apps button if appropriate. Furthermore, we take care to skip
over the All Apps column when necessary in order to maintain all
previous functionality.

Bug: 25590522
Change-Id: I5d6a8ee69de8834314c4689246fe7d54329b2eef
2015-11-10 11:40:58 -08:00
Tony Wickham
94fd1bcf05 Merge "Stop explicitly snapping to page when navigating with keyboard." into ub-launcher3-burnaby-polish
am: 0f6f2b181f

* commit '0f6f2b181fcf28887b343226cef3b263a65621cd':
  Stop explicitly snapping to page when navigating with keyboard.
2015-11-06 18:11:43 +00:00
Tony Wickham
25189851ac Stop explicitly snapping to page when navigating with keyboard.
When an icon grabs focus, it already snaps to its own page, so
the explicit snapToPage() is redundant. And in the case where no icon
will grab the focus, the explicit call puts us in a weird state
because the page snaps but the focus doesn't change (see bug).

(This happens, for instance, if you are moving from an icon on the
bottom right of page 1 and the only icon on page 2 is in the top
left. In this case, the second icon won't take focus because the
angle is too wide according to FocusLogic#handleDpadHorizontal().)

Bug: 25434120
Change-Id: I17b0ef7d86426a2599bc948bf2313dca7e112364
2015-11-04 17:44:32 -08:00
Tony Wickham
38b1220767 Stop clearing focus when snapping to a new workspace page.
am: 04e2c9ef56

* commit '04e2c9ef5663262fc9dd08ffc4b59fe305a017f3':
  Stop clearing focus when snapping to a new workspace page.
2015-11-03 22:07:57 +00:00
Tony Wickham
04e2c9ef56 Stop clearing focus when snapping to a new workspace page.
Clearing the focus was causing the first child in the new page to
immediately take focus, which caused FocusIndicatorView jank when
using a keyboard.

Bug: 25256728
Change-Id: I5ab31ebc3fe370d7ac9e9792b30dab3467023738
2015-10-30 18:04:48 -07:00
Winson
1f832f85d5 am 2949fb5b: Fixing talk-back folder icon removal regression.
* commit '2949fb5b16a07259e221c5c04470e90c8afb4ea8':
  Fixing talk-back folder icon removal regression.
2015-09-24 18:26:44 +00:00
Winson
2949fb5b16 Fixing talk-back folder icon removal regression.
Change-Id: I0b7fff645828d5198500973f1c9ea74f406a1a43
2015-09-24 18:21:16 +00:00
Winson Chung
26bfdd9d5a am a3c9fb12: Merge "Requiring key chord to delete icons and folders on the workspace" into ub-launcher3-burnaby-polish
* commit 'a3c9fb125c7449df5add990e91e0e3471e3cc776':
  Requiring key chord to delete icons and folders on the workspace
2015-09-18 18:53:48 +00:00
Winson
fa56b3f2f1 Requiring key chord to delete icons and folders on the workspace
- Also fixing case where the all apps button to search for more apps
  was not focusable

Bug: 20639227
Change-Id: Ie4d9092e654d3cafc0eb346b3bb744ec3e295e92
2015-09-14 19:47:19 +00:00
Winson
7089a4e197 am c0b52fef: Refactoring to ensure item deletion always removes from the DB.
* commit 'c0b52fefbc11531d560359c093484099f9d1298e':
  Refactoring to ensure item deletion always removes from the DB.
2015-09-10 22:03:57 +00:00
Winson
c0b52fefbc Refactoring to ensure item deletion always removes from the DB.
- Routing the various places where we call through to delete from
  LauncherModel through Launcher, which will delegate the removal
  of the icon from the workspace, and properly handle the removal
  of all items and their contents from the db.

Bug: 23944119

Change-Id: I022fe2b3e79da16b5af87505c4362490b8422686
2015-09-10 14:55:17 -07:00
Sunny Goyal
6c56c68555 Changing the dogfood check to a static boolean to better handle proguard optimizations
Change-Id: I892b88ce1a007fafc23a73ad4193c5c4aa411d1b
2015-07-16 14:09:53 -07:00
Sunny Goyal
4f3e9383eb Code cleanup
> Removing obsolete logging
> Removing unused methods
> Removing resource leak warning due to non-static handler class in launcher

Change-Id: Ic38cc8aea82899b0b5ee3235f04e5964e49245fb
2015-06-05 00:34:06 -07:00
Sunny Goyal
316490e636 Removing some synthetic method creation
> Make package-private and @Thunk all private methods and constructors accessed from inner classes.

Change-Id: Ie5913860a0c33e48e9bf68f9b5b1699f64c2f174
2015-06-02 10:04:59 -07:00
Sunny Goyal
c6205603ef Creating landscape and portrait device profiles at app initialization
Change-Id: Ide9d007adc36b348e19b05cdf49e87f8b02db60e
2015-05-22 08:46:41 -07:00
Adam Cohen
2e6da1539b Refactoring DeviceProfile
-> Pulling out the parts of device profile which can (and need to be)
   initialized and accessed without access to an Activity context,
   ie. the invariant bits.
-> The invariant bits are stored in InvariantDeviceProfile which is
   initialized statically from LauncherAppState.
-> The DeviceProfile contains the Activity context-dependent bits,
   and we will create one of these for each Activity instance, and
   this instance is accessed through the Launcher activity.
-> It's possible that we can continue to refactor this such that
   all appropriate dimensions can be computed without an Activity
   context (by only specifying orientation). This would be an
   extension of this CL and allow us to know exactly how launcher
   will look in both orientations from any context.

Sets the stage for some improvements around b/19514688

Change-Id: Ia7daccf14d8ca2b9cb340b8780b684769e9f1892
2015-05-21 16:16:40 -07:00
Winson Chung
c393b0765d Fixing issue where the prediction bar apps are not focused.
- Also fixes issue where all apps is not accessible by keyboard
  when there are no other apps in the hotseat.

Bug: 21334471
2015-05-21 00:37:50 +00:00
Sunny Goyal
fc3c1edf7b Fixing folder focus logic
> Folder items no longer remain in a linear order when a folder
gets rearranged, and se we need to use createSparseMatrix instead
of createFullArray. Also because of this we need to use getChildAt(x, y)
instead of getChildAt(index)
> Removing traces of AppsCustomizePage (all apps) from FocusHelper

Change-Id: I9007f6b95cb823e27ef4a43ce725fda8ef1b7cf8
2015-04-16 14:53:58 -07:00
Hyunyoung Song
b76cd628e6 Focus handling null pointer exception during monkey tests.
- Also fix a bug where the focus is not navigating to the next page when there
isn't an icon within +45 and -45 range of the origin.

b/20294717

Change-Id: I16dac5c6a0463fbc9f56a447abedad18abadde98
2015-04-16 14:34:09 -07:00
Hyunyoung Song
ada50984dc Focus handling - RTL support
- Support LEFT and RIGHT keys to work across workspaces when in RTL mode.
- Folder icons navigate correctly on DPAD_LEFT/RIGHT events
- Folder navigation across pages also works correctly
- Deleted dead code inside FocusHelper

b/20120358

Change-Id: I7f851cb7ed31f666a91b2f856458d7966ea5f712
2015-04-13 17:44:31 -07:00
Adam Cohen
091440a9cb Reducing method count by eliminating synthetic accessors
Elimates 304 methods based on dex analysis

The java compiler generates sythetic accessor methods for all private
fields, methods and contructors accessed from inner classes. By marking them
package-private and @Thunk instead, sythentic accessor methods are no
longer needeed. These annotated elements should be treated as private.

Change-Id: Id0dc2c92733474250d8ff12fa793d3a8adeb1f26
2015-03-20 11:15:54 -07:00
Hyunyoung Song
18bfaafd3d key event focus logic should support large tablets
TL;DR;; On smaller tablets, landscape = vertical hotseat bar, and
portrait = horizontal hotseat bar. However, in larger tablets, hotseat bar is
always horizontal. This is now correctly handled using DeviceProfile.isVerticalBar
method.

b/19732584

Change-Id: I1035c89b4685be12dbc863f8a1465047a5fec6a6
2015-03-17 11:32:21 -07:00
Sunny Goyal
290800b5b7 Adding a scrollable folder content implementation
> Size is restricted to 3x3 for now
> Drag-drop across page s not implemented yet
> A-Z sorting is not implemented yet

Change-Id: I84328caa6ad910d1edeeac6f3a7fb61b7292ea7e
2015-03-09 14:21:43 -07:00
Sunny Goyal
0b0d9d40ee Merge "Refactoring folder content" into ub-launcher3-burnaby 2015-03-05 04:30:22 +00:00
Hyunyoung Song
ac721f8d5f Fix the broken build from recent focus navigation handling code
(compilation error).

Change-Id: I9beb63a88f8c7c247f397d0495501dbc0f637456
2015-03-04 16:33:56 -08:00
Sunny Goyal
c3a609f950 Refactoring folder content
> Refactoring the CellLayout in folder with a custom view so
that it can be replaced easily with a scrollable paged view.
> Moving some methods from the folder to this new view which
assume a single page layout for the folder
> Changing folder from LinearLayout to FrameLayout to properly
handle focus traversal in case of multi-page folders

Change-Id: I073c00b995488f9f5d8123b00357e094ca2cec7c
2015-03-04 15:55:47 -08:00
Hyunyoung Song
3853171963 [key event focus] DPAD navigates to the nearest item on next/previous page
b/19381790
b/16351792

TL;DR;; Previously, when RIGHT is handled on the right most column of the
current page or when LEFT is handled on the left most column, the next
icon of focus is next page 'first' icon or the previous page 'last icon'.
With this change, the row information is preserved when trying to locate
an icon to give focus in the next/previous page.

Next CL: long awaited unit tests that capture corner cases for different
orientation/ device configuration.

Change-Id: I5278bed45275b3e4cb39fb698df35f90bb45a415
2015-03-03 19:25:16 -08:00
Hyunyoung Song
31178b8237 [key event focus handling] (1)hotseat <-> icon now symmetric, (2)support DEL keycode
TL;DR; (1) Key event navigation from and to the hotseat and icons in the workspace
is now symmetric. Since there is one more icon in the hotseat, only left
N-1 icon navigation was symmetric.

(2) KeyEvent.KEYCODE_DEL and KeyEvent.KEYCODE_FORWARD_DEL can now delete icons
from the workspace. The focus move to the previous icon where the focus
traveled from.

Also contains minor styling and indexing issues.

Bug: 15408321
Bug: 19381790

Change-Id: I16cbcb2693e92eebb830997d01c0bf674073dd51
2015-02-24 22:14:11 +00:00
Hyunyoung Song
ee3e6a7b77 [key event focus handling] Cleanup/Refactor/Feature
1) Focus navigation handling is refactored to Focus utility class.
New 2 step dpad navigation algorithm is inside Focus class
2) Introduced a map (or matrix) that indicates where sparse icons are located inside a grid.
This enables getting rid of the icon sorting logic which was costly.
3) Unified all the dpad handling logic inside the handleXXKeyEvent methods
4) DOWN/UP key will allow navigation between workspace icons and the hotseat
5) Folder icons allow DOWN/UP to navigate to the title

b/19381790

Change-Id: Id45b3f215ef7c1ca5f99b08e3d721e219298627a
2015-02-20 14:25:27 -08:00
Sunny Goyal
1aaf6f20a7 Removing AccessibleTabView and some other dead code.
Change-Id: Ia122a6277f924e6077dbf15a4dc40b5042aa987d
2014-10-21 10:05:23 -07:00