Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5fb5e4c authored by Jim Miller's avatar Jim Miller
Browse files

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
parent dbf500aa
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -594,13 +594,12 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
        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 class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
        }
    }

    public void showInitialPageHints() {
        mShowingInitialHints = true;
        updateChildrenContentAlpha(KeyguardWidgetFrame.OUTLINE_ALPHA_MULTIPLIER);
    }

    @Override
    void setCurrentPage(int currentPage) {
        super.setCurrentPage(currentPage);
        updateChildrenContentAlpha(0.0f);
        updateWidgetFramesImportantForAccessibility();
    }

+2 −0
Original line number Diff line number Diff line
@@ -756,6 +756,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
    @Override
    public void onChildViewRemoved(View parent, View child) {
        mForceScreenScrolled = true;
        invalidate();
        invalidateCachedOffsets();
    }

    protected void invalidateCachedOffsets() {