From bb5278b663a0a5b05bf7f8d2dfe27f1aa5f01142 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 17 Mar 2014 19:07:56 -0700 Subject: Fixing issue with cards being rendered under the nav bar after a configuration change due to improperly setting the system insets. --- .../SystemUI/src/com/android/systemui/recents/RecentsService.java | 5 +++-- .../src/com/android/systemui/recents/views/TaskStackView.java | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'packages/SystemUI') diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsService.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsService.java index 25dd269..485b136 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsService.java @@ -58,12 +58,13 @@ class SystemUIMessageHandler extends Handler { Bundle data = msg.getData(); Rect windowRect = (Rect) data.getParcelable("windowRect"); Rect systemInsets = (Rect) data.getParcelable("systemInsets"); - RecentsConfiguration.getInstance().updateSystemInsets(systemInsets); // Create a dummy task stack & compute the rect for the thumbnail to animate to TaskStack stack = new TaskStack(context); TaskStackView tsv = new TaskStackView(context, stack); - tsv.computeRects(windowRect.width(), windowRect.height() - systemInsets.top); + // Since the nav bar height is already accounted for in the windowRect, don't pass + // in a bottom inset + tsv.computeRects(windowRect.width(), windowRect.height() - systemInsets.top, 0); tsv.boundScroll(); TaskViewTransform transform = tsv.getStackTransform(0); Rect taskRect = new Rect(transform.rect); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java index 4ec055e..62cf394 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java @@ -428,16 +428,15 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal } /** Computes the stack and task rects */ - public void computeRects(int width, int height) { + public void computeRects(int width, int height, int insetBottom) { // Note: We let the stack view be the full height because we want the cards to go under the // navigation bar if possible. However, the stack rects which we use to calculate // max scroll, etc. need to take the nav bar into account // Compute the stack rects - RecentsConfiguration config = RecentsConfiguration.getInstance(); mRect.set(0, 0, width, height); mStackRect.set(mRect); - mStackRect.bottom -= config.systemInsets.bottom; + mStackRect.bottom -= insetBottom; int smallestDimension = Math.min(width, height); int padding = (int) (Constants.Values.TaskStackView.StackPaddingPct * smallestDimension / 2f); @@ -466,7 +465,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal " awaitingFirstLayout: " + mAwaitingFirstLayout, Console.AnsiGreen); // Compute our stack/task rects - computeRects(width, height); + RecentsConfiguration config = RecentsConfiguration.getInstance(); + computeRects(width, height, config.systemInsets.bottom); // Debug logging if (Constants.DebugFlags.UI.MeasureAndLayout) { -- cgit v1.1