Merge "Fixes header bar sizes when changing display sizes"

This commit is contained in:
TreeHugger Robot
2016-11-01 17:31:41 +00:00
committed by Android (Google) Code Review
2 changed files with 17 additions and 24 deletions

View File

@@ -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());
}
/**

View File

@@ -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);
}
/**