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

Commit 5f8775bb authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[MainSwitchPreference] Partially revert ag/32215978" into main

parents 95a16504 150b2036
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -112,6 +112,22 @@ public class MainSwitchBar extends LinearLayout implements OnCheckedChangeListen
        if (mSwitch.getVisibility() == VISIBLE) {
            mSwitch.setOnCheckedChangeListener(this);
        }

        if (attrs != null) {
            final TypedArray a = context.obtainStyledAttributes(attrs,
                    androidx.preference.R.styleable.Preference, 0 /*defStyleAttr*/,
                    0 /*defStyleRes*/);
            final CharSequence title = a.getText(
                    androidx.preference.R.styleable.Preference_android_title);
            setTitle(title);
            //TODO(b/369470034): update to next version
            if (isExpressive && Build.VERSION.SDK_INT >= VERSION_CODES.VANILLA_ICE_CREAM) {
                CharSequence summary = a.getText(
                        androidx.preference.R.styleable.Preference_android_summary);
                setSummary(summary);
            }
            a.recycle();
        }
    }

    @Override