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

Commit bfff1c80 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "Improving getWorkspaceAppIcon()" into ub-launcher3-qt-qpr1-dev

parents b5d2ab59 49a28a72
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
            mLauncher.assertTrue("Unable to scroll to a clickable icon: " + appName,
                    hasClickableIcon(allAppsContainer, appListRecycler, appIconSelector));

            final UiObject2 appIcon = mLauncher.getObjectInContainer(appListRecycler,
            final UiObject2 appIcon = mLauncher.waitForObjectInContainer(appListRecycler,
                    appIconSelector);
            return new AppIcon(mLauncher, appIcon);
        }
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
                flingForward();
            }

            mLauncher.getObjectInContainer(verifyActiveContainer(), clearAllSelector).click();
            mLauncher.waitForObjectInContainer(verifyActiveContainer(), clearAllSelector).click();
            try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer(
                    "dismissed all tasks")) {
                return new Workspace(mLauncher);
+0 −7
Original line number Diff line number Diff line
@@ -678,13 +678,6 @@ public final class LauncherInstrumentation {
        return object;
    }

    @NonNull
    UiObject2 getObjectInContainer(UiObject2 container, BySelector selector) {
        final UiObject2 object = container.findObject(selector);
        assertNotNull("Can't find an object with selector: " + selector, object);
        return object;
    }

    @NonNull
    List<UiObject2> getObjectsInContainer(UiObject2 container, String resName) {
        return container.findObjects(getLauncherObjectSelector(resName));
+9 −6
Original line number Diff line number Diff line
@@ -108,11 +108,14 @@ public final class Workspace extends Home {
     */
    @NonNull
    public AppIcon getWorkspaceAppIcon(String appName) {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                "want to get a workspace icon")) {
            return new AppIcon(mLauncher,
                mLauncher.getObjectInContainer(
                    mLauncher.waitForObjectInContainer(
                            verifyActiveContainer(),
                            AppIcon.getAppIconSelector(appName, mLauncher)));
        }
    }

    /**
     * Ensures that workspace is scrollable. If it's not, drags an icon icons from hotseat to the
@@ -142,13 +145,13 @@ public final class Workspace extends Home {

    @NonNull
    public AppIcon getHotseatAppIcon(String appName) {
        return new AppIcon(mLauncher, mLauncher.getObjectInContainer(
        return new AppIcon(mLauncher, mLauncher.waitForObjectInContainer(
                mHotseat, AppIcon.getAppIconSelector(appName, mLauncher)));
    }

    @NonNull
    public Folder getHotseatFolder(String appName) {
        return new Folder(mLauncher, mLauncher.getObjectInContainer(
        return new Folder(mLauncher, mLauncher.waitForObjectInContainer(
                mHotseat, Folder.getSelector(appName, mLauncher)));
    }