Merge "Fix accessibility announce on apps page" into ub-now-nova
This commit is contained in:
@@ -29,6 +29,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TabHost;
|
||||
@@ -430,6 +431,14 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona
|
||||
// prevent slowing down the animation)
|
||||
mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage());
|
||||
|
||||
// Opening apps, need to announce what page we are on.
|
||||
AccessibilityManager am = (AccessibilityManager)
|
||||
getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||
if (am.isEnabled()) {
|
||||
// Notify the user when the page changes
|
||||
announceForAccessibility(mAppsCustomizePane.getCurrentPageDescription());
|
||||
}
|
||||
|
||||
// Going from Workspace -> All Apps
|
||||
// NOTE: We should do this at the end since we check visibility state in some of the
|
||||
// cling initialization/dismiss code above.
|
||||
|
||||
@@ -1466,6 +1466,14 @@ public class Workspace extends SmoothPagedView
|
||||
mWallpaperOffset.syncWithScroll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void announceForAccessibility(CharSequence text) {
|
||||
// Don't announce if apps is on top of us.
|
||||
if (!mLauncher.isAllAppsVisible()) {
|
||||
super.announceForAccessibility(text);
|
||||
}
|
||||
}
|
||||
|
||||
void showOutlines() {
|
||||
if (!isSmall() && !mIsSwitchingState) {
|
||||
if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel();
|
||||
|
||||
Reference in New Issue
Block a user