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

Commit f1245a8e authored by Jacky Wang's avatar Jacky Wang
Browse files

[MainSwitchPreference] Clean up MainSwitchBar

The delete code is redundant, which will be applied during
MainSwitchPreference.onBindViewHolder.

Bug: 400333584
Flag: EXEMPT cleanup
Test: manual
Change-Id: I12a9202144f4db69e5ba880a23833d4f3975e233
parent 34d533a2
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -112,26 +112,6 @@ public class MainSwitchBar extends LinearLayout implements OnCheckedChangeListen
        if (mSwitch.getVisibility() == VISIBLE) {
            mSwitch.setOnCheckedChangeListener(this);
        }

        setChecked(mSwitch.isChecked());

        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();
        }

        setBackground(mSwitch.isChecked());
    }

    @Override