diff options
author | Artem Shvadskiy <ashvadskiy@cyngn.com> | 2015-12-02 16:05:01 -0800 |
---|---|---|
committer | Artem Shvadskiy <ashvadskiy@cyngn.com> | 2015-12-21 12:04:03 -0800 |
commit | b7121babd1abedc085244a5145052ad453ce86a6 (patch) | |
tree | 30cd03d013c41ccaaf4a5de3feccfff7d2aa0082 /src/com/android/launcher3/Launcher.java | |
parent | acf61e0834d2c0f605a3abc6fde86f0866a8b5a2 (diff) | |
download | android_packages_apps_Trebuchet-b7121babd1abedc085244a5145052ad453ce86a6.tar.gz android_packages_apps_Trebuchet-b7121babd1abedc085244a5145052ad453ce86a6.tar.bz2 android_packages_apps_Trebuchet-b7121babd1abedc085244a5145052ad453ce86a6.zip |
Add remote apps to application drawer.
Patch 2:
1. Use isRemote() method instead of checking flag manually.
2. Launch remote app directly through intent, bypassing regular app logic.
3. Pull syncing code out of LauncherModel and into RemoteFolderManager.
4. Check setting before loading apps.
5. Delete old apps before loading new ones.
6. Add/remove directly from AppDrawerListAdapter, since we are not sure
if we want remote apps to show up in Google-style paged drawer.
7. Get number of columns for drawer, so we always load just enough
to fill one row.
Patch 3: Remove old ArrayList from LauncherModel.
Patch 4:
1. Update redlines.
2. Clean up layout/dimens.
3. Add custom scrubber icon for remote apps.
4. Apply custom styles to remote header.
TODO: Implement info icon click event, and replace remote apps based
on updater cache status.
Patch 5: Clean up app_drawer_item.xml
Patch 6: Rebase.
Patch 7:
1. Add forgotten rebase method to RemoteFolderManager stub.
2. Apply default styles to app_drawer_item and don't bother
checking to apply styles unless remote folder is enabled.
3. Minor redline fix.
Patch 8: Add larger bottom margin to remote header.
Patch 9:
1. Create new view type for custom header to avoid on click bug.
2. Refactor custom style to apply on view holder creation,
instead of on bind.
3. Add click event for custom header icon.
Change-Id: If123d7ac82a0af0fa171fa3408b6c2f1f8a48b7b
issue-id: CYNGNOS-1380
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 5567a58c0..ff59dce08 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2252,6 +2252,10 @@ public class Launcher extends Activity return mRemoteFolderManager; } + public AppDrawerListAdapter getAppDrawerListAdapter() { + return mAppDrawerAdapter; + } + public Hotseat getHotseat() { return mHotseat; } @@ -2979,10 +2983,19 @@ public class Launcher extends Activity } else if (v == mAllAppsButton) { onClickAllAppsButton(v); } else if (tag instanceof AppInfo) { + AppInfo info = (AppInfo) tag; + + // Remote apps do not exist in package manager, so they should be launched + // directly by intent. + if (info.isRemote()) { + startActivity(info.intent); + return; + } + startAppShortcutOrInfoActivity(v); LauncherApplication.getLauncherStats().sendAppLaunchEvent( - LauncherStats.ORIGIN_APPDRAWER, ((AppInfo)tag).componentName.getPackageName()); - String packageName = ((AppInfo)tag).getIntent().getComponent().getPackageName(); + LauncherStats.ORIGIN_APPDRAWER, info.componentName.getPackageName()); + String packageName = info.getIntent().getComponent().getPackageName(); if (LauncherStats.SETTINGS_PACKAGE_NAME.equals(packageName)) { LauncherApplication.getLauncherStats() .sendSettingsOpenedEvent(LauncherStats.ORIGIN_APPDRAWER); @@ -3841,6 +3854,7 @@ public class Launcher extends Activity if (drawer && contentType == AppsCustomizePagedView.ContentType.Applications) { toView = findViewById(R.id.app_drawer_container); + mRemoteFolderManager.onAppDrawerOpened(); } else { toView = mAppsCustomizeTabHost; } @@ -5435,7 +5449,7 @@ public class Launcher extends Activity for (AppInfo info : appInfos) { removedComponents.add(info.componentName); } - if (!packageNames.isEmpty()) { + if (packageNames != null && !packageNames.isEmpty()) { mWorkspace.removeItemsByPackageName(packageNames, user); } if (!removedComponents.isEmpty()) { |