Merge "Show "Doesn't support work profiles" text in Settings for launchers not supporting work profiles." into pi-dev

This commit is contained in:
Antoan Angelov
2018-03-20 19:33:17 +00:00
committed by Android (Google) Code Review
2 changed files with 91 additions and 0 deletions

View File

@@ -20,7 +20,9 @@ import android.content.Context;
import android.support.v4.content.res.TypedArrayUtils;
import android.support.v7.preference.CheckBoxPreference;
import android.support.v7.preference.PreferenceViewHolder;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import com.android.settings.R;
@@ -72,6 +74,12 @@ public class RadioButtonPreference extends CheckBoxPreference {
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
View summaryContainer = view.findViewById(R.id.summary_container);
if (summaryContainer != null) {
summaryContainer.setVisibility(
TextUtils.isEmpty(getSummary()) ? View.GONE : View.VISIBLE);
}
TextView title = (TextView) view.findViewById(android.R.id.title);
if (title != null) {
title.setSingleLine(false);