Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce580466 authored by Doris Ling's avatar Doris Ling
Browse files

Check if singleLineTitle attribute is set for the preference.

Only call setSingleLine() on the preference title if the attribute is
set.

Bug: 37328004
Test: manual
Change-Id: Ia95230cd08feaf8213cb5917c105d070eb30c11c
parent 1eaab2db
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ public class Preference implements Comparable<Preference> {
    private boolean mDependencyMet = true;
    private boolean mParentDependencyMet = true;
    private boolean mRecycleEnabled = true;
    private boolean mHasSingleLineTitleAttr;
    private boolean mSingleLineTitle = true;
    private boolean mIconSpaceReserved;

@@ -303,6 +304,7 @@ public class Preference implements Comparable<Preference> {

                case com.android.internal.R.styleable.Preference_singleLineTitle:
                    mSingleLineTitle = a.getBoolean(attr, mSingleLineTitle);
                    mHasSingleLineTitleAttr = true;
                    break;

                case com.android.internal.R.styleable.Preference_iconSpaceReserved:
@@ -609,7 +611,9 @@ public class Preference implements Comparable<Preference> {
            if (!TextUtils.isEmpty(title)) {
                titleView.setText(title);
                titleView.setVisibility(View.VISIBLE);
                if (mHasSingleLineTitleAttr) {
                    titleView.setSingleLine(mSingleLineTitle);
                }
            } else {
                titleView.setVisibility(View.GONE);
            }