Merge "Workaround issue with latest version of RecyclerView which is overriding our custom accessibility delegate" into ub-launcher3-qt-dev

This commit is contained in:
Adam Cohen
2019-06-21 21:16:04 +00:00
committed by Android (Google) Code Review
@@ -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);