summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/FocusHelper.java
Commit message (Collapse)AuthorAgeFilesLines
* Separating the config and flags in different directories so thatSunny Goyal2017-03-071-2/+2
| | | | | | | it is easier to override one or the other Bug: 36001650 Change-Id: I713f4f5dbcf902614ce9f6c7a73bdace7bdf1ea0
* resolve merge conflicts of 2fd0208 to ub-launcher3-masterTony Wickham2016-10-121-2/+2
|\ | | | | | | Change-Id: I20ad6eaace81786be080e28d6eb551908add6d90
| * Use Launcher.getLauncher(Context) instead of type-casting.Tony2016-10-071-2/+2
| | | | | | | | | | Bug: 32010039 Change-Id: Icb80d3e547a706740b84df2cb80f99e4a7f81c43
* | Exposing custom actions using keyboard shortcutSunny Goyal2016-09-231-34/+0
|/ | | | | | | | | | | | | 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
* Adding a flag (enabled by default) to remove the all-apps button.Sunny Goyal2016-06-171-8/+4
| | | | | | | All apps can still be opened by clicking the caret. Bug: 29398447 Change-Id: I61f1b05cea83a0a49d7cc16c518c5419618ba779
* Removing the SearchDropTarget bar as it no longer contains the QSBSunny Goyal2016-06-061-1/+1
| | | | | | | | | | | | > 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
* Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies ↵Sunny Goyal2016-02-231-0/+1
| | | | | | | | breakage" This reverts commit fc956e5a2a818c06ed3424e15b0aa20a3f604658. Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
* Reverting refactoring of Folder and FolderIcon to avoid dependencies breakageSunny Goyal2016-02-171-1/+0
| | | | Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869
* Refactor FolderIcon to separate the preview effect into it's own classAdam Cohen2016-02-121-0/+2
| | | | | | | -> 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
* Merge "Cleanup keyboard code." into ub-launcher3-burnaby-polishTony Wickham2015-12-041-38/+21
|\ | | | | | | | | | | | | am: b88d0bccbe * commit 'b88d0bccbe997e5c45c930698e37f52865bd9210': Cleanup keyboard code.
| * Cleanup keyboard code.Tony Wickham2015-12-041-38/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fullscreen pages (e.g. Now) are focusable via keyboard.Tony Wickham2015-12-031-1/+43
|\| | | | | | | | | | | | | am: 0fa5ada226 * commit '0fa5ada2261a29ad9be7195c8cdb8cb50bdd0742': Fullscreen pages (e.g. Now) are focusable via keyboard.
| * Fullscreen pages (e.g. Now) are focusable via keyboard.Tony Wickham2015-12-031-1/+43
| | | | | | | | Change-Id: I962551651aeb9ac7b57bb51b195adc3140db30d8
* | Make sure pages are always accessible via left/right arrow keys.Tony Wickham2015-12-031-10/+87
|\| | | | | | | | | | | | | am: af78b59af1 * commit 'af78b59af19264105b8ce856defa5342d6fd584a': Make sure pages are always accessible via left/right arrow keys.
| * Make sure pages are always accessible via left/right arrow keys.Tony Wickham2015-12-031-10/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Merge "Add special column for All Apps button in FocusLogic\'s sparse ↵Tony Wickham2015-12-031-12/+10
|\| | | | | | | | | | | | | | | | | matrix." into ub-launcher3-burnaby-polish am: b879abd274 * commit 'b879abd2747c1c1473c8d2b9d9c97707da8218f3': Add special column for All Apps button in FocusLogic's sparse matrix.
| * Merge "Add special column for All Apps button in FocusLogic's sparse ↵Tony Wickham2015-12-031-12/+10
| |\ | | | | | | | | | matrix." into ub-launcher3-burnaby-polish
| | * Add special column for All Apps button in FocusLogic's sparse matrix.Tony Wickham2015-11-101-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Handle more cases in FocusHelper#handleHotseatButtonKeyEvent()." into ↵Tony Wickham2015-11-111-8/+34
|\| | | | | | | | | | | | | | | | | | | | | | | | | | ub-launcher3-burnaby-polish am: a43f78fc4b * commit 'a43f78fc4b70bf54b9c90758660b6155ef0257aa': Handle more cases in FocusHelper#handleHotseatButtonKeyEvent().
| * | Handle more cases in FocusHelper#handleHotseatButtonKeyEvent().Tony Wickham2015-11-101-8/+34
| |/ | | | | | | | | | | | | | | | | 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
* | Merge "Stop explicitly snapping to page when navigating with keyboard." into ↵Tony Wickham2015-11-061-7/+2
|\| | | | | | | | | | | | | | | | | ub-launcher3-burnaby-polish am: 0f6f2b181f * commit '0f6f2b181fcf28887b343226cef3b263a65621cd': Stop explicitly snapping to page when navigating with keyboard.
| * Stop explicitly snapping to page when navigating with keyboard.Tony Wickham2015-11-041-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Stop clearing focus when snapping to a new workspace page.Tony Wickham2015-11-031-1/+0
|\| | | | | | | | | | | | | am: 04e2c9ef56 * commit '04e2c9ef5663262fc9dd08ffc4b59fe305a017f3': Stop clearing focus when snapping to a new workspace page.
| * Stop clearing focus when snapping to a new workspace page.Tony Wickham2015-10-301-1/+0
| | | | | | | | | | | | | | | | | | 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
* | am 2949fb5b: Fixing talk-back folder icon removal regression.Winson2015-09-241-2/+2
|\| | | | | | | | | * commit '2949fb5b16a07259e221c5c04470e90c8afb4ea8': Fixing talk-back folder icon removal regression.
| * Fixing talk-back folder icon removal regression.Winson2015-09-241-2/+2
| | | | | | | | Change-Id: I0b7fff645828d5198500973f1c9ea74f406a1a43
* | am a3c9fb12: Merge "Requiring key chord to delete icons and folders on the ↵Winson Chung2015-09-181-9/+37
|\| | | | | | | | | | | | | workspace" into ub-launcher3-burnaby-polish * commit 'a3c9fb125c7449df5add990e91e0e3471e3cc776': Requiring key chord to delete icons and folders on the workspace
| * Requiring key chord to delete icons and folders on the workspaceWinson2015-09-141-9/+37
| | | | | | | | | | | | | | - Also fixing case where the all apps button to search for more apps was not focusable Bug: 20639227 Change-Id: Ie4d9092e654d3cafc0eb346b3bb744ec3e295e92
* | am c0b52fef: Refactoring to ensure item deletion always removes from the DB.Winson2015-09-101-4/+8
|\| | | | | | | | | * commit 'c0b52fefbc11531d560359c093484099f9d1298e': Refactoring to ensure item deletion always removes from the DB.
| * Refactoring to ensure item deletion always removes from the DB.Winson2015-09-101-4/+8
| | | | | | | | | | | | | | | | | | | | | | - 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
* | Changing the dogfood check to a static boolean to better handle proguard ↵Sunny Goyal2015-07-161-1/+2
|/ | | | | | optimizations Change-Id: I892b88ce1a007fafc23a73ad4193c5c4aa411d1b
* Code cleanupSunny Goyal2015-06-051-6/+6
| | | | | | | | > Removing obsolete logging > Removing unused methods > Removing resource leak warning due to non-static handler class in launcher Change-Id: Ic38cc8aea82899b0b5ee3235f04e5964e49245fb
* Removing some synthetic method creationSunny Goyal2015-06-021-1/+1
| | | | | | > Make package-private and @Thunk all private methods and constructors accessed from inner classes. Change-Id: Ie5913860a0c33e48e9bf68f9b5b1699f64c2f174
* Creating landscape and portrait device profiles at app initializationSunny Goyal2015-05-221-7/+8
| | | | Change-Id: Ide9d007adc36b348e19b05cdf49e87f8b02db60e
* Refactoring DeviceProfileAdam Cohen2015-05-211-16/+19
| | | | | | | | | | | | | | | | | | | | -> 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
* Fixing issue where the prediction bar apps are not focused.Winson Chung2015-05-211-2/+4
| | | | | | - Also fixes issue where all apps is not accessible by keyboard when there are no other apps in the hotseat. Bug: 21334471
* Fixing folder focus logicSunny Goyal2015-04-161-99/+56
| | | | | | | | | | > 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
* Focus handling null pointer exception during monkey tests.Hyunyoung Song2015-04-161-1/+9
| | | | | | | | | - 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
* Focus handling - RTL supportHyunyoung Song2015-04-131-169/+122
| | | | | | | | | | | - 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
* Reducing method count by eliminating synthetic accessorsAdam Cohen2015-03-201-2/+3
| | | | | | | | | | | 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
* key event focus logic should support large tabletsHyunyoung Song2015-03-171-18/+25
| | | | | | | | | | | 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
* Adding a scrollable folder content implementationSunny Goyal2015-03-091-8/+37
| | | | | | | | > 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
* Merge "Refactoring folder content" into ub-launcher3-burnabySunny Goyal2015-03-051-3/+1
|\
| * Refactoring folder contentSunny Goyal2015-03-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | > 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
* | Fix the broken build from recent focus navigation handling codeHyunyoung Song2015-03-041-2/+2
| | | | | | | | | | | | (compilation error). Change-Id: I9beb63a88f8c7c247f397d0495501dbc0f637456
* | [key event focus] DPAD navigates to the nearest item on next/previous pageHyunyoung Song2015-03-031-1/+45
|/ | | | | | | | | | | | | | | | 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
* [key event focus handling] (1)hotseat <-> icon now symmetric, (2)support DEL ↵Hyunyoung Song2015-02-241-27/+45
| | | | | | | | | | | | | | | | | | | 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
* [key event focus handling] Cleanup/Refactor/FeatureHyunyoung Song2015-02-201-530/+296
| | | | | | | | | | | | | | 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
* Removing AccessibleTabView and some other dead code.Sunny Goyal2014-10-211-208/+0
| | | | Change-Id: Ia122a6277f924e6077dbf15a4dc40b5042aa987d
* Changing hotseat keyboard controlsSunny Goyal2014-08-201-41/+82
| | | | | | | | | | > Left and right keys don not navigate to next/prev page > Down arrow on apps apps last row, do not take the focus to the end > Nagivation sounds when focus changes issue: 16352221 Change-Id: I5982f22dc80c408673092f8fa8ca1b2fc6381635