From 294762c45fdd750ac04c0b1e15a7f89c9562a26c Mon Sep 17 00:00:00 2001 From: Beverly Date: Thu, 4 Jun 2020 13:30:15 -0400 Subject: [PATCH] Always update PageIndicator visibility Even if the number of childCount of the PageIndicator matches the new number of pages being set, update the PageIndicator's visibility in case this is the first time PageIndicator is being set to visible. Test: Reboot device, fully expand QS with more than one page of tiles -> should be able to see the PageIndicator Fixes: 158118587 Change-Id: I20cc995cfe6d92b730ce722c924b945bfa1c6bde --- .../src/com/android/systemui/qs/PageIndicator.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java b/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java index 0d614497190fd..2c76d70fb3cc8 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java +++ b/packages/SystemUI/src/com/android/systemui/qs/PageIndicator.java @@ -45,9 +45,6 @@ public class PageIndicator extends ViewGroup { } public void setNumPages(int numPages) { - if (numPages == getChildCount()) { - return; - } TypedArray array = getContext().obtainStyledAttributes( new int[]{android.R.attr.colorControlActivated}); int color = array.getColor(0, 0); @@ -55,12 +52,12 @@ public class PageIndicator extends ViewGroup { setNumPages(numPages, color); } - /** Oveload of setNumPages that allows the indicator color to be specified.*/ + /** Overload of setNumPages that allows the indicator color to be specified.*/ public void setNumPages(int numPages, int color) { + setVisibility(numPages > 1 ? View.VISIBLE : View.GONE); if (numPages == getChildCount()) { return; } - setVisibility(numPages > 1 ? View.VISIBLE : View.GONE); if (mAnimating) { Log.w(TAG, "setNumPages during animation"); }