am 618f8cc5: Merge "Don\'t leave space for summary text if it\'s an empty string" into klp-dev
* commit '618f8cc5dbb6dff03ad3270d6b948b1ef90c5dd6': Don't leave space for summary text if it's an empty string
This commit is contained in:
@@ -21,6 +21,7 @@ import android.content.SharedPreferences;
|
||||
import android.content.res.TypedArray;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
@@ -215,17 +216,17 @@ public abstract class TwoStatePreference extends Preference {
|
||||
TextView summaryView = (TextView) view.findViewById(com.android.internal.R.id.summary);
|
||||
if (summaryView != null) {
|
||||
boolean useDefaultSummary = true;
|
||||
if (mChecked && mSummaryOn != null) {
|
||||
if (mChecked && !TextUtils.isEmpty(mSummaryOn)) {
|
||||
summaryView.setText(mSummaryOn);
|
||||
useDefaultSummary = false;
|
||||
} else if (!mChecked && mSummaryOff != null) {
|
||||
} else if (!mChecked && !TextUtils.isEmpty(mSummaryOff)) {
|
||||
summaryView.setText(mSummaryOff);
|
||||
useDefaultSummary = false;
|
||||
}
|
||||
|
||||
if (useDefaultSummary) {
|
||||
final CharSequence summary = getSummary();
|
||||
if (summary != null) {
|
||||
if (!TextUtils.isEmpty(summary)) {
|
||||
summaryView.setText(summary);
|
||||
useDefaultSummary = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user