From 3f343b7b5394595640d3467f4049a0fe92f21520 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 16 Apr 2019 11:46:35 -0700 Subject: [PATCH] Smarter task laying out based off onMeasure Previously laid out via calls to layoutParams. This isn't as optimized as being baked into the measure + layout system and has the issue of being less flexible. For example, if the device profile changes (e.g. orientation change), we'd have to apply new layout params for all the views. With this CL, we would only need to do this for top-level views and the children will resolve themselves. Bug: 114136250 Test: Check layout on marlin + walleye Change-Id: Iddd503a8844bdde7724d3f804660da61719d5c90 (cherry picked from commit c98f116b7757e48d09f29325e0c32d20fedc18d6) --- .../res/layout/icon_recents_root_view.xml | 1 - go/quickstep/res/layout/task_item_view.xml | 20 ++-- .../com/android/quickstep/TaskAdapter.java | 14 +-- .../android/quickstep/TaskLayoutManager.java | 42 ++++++++ .../quickstep/views/IconRecentsView.java | 8 +- .../android/quickstep/views/TaskItemView.java | 32 ------ .../quickstep/views/TaskLayoutUtils.java | 14 --- .../views/TaskThumbnailIconView.java | 100 ++++++++++++++++++ 8 files changed, 157 insertions(+), 74 deletions(-) create mode 100644 go/quickstep/src/com/android/quickstep/TaskLayoutManager.java create mode 100644 go/quickstep/src/com/android/quickstep/views/TaskThumbnailIconView.java diff --git a/go/quickstep/res/layout/icon_recents_root_view.xml b/go/quickstep/res/layout/icon_recents_root_view.xml index 630088236a..6dc293f748 100644 --- a/go/quickstep/res/layout/icon_recents_root_view.xml +++ b/go/quickstep/res/layout/icon_recents_root_view.xml @@ -29,7 +29,6 @@ android:id="@+id/recent_task_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="1" android:scrollbars="none"/>