Commit Graph

83 Commits

Author SHA1 Message Date
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
4043b05cde Cancel badge scale anim when setting new badge scale
Otherwise it's possible the badge scale animation will override the
non-animated set value, which could mean a badge continues to show
even though it shouldn't:
- Animate badge scale to 1
- Before animation finishes, set badge scale to 0
- Badge scale ends at 1, since animation wasn't cancelled, so we
  continue to show it indefinitely

Also exported some properties in case a similar issue arises.

Bug: 111791593
Change-Id: Ia1a417239b909886adf9351e9bdc06a3b22d8b73
2018-08-17 13:47:39 -07:00
Sunny Goyal
d230307a95 Migrating to android-x
Change-Id: I9a774152d13a541e8496dd84f2469bfed407f86d
2018-08-14 15:22:12 -07:00
TreeHugger Robot
52b28f0926 Merge "Adjust notification dots" into ub-launcher3-master 2018-08-09 22:19:57 +00:00
Tony
05d98c246b Adjust notification dots
- Use consistent bounds for folders as other icons, to ensure dot
  has a consistent placement (moved right+up a bit)
- Strengthen the ambient shadow to improve contrast
  - Increased blur size and opacity
- Use a dark gray rather than black for dots on dark folders

Bug: 73331123
Change-Id: I888f4645d3a48465af93f5003dda8f8b7c3129f3
2018-07-23 16:41:45 -07:00
Jon Miranda
aeb4dd026c Fix bug where default folder name doesn't change when locale changes.
Bug: 78611156
Change-Id: I25c67fc5ebc3edc2d6090f0da0e37bf2e4c07cbf
2018-07-12 12:41:52 -07:00
Sunny Goyal
0b0847b272 Fixing taskMenu and taskView clicks in fallback activity
> Extracting common methods from Launcher & DragLauncher to base classes
> Remoting some dependencies on Launcher and using the base class instead

Change-Id: I121cacf8a14190b4703cda60bdeb4f79eee69ded
2018-03-15 17:29:43 -07:00
Sunny Goyal
8a2a63b3f0 Moving click and long click handling for items from launcher to separate class
Change-Id: I1d12862205f7fa7f3671ff351e66dba58bb430e2
2018-03-08 15:21:42 -08:00
Derek Sollenberger
26a1b452f4 Stop using deprecated Canvas APIs.
Bug: 73777445
Test: compile
Change-Id: Ic0a1f4ebc10ba46229fd97408c052c0b450b4945
2018-03-01 04:39:57 +00:00
Sunny Goyal
6bb51f425b Removing some unused code path
Change-Id: I16a651d77c6557b33f8389407a222f058a8168d4
2018-01-04 11:12:44 -08:00
Sunny Goyal
179249d804 Dominant color is part of icon cache
> Calculating extracted color during icon generation and storing it in model and DB
> Removing unused logic avoid various types of badge rendering
> Icons are badged with extracted colors, while folder is badged with theme color

Bug: 35428783
Change-Id: I93e30c52fbded7515c3ae1778422e84672eafb56
2018-01-03 16:55:58 -08:00
Sunny Goyal
5bc6b6f14c Consolidating various interpolators
Change-Id: I9588eee3552001b162a1e8d5ccefcfb44d221880
2017-10-26 16:38:55 -07: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
1797af41d1 Cleaning up drag state management.
When the drag is started, the UI automatically goes into spring loaded mode. On a successful
drop, it is the responsibility of the {@link DropTarget} to exit out of the spring loaded
mode. If the drop was cancelled for some reason, the UI will automatically exit out of this mode.

Bug: 34692289
Change-Id: Ic611739a43bb8d9279b587aaee3039326c143e8b
2017-10-16 13:06:52 -07:00
Jon Miranda
6d3586c761 Polish animation when icon returns to Folder.
ie. The animation when the user drags an icon from a Folder to a
full workspace/hotseat.

Bug: 31443188
Change-Id: If51b23cd8fc822543ac3f550f9fd2e48dd58e0e9
2017-09-11 11:01:31 -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
Jon Miranda
4f59381bc4 Fix bug where dragging app from Search breaks Folder preview.
Bug: 64975940
Change-Id: I3182a9396aa1e34bc3489f794f2de40387c50da3
2017-08-30 11:59:30 -07:00
Sunny Goyal
e29897f503 Adding spring effect for folder icons when dragging similar to adaptive icons
Bug: 63889144
Change-Id: Idd1fd13c6343bf3e0a3a0e5ff0be730d41996575
2017-07-25 14:30:54 -07:00
Jon Miranda
0c172151c3 Fix bug when dragging FolderIcon between Workspace/Hotseat.
Bug: 63902464
Change-Id: I7995295d5c350720030abc6651af681c880464f8
2017-07-24 12:32:41 -07:00
Jon Miranda
4dd024b974 Add new motion for when Folder preview changes due to onDrop.
Instead of changing the display order of the Folder to preserve
the upper left quadrant, we are opting to change the Folder Icon
preview to always show the upper left quadrant.

This means that when adding items to a Folder, the preview items
may change. (They will change when the column size increases).

Bug: 27944225
Bug: 63140071
Change-Id: I863c2479469d68559cab2878030c2087d48217d6
2017-07-14 14:27:44 -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
6c5d10261e Move the PreviewItem drawing/animation logic to PreviewItemManager.
We want this refactor in O-DR since we will be adding more animations:
- closing from a non-first page (ag/2455887 b/36022592)
- new on-drop animations *if we end up removing the permutation logic.

Bug: 36022592
Change-Id: I82b8f5f5033d4fd9bd50fbe414b0fb721891d043
2017-07-06 12:20:56 -07:00
Jon Miranda
69c340a05e Match items in icon preview with items in Folder using permutations.
Before, with the FolderIconPreviewVerifier, we would
adjust which items are displayed in the FolderIcon.
This caused some issues where the apps in the folder
icon would jump to whatever was in the upper left quadrant.

Now, we always display the 4 first items in the icon by
modifying the XY positions of the items within the Folder.

Bug: 27944225
Bug: 35064148
Change-Id: I46c0fbb064d4da4da155e29963bfb92b14e40f07
2017-06-28 09:52:11 -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
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
Sunny Goyal
828b11e5a9 Setting the callback for previewItems to folderIcon. This allows the FolderIcon to get updated
without going through the child'draw pass.
Also simplifying the draw code for the FolderIcon to remove any cycling invalidate calls

Bug: 62900800
Change-Id: I17009a5347a1c3c35426313ac759e0240ce6a395
2017-06-22 10:25:43 -07:00
Sunny Goyal
318f567a84 Prevent recursive draw-invalidate cycle when drawing folder
Change-Id: I4d3e680ee0cd1af9da997ac92c505ca38ee4e810
2017-06-21 16:11:17 -07:00
TreeHugger Robot
7518fa2d40 Merge "Show and update preload icons when they are in a FolderIcon preview." into ub-launcher3-dorval-polish 2017-06-20 18:13:52 +00:00
Jon Miranda
2ef1ab4017 Show and update preload icons when they are in a FolderIcon preview.
Bug: 62626549
Change-Id: Ie0ad06d0239dccb8d8388381ffe845c4bbc079d6
2017-06-20 11:05:34 -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
Tony Wickham
b37200637d Merge "Animate badge after folder closes" into ub-launcher3-dorval-polish 2017-06-16 17:56:31 +00:00
Tony
814deadc2c Animate badge after folder closes
Bug: 62586079
Change-Id: I17d7b88730c16f5cce36972dd485fd10b823f742
2017-06-15 18:30:41 -07:00
Tony Wickham
0ecf5bcfcb resolve merge conflicts of 7092db024 to ub-launcher3-dorval-polish
Test: I solemnly swear I tested this conflict resolution.x
Change-Id: I0f9ed3d42fcb04299c3c23d06629f855614c0538
2017-06-08 15:49:07 -07:00
Tony Wickham
7092db0241 Add support for color extracted notification dots
Changing the badge_color in colors.xml to transparent
will cause them to be color extracted.

When an extracted color is used in the IconPalette, we
desaturate the background. Otherwise we respect the
exact color specified in colors.xml.

Change-Id: Ie82d0c5335fa5f24d4cc47766e4c1719c4916f8b
2017-06-08 21:08:47 +00:00
Sunny Goyal
368ae77201 Defining a dark theme for launcher
> Removing the code for LIGHT_STATUS_BAR as that will be controlled by the theme
> Updating icon cache to always use transparent background for low-res, as the
theme can change the bg color

Change-Id: Iab64ec29cab629ee515af22ec15b95d3f40a9df5
2017-05-24 14:34:04 -07:00
Jon Miranda
c476d6e192 Allow user to place PendingAddShortcutInfo in opened Folder.
Current implementation only allowed dropping PendingAddShortcutInfo
on a FolderIcon.

Bug: 37814579
Change-Id: Ice42421c34665b0ebf199945761c5c86614573a4
2017-05-22 14:49:28 -07:00
Tony Wickham
d5dbf61757 resolve merge conflicts of 02aced978 to ub-launcher3-dorval-polish
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ib44ce0130b9eb01c354f18326d7d3a1eeb2c5eb8
2017-05-19 10:52:19 -07:00
Tony Wickham
e6a790e5ae Use a single color for all icon badges.
Bug: 38346375
Change-Id: I26b7ad3dcfea6a18e169d656e19605c9794eadd3
2017-05-16 13:04:23 -07:00
Jon Miranda
f79e54b8ac Add missing 'leave behind' view for new Folder animation.
Bug: 35064148
Bug: 38338552
Change-Id: Iac1a795acf0ab21cf319e50d8b504cf42fbbb976
(cherry picked from commit 9544c8e498)
2017-05-16 17:20:50 +00:00
Jon Miranda
bdb5424fae Fade in the FolderIcon stroke after Folder animates closed.
When the Folder animates closed, it hides itself the same
time as the FolderIcon becomes visible. Because the Folder
does not have the white stroke outline, there is a visual
jump between the closed Folder and the FolderIcon.

This change is a subtle and easy step towards reducing
the visual jump.

Bug: 35064148
Change-Id: I8aeeed873e7144499d19f3b01c85bfa8a792097f
2017-05-01 19:07:56 +00:00
Tony Wickham
f73161b883 Support notifications with 0 count (show as dots)
am: 0530e8c608

Change-Id: I6ec98b093fbd297d2f57bea91c0eb6b051c4b3c5
2017-04-27 03:01:02 +00:00
Tony Wickham
0530e8c608 Support notifications with 0 count (show as dots)
- Show number if number > 0
- Show icon if number == 0 and a notification specified an icon to show
- Show a dot otherwise
- In cases of multiple notifications, stack a second badge behind the
  first (visuals will be updated in future CL, as well as support
  stacked dots)
- Folders always show dot if any app within has a badge.

Change-Id: I0a89059b0e0a0d174fe739c9da4f75fa18c0edfa
2017-04-26 19:39:05 -07:00
Tony Wickham
0e96f3fea9 Merge "Update icon badges to match spec" into ub-launcher3-dorval
am: 0fa96ea2f6

Change-Id: I5f8e6bdbca13435d54e3b636564f7d3eef58ca5c
2017-04-25 23:59:41 +00:00
Tony Wickham
1237df0a7c Update icon badges to match spec
- Size defined as percentage of app icon size
- Width changes when there are 2 or 3 digits (round rect)
- Offset slightly away from the app icon
  - Had to move drawing to BubbleTextView instead of
    FastBitmapDrawable
- Hide badge when dragging and while popup is open
- Tweaks for some color/text parameters

Bug: 35744066
Change-Id: Ibb15ca634abaa0729aea637c904c4c6889a58c7c
2017-04-25 12:55:02 -07:00
Sunny Goyal
4eaacc7485 Merge "Defining HomeScreenElementTheme for elements which appear on top of wallpaper" into ub-launcher3-master 2017-03-13 18:58:03 +00: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
Sunny Goyal
dec75d5add Merge "Updating FolderIcon drawing to avoid dependency on software layer." into ub-launcher3-dorval
am: 3ba48fa019

Change-Id: Id18f5a34264411582115cde8cddd0dc8ecded8df
2017-03-06 18:59:41 +00:00
Sunny Goyal
19b93b7988 Updating FolderIcon drawing to avoid dependency on software layer.
Instead of cliping using clipPath, using PorterDuffXfermode to clear
area outside the bounds. This provides much better support for antialiasing.
Software layer was also being used for drawing shadow. But since the paint
color was set to transparent, no shadow was being drawn in O. Instead drawing
the shadow using radial gradient.

Bug: 35680116
Bug: 35428783
Change-Id: I0431664400628d5d01675fe72fe7ade01b64d611
2017-03-03 12:51:26 -08:00
Jon Miranda
5fcbad03ef Added getIconSize method to PreviewLayoutRule interface.
This will be used in new Folder animation.

Bug: 35064148
Change-Id: I5573336c0b8a9db8d1e600b1e16de07f48f35a21
2017-03-01 16:06:21 -08:00