Merge "DeviceProfile.overviewRowSpacing should exclude extra top margin on grid tasks" into sc-v2-dev

This commit is contained in:
TreeHugger Robot 2021-12-11 01:12:57 +00:00 committed by Android (Google) Code Review
commit 953873dd18
2 changed files with 10 additions and 2 deletions

View File

@ -37,6 +37,7 @@ import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel;
import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.Overview;
import com.android.launcher3.tapl.OverviewActions; import com.android.launcher3.tapl.OverviewActions;
import com.android.launcher3.tapl.OverviewTask; import com.android.launcher3.tapl.OverviewTask;
import com.android.launcher3.tapl.TestHelpers;
import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
@ -321,7 +322,8 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
public void testOverviewForTablet() throws Exception { public void testOverviewForTablet() throws Exception {
if (!mLauncher.isTablet()) { // TODO(b/210158657): Re-enable for OOP
if (!mLauncher.isTablet() || !TestHelpers.isInLauncherProcess()) {
return; return;
} }
for (int i = 2; i <= 14; i++) { for (int i = 2; i <= 14; i++) {

View File

@ -394,7 +394,13 @@ public class DeviceProfile {
} }
overviewActionsMarginThreeButtonPx = res.getDimensionPixelSize( overviewActionsMarginThreeButtonPx = res.getDimensionPixelSize(
R.dimen.overview_actions_margin_three_button); R.dimen.overview_actions_margin_three_button);
overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing); // Grid task's top margin is only overviewTaskIconSizePx + overviewTaskMarginGridPx, but
// overviewTaskThumbnailTopMarginPx is applied to all TaskThumbnailView, so exclude the
// extra margin when calculating row spacing.
int extraTopMargin = overviewTaskThumbnailTopMarginPx - overviewTaskIconSizePx
- overviewTaskMarginGridPx;
overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing)
- extraTopMargin;
overviewGridSideMargin = isLandscape overviewGridSideMargin = isLandscape
? res.getDimensionPixelSize(R.dimen.overview_grid_side_margin_landscape) ? res.getDimensionPixelSize(R.dimen.overview_grid_side_margin_landscape)
: res.getDimensionPixelSize(R.dimen.overview_grid_side_margin_portrait); : res.getDimensionPixelSize(R.dimen.overview_grid_side_margin_portrait);