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

Commit 66ed415f authored by Adam Cohen's avatar Adam Cohen Committed by Android (Google) Code Review
Browse files

Merge "Workaround issue with latest version of RecyclerView which is...

Merge "Workaround issue with latest version of RecyclerView which is overriding our custom accessibility delegate" into ub-launcher3-qt-dev
parents 70266689 29794c56
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import android.view.ViewDebug;
import android.widget.TextView;

import com.android.launcher3.Launcher.OnResumeCallback;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
import com.android.launcher3.dot.DotInfo;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.graphics.DrawableFactory;
@@ -227,6 +228,18 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
        applyFromWorkspaceItem(info, false);
    }

    @Override
    public void setAccessibilityDelegate(AccessibilityDelegate delegate) {
        if (delegate instanceof LauncherAccessibilityDelegate) {
            super.setAccessibilityDelegate(delegate);
        } else {
            // NO-OP
            // Workaround for b/129745295 where RecyclerView is setting our Accessibility
            // delegate incorrectly. There are no cases when we shouldn't be using the
            // LauncherAccessibilityDelegate for BubbleTextView.
        }
    }

    public void applyFromWorkspaceItem(WorkspaceItemInfo info, boolean promiseStateChanged) {
        applyIconAndLabel(info);
        setTag(info);