Merge "Announce wallpaper selection for accessibility" into jb-ub-now-indigo-rose

This commit is contained in:
Alan Viverette
2013-10-09 00:28:22 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -41,6 +41,8 @@
<!-- Accessibility string used as a label for a particular wallpaper in the Wallpaper Picker list.
e.g. "Wallpaper 3 of 10" -->
<string name="wallpaper_accessibility_name">Wallpaper %1$d of %2$d</string>
<!-- Accessibility string used to announce that an item has been selected. -->
<string name="announce_selection">Selected <xliff:g id="label" example="Wallpaper 3 of 10">%1$s</xliff:g></string>
<!-- Label on button to delete wallpaper(s) -->
<string name="wallpaper_delete">Delete</string>
@@ -52,6 +52,7 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.DecelerateInterpolator;
import android.widget.BaseAdapter;
import android.widget.FrameLayout;
@@ -254,6 +255,10 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
}
mSelectedThumb = v;
v.setSelected(true);
// TODO: Remove this once the accessibility framework and
// services have better support for selection state.
v.announceForAccessibility(
getString(R.string.announce_selection, v.getContentDescription()));
}
info.onClick(WallpaperPickerActivity.this);
}