Commit Graph

48 Commits

Author SHA1 Message Date
Jonathan Miranda
c2a49ee2bc resolve merge conflicts of 46378eb881 to sc-v2-dev
Folder icon polish.

- Increase the overlap between the preview items and the background
  so that it appears more intentional (lots of reports of users
  thinking that its a bug)
- Fix bug where clip path was still clipping icons when
  dragging and swiping to home.

Bug: 194339057
Bug: 193701705
Bug: 191225536
Test: test 2 icon, 3 icon, and 4 icon folders
      close folder on 2nd page, ensure clipping
      ensure no preview items are clipped in drag view
      ensure no preview items are clipped in swipe up to home
      test 2x2, 3x3, 4x4, 4x5, and 5x5 grids to ensure no clipping
      of folder icons
      drag and drop folder in and out of hotseat
      create folders (2 icon, 3 icon, 4 icon)

Change-Id: I09ce9ef59e340b1009de3d26eed430a0a8dc4b33
Merged-In: Id49bae33438e10248bef05450d7e2c92c2140748
2021-07-22 00:43:27 +00:00
Jon Miranda
92c1b5d3ab Folder icon polish.
- Increase the overlap between the preview items and the background
  so that it appears more intentional (lots of reports of users
  thinking that its a bug)
- Fix bug where clip path was still clipping icons when
  dragging and swiping to home.

Bug: 193701705
Bug: 191225536
Test: test 2 icon, 3 icon, and 4 icon folders
      close folder on 2nd page, ensure clipping
      ensure no preview items are clipped in drag view
      ensure no preview items are clipped in swipe up to home
      test 2x2, 3x3, 4x4, 4x5, and 5x5 grids to ensure no clipping
      of folder icons
      drag and drop folder in and out of hotseat
      create folders (2 icon, 3 icon, 4 icon)

Merged-In: Id49bae33438e10248bef05450d7e2c92c2140748
Change-Id: Ic3708bd402704f0a6f57ae5315ef602e2bbc6d82
2021-07-20 22:16:21 +00:00
Jonathan Miranda
9bf19c1d7f Merge "Polish folder icon bugs." into sc-dev am: 835fab2305
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15046894

Change-Id: Id5684eeab5e56461eeeb60e23c37221afeb2b4dc
2021-06-22 22:22:56 +00:00
Jon Miranda
fa1e14c4b8 Polish folder icon bugs.
- Fix bug where folders are misaligned.
- Fix bug when closing on 2nd page of large folder.

Bug: 184822585
Test: drag folder originally in hotseat to workspace, vice versa
      test on grid where isScalable=true and isScalable=false

Change-Id: I08a79b8d280df3e3974baaa07e80db6bc4165e58
2021-06-22 11:12:47 -07:00
Sunny Goyal
5d5085c5c3 Fixing widget not laid-out properly in preview
Bug: 185306338
Test: Manual
Change-Id: Ib1ec8a53e4701f6813813b86bf481b837127a909
2021-06-16 15:24:16 -07:00
Jon Miranda
af6ebe87ea Do not add padding left/right when cell layout border spacing exists.
Bug: 188094809
Test: enable layout bounds and view text spanning entire cell
Change-Id: Ia7ed45d0e844b2594a8708e03fe385a321345f5e
2021-06-11 18:02:49 -07:00
Jon Miranda
611dba4c94 Use grid border spacing as widget padding if possible.
Widget padding is added by the system to create reliable consistency
between widgets.

Now that we have added border spacing between cells on the launcher
grid, we have significantly decreased the available space for widgets
on home screens: widget padding is 8dp on all sides, border spacing is
currently spec'd to be 16dp.

We can inset the widget padding added by the system, and instead rely
on the border spacing between cells to create reliable consistency
between widgets.

Bug: 175329686
Test: manual
      turn CellLayout#VISUALIZE_GRID debug flag on
      test drag and drop, resizing using drag handles
      view measurements in go/web-hv
Change-Id: Iabb9f45e82e4ae039f55d7fd27fbd0d23be60191
2021-03-02 15:06:46 -05:00
Tony Wickham
bb4de85c25 Draw folder leave-behind when opening folder in taskbar
Previously there was only support for CellLayout to draw the
leave-behind. Added FolderIconParent interface so any parent can
draw the leave-behind, and implement that by TaskbarView.

Test: Open folder in Taskber, ensure leave-behind draws

Bug: 171917176
Change-Id: I08d1d939a34f971f893994fe05cac972d165ef53
2021-02-16 15:10:05 -08:00
Jon Miranda
228877d37c Add border spacing and fixed cell height to grid.
- Border spacing is the spacing between the cells.
- Workspace cell height is now fixed, and we allocate
  all the "extra" space to three different variable height
  areas.

* Built behind ENABLE_FOUR_COLUMNS flag because it hinders the
default grid.

Bug: 175329686
Test: - set border spacing to 0 and confirm matches prior layout
      - test drag and drop still worked
      - test reordering
      - test widgets
      - test folders
      - test multiwindow

Change-Id: Ic6f3dff577d28ff214bda4b0a787ec7fd08c108b
2021-02-10 17:22:37 -05:00
Samuel Fufa
2ea01e4871 Separate QSB from on device search
Bug: 175125073
[Preview attached to BR]

Change-Id: If967d95e32b58263ede5eb8a3c1b773cef789f28
2020-12-09 12:46:30 -06:00
Sunny Goyal
c4d3201538 Removing support for fake landscape
Bug: 111068105
Change-Id: If31d2f700ddee1d21541735de3a8006ee2a53c5c
2020-04-03 17:11:35 -07:00
Adam Cohen
650869973a Refactor / Cleanup / Simplify a bunch of dnd related rendering / animation
Addresses:
=> Fix folder icon drop location mapping (was very far off)
=> Fix BubbleTextView drop animation shifted by a few pixels
=> Get rid multiple unnecessary calls to setDragMode(none), was breaking
   some of the reorder flow; still some issues to address here.
=> Fix folder icon parallax (didn't work when the folder had a dot)

Test: manual

Change-Id: I5959cf341996f75d30212353ec096ed25bf40ea5
2020-03-21 01:26:09 +00:00
Sunny Goyal
ae6e318711 Initial changes to creating a fake landscape Launcher UI
Workspace and hotseat are drawn in rotated UI giving the impression that the
device is in Portrait, even though it is in landscape

Bug: 131360075
Change-Id: I29c4068af25fd4dcf7039b9a45886e864a137977
2019-05-02 10:59:28 -07:00
Sunny Goyal
ab770a10b9 Making CellLayout inflatable without LauncherActivtiy
This will allow creating cellLayout with a different device profile
or a different activtiy which can be used when displaying multiple
activities in multi-display or generating a preview for changing
display properties.

Change-Id: I386731d95e33c48bdef270ce9c0d3e9feefb6262
2018-11-20 17:11:13 -08:00
Sunny Goyal
41e7328cb5 Fixing LauncherState not getting applied in some cases
> In case of swipe-up from homescreen, super method was not called everytime
> When swiping up from an app, repply() state was skipping as we didn't finish the
  last animation, leading to views staying visible and interactive
> Intercepting touch in RecentsView and pagesView based on visibility

Bug: 76467534

Change-Id: Ia5ef58d508b656f371a32cd2f1de00dd18c6aa5c
2018-03-30 11:06:25 -07:00
Sunny Goyal
29947f0b53 No more waiting around for resume
Apply model updates as son as they arrive instead of waiting for onResume.
Various workspace items do not use any configuration dependent resources.
For Widgets, we wait until the host starts lietening before inflating the actual view.

Change-Id: Icb2f5e5940c1ce6c27062ccd34eff87e80af5ab1
2017-12-19 12:50:17 -08:00
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
0b754e564b Making some methods accessible
Bug: 63996463
Change-Id: I3cd2e21b8aa6744fc8003a131178ce1671e024dd
2017-08-07 07:43:25 -07:00
Jon Miranda
b28c4fcf35 Landscape grid changes for Workspace/All Apps.
This is the just first CL to get eyes on the changes.
Next CL will update the All Apps to be full width.

Bug: 37015359
Change-Id: I2d7ec6851fdc13b8fa654e7e2be3152330243ccc
2017-06-23 11:47:48 -07:00
Jon Miranda
0966072c91 Portrait grid changes for Workspace/All Apps.
Bug: 37015359
Change-Id: Ifbdd0e71c36e532b189e02283e3eeb562ebe2654
2017-06-19 17:02:45 -07:00
Jon Miranda
2126691ce2 Fix widget reorder animations in multi-window mode.
The original animation assumed that the views are not
translated and not scaled. In multi-window mode this
assumption is no longer valid, because app widgets are
scaled and translated to fit center within their cells.

Bug: 32176631
Change-Id: Id60c793730d982277c9d91860e9fb0e6a0df7d38
2016-12-20 09:31:47 -08:00
Jon Miranda
e96798e885 Smooth animation when dropping a widget in multi-window mode.
Factored in app widget scaling in methods related to estimating
widget size and positions.
ie. Dropping a widget that needs to be resized to fit in the
workspace.

Bug: 32176631
Change-Id: I106fe12041565a090047f146a07d4bc80a074b4a
2016-12-14 16:30:20 -08:00
Sunny Goyal
776ca257ce Merge "Defining various modes for CellLayout: Workspace, Hotseat & Folder" into ub-launcher3-master 2016-12-12 20:45:17 +00:00
Jon Miranda
7ae64ffbe1 Scale widgets in multi-window mode.
To keep this CL small and focused, I'm going to create
a separate CL that handles the scaling for the widget in
drag and drop mode.

Bug: 32176631
Change-Id: Id6557d070edb664aa1f4851de7abf494cf8a0677
2016-11-23 10:32:42 -08:00
Sunny Goyal
c13403c612 Defining various modes for CellLayout: Workspace, Hotseat & Folder
> Moving the definition of modes to xml
> Defining attributes in xml

Change-Id: I7a569fdbeb833d569eeeef2f2cbc8214e608ad11
2016-11-21 15:20:16 +05:30
Sunny Goyal
aa8a871e33 Removing widgetGap and heightGap from cellLayout
This values are always set to 0

Change-Id: Ic317efdc65baa22e915f4766c60c67c116bb94a8
2016-11-20 15:26:26 +05:30
Jon Miranda
93e1f04fa9 Hide workspace text in multi-window mode.
* Vertically centers workspace icons.
* New iconDisplay value so shortcut text is not overriden.

Bug: 32176631

Change-Id: I86753bab5b24aafc417e0f77d8c471fc4c0dc7f0
2016-11-15 11:19:03 -08:00
Sunny Goyal
35fe7be54e Removing some deprecated code around page layers
1) setChildrenDrawnWithCacheEnabled: deprecated
2) Removing custom logic based on isHardwareAccelerated. This check was not being
used consistantly everywhere

Bug: 29761236
Change-Id: Ic4a9c764f154497e376e37de2351fe04d1b48500
2016-10-26 13:14:03 -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
Winson
1f06427266 Initial changes to tweak layout.
- Adding DeviceProfile callback for when the launcher layout changes due
  to insets.  This is necessary since there are now different layouts
  depending on which side the navigation bar is on
- Consolidating hotseat and other layout into the device profile 
  launcher layout logic
- Making the all apps icons match the workspace icon height
- Tweaking caret drawable to draw to the bounds specified to simplify
  layout in each orientation
- Fixing minor issue with page indicator shifting in landscape
- Centering overview buttons to the workspace page

Bug: 30021487
Change-Id: I1866bce00b2948f3edd06168c0f88d81207e3f13
2016-07-20 10:17:08 -07:00
Sunny Goyal
7c786f75d1 Allowing the first screen to expand to the screen edge
This allows the QSB to extend all the way to the edge
Change-Id: I43c6e21e44fef7fffe6fb12b7afb95549b68679f
2016-06-06 16:41:57 -07:00
Tony Wickham
11c45f1141 Merge "Add appropriate (tiny) offset to widget drops so they land correctly." into ub-launcher3-burnaby-polish
am: 8db5d7ca60

* commit '8db5d7ca60e79f007bfce7952c15c74d0ee44bc0':
  Add appropriate (tiny) offset to widget drops so they land correctly.
2015-12-04 14:21:19 -08:00
Tony Wickham
a501d49a6a Add appropriate (tiny) offset to widget drops so they land correctly.
Also removed some unused parameters I found on the way.

Bug: 25191623
Change-Id: Ib9a30db106467c114cc8b54a5b13ed3e88162d56
2015-12-03 11:54:13 -08:00
Tony Wickham
26b0142543 Don't add offset to CellLayout's fullscreen children.
Bug: 25411084
Change-Id: Ifbcd0a53cf04a7fc29386f4f09aaf7f972e7354a
2015-11-10 14:49:36 -08:00
Sunny Goyal
42e28092b3 Removing some eclipse warnings
Change-Id: I160feaee81b262be02446885fae643c0be71b7af
2015-08-17 12:56:19 -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
Sunny Goyal
7066003b20 Various lint error fixes.
> Fixing some RTL errors by specifying both marginStart and marginLeft
> Moving all layout direction checks to Utilities
> Explicitely adding @TargetApi before every method

Change-Id: Ibe9c52b93b5a6adeadb27ace2b312770fd732ea0
2015-05-14 12:28:07 -07:00
Sunny Goyal
f7a29e83f0 Removing some unused method params from CellLayout
> Replacing various distance calculations with Math.hypot
> Moving findVacantCell to Utilities

Change-Id: I0cb194b603e52b3bb2b29a095bb4da2bb408ab13
2015-04-24 15:28:20 -07: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
Adam Cohen
5940042d39 Supporting custom widgets provided by launcher
-> This change provides integration for widgets provided by
   the launcher package which can run arbitrary code.

Change-Id: I6052da5c4afed7ee72e3b44d045b9c46f2d84c42
2014-12-05 16:18:41 -08:00
Winson Chung
3a6e7f330e Initial changes for new clings. (Bug 11142616)
Change-Id: Id66ebceb99449941921d9e617dfe0cc05a2e3b65
2013-10-09 17:53:32 -07:00
Winson Chung
69737c3e49 Ensuring that we offset cell items by their destination cell padding. (Bug 10881814)
Change-Id: Idc16ae64b1a0e7f79b8a3ff5da6854fbab7867d2
2013-10-08 17:00:19 -07:00
Vladimir Marko
2824b0750e Don't measure GONE views.
Don't measure GONE views in ShortcutAndWidgetContainer and
PagedView. They will not be processed in onLayout anyway.
This is pre-requisite for avoiding costly onMeasure in GEL.

Bug: 10734110
Change-Id: I4c1bef41d9185af5eda42b43371546c60f341f87
2013-10-07 15:06:20 +01:00
Winson Chung
cdef044036 Fixing some grid spacing issues. (Bug 10754537, 10754538)
- Ensuring app names don't run into each other in folders and on the workspace
- Ensuring that app names are aligned with folder names

Change-Id: Ie8d546eacd52005778d81c46011c1c84bc24118c
2013-09-19 18:07:05 -07:00
Michael Jurka
26acafbe67 Fix crash when setting wallpaper
Also clean up some unused code

Change-Id: Ibef8d3d594cc859a993640fd6ee578e9eeb633d1
2013-09-05 21:52:14 +02:00
Winson Chung
5f8afe6280 Initial Changes for Dynamic Grid
Change-Id: I9e6f1e5167791cf8dc140778dfa447f86424e9bf
2013-08-20 10:56:05 -07:00
Adam Cohen
ec40b2b90c Giving custom content full screen
Change-Id: Icd104fff8a1a315b795a60b812048a6218bf0e5a
2013-07-23 17:47:54 -07:00
Daniel Sandler
325dc23624 Launcher2 is now Launcher3.
Changes include
  - moving from com.android.launcher{,2} to
    com.android.launcher3
  - removing wallpapers
  - new temporary icon

Change-Id: I1eabd06059e94a8f3bdf6b620777bd1d2b7c212b
2013-06-05 23:30:20 -04:00