Commit Graph

48 Commits

Author SHA1 Message Date
Thales Lima
78d00adcbe launcher: create more space options
The grid doesn't have a constant space between cells anymore, so we need
new attributes for the different spaces in different situations.

Bug: 191879424
Test: checking cell size and extra space in dumpsys
Change-Id: I4b6aae5b3fea281490c00cd13d0cd3a25372f21b
2021-10-05 12:26:05 +01: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
Jon Miranda
9d41499a33 Fix bug where preview item icon fades/disappears for a frame during
- Remove fade since we no longer clip icons.
- Ensures a clean handoff between drag view and folder icon preview item.

Bug: 175329686
Test: create folder / add items to folder
Change-Id: Iaab592410734b0b5239dbbddbb9b2ed5a9f5d8b0
2021-06-15 21:14:47 +00:00
Jon Miranda
5688010306 Folder polish - update color extraction, fix contrast issues.
- Also fixes open/close animation when items were not getting clipped
  due to folder not being measured yet.

Bug: 190210234
Bug: 190164147
Test: manual
Change-Id: I230c33d7e4e1871d8d702737c56c79ce46504b8f
Merged-In: I230c33d7e4e1871d8d702737c56c79ce46504b8f
2021-06-14 17:54:19 +00:00
Jon Miranda
f564b65f2a Folder preview polish.
- Fixes notification dot not aligning in 4x5 grid
- Fixes clipping issues with large folders
- Fixes clipping issues with preview item animations

Bug: 188095988
Test: manual

Change-Id: I6821b3cb3c65e5928c7be1cddd7f292a37842698
2021-06-09 10:04:39 -07:00
Jon Miranda
e41dd483e6 New folder icon style (uncropped icons).
- Switch Circle to PathShape as it allows for more flexibility on
  choosing what gets cropped.
- Remove shadows, and stroke.

Bug: 188095988
Test: manual
Change-Id: I602b3efcd35c2c11dc3461f49099c2f2a56eae59
2021-06-04 18:32:10 -07:00
Jon Miranda
7bbd03160f Fix contrast issue with folder background and text colors.
Bug: 187797251
Test: dark wallpaper, light wallpaper, toggle dark theme on both
Change-Id: I57ddfc91878d68735d5ae5ec5ab78222fda101ca
2021-05-11 17:01:53 -07:00
Jon Miranda
0b6fa71deb Add local wallpaper color extraction to folder backgrounds.
- Starts listening to local wallpaper colors as soon as folder
  is positioned.
- The folder open animation already has a background color
  animator.
- For simplicity, folder open animation always starts
  first, and then we cancel its background color animator,
  and start a new animator to the extracted color.
- setAutoCancel would be handy here, but it does not work, will
  track in a separate bug.
- Since folders are reused, we clear our the color extractor on
  folder close.

Bug: 175329686
Test: multiple folders on rainbow background
      open each folder, ensure bg animates to proper color
Change-Id: Ie0f2c0632fa2361f7710ba247d74f882620dec16
2021-05-07 16:16:36 -07:00
Jon Miranda
c1e66b523e Fix folder outline not matching the v28 radius.
Bug: 175329686
Test: manual, open folder and verify no visual artifacts
Change-Id: If7cfaf6f95e43ad6f2636b136bc98961554ebf36
2021-03-11 19:05:45 -05:00
Jon Miranda
e126d72fa8 More grid changes, closer to final specs.
* Added isScalable, minCellWidth, minCellHeight, and borderSpacing attrs

When isScalable is true, we use set workspace cell values to
minCellWidth/minCellHeight and then scale the cell values to
fit the available space. This allows us to have consistent
aspect ratios when two devices match the display/grid options.

This is different from the dynamic grid, which calculates
cell values based on iconSize/textSize/etc and then allows
the cell width to be as wide as space allows.

I adjusted some variables so that they will auto adjust
based on another value, indepenent from whether the
grid isScalable or not. An example of this is the folder
label text, where it's always set to be 1.14x of whatever
the workspace icon text size is. This is so we don't need
to add a bunch of more variables to DisplayOption/GridOption.

Bug: 175329686
Test: - switching between device profiles,
      - testing folder open/close
      - testing in multiwindow
      - testing in landscape
Change-Id: Ia469ae0d65b518469ef264b726db46f4a3210056
2021-02-25 17:34:56 -05:00
Tony Wickham
1906cc33f9 Refactor Folder to use ActivityContext and BaseDragLayer
These are the more generic versions of Launcher and DragLayer, so
that Folders can be used in other surfaces.

Test: Open and close Folders on home screen, ensure works properly
Bug: 171917176
Change-Id: I39b9aedbd8319ca61ea0e776bc95eab585e023d5
2021-02-16 15:06:50 -08:00
Sunny Goyal
8b37c57804 Fixing widget sheet not scrolled using external mouse
> Fixing crash when some properties are not initialized if draw is not called
> Adding robolectic support for UI testing
> Adding robo tests to verify workspace, all-apps, widgets and folder scrolling

Bug: 147312357
Change-Id: Id7756e07f06396359e441cdff2e4f992bdcb97bb
2020-03-31 12:17:09 -07:00
Lucas Dupin
4918ed38d2 Add wallpaper zoom to areas that have blur
Whenever blurring, the wallpaper should also zoom out. This is the
mental model of our Depth System.

Test: manual
Bug: 149792636
Change-Id: I1783eb87fefeb6f917f0ba64f2c6ec8f1f2004fa
2020-03-18 13:29:58 -07:00
Winson Chung
8687bc2131 Initial changes to support blur
- Add a new controller to update the background blur on either the
  launcher or app surfaces based on state or transition

Bug: 149792636

Change-Id: I6103cd3d53a00c8025558dd49bb73137e2980014
2020-03-06 14:45:20 -08:00
Jon Miranda
4744701f60 Fix folder open/close animation when grid size is small.
The issue was that the scaled folder size was smaller than the clip size.
To ensure that the folder size is always larger than the clip size, we
instead scale the contents of the folder instead of the folder itself.

Bug: 143703075
Change-Id: I6eadcc487148fe7e2b7dd9f0ff94a9205048b992
2019-11-19 14:42:48 -08:00
Sunny Goyal
11a50747ed Refactoring some folder binding logic:
> Moving grid calcutation in a separate class
> Moving content saving logic to folder instead of relying on item bind

Bug: 139051851
Change-Id: I81b226dbebe13652482a767c992e8cc8f4f35a60
2019-08-14 12:03:09 -07:00
Hyunyoung Song
d8c71598ee Make folder backgrounds opaque
Bug: 130451254
Change-Id: I3b15d97e44e4ccc2968cfb4402d2479cca958afe
2019-05-15 17:12:39 -07:00
Hyunyoung Song
e751d90c44 Implement 3 shades of folder icon/container fill color
Bug: 130451254

Change-Id: I36d885a2b0247f1bb84cb98073459853ae723331
2019-05-14 10:15:11 -07:00
vadimt
1b383af652 Not using magic constants for navbar height
Change-Id: I6783b8a2ebb059ce35748d8c3e818cbe732ff40d
2019-05-08 17:20:34 -07:00
Sunny Goyal
905262c1a7 Adding utility method to get adaptive icon scale
Change-Id: I5ff190c3b794bb13309375782ccd420e85b59091
2019-05-03 21:31:46 -07:00
Sunny Goyal
066ace1b88 Replacing setAlphaComponent with setAlphaComponentBound for better animation interpolation
setAlphaComponent throws expetion for invalid range, which can cause brashes in overshoot
interpolation

Bug: 118390004
Change-Id: Ic9c5ff3d660eba353b982c4c47ccfaf329b3e296
2018-11-06 09:59:03 -08:00
Sunny Goyal
d0ae492e9f Changing the FolderIcon shape based on AdpativeIcon
> Creating an abstract interface to represent a folderIcon shape
> Defined few common folder shapes
> Picking the folder shape closest to the AdaptiveIcon shape

Bug: 111433118
Change-Id: Ib35eddbdd6692767aa9dbe6aae1a379a68cc456a
2018-10-17 12:14:41 -07:00
Tony Wickham
6a71a5bd77 Add undo snackbar for deleting items
- Add methods to ModelWriter to prepareForUndoDelete, then
  enqueueDeleteRunnable, followed by commitDelete or abortDelete.
- Add Snackbar floating view
- Show Undo snackbar when dropping or flinging to delete target; if the
  undo action is clicked, we abort the delete, otherwise we commit it.

Bug: 24238108
Change-Id: I9997235e1f8525cbb8b1fa2338099609e7358426
2018-08-30 16:22:25 -07:00
Sunny Goyal
d230307a95 Migrating to android-x
Change-Id: I9a774152d13a541e8496dd84f2469bfed407f86d
2018-08-14 15:22:12 -07:00
Sunny Goyal
849c6a2b18 Removing Launcher activity dependency on various animations
(This cl reverts change-Id: I455edcd17bda83ab51c2c04fa40e66097a4d6975)

Various animations were marked for cancellation when launcher activity is
destroyed. This this does not work with multiple activities (Launcher,
fallback recents, shortcut confirmation). Also since launcher activity
handles configuration changes, the activity is not destroyed often.

Instead associating a target with various animations which automatically
cancels the animations when that target goes away.

Change-Id: I64cd095a28075561a9e20c9dcdeb9f90c18e1047
2018-08-10 13:31:46 -07:00
Sunny Goyal
ed7a6937cb Unifying and maintaining the text-alpha and text visibility property
Bug: 76228194
Change-Id: I70be5f9fd22c53864a9a0308f256baa7dc1f3ab7
2018-04-17 20:08:10 +00:00
Sunny Goyal
aeb1643ec6 Launcher state management cleanup
> Removing Widgets and related states
> Fixing different durations being used when opening/closing all-apps
> Removing some unnecessary object allocations when changing state without animation
> Differentiating widget bootm sheel and full sheet in logs

Bug: 67678570
Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
2017-10-17 12:42:08 -07:00
Sunny Goyal
add3d8322d Removing some folder customization options
The old folder preview and animation relied on creating bitmaps for transition.
As we move to hardware bitmaps, creating custom bitmaps which rely on icon bitmaps
would be costly (hardware bitmaps are immutable and cannot be drawn on a software canvas).

Bug: 35428783
Change-Id: I39869ed44feb6a886985ad15775bc1ab55565727
2017-09-08 12:07:24 -07:00
Jonathan Miranda
9ad87463a8 Revert "Update Folders to match spec."
This reverts commit fd8fa136f5.

Change-Id: Ifb8ce81e23f38df2eb2c26f93376eca19caae5b1
2017-07-26 11:05:29 -07:00
Jon Miranda
fd8fa136f5 Update Folders to match spec.
Bug: 63825895
Change-Id: Ia1a139f1afd944eefcd370645142227317e2bf20
2017-07-20 15:08:06 -07:00
Jon Miranda
ecf451457b Polish Folder open animation during drag and drop.
We now use the current FolderIcon background radius as the
clipping size for the Folder, which results in a smoother
hand-off between the two.

Before this change, the Folder would center itself against the FolderIcon
during the hand-off. This resulted in the preview items being fully-visible
in the FolderIcon, to being clipped in the Folder.

Bug: 63709477

Change-Id: I1da187485f28dde92d171729b011ada47a506f85
2017-07-14 13:18:25 -07:00
Jon Miranda
27bdbcae7f Slide in first page preview items in FolderIcon after Folder closes.
If the Folder is not closed on on the first page, we animate the
current page items as if they are in the preview.

When the Folder finishes closing, the first page preview items
slide in as the current page preview items slide out.

Bug: 36022592
Bug: 35064148
Change-Id: I7ede7ed9e091e2a0c3cbe11731744bfe9ce36595
2017-07-10 11:28:57 -07:00
Jon Miranda
de0ea81442 Folder animation polish.
* Use different interpolators so that the prevew items in large folders
  appear aligned with the rest of the folder contents longer (the
  preview item movements are less jumpy).
* Fixed animation elevation on close.

Bug: 63131666
Bug: 35064148
Change-Id: Iecb1a8d3105e630ee00b3ea4b692979efb928d7d
2017-06-29 09:34:17 -07:00
Tony Wickham
aa2272f81c Popup visual changes
- Don't remove elevation during animation (b/62905720)
- Other adjustments (b/35766387)
  - Add "gutter" between notification and shortcuts
  - Change shortcuts to always be primary color (e.g. white)
  - Scale down shortcut icons when notifications present
  - Apply icon extracted color to "Notifications" header

Change-Id: Idf791dc76d15d05d246000ad73810916d7cd1750
2017-06-27 19:43:18 -07:00
Jon Miranda
c7aa37d696 Animate Folder elevation halfway thru transition.
The current implementation had the Folder elevation animate in
after the Folder transition was done completing. To make it appear
more smooth, we animate the Folder elevation halfway thru the
transition.

We will keep the separate FolderIcon shadow fade-in animation on
the closing transition otherwise the shadow will be apparent in the
"preview."

Bug: 62787582
Bug: 35064148
Change-Id: Ifd3d84214b0600b6651005c8e65d90b0d8ade422
2017-06-26 11:31:33 -07:00
Jon Miranda
cb73920b23 Move inner classes out of FolderIcon.
The goal is to eventually move all of the PreviewBackground and
Preview Item drawing out of the FolderIcon class.

Bug: 36022592

Change-Id: Ie0552bb4ca8a7e232c1c454a23558940e9394a14
2017-06-25 21:29:35 -07:00
Sunny Goyal
4e5a878bc4 Fixing two different implementations for animating text alpha
The animator in BubbleTextView maintains an internal state which was getting
invalidated by the FolderAnimator.

Change-Id: I53885fe8f1773ca62fe59f1712056f02ff9a749f
2017-06-23 11:02:02 -07:00
Jon Miranda
a0233f72be Move PreviewBackground into its own class file.
This is done in preparation for new PreviewBackground animation
where we will be animating in the first page preview items when
closing the Folder from a non-first page.

Bug: 36022592
Bug: 35064148
Change-Id: Id4d54da16ddfa852ca639a2dc8d328307d4d443a
2017-06-22 18:34:45 -07:00
Jon Miranda
f9e8626fd0 Fix shadow problems with Folder animation.
The shadow from the top of the Folder is visible through
the transparent part of the 'preview' background. When we
remove the elevation as part of the animation, the shadow
jumps into visibility when the animation is done.

To solve this, we remove the elevation during the Folder animation and
 * Animate the elevation at the end of the Folder opening animation.
 * Animate the shadow of the FolderIcon bg in once the Folder is closed.

Bug: 62787582
Bug: 35064148
Change-Id: Id5d8fcbfa4f74882531334f12488560da2496faf
2017-06-20 09:24:17 -07:00
Jon Miranda
e4a252a16b Fade folder icon text when opening/closing.
Bug: 62065293
Bug: 35064148
Change-Id: I9c54c6d222216fa079c76a069f0ec8dd966d5bfb
2017-06-18 17:47:11 -07:00
Jon Miranda
d5fc4f309f Fix folder animation in RTL mode.
Bug: 37905379
Change-Id: I3d837753b8fd4bcd2e2c59f1aa7c62457f037de3
2017-05-09 08:02:50 -07:00
Jon Miranda
733abf02d1 Fix folder animations in spring loaded mode + polish.
* Changed interpolators.

Bug: 36653850
Bug: 35064148
Change-Id: I44a732be969582f718d7dc2f82a9f976331821cb
2017-03-29 16:42:02 -07:00
Jon Miranda
ce74d2a813 Smoother folder animation tweaks.
1. Start preview item animations later opening
2. Finish item animations sooner when closing
3. 1 & 2 allow the preview items to move as part of
   the Folder and allows for a smoother animation
4. Remove setCurrentPlayTime as it is O API.

Bug: 36522198
Bug: 35064148
Change-Id: If63d4d032078ff4e28b72a09e35da3a71f1d0e27
2017-03-23 14:04:55 -07:00
Jon Miranda
a7cddd2c96 Refactor Folder/FolderAnimationManager code.
* FolderAnimationManager is now lazy loaded.
* Extract methods to simplify code.

Bug: 35064148

Change-Id: I08a72ef19a1f21637f033059d5e228ef67135ccd
2017-03-16 12:12:46 -07:00
Jon Miranda
5f3f4d4280 Added new interpolators for preview items in large folders.
With larger folders, we want the preview items to reach their final positions faster
(when opening) and later (when closing) so that they appear aligned with the rest of
the folder items when they are both visible.

Bug: 35064148
Change-Id: I170ac2db36a3a20ebe5505711ea59e625050bc1b
2017-03-08 12:22:34 -08:00
Jon Miranda
ac3a64dbf4 Fix bug where FolderIcon is invisible when closing Folder with no animation.
When we open the Folder, we set the FolderIcon to View.INVISIBLE.
It is possible to close the Folder without animating it (ie. when apps
are being auto added / auto closed to Work Profile Folder), and so the
FolderIcon is never set to View.VISIBLE.

Bug: 35064148
Change-Id: I2fc5b7ecaceffde0a3f3875870897c18e6e8dadf
2017-03-07 09:41:20 -08:00
Jon Miranda
39f817e60a Fix bug where first page Folder text stays transparent.
This can happen where you drag a new item to a Folder that has
a full first page.

Bug: 36022385
Bug: 35064148
Change-Id: I092a79a13b7f779f09ee7a79488a16fe8bfbc2fd
2017-03-07 08:38:22 -08:00
Jon Miranda
4717011626 New folder animations.
Added FolderAnimationManager, which manages the opening
and closing animations.

All of the animations are done in the Folder.
ie. When the users taps on the FolderIcon, we immediately hide the
FolderIcon and show the Folder inits place before starting the animation.

Bug: 35064148
Change-Id: Icacdbbf78a25489f2eab4fd352f2c6ed71eb710b
2017-03-06 16:25:54 -08:00