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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -97,9 +97,12 @@ 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 */,
|
||||
true /* showTextName */, false /* animate */);
|
||||
// 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 */);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 */);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user