Fix hotseat and prediction row to allow updates when empty.
Rotating the screen in the homescreen empties the hotseat, however it does not get populated while it is visible to the user. The user should not be able to see an empty hotseat or prediction row if predictions are available. It should therefore be possible to populate these when they are empty even if they are visible to the user.
Change-Id: I8e5252bd29050c2cd9d443aedcb3f3e305c0e2d7
diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
index 37336d1..f313d75 100644
--- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
+++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java
@@ -206,7 +206,7 @@
* we can optimize by swapping them in place.
*/
public void setPredictedApps(List<ItemInfo> items) {
- if (isShown() && getWindowVisibility() == View.VISIBLE) {
+ if (!mLauncher.isWorkspaceLoading() && isShown() && getWindowVisibility() == View.VISIBLE) {
mPendingPredictedItems = items;
return;
}
diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
index 76bab59..d3b7e22 100644
--- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
+++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
@@ -251,7 +251,9 @@
* Sets or updates the predicted items
*/
public void setPredictedItems(FixedContainerItems items) {
- if (mHotseat.isShown() && mHotseat.getWindowVisibility() == View.VISIBLE) {
+ if (!mLauncher.isWorkspaceLoading()
+ && mHotseat.isShown()
+ && mHotseat.getWindowVisibility() == View.VISIBLE) {
mHotseat.setOnVisibilityAggregatedCallback((isVisible) -> {
if (isVisible) {
return;