Merge "Make partially visible widget pages not important for accessibility." into jb-mr1-dev

This commit is contained in:
Svetoslav Ganov
2012-11-06 17:46:32 -08:00
committed by Android (Google) Code Review

View File

@@ -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() {
if (mCallbacks != null) {
mCallbacks.onUserActivityTimeoutChanged();
@@ -312,6 +328,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
content.getContentDescription());
frame.setContentDescription(contentDescription);
}
updateWidgetFrameImportantForAccessibility(frame);
}
/**
@@ -558,6 +575,12 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
animateOutlinesAndSidePages(true, -1);
}
@Override
void setCurrentPage(int currentPage) {
super.setCurrentPage(currentPage);
updateWidgetFramesImportantForAccessibility();
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
@@ -669,6 +692,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
}
mWidgetToResetAfterFadeOut = -1;
}
updateWidgetFramesImportantForAccessibility();
}
});
mChildrenOutlineFadeAnimation.start();