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

Commit bad1c73e authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Hide clear-all button from accessibility

This solves muliple navigation problems in Overview.

Bug: 79165501
Change-Id: I2ae99fe3ad24194c9516bb2a99344289ef7408e8
Testing: Manual
parent 1b74bd65
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11,4 +11,5 @@
    android:textColor="?attr/workspaceTextColor"
    android:visibility="invisible"
    android:textSize="14sp"
    android:importantForAccessibility="no"
/>
 No newline at end of file
+0 −9
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;

public class ClearAllButton extends Button {
@@ -36,14 +35,6 @@ public class ClearAllButton extends Button {
        mRecentsView = recentsView;
    }

    @Override
    public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
        super.onInitializeAccessibilityNodeInfo(info);
        // Should be visible to accessibility even when completely covered by the task.
        // Otherwise, we won't be able to scroll to it.
        info.setVisibleToUser(true);
    }

    @Override
    public boolean performAccessibilityAction(int action, Bundle arguments) {
        final boolean res = super.performAccessibilityAction(action, arguments);
+0 −2
Original line number Diff line number Diff line
@@ -1303,8 +1303,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl

    private void onChildViewsChanged() {
        final int childCount = getChildCount();
        mClearAllButton.setAccessibilityTraversalAfter(
                childCount == 0 ? NO_ID : getChildAt(childCount - 1).getId());
        mClearAllButton.setVisibility(childCount == 0 ? INVISIBLE : VISIBLE);
    }