Merge "Fix crash opening avatar picker in non-en-US locale." into udc-dev am: 0f3d66a93a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23709963 Change-Id: I9abe9457f806d33f88e317276ec95ec581c103c8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -643,8 +643,10 @@
|
||||
array must also be populated with a content description for each image. -->
|
||||
<array name="avatar_images"/>
|
||||
|
||||
<!-- Content descriptions for each of the images in the avatar_images array. -->
|
||||
<string-array name="avatar_image_descriptions"/>
|
||||
<!-- Content descriptions for each of the images in the avatar_images array. When overlaid
|
||||
these values should be translated, but this empty array must not be translated or it may
|
||||
replace the real descriptions with an empty array. -->
|
||||
<string-array name="avatar_image_descriptions" translatable="false"/>
|
||||
|
||||
<!-- NOTE: if you change this, you must also add the corresponding scale key and lookup table to
|
||||
frameworks/base/core/java/android/content/res/FontScaleConverterFactory.java -->
|
||||
|
||||
@@ -243,7 +243,7 @@ public class AvatarPickerActivity extends Activity {
|
||||
int index = indexFromPosition(position);
|
||||
viewHolder.setSelected(position == mSelectedPosition);
|
||||
viewHolder.setDrawable(mImageDrawables.get(index));
|
||||
if (mImageDescriptions != null) {
|
||||
if (mImageDescriptions != null && index < mImageDescriptions.size()) {
|
||||
viewHolder.setContentDescription(mImageDescriptions.get(index));
|
||||
} else {
|
||||
viewHolder.setContentDescription(getString(
|
||||
|
||||
Reference in New Issue
Block a user