Merge "Use compound drawable instead of image span." into nyc-dev
diff --git a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
index d0c249f..1f1a9b8 100644
--- a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
@@ -651,8 +651,11 @@
final int disabledColor = context.getColor(R.color.disabled_text_color);
sb.setSpan(new ForegroundColorSpan(disabledColor), 0, sb.length(),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
- final ImageSpan image = new RestrictedLockImageSpan(context);
- sb.append(" ", image, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+ textView.setCompoundDrawables(null, null, getRestrictedPadlock(context), null);
+ textView.setCompoundDrawablePadding(context.getResources().getDimensionPixelSize(
+ R.dimen.restricted_icon_padding));
+ } else {
+ textView.setCompoundDrawables(null, null, null, null);
}
textView.setText(sb);
}