Show "Doesn't support work profiles" text in Settings for launchers not

supporting work profiles.

Screenshot: https://screenshot.googleplex.com/iz3xoeSvbOA.png

Test: Manually go to Settings -> Apps & notifications -> Default apps -> Home app.
Test: make ROBOTEST_FILTER=RadioButtonPreferenceTest -j40 RunSettingsRoboTests
Bug: 69297461
Change-Id: I55c721d7ad979c882bb879a974758cf08eaf0c86
This commit is contained in:
arangelov
2018-03-20 14:53:55 +00:00
committed by Antoan Angelov
parent a0cb928098
commit 2c9d620091
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);