Fix missing clock in keyguard
This fixes a bug where the clock sometimes doesn't show due to the
alpha values not being reset when the widget page order changes
due to removing a widget.
Fixes bug 8545025.
Change-Id: I17c531af4c844647b3262fcf56faa84fff8bafc5
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
index ad5e257..1bcee4e 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java
@@ -594,13 +594,12 @@
animateOutlinesAndSidePages(false);
}
- public void showInitialPageHints() {
- mShowingInitialHints = true;
+ void updateChildrenContentAlpha(float sidePageAlpha) {
int count = getChildCount();
for (int i = 0; i < count; i++) {
KeyguardWidgetFrame child = getWidgetPageAt(i);
if (i != mCurrentPage) {
- child.setBackgroundAlpha(KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER);
+ child.setBackgroundAlpha(sidePageAlpha);
child.setContentAlpha(0f);
} else {
child.setBackgroundAlpha(0f);
@@ -609,9 +608,15 @@
}
}
+ public void showInitialPageHints() {
+ mShowingInitialHints = true;
+ updateChildrenContentAlpha(KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER);
+ }
+
@Override
void setCurrentPage(int currentPage) {
super.setCurrentPage(currentPage);
+ updateChildrenContentAlpha(0.0f);
updateWidgetFramesImportantForAccessibility();
}
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
index 539ec1a..186a013 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
@@ -756,6 +756,8 @@
@Override
public void onChildViewRemoved(View parent, View child) {
mForceScreenScrolled = true;
+ invalidate();
+ invalidateCachedOffsets();
}
protected void invalidateCachedOffsets() {