summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps/AllAppsContainerView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsContainerView.java')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java67
1 files changed, 19 insertions, 48 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 0083d47f2..97a87c16c 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -102,18 +102,14 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
@Override
protected void updateBackground(
int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) {
- if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
- if (mLauncher.getDeviceProfile().isVerticalBarLayout()) {
- getRevealView().setBackground(new InsetDrawable(mBaseDrawable,
- paddingLeft, paddingTop, paddingRight, paddingBottom));
- getContentView().setBackground(
- new InsetDrawable(new ColorDrawable(Color.TRANSPARENT),
- paddingLeft, paddingTop, paddingRight, paddingBottom));
- } else {
- getRevealView().setBackground(mBaseDrawable);
- }
+ if (mLauncher.getDeviceProfile().isVerticalBarLayout()) {
+ getRevealView().setBackground(new InsetDrawable(mBaseDrawable,
+ paddingLeft, paddingTop, paddingRight, paddingBottom));
+ getContentView().setBackground(
+ new InsetDrawable(new ColorDrawable(Color.TRANSPARENT),
+ paddingLeft, paddingTop, paddingRight, paddingBottom));
} else {
- super.updateBackground(paddingLeft, paddingTop, paddingRight, paddingBottom);
+ getRevealView().setBackground(mBaseDrawable);
}
}
@@ -132,18 +128,10 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
}
/**
- * Adds new apps to the list.
- */
- public void addApps(List<AppInfo> apps) {
- mApps.addApps(apps);
- mSearchUiManager.refreshSearchResult();
- }
-
- /**
- * Updates existing apps in the list
+ * Adds or updates existing apps in the list
*/
- public void updateApps(List<AppInfo> apps) {
- mApps.updateApps(apps);
+ public void addOrUpdateApps(List<AppInfo> apps) {
+ mApps.addOrUpdateApps(apps);
mSearchUiManager.refreshSearchResult();
}
@@ -224,6 +212,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
mAppsRecyclerView.setLayoutManager(mLayoutManager);
mAppsRecyclerView.setAdapter(mAdapter);
mAppsRecyclerView.setHasFixedSize(true);
+ // No animations will occur when changes occur to the items in this RecyclerView.
+ mAppsRecyclerView.setItemAnimator(null);
if (FeatureFlags.LAUNCHER3_PHYSICS) {
mAppsRecyclerView.setSpringAnimationHandler(mSpringAnimationHandler);
}
@@ -238,11 +228,9 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
mAppsRecyclerView.preMeasureViews(mAdapter);
mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener());
- if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
- getRevealView().setVisibility(View.VISIBLE);
- getContentView().setVisibility(View.VISIBLE);
- getContentView().setBackground(null);
- }
+ getRevealView().setVisibility(View.VISIBLE);
+ getContentView().setVisibility(View.VISIBLE);
+ getContentView().setBackground(null);
}
public SearchUiManager getSearchUiManager() {
@@ -260,32 +248,15 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
// Update the number of items in the grid before we measure the view
grid.updateAppsViewNumCols();
- if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
- if (mNumAppsPerRow != grid.inv.numColumns ||
- mNumPredictedAppsPerRow != grid.inv.numColumns) {
- mNumAppsPerRow = grid.inv.numColumns;
- mNumPredictedAppsPerRow = grid.inv.numColumns;
-
- mAppsRecyclerView.setNumAppsPerRow(grid, mNumAppsPerRow);
- mAdapter.setNumAppsPerRow(mNumAppsPerRow);
- mApps.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow);
- }
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- return;
- }
-
- // --- remove START when {@code FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP} is enabled. ---
- if (mNumAppsPerRow != grid.allAppsNumCols ||
- mNumPredictedAppsPerRow != grid.allAppsNumPredictiveCols) {
- mNumAppsPerRow = grid.allAppsNumCols;
- mNumPredictedAppsPerRow = grid.allAppsNumPredictiveCols;
+ if (mNumAppsPerRow != grid.inv.numColumns ||
+ mNumPredictedAppsPerRow != grid.inv.numColumns) {
+ mNumAppsPerRow = grid.inv.numColumns;
+ mNumPredictedAppsPerRow = grid.inv.numColumns;
mAppsRecyclerView.setNumAppsPerRow(grid, mNumAppsPerRow);
mAdapter.setNumAppsPerRow(mNumAppsPerRow);
mApps.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow);
}
-
- // --- remove END when {@code FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP} is enabled. ---
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}