summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
Commit message (Collapse)AuthorAgeFilesLines
* Use Launcher.getLauncher(Context) instead of type-casting.Tony2016-10-071-1/+1
| | | | | Bug: 32010039 Change-Id: Icb80d3e547a706740b84df2cb80f99e4a7f81c43
* Some optimizations in blur outline generatorSunny Goyal2016-09-021-0/+1
| | | | | | | | | 1) Using ALPHA_8 as the start and end bitmap. This removes one extra bitmap generation step 2) Using ByteBuffer on ALPHA_8 bitmap for clipAlpha. This allows us to use byteArray instead of intArray for representing pixels Change-Id: I1b654c439fd491b6b91180ddc562bb97fad857aa
* Removing wrong dead code around direction matchingSunny Goyal2016-08-181-6/+3
| | | | Change-Id: Ic8349fcac4bfe6222b1cbf26e8cbb1810dc32298
* Moving the state changes during drag-n-drop from startDrag to onDragStartSunny Goyal2016-08-151-3/+5
| | | | | | | This will allow drag controller to optinally defer drag, based on some threshold, by simply deferring the callback onDragStart Change-Id: I17c06a15e2092b9797c7e57529b12a53d2acae6e
* Fixing issue with shadow drawing over search bar.Winson2016-07-201-1/+2
| | | | | | - Adding notion of clip-against view for click shadow alignment. Bug: 30255227 Change-Id: Id5716a3484051a55690025d61f709e3d96cbe024
* Moving the QSB out of the cell layout to the Drag layerSunny Goyal2016-07-131-4/+0
| | | | | | | | This allows better edge matching for the QSB. The QSB position is kept synchronized with the page scroll and all-apps transition. But its not visible in spring loaded and overview mode Change-Id: I4e6723607ea966ee672273a9ca67c792fd6b5661
* Allowing the first screen to expand to the screen edgeSunny Goyal2016-06-061-13/+19
| | | | | This allows the QSB to extend all the way to the edge Change-Id: I43c6e21e44fef7fffe6fb12b7afb95549b68679f
* Moving the QSB to the workspace grid.Sunny Goyal2016-05-271-1/+1
| | | | | | | | | | | | The QSB will only be resent on the first screen of the workspace covering the full width of the first row. If will not be movable. The first screen of the workspace will not be movable. The searchDropTargetBar no longer contains the QSB (it can be renamed in aseparate cl). Refactoring all QSB related logic by moving it to a custom view inflated only using xml. Change-Id: Icb4fd6eb855df1af15f685961c38351bf4fd4f4a
* Refactoring out grid occupancy management in a separate classSunny Goyal2016-05-271-243/+126
| | | | Change-Id: I37a830c0f2eb0a0dd4f5fc78fa29127cb18cb3c2
* Simplifying view cluster by using a single int flag instead of 4 booleansSunny Goyal2016-05-111-65/+24
| | | | | | Also fixing the bug where dirty flgas were never being set to false Change-Id: Idbb16d07bef5a157502e1652bd1beb33ff39faaa
* Merge "Stop animating highlighted page border in spring-loaded mode." into ↵Tony Wickham2016-04-071-1/+2
|\ | | | | | | ub-launcher3-calgary
| * Stop animating highlighted page border in spring-loaded mode.Tony Wickham2016-04-041-1/+2
| | | | | | | | | | | | | | | | It looked weird, because the scrim cutout happens immediately and the border flickered into place shortly after. Bug: 27135377 Change-Id: Iff861db73c438c7dabccd6ed7c4ee38dbeb77ea1
* | Fix a couple polish bugs with new folder previewsAdam Cohen2016-04-011-5/+10
|/ | | | | | | | | | -> Don't reuse the same background object for the folder create preview since this can cause interruptions in the animations for previous creation previews. -> When drawing the background to preview creation, don't draw the stroke above the icon since the icon is not yet contained by the folder. Change-Id: Ib666dc2453df465b342c02f3bd109b553a769dcc
* Switch all folder preview rendering to be programmatic (ie. no assets)Adam Cohen2016-03-031-70/+47
| | | | | | | | | | | | | | | -> Refactored the preview background rendering to be much more self-contained. This cleans up a lot of code in the CellLayout, and keeps the logic in the right place. -> We switch to software rendering for performance and compatibility reasons. -> Removed all assets. -> FolderIcon accept animation includes animation of the clipped region. -> 1:1 hand-off of drawing of the FolderIcon background between the FolderIcon and the CellLayout. Unfortunately, CellLayout rendering is still required to work around clipping issues (due to use of software layer). We also need this to support folder creation feedback. Change-Id: Ib8f7fa6359dfedff8145f38dd50ba03849ca0d51
* Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies ↵Sunny Goyal2016-02-231-1/+3
| | | | | | | | breakage" This reverts commit fc956e5a2a818c06ed3424e15b0aa20a3f604658. Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
* Reverting refactoring of Folder and FolderIcon to avoid dependencies breakageSunny Goyal2016-02-171-3/+1
| | | | Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869
* Refactor FolderIcon to separate the preview effect into it's own classAdam Cohen2016-02-121-4/+5
| | | | | | | -> 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 "Making some view properties exported. These will be visible in ↵Sunny Goyal2016-02-111-0/+6
|\ | | | | | | hierarchy viewer" into ub-launcher3-calgary
| * Making some view properties exported.Sunny Goyal2016-02-091-0/+6
| | | | | | | | | | | | These will be visible in hierarchy viewer Change-Id: I940724a7f61d67b8502d77be203a94875bc92668
* | Tweak spring-loaded workspace.Tony Wickham2016-02-081-2/+5
|/ | | | | | | | | | | | | - No page indicators in spring-loaded mode - Don’t move workspace up as high - Scale workspace at 90% instead of 80% on phones - Increase speed of workspace -> spring-loaded -> workspace - Widgets were being scaled down twice when dragging from widget picker - Don't scale up icons when dragging (scaling other stuff down is enough) - Make scrim less dark and panels more transparent - Thin white border around page instead of highlight when hovering Change-Id: I963e91c20d4c0340480d165e0f3b8064783c0cb2
* Added config_springLoadWorkspace to enable/disable spring-loaded workspace.Tony Wickham2015-12-041-0/+8
| | | | | | | | - Added side hints back - Only scale down icons if spring-loaded - Only show App Info drop target if spring-loaded Change-Id: I4b0dddccbe0e80b7ceb6b7266fc527f757744148
* Merge "Add appropriate (tiny) offset to widget drops so they land ↵Tony Wickham2015-12-041-5/+12
|\ | | | | | | | | | | | | | | | | correctly." into ub-launcher3-burnaby-polish am: 8db5d7ca60 * commit '8db5d7ca60e79f007bfce7952c15c74d0ee44bc0': Add appropriate (tiny) offset to widget drops so they land correctly.
| * Add appropriate (tiny) offset to widget drops so they land correctly.Tony Wickham2015-12-031-5/+12
| | | | | | | | | | | | | | Also removed some unused parameters I found on the way. Bug: 25191623 Change-Id: Ib9a30db106467c114cc8b54a5b13ed3e88162d56
* | Merge "Skip to the end of the folder open animation in battery saver mode." ↵Tony Wickham2015-11-251-5/+1
|\| | | | | | | | | | | | | | | | | into ub-launcher3-burnaby-polish am: 6e83dc4031 * commit '6e83dc4031b78ac6e65102b2d936e9e769686fec': Skip to the end of the folder open animation in battery saver mode.
| * Skip to the end of the folder open animation in battery saver mode.Tony Wickham2015-11-121-5/+1
| | | | | | | | | | Bug: 25666809 Change-Id: I867d56a34fc5e0ad6aaabd8b6df47be05ec31966
* | Don\'t add offset to CellLayout\'s fullscreen children.Tony Wickham2015-11-101-3/+8
|\| | | | | | | | | | | | | am: 26b0142543 * commit '26b01425436277447fe24d01ad50d9e64f82109e': Don't add offset to CellLayout's fullscreen children.
| * Don't add offset to CellLayout's fullscreen children.Tony Wickham2015-11-101-3/+8
| | | | | | | | | | Bug: 25411084 Change-Id: Ifbcd0a53cf04a7fc29386f4f09aaf7f972e7354a
* | Merge "Refactoring WallpaperOffsetInterpolator to a new file Removing some ↵Sunny Goyal2015-10-301-14/+1
|\ \ | | | | | | | | | us unused methods" into ub-launcher3-master
| * | Refactoring WallpaperOffsetInterpolator to a new fileSunny Goyal2015-10-161-14/+1
| | | | | | | | | | | | | | | | | | Removing some us unused methods Change-Id: Ife790e5ca6848fa13dc3fab1bba1e6220bf83743
* | | resolved conflicts for a8709ddb to ub-launcher3-masterTony Wickham2015-10-151-4/+6
|\ \ \ | |/ / |/| / | |/ Change-Id: I172395e6e172914627b6dec721070a66520557b1
| * Fix "The specified child already has a parent" IllegalStateException.Tony Wickham2015-10-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was due to a race condition between removing a prebound widget view from the drag layer and adding the same view to the workspace upon dropping it; if you let go of the widget immediately after picking it up, the latter happened before the former. Specifically, the flow was: long-click a widget --> drop --> remove the view from the drag layer if it's not null (it is, so nothing happens) --> the view is finally bound/inflated and added to the drag layer --> add the view to the workspace --> already has a parent. There are actually 2 problems here: one is that the bind/inflate is asynchronous, and can therefore happen after dropping the widget view being inflated, and the other is that the view is added to the workspace even though the transition has barely started (we usually ignore drops if the transition is less than half complete). It turns out that this second problem was also due to a race condition, this time between dropping a widget or app onto the workspace and calling LauncherStateTransitionAnimation.dispatchOnLauncherTransitionStart(). If the drop happened before the dispatch, as in the case of the crash, then the drop was accepted because the transition progress was still 1.0 from the previous transition. I fixed the first problem by removing the drag layer widget view in Launcher where it is potentially used instead of Workspace. And I fixed the second problem by setting mTransitionProgress to 0 in Workspace.onLauncherTransitionPrepare(). I also added some debugging logs. Bug: 23896857 Change-Id: I66944e6d3f23b70dea15f7fb01af0763a1bfcbda
| * Jailing the saved instance state of all the dynamically generated viewsSunny Goyal2015-10-051-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using itemId instead of generating a new id for each item. This is because if the process gets killed, View.generateId will get reset but we will still receive the generated item id map in onRestoreInstance. This will cause conflicts with newly generated item ids. We wrap all the generated homescreen views inside a single sparse array. This ensures that we do not cause any conflict with dynamically generated views in other parts of the UI. Bug: 16840760 Change-Id: I6fe69c2e1dd463402f51222715fae31b9d4dd240
* | resolved conflicts for e78e3d73 to ub-launcher3-masterSunny Goyal2015-09-251-1/+16
|\| | | | | | | Change-Id: Idc119a57e21cf6016ee0fd91866839301db072d6
| * Accessibility fixesSunny Goyal2015-09-251-1/+16
| | | | | | | | | | | | | | | | | | | | | | 1) Use a different content description for temporary new page 2) Use different accessibility description for add widget toast 3) Announce when an item is deleted 4) Announce when hovering over a drop target 5) Announce state during drag-n-drop and widget resize (similar to seekbar) Bug: 23573321, 24057944 Change-Id: Icabb317625e70c78e11c0b4f99b9339172d93594
* | am 1cdb6d06: onDropChild() always marks the cell as occupied.Tony Wickham2015-09-171-0/+1
|\| | | | | | | | | * commit '1cdb6d066123cb9b2f9ea2c66246b29bf1dd9cf2': onDropChild() always marks the cell as occupied.
| * onDropChild() always marks the cell as occupied.Tony Wickham2015-09-171-0/+1
| | | | | | | | | | Bug: 24164487 Change-Id: I11ef638a56b638ee82c3cd748340995970fc7e32
| * Don't repeat ReorderPreviewAnimation for folders/widgets in power save mode.Tony Wickham2015-09-041-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | Since power save mode (introduced in Lollipop, also known as battery saver) disables animations, the ReorderPreviewAnimation looks bad - instead of displaced folders subtly and smoothly moving up and down, they violently jump between up and down positions in rapid succession. Setting the animation to not repeat in this case avoids this issue. Bug: 23675090 Change-Id: I8149610af75e7023dca28a942b3447228083cd33 (cherry picked from commit 9e0702f4af33db569c9ed79bdf311204abe40dd5)
* | When placing a widget, go to a page with enough space.Tony Wickham2015-09-091-0/+20
| | | | | | | | | | | | | | | | | | | | The search for this page starts at the current one and continues to the right (on LTR) until a page is found that can accomodate the widget, taking possible resizing and reordering into account. Bug: 11338870 Change-Id: I2e9a310eb8f74024dca9150f55a525e1309c2f07
* | Don't repeat ReorderPreviewAnimation for folders/widgets in power save mode.Tony Wickham2015-09-021-2/+14
| | | | | | | | | | | | | | | | | | | | | | Since power save mode (introduced in Lollipop, also known as battery saver) disables animations, the ReorderPreviewAnimation looks bad - instead of displaced folders subtly and smoothly moving up and down, they violently jump between up and down positions in rapid succession. Setting the animation to not repeat in this case avoids this issue. Bug: 23675090 Change-Id: I8149610af75e7023dca28a942b3447228083cd33
* | Jailing the saved instance state of all the dynamically generated viewsSunny Goyal2015-08-271-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Using itemId instead of generating a new id for each item. This is because if the process gets killed, View.generateId will get reset but we will still receive the generated item id map in onRestoreInstance. This will cause conflicts with newly generated item ids. We wrap all the generated homescreen views inside a single sparse array. This ensures that we do not cause any conflict with dynamically generated views in other parts of the UI. Change-Id: I6fe69c2e1dd463402f51222715fae31b9d4dd240
* | Refactor StylusEventHelper to provide onButtonPress/Release methodsMady Mellor2015-08-211-2/+2
| | | | | | | | | | | | | | | | This will enable an easier migration to the new M APIs for identifying button presses from stylus / other tools. Bug: 20430722 Change-Id: I41cfa6eff8d76bb83cf1bdaf6623ec1092ed554c
* | Moving drag-drop related code into a separate package.Vadim Tryshev2015-08-201-4/+4
| | | | | | | | | | | | | | | | | | This is per an earlier CR comment "we should probably move all this code to its own package (launcher3.dragndrop) in a separate cl". I'm not moving DragSource because it's referred from gsa code. Bug: 22609426 Change-Id: Ia7204dab99c0c395c66b77143a2d60411153f5f3
* | Some cleanup around drag and dropSunny Goyal2015-08-131-43/+44
| | | | | | | | | | | | | | > Instead of resizing the rect for dragoutline in onDrow, store the resized rect itself > Remove unnecessary inverse matrix calculation Change-Id: If13c3c5aaecba5a1d3a4f5d39199ed82e9662c62
* | resolved conflicts for merge of 3f7550c1 to ub-launcher3-masterSunny Goyal2015-08-041-60/+0
|\| | | | | | | Change-Id: I3bb155473d48832e496a8983f84c20e6e935fa41
| * Calculating widget minSpans and spans statically/independent of orientationSunny Goyal2015-08-031-60/+0
| | | | | | | | | | | | | | | | | | > Filtering the widget list and excluding widgets which dont fit the grid > setting minSpans for the widget item when binding. Bug: 22541314 Bug: 22559137 Change-Id: Ieda48b56c95bee0c7ec71dd691af7e23e2d43db6
* | Merge "Several animation calls cleanup" into ub-launcher3-masterSunny Goyal2015-08-031-12/+8
|\ \
| * | Several animation calls cleanupSunny Goyal2015-07-311-12/+8
| | | | | | | | | | | | | | | | | | | | | > Using View property instead of strings to avoid extra reflection step > Using ViewPropertyAnimator when several properties are being animated Change-Id: I41625643b38b70bac11e2c81d18058ec878d73bd
* | | am ec70312d: Merge "Fixing issue with flash during overview transition." ↵Winson Chung2015-07-311-1/+6
|\ \ \ | |/ / |/| / | |/ | | | | | | into ub-launcher3-burnaby * commit 'ec70312dea4083416d2d132ea8853455b0dec616': Fixing issue with flash during overview transition.
| * Fixing issue with flash during overview transition.Winson Chung2015-07-311-1/+6
| | | | | | | | | | | | | | | | | | | | | | - This is due to the TransitionDrawable which does not actually start an animation until it is first drawn. This workaround will just immediately reset the transition if it is not currently visible instead of animating (which is actually deferred until the next animation into overview mode). Bug: 22414257 Change-Id: Id481303d0c99a20c1d16396c024ab50303f45576
* | Merge "Changing the dogfood check to a static boolean to better handle ↵Sunny Goyal2015-07-281-1/+2
|\ \ | | | | | | | | | proguard optimizations" into ub-launcher3-master