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

Commit 334efeba authored by Zak Cohen's avatar Zak Cohen Committed by Alex Chau
Browse files

Overview - Adds first pass at making landscape layout real.

Adds dynamic sizing to margins around task view, also creates space in the
overview actions view in landscape to make space for the proactive chips if
needed.

Bug: 182529089
Test: Local build and run on two devices
Change-Id: I447de3564a3249ede4e8e8a4d3e5d1c177f6be61
parent 59230c3c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -22,5 +22,4 @@
    android:layout_height="wrap_content"
    android:text="@string/recents_clear_all"
    android:textColor="?attr/workspaceTextColor"
    android:textSize="14sp"
    android:translationY="@dimen/task_thumbnail_half_top_margin" />
 No newline at end of file
    android:textSize="14sp" />
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- NOTE! don't add dimensions for margins / paddings / sizes that change per orientation to this
     file, they need to be loaded at runtime. -->
<com.android.quickstep.views.TaskView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
@@ -24,8 +26,7 @@
    <com.android.quickstep.views.TaskThumbnailView
        android:id="@+id/snapshot"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/task_thumbnail_top_margin"/>
        android:layout_height="match_parent"/>

    <com.android.quickstep.views.IconView
        android:id="@+id/icon"
+2 −0
Original line number Diff line number Diff line
@@ -16,4 +16,6 @@
-->
<resources>
    <dimen name="task_card_menu_horizontal_padding">24dp</dimen>

    <dimen name="overview_task_margin">8dp</dimen>
</resources>
 No newline at end of file
+0 −4
Original line number Diff line number Diff line
@@ -15,11 +15,7 @@
-->

<resources>

    <dimen name="task_thumbnail_top_margin">80dp</dimen>
    <dimen name="task_thumbnail_half_top_margin">40dp</dimen>
    <dimen name="task_thumbnail_icon_size">48dp</dimen>
    <dimen name="task_icon_top_margin">16dp</dimen>
    <!-- For screens without rounded corners -->
    <dimen name="task_corner_radius_small">2dp</dimen>

+14 −12
Original line number Diff line number Diff line
@@ -201,14 +201,18 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
            PagedOrientationHandler orientedState) {
        Resources res = context.getResources();

        int taskMargin = res.getDimensionPixelSize(R.dimen.overview_task_margin);
        int taskIconAndMargin = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size)
                + res.getDimensionPixelSize(R.dimen.task_icon_top_margin);
        int proactiveRowAndMargin = res.getDimensionPixelSize(R.dimen.overview_proactive_row_height)
        int taskMargin = dp.overviewTaskMarginPx;
        int proactiveRowAndMargin;
        if (dp.isVerticalBarLayout()) {
            // In Vertical Bar Layout the proactive row doesn't have its own space, it's inside
            // the actions row.
            proactiveRowAndMargin = 0;
        } else {
            proactiveRowAndMargin = res.getDimensionPixelSize(R.dimen.overview_proactive_row_height)
                    + res.getDimensionPixelSize(R.dimen.overview_proactive_row_bottom_margin);

        }
        calculateTaskSizeInternal(context, dp,
                taskIconAndMargin + taskMargin,
                dp.overviewTaskThumbnailTopMarginPx,
                proactiveRowAndMargin + getOverviewActionsHeight(context) + taskMargin,
                res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
                outRect);
@@ -267,13 +271,11 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
     * Calculates the modal taskView size for the provided device configuration
     */
    public final void calculateModalTaskSize(Context context, DeviceProfile dp, Rect outRect) {
        Resources res = context.getResources();
        calculateTaskSizeInternal(
                context, dp,
                res.getDimensionPixelSize(R.dimen.overview_task_margin),
                getOverviewActionsHeight(context)
                        + res.getDimensionPixelSize(R.dimen.overview_task_margin),
                res.getDimensionPixelSize(R.dimen.overview_task_margin),
                dp.overviewTaskMarginPx,
                getOverviewActionsHeight(context) + dp.overviewTaskMarginPx,
                dp.overviewTaskMarginPx,
                outRect);
    }

Loading