Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11c0ebcd authored by Nick Chameyev's avatar Nick Chameyev
Browse files

Capture Launcher icon positions by reusing UiObject2

Reuse the same UiObject2/HomeAppIcon objects
when capturing Launcher icon positions.

When invoking 'launcher.workspace.allWorkspaceIcons'
we wait for the animation to finish which makes
the test fail as we expect to capture icon positions
midway through the animation.

Test: atest LauncherFoldAnimationTest
Bug: 315163608
Bug: 296991492
Flag: EXEMPT bugfix
Change-Id: I668d15165e4c777b3be24d66ad3f7888eaca2fea
parent 09398bf1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.launcher3.tapl;

import static com.android.launcher3.testing.shared.TestProtocol.TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE;

import android.graphics.Point;
import android.util.Log;
import android.widget.TextView;

@@ -128,6 +129,14 @@ public abstract class AppIcon extends Launchable {
        return getObject().getContentDescription();
    }

    /**
     * @return the center coordinates of the icon
     */
    @NonNull
    public Point getVisibleCenter() {
        return getObject().getVisibleCenter();
    }

    /**
     * Create a regular expression pattern that matches strings containing all of the non-whitespace
     * characters of the app name, with any amount of whitespace added between characters (e.g.