commit | f183b36c14a6f1187116f5674a36df8739f777ee | [log] [tgz] |
---|---|---|
author | fbaron <fbaron@google.com> | Thu Feb 01 11:11:51 2024 -0800 |
committer | fbaron <fbaron@google.com> | Thu Feb 01 12:56:52 2024 -0800 |
tree | 85bd96f0e3c1eacbfaadb727bbbbe975196df4ca | |
parent | ac7c1e373672fa06b200635814d3dd93085a27ae [diff] |
Fix pagination animation when removing a page Flag: NONE Test: verified on device Fix: 323384413 Change-Id: I43443f815990df4014b4cfad05f68a445d44a5f4
diff --git a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java index fd1b64f..df369c6 100644 --- a/src/com/android/launcher3/pageindicators/PageIndicatorDots.java +++ b/src/com/android/launcher3/pageindicators/PageIndicatorDots.java
@@ -365,6 +365,13 @@ @Override public void setMarkersCount(int numMarkers) { mNumPages = numMarkers; + + // If the last page gets removed we want to go to the previous page. + if (mNumPages == mActivePage) { + mActivePage--; + CURRENT_POSITION.set(this, (float) mActivePage); + } + requestLayout(); }