Call invalidate() during updateView() for updating the header.
This issue is triggered due to onAppsUpdated() randomly due to app installing/uninstalling/updating/archiving. Eventually
onBind() is called but logs shows evidence that the state is correct (even though it doesn't reflect that), hence invalidating will fix this issue.
We can't call notifyItemChange() in updateView() since updateView() can be part of onBind() in which case means this is part of a scrolling gesture. notifyItemChange()
via adapter index will also not work in reset() since doing so will mess up upon animation.
bug: 373345958
Test: manual/presubmit
Flag: NONE invalidating when updateView() is called
Change-Id: Ibc99cc70562575cadf035136e50e9e5eec1e70ea
diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java
index 6a40121..fe79f8d 100644
--- a/src/com/android/launcher3/allapps/PrivateProfileManager.java
+++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java
@@ -220,7 +220,7 @@
* when animation is not running.
*/
public void reset() {
- // Ensure the state of the header views is what it should be before animating.
+ // Ensure the state of the header view is what it should be before animating.
updateView();
getMainRecyclerView().setChildAttachedConsumer(null);
int previousState = getCurrentState();
@@ -435,6 +435,7 @@
lockPill.setVisibility(GONE);
}
}
+ mPSHeader.invalidate();
}
/** Sets the enablement of the profile when header or button is clicked. */