summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppsCustomizePagedView.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-06-06 22:43:33 -0700
committerAdam Cohen <adamcohen@google.com>2013-06-06 22:44:32 -0700
commit947dc5431981e40ffc8d687604f7777d35915034 (patch)
treec2115c52699f3bbdc7cb30681c65e3b8745ff0a4 /src/com/android/launcher3/AppsCustomizePagedView.java
parentb5fe60c8a502fb7e265e3183550478b2b2a49264 (diff)
downloadandroid_packages_apps_Trebuchet-947dc5431981e40ffc8d687604f7777d35915034.tar.gz
android_packages_apps_Trebuchet-947dc5431981e40ffc8d687604f7777d35915034.tar.bz2
android_packages_apps_Trebuchet-947dc5431981e40ffc8d687604f7777d35915034.zip
HACK: Getting rid of all apps button / all apps from AppsCustomizePagedView
Change-Id: I74e4a53e9486237ad246ebdfa9e97c6ed9475b58
Diffstat (limited to 'src/com/android/launcher3/AppsCustomizePagedView.java')
-rw-r--r--src/com/android/launcher3/AppsCustomizePagedView.java29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 43a5259a6..df55f048d 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -201,6 +201,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
private AccelerateInterpolator mAlphaInterpolator = new AccelerateInterpolator(0.9f);
private DecelerateInterpolator mLeftScreenAlphaInterpolator = new DecelerateInterpolator(4);
+ public static boolean DISABLE_ALL_APPS = true;
+
// Previews & outlines
ArrayList<AppsCustomizeAsyncTask> mRunningTasks;
private static final int sPageSleepDelay = 200;
@@ -433,7 +435,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
if (!isDataReady()) {
- if (!mApps.isEmpty() && !mWidgets.isEmpty()) {
+ if ((DISABLE_ALL_APPS || !mApps.isEmpty()) && !mWidgets.isEmpty()) {
setDataIsReady();
setMeasuredDimension(width, height);
onDataReady(width, height);
@@ -1546,9 +1548,11 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
public void setApps(ArrayList<ApplicationInfo> list) {
- mApps = list;
- Collections.sort(mApps, LauncherModel.getAppNameComparator());
- updatePageCountsAndInvalidateData();
+ if (!DISABLE_ALL_APPS) {
+ mApps = list;
+ Collections.sort(mApps, LauncherModel.getAppNameComparator());
+ updatePageCountsAndInvalidateData();
+ }
}
private void addAppsWithoutInvalidate(ArrayList<ApplicationInfo> list) {
// We add it in place, in alphabetical order
@@ -1561,9 +1565,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
}
}
}
+
public void addApps(ArrayList<ApplicationInfo> list) {
- addAppsWithoutInvalidate(list);
- updatePageCountsAndInvalidateData();
+ if (!DISABLE_ALL_APPS) {
+ addAppsWithoutInvalidate(list);
+ updatePageCountsAndInvalidateData();
+ } else {
+ // TODO: Maybe put them somewhere else?
+ }
}
private int findAppByComponent(List<ApplicationInfo> list, ApplicationInfo item) {
ComponentName removeComponent = item.intent.getComponent();
@@ -1595,9 +1604,11 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
// We remove and re-add the updated applications list because it's properties may have
// changed (ie. the title), and this will ensure that the items will be in their proper
// place in the list.
- removeAppsWithoutInvalidate(list);
- addAppsWithoutInvalidate(list);
- updatePageCountsAndInvalidateData();
+ if (!DISABLE_ALL_APPS) {
+ removeAppsWithoutInvalidate(list);
+ addAppsWithoutInvalidate(list);
+ updatePageCountsAndInvalidateData();
+ }
}
public void reset() {