Delays removal of extra screen when dropping an app.

This prevents a conflict between the scroll animation
and layout transition caused by removing the screen.
Since the extra screen is at the end of the workspace,
this most commonly (only?) causes issues in RTL, as
everything shifts to the left to fill the void of the
empty screen. See bug for example video of the issue.

With this change, the removal of the empty screen
happens after Launcher finishes transitioning back
to NORMAL state after dropping an icon/widget,
rather than in onDragEnd.

Note: There is a similar issue when placing a widget
in RTL (even if not switching screens), but it's not
made worse by this CL. Filed b/166531479.

Demo:
https://drive.google.com/file/d/1JTP81syjoBFe3_N2SOZHP5r5_RoCUWan/view?usp=sharing

Fixes: 163382092
Change-Id: I55ed5af8e1d80dcc0d1b6502c3c5b068dc6f8722
This commit is contained in:
Andy Wickham
2020-08-26 19:08:18 -07:00
parent 9a472fbd7d
commit 0f12b6013d
2 changed files with 16 additions and 6 deletions

View File

@@ -28,7 +28,7 @@ public interface WorkspaceLayoutManager {
String TAG = "Launcher.Workspace";
// The screen id used for the empty screen always present to the right.
// The screen id used for the empty screen always present at the end.
int EXTRA_EMPTY_SCREEN_ID = -201;
// The is the first screen. It is always present, even if its empty.
int FIRST_SCREEN_ID = 0;