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

Commit 150b2036 authored by Jacky Wang's avatar Jacky Wang
Browse files

[MainSwitchPreference] Partially revert ag/32215978

Bug: 399273407
Bug: 400333584
Flag: EXEMPT bugfix
Test: manual
Change-Id: Ia26ccfc56e257d0bae52f39601015ada429eb291
parent ec44be7b
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -112,6 +112,22 @@ public class MainSwitchBar extends LinearLayout implements OnCheckedChangeListen
        if (mSwitch.getVisibility() == VISIBLE) {
        if (mSwitch.getVisibility() == VISIBLE) {
            mSwitch.setOnCheckedChangeListener(this);
            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
    @Override