Use SettingsLib's MainSwitchBar to replace SwitchBar in Settings.
To log Settings metrics, the MainSwitch extends MainSwitchBar and replace the SwitchBar in SettingsActivity. Bug: 175181773 Test: Run robotest and apply the widget in Settings and see the ui Change-Id: I3add3702e9058ad9192b5172c7cf0e2ccfb55a70
This commit is contained in:
@@ -75,6 +75,8 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
|
||||
mMetricsFeatureProvider = metricsFeatureProvider;
|
||||
mSwitchController = switchController;
|
||||
mSwitchController.setListener(this);
|
||||
mSwitchController.setTitle(context.getString(R.string.bluetooth_main_switch_title));
|
||||
|
||||
mValidListener = false;
|
||||
mMetricsEvent = metricsEvent;
|
||||
|
||||
@@ -191,7 +193,6 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
|
||||
if (isChecked && !status) {
|
||||
mSwitchController.setChecked(false);
|
||||
mSwitchController.setEnabled(true);
|
||||
mSwitchController.updateTitle(false);
|
||||
triggerParentPreferenceCallback(false);
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user