Commit Graph

138 Commits

Author SHA1 Message Date
TreeHugger Robot
c6444eef17 Merge "Create a singleton HashMap instead of using Collections.singleton()" into ub-launcher3-master 2017-02-09 21:59:47 +00:00
Tony Wickham
580edcf529 Create a singleton HashMap instead of using Collections.singleton()
The Set returned by Collections.singleton() doesn't support all
operations, causing crashes in certain situations (namely, whenever
a notification is updated rather than added or removed).

Change-Id: Ie104b7f99c4a32db5f1f7e43ec3775d34dc26ce1
2017-02-09 10:30:06 -08:00
Sunny Goyal
d5d5e22715 Updating widget tray theme
Using standard theme attributes rather than custom color codes, so
that it plays nice with system theme changes.

Bug: 34819119
Bug: 34897402
Bug: 21446746
Change-Id: I265fba3ceae8873650fd09e4704838d313155e83
2017-02-09 10:16:22 -08:00
Sunny Goyal
782f0c9a89 Adding support for new APIs in O related to configurable shortcuts
> Config activities can now return PinItemRequest which can be used to pin
  deep shortcuts

Bug: 33584624
Change-Id: Ic0df436bd79e069615b9d60d24eb7594b824b2da
2017-01-19 13:54:31 -08:00
Tony Wickham
9a8d11f930 FastBitmapDrawable can draw an icon badge (notification count)
- Added BadgeInfo to contain data to be shown in a badge
  (currently just notification count).
- Added BadgeRenderer in DeviceProfile to contain things
  relevant to drawing the badge, such as size and Paint's.
- Added IconPalette to compute colors for the badge based
  on a dominant color (will also be used for notifications)
- FastBitmapDrawable uses these classes to draw the badge.

Bug: 32410600
Change-Id: I6595a4879943357590f7d20c22594691a573ecaf
2017-01-13 10:58:10 -08:00
Sunny Goyal
49f19f0af9 Adding some logging around launcher restore
> Also enabling fileLog when the device is debug build (even when
launcher is not dogfood build)

Bug: 30735662
Change-Id: Ieab2c962d57f6f7f972f8111070d4ecbef06b3e7
2017-01-09 14:27:56 -08:00
Sunny Goyal
a52ecb0390 Removing all compatibility code below Lollipop
Bug: 32745285
Change-Id: I62971908e3e4402941fab627bbdfd47be64473a3
2016-12-16 15:05:09 -08:00
Sunny Goyal
88e5aa1d61 Using support lib for isAtleastO check
Bug: 32610406
Change-Id: I89b3c4f0c99ac605883677cf0becaab0fbf48a86
2016-12-16 11:10:49 -08:00
Jon Miranda
6f6a06ac47 Restore original scaleRectAboutCenter method.
Change-Id: Ibb49c56aab29d1223a0ab36476a32d565566eb25
2016-12-15 11:26:43 -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
ab121c1715 Adding a generic method to initiate overridable objects
Change-Id: Ia433427c65ad38804f2eed9c6bc209df232758c0
2016-12-12 17:01:11 +00:00
Sunny Goyal
f8d5370a9f Merge "Catching TransactionTooLargeException when binding widget." into ub-launcher3-master 2016-11-15 19:07:32 +00:00
Sunny Goyal
f4a0d1886f Merge "Enabling async inflation for AppWidgets" into ub-launcher3-master 2016-11-10 19:50:24 +00:00
Sunny Goyal
712ee53c67 Catching TransactionTooLargeException when binding widget.
A widget can potentially bypass binder size limit with remote views when
using partual updates (as the merging happens on the system service). In
such a case, show the widget in error state.

Bug: 32365088
Change-Id: Id1c4425958a06463273731464e31f05908c35ec7
2016-11-09 12:43:11 -08:00
Sunny Goyal
47564ca3a1 Merge "Simplifying mapCoordInSelfToDescendant" into ub-launcher3-master 2016-11-07 18:09:39 +00:00
Tony Wickham
aa7d8776c8 Remove unused Utilities methods related to motion event translation
These were necessary when we had the ShortcutsContainerListener with
touch forwarding, but they are no longer used since we removed that
listener when we moved to the pre-drag model.

Change-Id: I845d4a1a73fa1a675cef1c52fe304357674a2f68
2016-11-03 15:51:55 -07:00
Sunny Goyal
dcc0ba29a5 Enabling async inflation for AppWidgets
Bug: 22839968
Change-Id: Id622053c2882f478b3a3ab3918a9f76750ead8c6
2016-11-03 15:25:23 -07:00
Sunny Goyal
f5e3744637 Updating version check method names
Change-Id: If98851677545a9bbb9de308c23ff5c155a61a8bf
2016-11-02 10:31:41 -07:00
Sunny Goyal
5e0e94f0b2 Simplifying mapCoordInSelfToDescendant
> Removing new object creation (during draw and touch handling)
> Simplifying matrix operation to call invert only once at the end

Change-Id: Iffadd6e9d84997baa36719ed688a7c3c1027e839
2016-10-28 10:24:40 -07:00
Hyunyoung Song
0de011705b Code sanitization
- Removed bad method/class name typos

Change-Id: Ie6900e9e3d9ce9b550d2a2442a5dac3f7050a573
2016-10-06 10:57:29 -07:00
Sunny Goyal
290e9e2807 Updating the paddings in folder cell
am: baec6ffae2

Change-Id: I4bfa78ade93639d3864baeeb5028b9caa3935c29
2016-09-19 16:39:23 +00:00
Sunny Goyal
baec6ffae2 Updating the paddings in folder cell
> Updating overall padding for the cell and adding drawable padding
> Ensuring that the folder cell is always rendered properly based
  on available vertical space

Bug: 30605958
Change-Id: I8ceb9fea5a25052b0d7461f52edca0e6a33fa085
2016-09-16 12:05:02 -07:00
Sunny Goyal
10629b077c Moving some image handling classes to .graphics package
Change-Id: Id6d3d0b9c345a503ff2e09f073eb4b6449e21c7e
2016-09-02 12:34:33 -07:00
Sunny Goyal
52851aa3fd Fixing topView not being considered in all places when calculating accessible
and focusable views

Bug: 30563273
Change-Id: I6253ce33ee5c328efdde2ea733029975b31e5eb8
2016-09-02 10:52:07 -07:00
Sunny Goyal
e2ec8a3cd5 Removing some reflection code
Change-Id: I8a0a707d69999e5f9911e7d8df7d4a659b3dfb8f
2016-09-01 11:01:05 -07:00
Sunny Goyal
dfc8b6685b Preventing unnecessary setLayout calls in workspace
Separating getSystemProperty in a separate method

Change-Id: I88716e796e29ac27ef25afa41077a8f29eb65f25
2016-08-30 14:06:51 -07:00
Sunny Goyal
f3a09f9757 Starting the settings activity with same animation as wallpaper (and widgets tray)
Change-Id: I7744d50c9762200eb2ffea37d8435c9bc221c526
2016-08-25 09:46:39 -07:00
Sunny Goyal
a9206128a2 Updating version check to use SDK_INT
Change-Id: Idb46053e7304bc8d0cab03a17a6fe73013e4f092
2016-08-15 19:35:22 -07:00
Sunny Goyal
79cf718fcd Badging shortcuts with app icons
Change-Id: I3fa005ece20a54b31f823acb28c384ecdf1eafb1
2016-07-29 16:06:36 -07:00
Sunny Goyal
10923b30a2 Removing shadow and badging from the icon which is shown in the menu
These are added as soon as the icon is added to the workspace

Bug: 28980830
Change-Id: I725d2ee8994324f09d9ecf7bbbb0090a7ceb5769
2016-07-26 14:18:09 -07:00
Winson
be9798b6a2 Fixing issue with shadow drawing over search bar.
- Adding notion of clip-against view for click shadow alignment.

Bug: 30255227
Change-Id: Id5716a3484051a55690025d61f709e3d96cbe024
2016-07-20 16:21:24 -07:00
Sunny Goyal
4a464794f2 Adding support for dynamically adding shadows to the icon
Change-Id: I94d98750aea1faef8879e25990aa5c41a4894708
2016-07-20 11:26:22 -07:00
Tony Wickham
1bce7fd342 Long-press on an app to reveal its shortcuts.
- Add ShortcutsContainerListener to icons on workspace, folders, and
  all apps. This handles long-press and forwards following touches to
  the DeepShortcutsContainer that is created.
- Drag over shortcut before lifting finger to launch it.
- Shortcuts are rendered in pill-shaped DeepShortcutViews,
  which are inside DeepShortcutContainer on DragLayer.
- The shortcut container orients above or below the icon, and left or
  right-aligns with it. Biases for above + left-align.
- Long press a DeepShortcutPill to drag and pin it to the workspace.

Bug: 28980830
Change-Id: I08658d13ae51fe53064644e8d8f7b42f150fdd7d
2016-06-29 17:48:46 -07:00
Sunny Goyal
0d21daace2 Merge "Making some shortcut manager calls protected by MR1 version check" into ub-launcher3-calgary 2016-06-23 21:56:25 +00:00
Sunny Goyal
9994b2b171 Making some shortcut manager calls protected by MR1 version check
Change-Id: Ifdfa95a58aa18a825c1838c61055928dbe0ea3be
2016-06-23 14:55:56 -07:00
Sunny Goyal
11cec0209c Merge "Removing unnecessary object creation and double loop during getDescendantCoordRelativeToAncestor" into ub-launcher3-calgary 2016-06-23 21:29:21 +00:00
Andrew Sapperstein
abef55a1c1 Update Launcher to use theme colors.
Instead of using hard-coded variants of colors, use the theme color
that corresponds (colorAccent, colorPrimary, etc).

Updated:
- "Search for more apps" text
- App info drop target hover color
- PageIndicatorDots
- All apps & widget scroll bar & scroll popup colors
- All apps section text color
- widget picker background color

TODO:
- widget picker header color

BUG: 28625102
Change-Id: I74b543ff71b8caef8cd950c8183ac84c759cb4d5
2016-06-20 11:46:44 -07:00
Sunny Goyal
8cf47a5121 Removing unnecessary object creation and double loop during
getDescendantCoordRelativeToAncestor

Change-Id: I034db2282a8aaf129336a425338c6a80d6a3a073
2016-06-15 10:11:56 -07:00
Sunny Goyal
e8b5d20d94 Fixing bug in getDescendantCoordRelativeToParent where it was
calculating the coordinates relative to the root's parent

The bug went unnoticed for so long, as its only used in DragLayer
which is positioned at 0,0 in its parent

Change-Id: I101cda1f1fa919c0faf9b23b1eeb05764bdf1a40
2016-06-14 16:46:03 -07:00
Sunny Goyal
da4fe1a624 Moving the QSB to the workspace grid.
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
2016-05-27 18:23:29 -07:00
Sunny Goyal
ff4ba2d995 Refactoring out grid occupancy management in a separate class
Change-Id: I37a830c0f2eb0a0dd4f5fc78fa29127cb18cb3c2
2016-05-27 09:12:26 -07:00
Kenny Guy
367da9f422 Update wallpaper API to match NYC change.
Update check for whether setting wallpaper
is allowed for renamed API.

Bug: 28954131
Change-Id: I09ee46167d59d267ba95d136366f78f5735ea9a5
2016-05-26 11:11:06 +00:00
Sunny Goyal
3f732190cc Preventing unnecessary options update to QSB provider
by checking if the options have changed before calling update

Bug: 28586377
Change-Id: Idf263b7a32ca85f23f728fa29b9c8ac84289052e
2016-05-18 15:00:52 -07:00
Tony Wickham
f549dab31d Add PageIndicator interface and custom PageIndicatorLine view.
- The current PageIndicator has been renamed to PageIndicatorDots
  and PageIndicatorMarker has been renamed to PageIndicatorDot.
- PageIndicatorDots and PageIndicatorLine implement PageIndicator.
- PageIndicatorLine uses scroll progress and number of pages to
  draw a line of the correct size and position.
- All of these page indicator files are now in a pageindicators package.

Bug: 27227498

Change-Id: I9230d2e0600ce583989bd31d0b0e252b148d15c2
2016-05-17 18:53:57 -07:00
Sunny Goyal
f48e59268b Making the 'Allow rotation' setting dependent on system state
The setting will not be available on a tablet, where rotation is
always enabled. On mobiles, it will be disabled when auto-rotate
is disabled in display settings.
Also removing content provider dependency from settings, as its in the
same process as launcher.

Bug: 28704055
Change-Id: Ibe6b1e67411fb0e4b2e36446710f463e4a3d6883
2016-05-16 12:07:41 -07:00
Tony Wickham
462b5cca7b Extract color for the hotseat.
- Only considers the bottom fourth of the wallpaper
- Is translucent black or white depending on how dark/light
  the wallpaper is
- Hotseat extends behind the nav bar

Bug: 27230217
Change-Id: Id4ea6ee91b4dd221b4c277d22d5041cab178801d
2016-05-09 15:41:38 -07:00
Sunny Goyal
713edfce26 Adding a utility class for persistant logging.
The logs are kept for at max 48 hours. It uses two log files and switches
between the two based on the day of the year.

Change-Id: I9a99499b3445a62f29f62a5cd13db20b1783bcd3
2016-05-09 12:47:42 -07:00
Sunny Goyal
745bad9da1 Chaning the behavior of settings activity.
> Making all twoState prefs backed by content provider
> Using the stadard intent defined in N for settings
> Using SharedPrefsListener instead of LauncherProvider

Change-Id: I8272f54aa780bc0436e3d0aa89096a4bd2a9194f
2016-05-02 12:00:51 -07:00
Sunny Goyal
1ed6c4adde Showing a toast when changing wallaper is disabled
Bug: 27940102
Change-Id: I373093d9b85dca356aaa8798931d5315981fd74c
(cherry picked from commit 2afb636180)
2016-04-21 23:12:50 +00:00
Sunny Goyal
6388b2c61b Adding some utility methods for thread verification
Change-Id: I3fb6a1b860bba8a6efe413dd2698f972dc3e2506
2016-04-15 18:03:50 -07:00