Use a SwitchPreference for auto-rotate instead

- Change the UI to SwitchPreference
- Remove old string used by DropDownPreference
- Attach listener to monitor setting change

Change-Id: If42cceb74296814311eb0eff8e26b4a48a1c4d29
Fix: 35959797
Test: robotests
This commit is contained in:
Fan Zhang
2017-05-05 17:38:50 -07:00
parent e1c68df27e
commit 670410c04e
6 changed files with 233 additions and 48 deletions

View File

@@ -91,7 +91,7 @@ public class DisplaySettings extends DashboardFragment {
Context context, Lifecycle lifecycle) {
final List<PreferenceController> controllers = new ArrayList<>();
controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
controllers.add(new AutoRotatePreferenceController(context));
controllers.add(new AutoRotatePreferenceController(context, lifecycle));
controllers.add(new CameraGesturePreferenceController(context));
controllers.add(new DozePreferenceController(context));
controllers.add(new FontSizePreferenceController(context));