From 44607301e2afc687330b1b4e4d73c5028dcd4eee Mon Sep 17 00:00:00 2001 From: Mario Bertschler Date: Tue, 28 Nov 2017 13:34:20 -0800 Subject: [PATCH] Fixes a bug when using the prediction row view and changing screen orientation. Bug: 68713881 Change-Id: I9740eee8425d42af87c8c788aefff9a99ae48d2f --- src/com/android/launcher3/allapps/AllAppsContainerView.java | 3 +++ src/com/android/launcher3/allapps/PredictionRowView.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 2bb95cb50f..eb4c9b2989 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -543,6 +543,9 @@ public class AllAppsContainerView extends RelativeLayout implements DragSource, } private void setupHeader() { + if (mFloatingHeaderHandler == null) { + return; + } mHeader.setVisibility(View.VISIBLE); int contentHeight = mLauncher.getDeviceProfile().allAppsCellHeightPx; if (!mUsingTabs) { diff --git a/src/com/android/launcher3/allapps/PredictionRowView.java b/src/com/android/launcher3/allapps/PredictionRowView.java index 45ef6c1bb2..ea91770aaf 100644 --- a/src/com/android/launcher3/allapps/PredictionRowView.java +++ b/src/com/android/launcher3/allapps/PredictionRowView.java @@ -68,7 +68,10 @@ public class PredictionRowView extends LinearLayout { * Sets the number of apps per row. */ public void setNumAppsPerRow(int numPredictedAppsPerRow) { - mNumPredictedAppsPerRow = numPredictedAppsPerRow; + if (mNumPredictedAppsPerRow != numPredictedAppsPerRow) { + mNumPredictedAppsPerRow = numPredictedAppsPerRow; + onAppsUpdated(); + } } /**