Merge "Multiple custom themes 2/n" into ub-launcher3-qt-dev
diff --git a/src/com/android/customization/widget/OptionSelectorController.java b/src/com/android/customization/widget/OptionSelectorController.java
index 9725995..06b1e0c 100644
--- a/src/com/android/customization/widget/OptionSelectorController.java
+++ b/src/com/android/customization/widget/OptionSelectorController.java
@@ -125,23 +125,26 @@
if (holder instanceof TileViewHolder) {
TileViewHolder tileHolder = (TileViewHolder) holder;
- if (isActivated) {
- if (option == mAppliedOption) {
+ if (tileHolder.labelView != null) {
+ if (isActivated) {
+ if (option == mAppliedOption) {
+ CharSequence cd = mContainer.getContext().getString(
+ R.string.option_applied_previewed_description,
+ option.getTitle());
+ tileHolder.labelView.setContentDescription(cd);
+ } else {
+ CharSequence cd = mContainer.getContext().getString(
+ R.string.option_previewed_description, option.getTitle());
+ tileHolder.labelView.setContentDescription(cd);
+ }
+ } else if (option == mAppliedOption) {
CharSequence cd = mContainer.getContext().getString(
- R.string.option_applied_previewed_description, option.getTitle());
+ R.string.option_applied_description, option.getTitle());
tileHolder.labelView.setContentDescription(cd);
} else {
- CharSequence cd = mContainer.getContext().getString(
- R.string.option_previewed_description, option.getTitle());
- tileHolder.labelView.setContentDescription(cd);
+ // Remove content description
+ tileHolder.labelView.setContentDescription(null);
}
- } else if (option == mAppliedOption) {
- CharSequence cd = mContainer.getContext().getString(
- R.string.option_applied_description, option.getTitle());
- tileHolder.labelView.setContentDescription(cd);
- } else {
- // Remove content description
- tileHolder.labelView.setContentDescription(null);
}
}
}