Adjust restricted lock positions as per new design.

Bug: 27263531
Change-Id: I7e38a9e3356ca43ed936de1e6f8190eba4d4773e
This commit is contained in:
Sudheer Shanka
2016-03-07 12:56:53 -08:00
parent 179a57b21f
commit 115d15763d
7 changed files with 91 additions and 11 deletions

View File

@@ -130,7 +130,7 @@ public class UsbModeChooserActivity extends Activity {
private void inflateOption(final int mode, boolean selected, LinearLayout container,
final boolean disallowedByAdmin) {
View v = mLayoutInflater.inflate(R.layout.radio_with_summary, container, false);
View v = mLayoutInflater.inflate(R.layout.restricted_radio_with_summary, container, false);
TextView titleView = (TextView) v.findViewById(android.R.id.title);
titleView.setText(getTitle(mode));
@@ -139,7 +139,7 @@ public class UsbModeChooserActivity extends Activity {
if (disallowedByAdmin) {
if (mEnforcedAdmin != null) {
setDisabledByAdmin(titleView, summaryView);
setDisabledByAdmin(v, titleView, summaryView);
} else {
return;
}
@@ -164,12 +164,11 @@ public class UsbModeChooserActivity extends Activity {
container.addView(v);
}
private void setDisabledByAdmin(TextView titleView, TextView summaryView) {
private void setDisabledByAdmin(View rootView, TextView titleView, TextView summaryView) {
if (mEnforcedAdmin != null) {
titleView.setEnabled(false);
summaryView.setEnabled(false);
RestrictedLockUtils.setTextViewPadlock(this,
titleView, true /* showPadlock */);
rootView.findViewById(R.id.restricted_icon).setVisibility(View.VISIBLE);
Drawable[] compoundDrawables = titleView.getCompoundDrawablesRelative();
compoundDrawables[0 /* start */].mutate().setColorFilter(
getColor(R.color.disabled_text_color), PorterDuff.Mode.MULTIPLY);