Move BaseActivityInterface task size methods to DeviceProfile.

Fix: 238593212
Test: DeviceProfilePhoneTest.kt
Test: DeviceProfileVerticalBarTest.kt
Test: DeviceProfilePhone3ButtonTest.kt
Test: DeviceProfileVerticalBar3ButtonTest.kt
Test: DeviceProfileTabletLandscapeTest.kt
Test: DeviceProfileTabletPortraitTest.kt
Test: DeviceProfileTabletLandscape3ButtonTest.kt
Test: DeviceProfileTabletPortrait3ButtonTest.kt
Test: DeviceProfileTwoPanelLandscapeTest.kt
Test: DeviceProfileTwoPanelPortraitTest.kt
Test: DeviceProfileTwoPanelLandscape3ButtonTest.kt
Test: DeviceProfileTwoPanelPortrait3ButtonTest.kt
Change-Id: I30324d34ca119a467f530b590949743c2ba7b91a
This commit is contained in:
Pat Manning committed 2022-07-18 16:35:02 +01:00
1 parent 68c6b81d2a
commit 4e73e5e352
37 files changed
+1598 -307

No files matched your search

@@ -1431,9 +1431,8 @@ public class TaskView extends FrameLayout implements Reusable {
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
if (deviceProfile.isTablet) {
final int thumbnailPadding = deviceProfile.overviewTaskThumbnailTopMarginPx;
final Rect lastComputedTaskSize = getRecentsView().getLastComputedTaskSize();
final int taskWidth = lastComputedTaskSize.width();
final int taskHeight = lastComputedTaskSize.height();
final int taskWidth = deviceProfile.overviewTaskRect.width();
final int taskHeight = deviceProfile.overviewTaskRect.height();
int boxWidth;
int boxHeight;
@@ -1444,10 +1443,9 @@ public class TaskView extends FrameLayout implements Reusable {
boxWidth = taskWidth;
boxHeight = taskHeight;
} else {
// Otherwise task is in grid, and should use lastComputedGridTaskSize.
Rect lastComputedGridTaskSize = getRecentsView().getLastComputedGridTaskSize();
boxWidth = lastComputedGridTaskSize.width();
boxHeight = lastComputedGridTaskSize.height();
// Otherwise task is in grid.
boxWidth = deviceProfile.overviewGridTaskDimension.x;
boxHeight = deviceProfile.overviewGridTaskDimension.y;
}
// Bound width/height to the box size.