diff options
| author | 2016-11-01 17:31:41 +0000 | |
|---|---|---|
| committer | 2016-11-01 17:31:44 +0000 | |
| commit | 5579ff57aa6c756c08f505e021e686f56e6e14c6 (patch) | |
| tree | f60d631c8981a4be792b60ee1fa601c604a89e8e | |
| parent | 2ac09fd06d61b33284019b307e2af477070139a9 (diff) | |
| parent | 384e60e99d6a5925e0ba1d6534db3f1b57b7d6b0 (diff) | |
Merge "Fixes header bar sizes when changing display sizes"
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java | 16 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java | 25 |
2 files changed, 17 insertions, 24 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java index 64ef997a85c8..abde44e1c2f5 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java @@ -181,10 +181,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener ssp.registerTaskStackListener(mTaskStackListener); // Initialize the static configuration resources - LayoutInflater inflater = LayoutInflater.from(mContext); mDummyStackView = new TaskStackView(mContext); - mHeaderBar = (TaskViewHeader) inflater.inflate(R.layout.recents_task_view_header, - null, false); reloadResources(); } @@ -205,14 +202,6 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener Resources res = mContext.getResources(); reloadResources(); mDummyStackView.reloadOnConfigurationChange(); - // Update the header bar direction directly as it is not attached to anything and does not - // layout except in updateHeaderBarLayout() - mHeaderBar.setLayoutDirection(res.getConfiguration().getLayoutDirection()); - mHeaderBar.onConfigurationChanged(); - mHeaderBar.forceLayout(); - mHeaderBar.measure( - MeasureSpec.makeMeasureSpec(mHeaderBar.getMeasuredWidth(), MeasureSpec.EXACTLY), - MeasureSpec.makeMeasureSpec(mHeaderBar.getMeasuredHeight(), MeasureSpec.EXACTLY)); } /** @@ -586,6 +575,11 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener R.dimen.recents_task_view_header_height_tablet_land, R.dimen.recents_task_view_header_height, R.dimen.recents_task_view_header_height_tablet_land); + + LayoutInflater inflater = LayoutInflater.from(mContext); + mHeaderBar = (TaskViewHeader) inflater.inflate(R.layout.recents_task_view_header, + null, false); + mHeaderBar.setLayoutDirection(res.getConfiguration().getLayoutDirection()); } /** diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java index fce7f9d51ea4..571c0f67e18e 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackLayoutAlgorithm.java @@ -344,19 +344,6 @@ public class TaskStackLayoutAlgorithm { mContext = context; mCb = cb; mFreeformLayoutAlgorithm = new FreeformWorkspaceLayoutAlgorithm(context); - mMinMargin = res.getDimensionPixelSize(R.dimen.recents_layout_min_margin); - mBaseTopMargin = getDimensionForDevice(context, - R.dimen.recents_layout_top_margin_phone, - R.dimen.recents_layout_top_margin_tablet, - R.dimen.recents_layout_top_margin_tablet_xlarge); - mBaseSideMargin = getDimensionForDevice(context, - R.dimen.recents_layout_side_margin_phone, - R.dimen.recents_layout_side_margin_tablet, - R.dimen.recents_layout_side_margin_tablet_xlarge); - mBaseBottomMargin = res.getDimensionPixelSize(R.dimen.recents_layout_bottom_margin); - mFreeformStackGap = - res.getDimensionPixelSize(R.dimen.recents_freeform_layout_bottom_margin); - reloadOnConfigurationChange(context); } @@ -390,6 +377,18 @@ public class TaskStackLayoutAlgorithm { R.dimen.recents_layout_initial_bottom_offset_tablet, R.dimen.recents_layout_initial_bottom_offset_tablet); mFreeformLayoutAlgorithm.reloadOnConfigurationChange(context); + mMinMargin = res.getDimensionPixelSize(R.dimen.recents_layout_min_margin); + mBaseTopMargin = getDimensionForDevice(context, + R.dimen.recents_layout_top_margin_phone, + R.dimen.recents_layout_top_margin_tablet, + R.dimen.recents_layout_top_margin_tablet_xlarge); + mBaseSideMargin = getDimensionForDevice(context, + R.dimen.recents_layout_side_margin_phone, + R.dimen.recents_layout_side_margin_tablet, + R.dimen.recents_layout_side_margin_tablet_xlarge); + mBaseBottomMargin = res.getDimensionPixelSize(R.dimen.recents_layout_bottom_margin); + mFreeformStackGap = + res.getDimensionPixelSize(R.dimen.recents_freeform_layout_bottom_margin); } /** |