Merge "Use overview_actions_height from Resources to calculate OverviewActionsView alignment" into tm-dev
This commit is contained in:
@@ -362,10 +362,9 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
|
||||
/** Gets the space that the overview actions will take, including bottom margin. */
|
||||
private int getOverviewActionsHeight(Context context, DeviceProfile dp) {
|
||||
Resources res = context.getResources();
|
||||
return OverviewActionsView.getOverviewActionsBottomMarginPx(getNavigationMode(context), dp)
|
||||
+ OverviewActionsView.getOverviewActionsTopMarginPx(getNavigationMode(context), dp)
|
||||
+ res.getDimensionPixelSize(R.dimen.overview_actions_height);
|
||||
+ dp.overviewActionsHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -216,14 +216,12 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
|
||||
// Align vertically, using taskbar height + mDp.taskbarOffsetY() to estimate where
|
||||
// the button nav top is.
|
||||
View startActionView = findViewById(R.id.action_screenshot);
|
||||
int marginBottom = getOverviewActionsBottomMarginPx(
|
||||
DisplayController.getNavigationMode(getContext()), mDp);
|
||||
int actionsTop =
|
||||
(mDp.heightPx - marginBottom - mInsets.bottom) - startActionView.getHeight();
|
||||
(mDp.heightPx - marginBottom - mInsets.bottom) - mDp.overviewActionsHeight;
|
||||
int navTop = mDp.heightPx - (mDp.taskbarSize + mDp.getTaskbarOffsetY());
|
||||
int transY = navTop - actionsTop
|
||||
+ ((mDp.taskbarSize - startActionView.getHeight()) / 2);
|
||||
int transY = navTop - actionsTop + ((mDp.taskbarSize - mDp.overviewActionsHeight) / 2);
|
||||
setTranslationY(transY);
|
||||
} else {
|
||||
setPadding(mInsets.left, 0, mInsets.right, 0);
|
||||
|
||||
@@ -345,6 +345,7 @@
|
||||
<dimen name="task_thumbnail_icon_drawable_size_grid">0dp</dimen>
|
||||
<dimen name="overview_task_margin">0dp</dimen>
|
||||
<dimen name="overview_task_margin_grid">0dp</dimen>
|
||||
<dimen name="overview_actions_height">0dp</dimen>
|
||||
<dimen name="overview_actions_button_spacing">0dp</dimen>
|
||||
<dimen name="overview_actions_margin_gesture">0dp</dimen>
|
||||
<dimen name="overview_actions_top_margin_gesture">0dp</dimen>
|
||||
|
||||
@@ -191,6 +191,7 @@ public class DeviceProfile {
|
||||
public int overviewTaskIconDrawableSizePx;
|
||||
public int overviewTaskIconDrawableSizeGridPx;
|
||||
public int overviewTaskThumbnailTopMarginPx;
|
||||
public final int overviewActionsHeight;
|
||||
public final int overviewActionsMarginThreeButtonPx;
|
||||
public final int overviewActionsTopMarginGesturePx;
|
||||
public final int overviewActionsBottomMarginGesturePx;
|
||||
@@ -407,6 +408,7 @@ public class DeviceProfile {
|
||||
overviewPageSpacing = res.getDimensionPixelSize(R.dimen.overview_page_spacing);
|
||||
overviewActionsButtonSpacing = res.getDimensionPixelSize(
|
||||
R.dimen.overview_actions_button_spacing);
|
||||
overviewActionsHeight = res.getDimensionPixelSize(R.dimen.overview_actions_height);
|
||||
overviewActionsMarginThreeButtonPx = res.getDimensionPixelSize(
|
||||
R.dimen.overview_actions_margin_three_button);
|
||||
// Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but
|
||||
|
||||
Reference in New Issue
Block a user