Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88ea05ad authored by Zak Cohen's avatar Zak Cohen
Browse files

Overview actions - bring UI closer to redlines.

Test: local
Bug: 139828243
Change-Id: Ia1cb0fc1c111a6a22fa4b4a98b43cd9ac1869a2c
parent c7f39fc6
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ public class LayoutUtils {
        float taskWidth, taskHeight, paddingHorz;
        Resources res = context.getResources();
        Rect insets = dp.getInsets();
        final boolean overviewActionsEnabled = ENABLE_OVERVIEW_ACTIONS.get();

        if (dp.isMultiWindowMode) {
            if (multiWindowStrategy == MULTI_WINDOW_STRATEGY_HALF_SCREEN) {
@@ -113,7 +114,7 @@ public class LayoutUtils {
            final int paddingResId;
            if (dp.isVerticalBarLayout()) {
                paddingResId = R.dimen.landscape_task_card_horz_space;
            } else if (ENABLE_OVERVIEW_ACTIONS.get() && removeShelfFromOverview(context)) {
            } else if (overviewActionsEnabled && removeShelfFromOverview(context)) {
                paddingResId = R.dimen.portrait_task_card_horz_space_big_overview;
            } else {
                paddingResId = R.dimen.portrait_task_card_horz_space;
@@ -123,7 +124,9 @@ public class LayoutUtils {

        float topIconMargin = res.getDimension(R.dimen.task_thumbnail_top_margin);
        float bottomMargin = thumbnailBottomMargin(context);
        float paddingVert = res.getDimension(R.dimen.task_card_vert_space);

        float paddingVert = overviewActionsEnabled && removeShelfFromOverview(context)
                ? 0 : res.getDimension(R.dimen.task_card_vert_space);

        // Note this should be same as dp.availableWidthPx and dp.availableHeightPx unless
        // we override the insets ourselves.
@@ -141,7 +144,7 @@ public class LayoutUtils {
        // Center in the visible space
        float x = insets.left + (launcherVisibleWidth - outWidth) / 2;
        float y = insets.top + Math.max(topIconMargin,
                (launcherVisibleHeight - extraVerticalSpace - outHeight) / 2);
                (launcherVisibleHeight - extraVerticalSpace - outHeight - bottomMargin) / 2);
        outRect.set(Math.round(x), Math.round(y),
                Math.round(x) + Math.round(outWidth), Math.round(y) + Math.round(outHeight));
    }