Commit Graph

39 Commits

Author SHA1 Message Date
jayaprakashs
e534d3b5f9 Introduce FolderNameInfo class.
* Introduce FolderNameInfo class for passing down the folder name
suggestions from FolderNameProvider.
* Use FolderNameInfo for storing the serialized suggested names for
Folders. It is parsed and used in FolderEdit.

Bug: 148417030
Bug: 148916551
Bug: 148432151

Change-Id: Idaa81e203cc42889be15d0845230b4508521041c
2020-02-11 11:36:28 -08:00
Hyunyoung Song
1ae42423ca Load folder names during LoaderTask
Bug: 147359653

Change-Id: I4d1b53c3a72d0773d4bc8819ee8118fc719944ad
2020-01-28 22:06:05 -08:00
Hyunyoung Song
48e6489871 Introduce folder name type (auto vs manual).
Bug: 147769158

- Use both InputConnectionWrapper and TextWatcher to detect
manual input
- Also fix a bug in FolderNameProvider

Change-Id: I7bc0f380c6641481d934a53e9feb77caa19c674a
2020-01-26 22:34:31 -08:00
Sunny Goyal
ac6f69f78d Lazily binding folder pages and icons
Folders are bound before they are opened and unbound on close. This
allows us to recycle the views in folders

Bug: 139051851
Change-Id: Ic1ed3265c0f583af54d73dab6f2751bc95266ea9
2019-09-05 17:17:11 +00: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
Sunny Goyal
9589916418 ShortcutInfo renamed to WorkspaceItemInfo
Will get rid of ShortcutInfoCompat in a follow up cl

Change-Id: I7d7d9c938635f59b216290ba28bea9d0e0721a7d
2019-04-16 00:08:24 -07:00
Jonathan Miranda
36be1d3674 Revert "Update existing Folder items' ranks to match their pre-permutation layouts."
This reverts commit c4b296a50e.

Change-Id: Ieff7873edc3cb300fe454b0ad97d6f0b4f0cb5a9
2017-07-13 18:00:52 +00:00
Jon Miranda
c4b296a50e Update existing Folder items' ranks to match their pre-permutation layouts.
With the new Folder permutation logic, we change the position of the items
when they are added to a Folder. This means that existing Folders will
now appear in a different order than the user arranged them in.

This change makes sure that when a user upgrades, their existing Folders
will appear untouched.

Note: We decided to priotize restoring the original layout of the Folder,
      as opposed to making sure the preview items remain the same. This
      is less destructive of users' data (we're changing the window into
      the Folder, but not the location of items when the Folder is open).

Bug: 63115141
Bug: 35064148

Change-Id: Ib0a28b4b50be089878ffc3e40bced89832e125bc
2017-06-28 19:10:53 -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
Jon Miranda
608d0dba87 Close Folder before doing any automatic updates.
We already close the Folder when Work Profile apps are
auto added to the Work Profile Folder. This change extends that
functionality to when apps are being auto removed from the
Work Profile Folder.

Bug: 35845161
Change-Id: I2aa6a6a0ed28a95f6a59a549430f91482583548b
2017-02-28 13:15:28 -08:00
Jon Miranda
440609453f Close Folder when an item is auto added to it.
This can happen when items (as part of a Work Profile) are auto added
to the Work profile Folder.

Bug: 35628160
Change-Id: I29d3b277b0e9cd4bb238fb5aff9a52c6b9e764f8
2017-02-22 10:55:52 -08:00
Sunny Goyal
43bf11d9c9 Separating methods for updating the model to a sepatate class.
Removing static access to model update methods, to allow for better
access control and testing

Change-Id: I9afe004dbf1b2fe50df422fd28bceea9230a4704
2017-02-16 13:50:14 -08:00
Sunny Goyal
658058b960 Adding some widget addition flow tests
> Added two dummy widget providers: with config and without config
> Added tests for verify widget config flow

Change-Id: I4577f085abe8f8b82047b644c71cc9065358153a
2017-01-23 15:28:25 -08:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
32f3dda802 Adding a utility class to enforce that icons are always flattened on
the background thread.

Bug: 21325319
Change-Id: I4d0f02557cdbf70cfa86750ac047faf2917e39bf
2016-11-19 23:40:07 +05:30
Sunny Goyal
740ac7f00e Refactoring floating view opening/closing logic
> Creating a base view for floating panels with some common methods
> Moving the getOpen method to individual classes
> Moving the folder icon animation logic to folder icon
> Moving all the logic related for opening folder to Folder class

Change-Id: I898dfb6870b857cb921d2729b89618bc43ff2e88
2016-10-10 13:36:03 -07:00
Sunny Goyal
1edab71d01 Unifying toString() method for various ItemInfo subclasses
Change-Id: I7cde42f0df412e2877fb93c77e74ee56a25edead
2016-09-01 10:55:45 -07:00
Sunny Goyal
aaf7d1d13b instead of unbinding items from the loader, unregistering listeners
in activity.onDestroy()

Bug: 28740269
Change-Id: I6bf2ad6aca43970fd10cfbcc113e609c227e07bf
2016-05-17 14:42:10 -07:00
Sunny Goyal
90cb3e51af Revert "Wrapping folderLisners with weak reference, and storing it as an array"
This reverts commit e48644a6cc.

Change-Id: I7bd1d09cae42193de228cb58c08526eeaf57ec04
2016-05-17 21:25:48 +00:00
Sunny Goyal
e48644a6cc Wrapping folderLisners with weak reference, and storing it as an array
Storing as an array allows the listeners to be overriten on next bind.
These changes remove the need to unbind the item

Bug: 28740269
Change-Id: Ibbe4b760d64784fbe3075d18e2b946b366d631c5
2016-05-17 12:44:15 -07:00
Sunny Goyal
c52ba71005 Fixing folder icon not getting redrawn when the contents change
> Removing parent from ItemOperator as inconsistant values were
being passed in workspace and folderPagedView
> Fixing itemChanged causing multiple redraws, by passing a
'animate' parameter to explicitely request animation

Bug:27740161
Bug:28015426

Change-Id: Ide7b266bde9aad5f450a3f808a59182fe01a5110
2016-04-06 12:46:36 -07:00
Adam Cohen
f9c184a619 Refactor FolderIcon to separate the preview effect into it's own class
-> Created com.android.launcher3.folder package to house most folder-related files
   (aside from the FolderInfo) which is more related to the model than the UI.

Change-Id: I767063e1e4c775c01a799a3bede30cd94ac48ade
2016-02-12 17:28:31 -08:00
Sunny Goyal
aa8ef119f1 Refactoring ItemInfo
> Changing dragObject to ItemInfo
> Removing dropPos which is always null
> Removing requiresDbUpdate which is only used in CellLayout

Change-Id: I753ddaae0880c8a9bfee5a1266095ff34610284a
2015-06-30 10:26:49 -07:00
Sunny Goyal
a508e4f804 Do not trim folder title
Bug: 21297281
Change-Id: I633780f8207aabc8362f016e6b5a6e720cee1b86
2015-05-21 09:33:57 -07:00
Sunny Goyal
bfcb652c77 Merge "Animating the folder title & page indicator when a multi-page folder is opened for the first time" into ub-launcher3-burnaby 2015-05-13 03:25:37 +00:00
Winson Chung
82b016cb56 Trim all whitespace from titles and labels.
Bug: 20953160

Change-Id: I1610df5e445a4139522226f68fa6439926bc70c6
2015-05-08 22:22:39 -07:00
Sunny Goyal
b7e15adc7b Animating the folder title & page indicator when a multi-page folder
is opened for the first time

Change-Id: I70f5fd942724251a5e863fbb78a0c24f440b0283
2015-05-08 09:58:18 -07:00
Hyunyoung Song
111c83579a Removes code that is incompatible with google3, Velvet build rules.
Change-Id: Ibce31b52f5ffc4a03bdd48c575521c774f17a353
2015-04-30 15:43:26 -07:00
Sunny Goyal
8167dc2dcf Goodbye folder sorting
> Removing all traces of folder sorting

Change-Id: Id77a7745564c869f5c5c1b3a560bf606fe08b107
2015-04-27 14:02:06 -07:00
Sunny Goyal
18bf8e2ffd Automatically adding managed profile shortcuts to homescreen.
When the managed profile is created, a "Work" folder is created
and added to the homescreen. All work profile apps are added to this
folder and icons for subsequent installs (withing a fixed time frame)
are automatically added to this folder.
If this folder get deleted or the time-frame expires, icon for any new
install is placed on the homescreen.

Bug: 17410319
Change-Id: I49f4e437707d5eabe4eec85320765bf6ba7fde97
2015-04-10 19:37:13 -07:00
Sunny Goyal
5d85c44fd8 Adding sort switch in FolderPagedView
> Adding options column in DB to store generation purpose flags
> Storing isSorted flag in FolderInfo
> Adding a switch for A-Z sorting (only visible if pageCount > 1)
> When in sorted mode, spring-load snaps to the target location for 1.5 seconds

Change-Id: I8c7c778d2cc3ccbd35a2890a1a705e1c1a7e9a66
2015-03-17 14:49:38 -07:00
Kenny Guy
ed13187a74 Launcher3 multi-profile support
Use LauncherApps API and badging APIs instead of PackageManager.
With compatability layer that uses PackageManager pre L.

Adds support to show apps from current user and any managed profiles.

Background: Managed profiles are user sandboxes that are visible from
the primary user and can be launched as if they are a part of this user.
A launcher should now be capable of listing apps from this user as well
as related profiles of this user.

Launching of activities is now via the LauncherApps interface, to allow
for cross-profile app launching. Only activities with category LAUNCHER
can be added as a shortcut on the workspace for a managed profile.

Widgets and non-application shortcuts are only supported for the
current profile. Widgets from the managed profile are not available.

Change-Id: I5f396b1bf7f91ad91a5710ea4a0fd14573972eb9
2014-04-30 23:43:00 +01:00
Sameer Padala
be3e410b7a Fix source code so it compiles on google3
This is a follow up to cr/65191596 which checked for String + array warnings.

Change-Id: Id70eaa32b63b838b03be21d632c7470039b6423f
2014-04-21 19:37:17 -07:00
Anjali Koppal
7b168a1bb9 Make classes that extend ItemInfo public.
Also follow up on changes in ag/418520, adding Views to those method
params.

Change-Id: I93e0a3b30d10b969d1903a2f227f6744d709e89a
2014-03-04 17:16:11 -08:00
Winson Chung
33231f587e Fixing crash in empty folders. (Bug 11627191)
Change-Id: I7a0e23e16a7546a9612d3406257e15be758d4c52

Signed-off-by: Winson Chung <winsonc@google.com>
2013-12-09 17:24:48 -08:00
Winson Chung
72b520c956 Revert "Fixing crash in empty folders. (Bug 11627191)"
This reverts commit 68b667848e.

Change-Id: I51da495d6f8ef98b268c23cce02cce5ef1c7ea00
2013-12-10 01:17:03 +00:00
Winson Chung
68b667848e Fixing crash in empty folders. (Bug 11627191)
Change-Id: I7a0e23e16a7546a9612d3406257e15be758d4c52
2013-12-09 16:57:45 -08:00
Winson Chung
64359a53dc Ensuring that the db reflects all package added/removed/updated broadcasts.
- Also ensuring that newly added pages are added before the empty page

Change-Id: I97a01f791c438aa5c5b1fd770d3536b449a871bc
2013-07-11 14:19:52 -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