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

Commit 2a6d5849 authored by Michal Brzezinski's avatar Michal Brzezinski
Browse files

Fixing keyguard user switcher height after collapsing

User switcher still had expanded flight after being collapsed - caused by all children views (of type KeyguardUserDetailItemView) still being visible but having alpha of 0.
The function to make them GONE was called too early and with improper value, so they were never GONE.
Fix is to make them VISIBLE before animating opening user switcher and make them GONE only after closing animation is finished.

Fixes: 210121179
Test: open keyguard user switcher and close it -> views below should move back to their previous positions
Change-Id: I76ea8651b19ef7ae931e6c14951d804a85c237ed
parent 7d0f7fb7
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -246,7 +246,6 @@ public class KeyguardUserSwitcherController extends ViewController<KeyguardUserS
    }

    public int getHeight() {
        // TODO(brzezinski): fix height value when user switcher is back to collapsed
        return mListView.getHeight();
    }

+13 −3
Original line number Diff line number Diff line
@@ -97,10 +97,13 @@ public class KeyguardUserSwitcherListView extends AlphaOptimizedLinearLayout {
            } else {
                // Update clickable state immediately so that the menu feels more responsive
                userItemViews[i].setClickable(open);
                // Before running the animation, ensure visibility is set correctly
                userItemViews[i].updateVisibilities(animate || open /* showItem */,
                // when opening we need to make views visible beforehand so they can be animated
                if (open) {
                    userItemViews[i].updateVisibilities(true /* showItem */,
                            true /* showTextName */, false /* animate */);
                }

            }
        }

        if (animate && userItemViews.length > 1) {
@@ -117,6 +120,13 @@ public class KeyguardUserSwitcherListView extends AlphaOptimizedLinearLayout {
                        setClipChildren(true);
                        setClipToPadding(true);
                        mAnimating = false;
                        if (!open) {
                            // after closing we hide children so that height of this view is correct
                            for (int i = 1; i < userItemViews.length; i++) {
                                userItemViews[i].updateVisibilities(false /* showItem */,
                                        true /* showTextName */, false /* animate */);
                            }
                        }
                    });
        }
    }