Merge "Make partially visible widget pages not important for accessibility." into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5fff5f01f8
@@ -180,6 +180,22 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateWidgetFramesImportantForAccessibility() {
|
||||||
|
final int pageCount = getPageCount();
|
||||||
|
for (int i = 0; i < pageCount; i++) {
|
||||||
|
KeyguardWidgetFrame frame = getWidgetPageAt(i);
|
||||||
|
updateWidgetFrameImportantForAccessibility(frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateWidgetFrameImportantForAccessibility(KeyguardWidgetFrame frame) {
|
||||||
|
if (frame.getContentAlpha() <= 0) {
|
||||||
|
frame.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||||
|
} else {
|
||||||
|
frame.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void userActivity() {
|
private void userActivity() {
|
||||||
if (mCallbacks != null) {
|
if (mCallbacks != null) {
|
||||||
mCallbacks.onUserActivityTimeoutChanged();
|
mCallbacks.onUserActivityTimeoutChanged();
|
||||||
@@ -312,6 +328,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
|
|||||||
content.getContentDescription());
|
content.getContentDescription());
|
||||||
frame.setContentDescription(contentDescription);
|
frame.setContentDescription(contentDescription);
|
||||||
}
|
}
|
||||||
|
updateWidgetFrameImportantForAccessibility(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -558,6 +575,12 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
|
|||||||
animateOutlinesAndSidePages(true, -1);
|
animateOutlinesAndSidePages(true, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void setCurrentPage(int currentPage) {
|
||||||
|
super.setCurrentPage(currentPage);
|
||||||
|
updateWidgetFramesImportantForAccessibility();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttachedToWindow() {
|
public void onAttachedToWindow() {
|
||||||
super.onAttachedToWindow();
|
super.onAttachedToWindow();
|
||||||
@@ -669,6 +692,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
|
|||||||
}
|
}
|
||||||
mWidgetToResetAfterFadeOut = -1;
|
mWidgetToResetAfterFadeOut = -1;
|
||||||
}
|
}
|
||||||
|
updateWidgetFramesImportantForAccessibility();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mChildrenOutlineFadeAnimation.start();
|
mChildrenOutlineFadeAnimation.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user