Enable variable size thumbnail for large screen

- Introduced a feature flag
- Refresh TaskView size when thumbnail is refreshed or Recents resizes
- Disable edge scale down in large screens
- Added temp method to get task width/height ratio
- In fullscreen, scale down TaskThumbnailView and disable TaskView elevation
- Task boxing mechanism: http://screen/3NkePthAVUVH2Rv.png

Bug: 174464656
Test: Manually test overview and quickswitch for folded and unfolded, including with RTL.
Change-Id: I2ce24d588a246cc6a2408039a37d884021aa0800
This commit is contained in:
Alex Chau
2021-01-08 19:07:25 +00:00
parent fd03d04ae0
commit 7944ee5c79
8 changed files with 361 additions and 57 deletions

View File

@@ -745,6 +745,11 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
return mOrientationHandler.getChildStart(pageAtIndex);
}
protected int getChildVisibleSize(int index) {
View layout = getPageAt(index);
return mOrientationHandler.getMeasuredSize(layout);
}
@Override
public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {
int page = indexToPage(indexOfChild(child));
@@ -1457,8 +1462,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
}
private int getDisplacementFromScreenCenter(int childIndex, int screenCenter) {
View layout = getPageAt(childIndex);
int childSize = mOrientationHandler.getMeasuredSize(layout);
int childSize = getChildVisibleSize(childIndex);
int halfChildSize = (childSize / 2);
int childCenter = getChildOffset(childIndex) + halfChildSize;
return childCenter - screenCenter;