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
This commit is contained in:
Vadim Tryshev
2018-04-16 15:43:24 -07:00
parent 3483c52e6b
commit c7dc69dc1f
5 changed files with 1 additions and 24 deletions

View File

@@ -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;
}

View File

@@ -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.
}
}

View File

@@ -25,6 +25,4 @@ public interface PageIndicator {
void setActiveMarker(int activePage);
void setMarkersCount(int numMarkers);
void setPageDescription(CharSequence description);
}

View File

@@ -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.

View File

@@ -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) {