Commit Graph

44 Commits

Author SHA1 Message Date
Hyunyoung Song b2049196b9 Align badging logic with platform IconDrawableFactory.
The current logic in BaseIconFactory is only trying to add the user
badge if the user passed in isn't null and isn't the current user,
then if no such attempt is made, try to add an instant app badge. This
is causing user badge to disappear if the current user is a work
profile. Meanwhile, the badging logic in IconDrawableFactory is to try
to add the instant app badge first, and then always try to add the
user badge.

Bug: 132625654
Test: manually test as in b/128625591

Change-Id: I2241bdb524ca6bc66e545a0ec8433119e0448358
Signed-off-by: Hyunyoung Song <hyunyoungs@google.com>
2019-11-22 15:21:56 -08:00
Samuel Fufa a4431f8abe Icon left side badging
Test: Manual
Bug:138947443
Change-Id: I8a7ce6e1cccfbfd6c2c6fad96768ab64cfdb41b1
2019-11-13 17:06:16 -08:00
Pinyao Ting c1a1ced33a Add IconCache support for deep shortcuts, loads deepshortcut on
background thread.  Added a feature flag to toggle on/off this
feature.

Bug: 140242324
Test:
  1. (Custom Shortcut) Long click on google maps -> widgets -> drag
     driving mode to workspace.

  2. Open chrome -> add to home screen -> add -> add automatically.

  3. InstallShortcutReceiver
     In Launcher.completeAddShortcut, commend out the code that
     calls PinRequestHelper.createWorkspaceItemFromPinItemRequest,
     then open chrome -> add to home screen -> add -> add
     automatically.

  4. ShortcutDragPreviewProvider
     qdb -> long press on suggested app that has deep shortcut
     -> drag to workspace.

Change-Id: If7babe4eddf5434909bf686b4e9bde15e444d9fd
2019-11-05 11:27:28 -08:00
Sunny Goyal 14168431bd Adding support for dynamic calendar and clock icons
Change-Id: Icdba34340a27a4f6dff7310d0bf9fd29aef1330c
2019-10-29 13:50:02 -07:00
Sunny Goyal 3808a69a6c Storing BitmapInfo instead of icon and color directly in itemInfo
This will allow subclassing BitmapInfo to support custom icon/dynamic
icons which can be loaded on the background thread instead of going
through IconFactory which runs on UiThread

Change-Id: Ieced6e91330bdff1b505826d097a8df711dfe967
2019-10-28 11:12:47 -07:00
Pinyao Ting 7242db1a7c Revert "Revert "Revert "Revert "Revert "cache shourtcut image"""""
This reverts commit 28dc8de660.

Reason for revert: the code change introduces significant delay when saving deep shortcut icons in cache.

Change-Id: I5d67ac0c4c867a40e882b7a46be446f8f7f63ac7
2019-10-16 14:52:28 -07:00
Pinyao Ting 28dc8de660 Revert "Revert "Revert "Revert "cache shourtcut image""""
This reverts commit 52908c9adc.

Reason for revert: roll-forward and fixes the crash due to access icon cache on main thread

Bug: 141568904
Change-Id: I1274db349c4f508d9cf59735b5f15180bb0ec033
2019-10-15 09:54:09 -07:00
Samuel Fufa 023188e424 Merge "Scale Icon badges for shortcut and widgets" into ub-launcher3-qt-future-dev
am: f2d486e5b0

Change-Id: I5c2c115b1ee42489d969ff30c48abf00d4a5a3f7
2019-10-07 18:56:02 -07:00
Samuel Fufa aa038af6b3 Scale Icon badges for shortcut and widgets
Test: Manual
Bug: 141262820
Change-Id: I03edc986e3fe1876b6b7ed179b96864d587cb137
2019-10-04 17:06:33 -07:00
Sunny Goyal 1456522cab Merge "Removing static listeners from PackageInstallerCompat" into ub-launcher3-master 2019-10-02 18:27:45 +00:00
Pinyao Ting 52908c9adc Revert "Revert "Revert "cache shourtcut image"""
This reverts commit d13f0c5c45.

Reason for revert: app crashes when adding widgets automatically b/141568904

Change-Id: I5b97f440716c93b1bd93c899e3e1d40e8bbd2885
2019-10-01 09:44:11 -07:00
Sunny Goyal 045b4fab76 Removing static listeners from PackageInstallerCompat
Bug: 141376165
Change-Id: I2b49d53a05a04c622ed5a7b723109a6cc230d230
2019-09-30 23:17:15 -07:00
Pinyao Ting ddd0ff44ba Exclude shortcuts in popup from IconCache.
We want to load from/save icons to icon cache for pinned shortcuts only
to reduce memory footprint.

Bug: 140242324
Change-Id: I25c7d59e29c6e27752b36c2c3c226849d4e177af
2019-09-20 15:24:22 +00:00
Pinyao Ting cfbeab15f5 fix the issue update handler tries to cache a shortcut without valid
bitmap.

Change-Id: Ie400fdb811928015903319eed69879de1728539a
2019-09-16 20:38:44 +00:00
Pinyao Ting d13f0c5c45 Revert "Revert "cache shourtcut image""
This reverts commit f3d58f1f84.

Reason for revert: Rolling forward for development and fixes.

Bug: 140242324
Change-Id: I954cface2e50a5a9a5e143d2ea29fbcebb298ede
2019-09-16 20:20:38 +00:00
Pinyao Ting f3d58f1f84 Revert "cache shourtcut image"
This reverts commit 050f9b1279.

Reason for revert: Test failure on ub-launcher3-master (b/140998509)

Possible Root Cause: This happens when fallback image or default icon was
used for shortcut icon, but shortcut caching logic do not have the logic
to create either fallback image or default icon. So upon updating icon cache,
the icon remains to be null, causing an NPE.

Change-Id: I1ee3bb7a3cab2af5730c2ee77d9370c1578a9ad6
2019-09-16 18:00:26 +00:00
Pinyao Ting 050f9b1279 cache shourtcut image
Deep shortcuts now supports icon cache.

When workspace is being loaded, we will now attempt to load deep
shortcuts from memcache/db.

The icon for deep shortcuts loaded in the workspace is saved to
memcache/db after the workspace is loaded.

Bug: 140242324
Change-Id: I49da8319ad203476fe1e45683e2848dbde3473f2
2019-09-12 09:14:43 -07:00
Sunny Goyal e529a86fbd Adding support for storing keywords in iconCache
Change-Id: I1183e63a6556ebfb3eee5df23d149e09728193a9
2019-08-07 15:51:25 -07:00
Hyunyoung Song ae86d22dfb Guard against NPE inside BaseIconFactory
Bug: 137253043

This is a bandage fix.

Ideally, we should really figure out why TaskIconCache will be sending
null icon drawable to BaseIconFactory.

Change-Id: Ie005006baeddc9a3379283fe7139e590daad9a57
2019-07-18 00:06:04 +00:00
Sunny Goyal 70266689b7 Using a common gradle dependency path
Change-Id: If01b0d7ebd6719935ac467a5f085b0517b133bbc
2019-06-21 12:31:29 -07:00
Lyn Han 1c1b86bf51 Dot location getters
For use by SystemUI-Bubbles flyout-to-dot animation

Bug: 129158983
Test: manual (Bubbles dot looks good)
Change-Id: I53287efcfe3e02b4ba0572d62f138cc52f7f66a6
2019-06-20 22:34:44 +00:00
Hyunyoung Song f69426c484 Add shape detection logic only for circle icons
b/119330044

Change-Id: I93042effa8417167d844f073275e8b941e861e60
2019-06-03 14:05:20 -07:00
Tony Wickham e1cb93f957 Always place notification dots directly on adaptive icon path
- Calculate point on icon path nearest to top right corner, and
  use that as center for the dot
- Cleanup code related to dot offset

Test:
Set each style (different icon shape) and verify dot is in correct
placement for each of:
- Folders
- Icons in folders
- Icons in all apps
- Icons on workspace

Bug: 124414511
Change-Id: I036ed3677e8af222f00d4fad4a36a7e4d9b49ad9
2019-05-06 10:42:55 -07:00
Sunny Goyal 905262c1a7 Adding utility method to get adaptive icon scale
Change-Id: I5ff190c3b794bb13309375782ccd420e85b59091
2019-05-03 21:31:46 -07:00
Hyunyoung Song 2bf3f37f5a Fix icon shape refresh for widgets list / legacy shortcut black bg issue
Bug: 118085499
Change-Id: Ifc3c711815567f40f109e95bcb76c01f23b4a3a2
2019-04-02 11:00:50 -07:00
Hyunyoung Song de87a22773 Assign default adaptive icon background color
Bug: 126327184
Change-Id: I8c6db3cc0c2bf334862b60b0aa27aee4850039f1
2019-03-04 09:47:45 -08:00
TreeHugger Robot bd7678635e Merge "Prevent NPE inside iconloader library" into ub-launcher3-master 2019-02-12 18:09:08 +00:00
Hyunyoung Song f04391896a Prevent NPE inside iconloader library
Bug: 120439430

Even though there is @NonNull annotation, customers may not respect
this annotation.

Change-Id: I01679d01f6920c3cc945c4abe757b907f150aa23
2019-02-12 09:59:15 -08:00
Hyunyoung Song 224b028092 Increase icon cache version
Bug: 123939586

TL;DR;; For users that lost the change icon shape setting in home settings,
their icons will start upgrading to circle resulting in inconsistent
shapes.

Change-Id: Ibe5f1cdcc39a6b8688c287f46bcc7d7b09302b27
2019-02-12 09:23:04 -08:00
Sunny Goyal a5de7c7b52 Using android Q sdk in gradle
Change-Id: I5476b64b5279b5333a6bb241e67f35bf81dfe830
2019-01-30 11:41:02 -08:00
Sunny Goyal 8c48d8bea6 Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
2019-01-29 11:29:52 -08:00
Sunny Goyal 90e3fbca62 Updating folder shape when icon shape changes
> Removing unnecessary threading logic and the code was running on main thread anyway

Bug: 118757840
Change-Id: I7a012db5a0dbe2c23bd6ff2cd39679a803731ee8
2019-01-23 16:43:26 -08:00
Hyunyoung Song a8dbe9267a Make createIconBitmap public method
Bug: 122545624

Change-Id: I47ff6ec20f9d34856a727bdf3e328acee0db7f32
2019-01-08 16:00:25 -08:00
Hyunyoung Song c55a350da8 Refresh icon cache when icon shape path has changed
Bug: 120505990

$ adb shell cmd overlay enable --user 0 com.android.theme.icon.roundedrect
$ adb shell cmd overlay disable --user 0 com.android.theme.icon.roundedrect
$ adb shell cmd overlay enable --user 0 com.android.theme.icon.teardrop
$ adb shell cmd overlay disable --user 0 com.android.theme.icon.teardrop

Change-Id: I06663b9727f7434aae737d39977f1e6cf09bffbf
2019-01-04 11:57:52 -08:00
TreeHugger Robot ddf3592803 Merge "Move BadgeRenderer to iconloader library" into ub-launcher3-master 2018-12-01 00:37:30 +00:00
Tony Wickham 8912b04c80 Move BadgeRenderer to iconloader library
- Rename BadgeRenderer to DotRenderer
- Move drawing parameters to new class DrawParams
- Add leftAlign param
Change-Id: I69de56c13280ba5e7e1ea3868c23edfac01012e9
2018-11-30 16:28:56 -08:00
Sunny Goyal b891eebbb5 Fixing shortcut icons are not getting correct color extraction.
> Avoiding color extraction for icons which have already be evaluated
> Fixing color extraction from hardware bitmaps

Bug: 111343544
Change-Id: I624866e892465684871fbc130003e32945d86460
2018-11-30 01:41:56 -08:00
Sunny Goyal 202fabfe10 Adding reusable version of IconCache and IconFactory
> Adding resource based allowing projects to control cache behavior
> Fixing missing comments from ag/5470467
> Adding support for no-immemory cache

Bug: 115891474
Change-Id: I691206805430cd93d3be78119bc249cefd79790a
2018-11-09 15:44:07 -08:00
Sunny Goyal 1a9cbd3c88 Moving BaseIconCache to icon lib
Change-Id: I4fb56dcd6231a848d152e690edaf8885efbc995a
2018-11-08 15:18:25 -08:00
Sunny Goyal 9a4c5be23e Moving some utility classes to icon lib
Change-Id: I0cc19ea02fb0732e9e1778a18c0d2c229232d179
2018-11-07 13:16:07 -08:00
Sunny Goyal e62d2bb165 Removing some Launcher3 dependencies from BaseIconCache
Change-Id: Ic80ed4a5cd2fc414cd6c27096d798e7f0b8efc72
2018-11-06 14:51:55 -08: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 3ebe28a82b Fixing wrong directory pack for icon lib classes
Change-Id: Ic3690198b1c6204e322ba7b0f46ccef5dfa97181
2018-11-05 22:27:55 -08:00
Hyunyoung Song 719eee2be2 Create iconloader library
Bug: 115891474
Test: Builds everything

Change-Id: I1d75702d4e5a10d694eeb839784a629de2f74dd2
2018-11-02 14:18:45 -07:00