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

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

Removing accessibility description from page indicators

The current page is announced upon switching to it.
Is should be done this way for all future page implementations with
indicators.

Bug: 77827828
Test: Manual
Change-Id: I8f2f163a261dd7098939674d39e014236fc66d5d
parent 3483c52e
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -203,7 +203,6 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
        if (mPageIndicatorViewId > -1) {
            mPageIndicator = parent.findViewById(mPageIndicatorViewId);
            mPageIndicator.setMarkersCount(getChildCount());
            mPageIndicator.setPageDescription(getPageIndicatorDescription());
        }
    }

@@ -310,7 +309,6 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou

    private void updatePageIndicator() {
        if (mPageIndicator != null) {
            mPageIndicator.setPageDescription(getPageIndicatorDescription());
            mPageIndicator.setActiveMarker(getNextPage());
        }
    }
@@ -1541,10 +1539,6 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
        return false;
    }

    protected String getPageIndicatorDescription() {
        return getCurrentPageDescription();
    }

    protected boolean canAnnouncePageDescription() {
        return true;
    }
+1 −6
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -167,10 +168,4 @@ public class PersonalWorkSlidingTabStrip extends LinearLayout implements PageInd

    @Override
    public void setMarkersCount(int numMarkers) { }

    @Override
    public void setPageDescription(CharSequence description) {
        // We don't want custom page description as the tab-bar already has two tabs with their
        // own descriptions.
    }
}
+0 −2
Original line number Diff line number Diff line
@@ -25,6 +25,4 @@ public interface PageIndicator {
    void setActiveMarker(int activePage);

    void setMarkersCount(int numMarkers);

    void setPageDescription(CharSequence description);
}
+0 −5
Original line number Diff line number Diff line
@@ -227,11 +227,6 @@ public class PageIndicatorDots extends View implements PageIndicator {
        requestLayout();
    }

    @Override
    public void setPageDescription(CharSequence description) {
        setContentDescription(description);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        // Add extra spacing of mDotRadius on all sides so than entry animation could be run.
+0 −5
Original line number Diff line number Diff line
@@ -186,11 +186,6 @@ public class WorkspacePageIndicator extends View implements Insettable, PageIndi
        }
    }

    @Override
    public void setPageDescription(CharSequence description) {
        setContentDescription(description);
    }

    public void setShouldAutoHide(boolean shouldAutoHide) {
        mShouldAutoHide = shouldAutoHide;
        if (shouldAutoHide && mLinePaint.getAlpha() > 0) {