Merge "Allow settings preference title to span over multiple lines." into oc-dev

am: d09c7e61f4

Change-Id: I81b0285f59195911e3b98ca6f4bf8333da9b23a4
This commit is contained in:
Doris Ling
2017-04-12 18:10:41 +00:00
committed by android-build-merger
6 changed files with 21 additions and 68 deletions

View File

@@ -25,7 +25,6 @@ public class DividerPreference extends Preference {
private Boolean mAllowAbove;
private Boolean mAllowBelow;
private Boolean mMultiLine;
public DividerPreference(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -36,9 +35,6 @@ public class DividerPreference extends Preference {
if (a.hasValue(R.styleable.DividerPreference_allowDividerBelow)) {
mAllowBelow = a.getBoolean(R.styleable.DividerPreference_allowDividerBelow, false);
}
if (a.hasValue(R.styleable.DividerPreference_multiLine)) {
mMultiLine = a.getBoolean(R.styleable.DividerPreference_multiLine, false);
}
}
public DividerPreference(Context context) {
@@ -64,12 +60,5 @@ public class DividerPreference extends Preference {
if (mAllowBelow != null) {
holder.setDividerAllowedBelow(mAllowBelow);
}
if (mMultiLine != null && mMultiLine) {
TextView textView = (TextView)holder.findViewById(android.R.id.title);
if (textView != null) {
textView.setSingleLine(false);
}
}
}
}

View File

@@ -165,7 +165,6 @@ public class AppNotificationSettings extends NotificationSettingsBase {
channelPref.setKey(channel.getId());
channelPref.setTitle(channel.getName());
channelPref.setChecked(channel.getImportance() != IMPORTANCE_NONE);
channelPref.setMultiLine(true);
channelPref.setSummary(getImportanceSummary(channel.getImportance()));
Bundle channelArgs = new Bundle();
channelArgs.putInt(AppInfoBase.ARG_PACKAGE_UID, mUid);

View File

@@ -36,7 +36,6 @@ public class MasterSwitchPreference extends TwoTargetPreference {
private Switch mSwitch;
private boolean mChecked;
private boolean mMultiLine;
public MasterSwitchPreference(Context context, AttributeSet attrs,
int defStyleAttr, int defStyleRes) {
@@ -81,12 +80,6 @@ public class MasterSwitchPreference extends TwoTargetPreference {
if (mSwitch != null) {
mSwitch.setChecked(mChecked);
}
if (mMultiLine) {
TextView textView = (TextView) holder.findViewById(android.R.id.title);
if (textView != null) {
textView.setSingleLine(false);
}
}
}
public boolean isChecked() {
@@ -106,14 +99,6 @@ public class MasterSwitchPreference extends TwoTargetPreference {
}
}
public boolean isMultiLine() {
return mMultiLine;
}
public void setMultiLine(boolean multiLine) {
mMultiLine = multiLine;
}
/**
* If admin is not null, disables the switch.
* Otherwise, keep it enabled.