Commit Graph

15 Commits

Author SHA1 Message Date
Matías Hernández
2a3e8b3070 Update "Dark Theme" Settings screen to account for Modes that can toggle it
Bedtime is no longer a special case.

Fixes: 361592187
Test: atest com.android.settings.display.darkmode
Flag: android.app.modes_ui
Change-Id: Iddc5d8142d6bc0bb1f5c4ead876ee201c8818b12
2024-09-11 11:52:50 +02:00
Chaohui Wang
08a1c9876e Revert^2 "Migrate to CompoundButton.OnCheckedChangeListener"
8979681a8d

Change-Id: I60edd3aabf49afbe4aa016af780baa68d928bddf
2023-11-07 14:17:15 +00:00
Sebastian Pickl
8979681a8d Revert "Migrate to CompoundButton.OnCheckedChangeListener"
Revert submission 25147565-onSwitchChanged-CompoundButton

Reason for revert: breaking builds 

Bug:309601476

Reverted changes: /q/submissionid:25147565-onSwitchChanged-CompoundButton

Change-Id: Ie746db87d9c642599593aa3d5e5baf6b7ba89c0e
2023-11-07 13:26:36 +00:00
Chaohui Wang
71d1f021af Migrate to CompoundButton.OnCheckedChangeListener
Switch and SwitchCompat are both CompoundButton.

Using CompoundButton in Java will helps migration in the future.

Bug: 306658427
Test: manual - check Settings pages
Change-Id: If2e08a9a9557ec66a3b31ef18cd2e15943098a59
2023-11-07 20:22:27 +08:00
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Steven Ng
3859251be0 Add dark theme custom type into the dark theme settings page
Also fix some test cases.

I'd prefer using Robolectric shadows rather than mocking Android
framework classes. However, I can't do that in this CL due to the
lack of multiple shadow classes support.

Test: make RunSettingsRoboTests -j56
      ROBOTEST_FILTER=com.android.settings.display.darkmode.*
Bug: 215182463
Change-Id: If557d2933927a5dd0fadd3f6db6bb6f0ab7dd5ee
2022-01-26 16:15:52 +00:00
Stanley Wang
10b7a7d483 Use MainSwitchPreference to replace the button style switches.
Fix: 177967926
Fix: 177968295
Fix: 177967925
Fix: 177968078

Test: Run robotest and apply the widget in Settings and see the ui
Change-Id: Ie854de96e5495fa564fb8a097ed4547bbd2b10c5
2021-02-02 08:39:37 +00:00
Tsung-Mao Fang
ae9dc54c56 Remove duplicate result for dark mode
We only keep the one in display settings.

Test: robo test and search dark mode in settings search.
Fix: 155735315
Change-Id: I71041f473944e854ef4601063658021bb9411069
2020-05-05 21:08:37 +08:00
Jason Chiu
819abf7f87 Refine metrics log in infrastructure
- Add interfaces to set/get metrics category in BasePreferenceController
  for descendants having a chance to get it.
- Set metrics category in DashboardFragment
- Automatically log metrics in onPreferenceChange of
  TogglePreferenceController
- Add support for TwoStateButtonPreference in TogglePreferenceController
  to make the preference generic

Bug: 137559984
Test: robotest
Change-Id: Ia7e0d24a3db1991b18e0286d9894570fa71247a3
2020-04-07 14:08:39 +08:00
Jason Chiu
26343b82ee Add metric logs for special cases in Display and Battery page
Bug: 137559984
Test: robotest
Change-Id: I60f6237ac2c533306879f46ee4c25d54002cf0e9
2020-03-26 11:31:39 +08:00
Jay Aliomer
c31c35fb19 Custom dark theme scheduling
allows the use to set the start and end automatic dark theme
activation within a day.

Test: run all settings tests
Change-Id: If96fc050159724d553acb09c2da4fab1d5ff519f
2020-01-14 16:31:29 -05:00
Jay Aliomer
f4bc80c45c Battery saver mode should disable dark mode modification
disable toggle options and disable the dark theme drop down selection

Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.DarkUIPreferenceControllerTest" && \
make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.darkmode.DarkModeActivationPreferenceControllerTest" && \
make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.darkmode.DarkModeObserverTest" && \
make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.darkmode.DarkModeScheduleSelectorControllerTest"

Fixes: 	145098277
Fixes: 145297188
Fixes: 	145254016
Change-Id: I5c81a295810cc2d9a45657978104647e9c15da46
2019-12-02 18:19:52 +00:00
Jay Aliomer
53ad4fedc6 Revert "Revert "Add settings for scheduling dark theme""
This reverts commit 50c0fa136c.

Reason for revert: Fixed the error which is code incompatibility
Test: run all settings tests
Change-Id: I8f05b50f8198c4b2565bb9b6f62ddda5029c8365
Merged-In: I8f05b50f8198c4b2565bb9b6f62ddda5029c8365
Bug: 141567787
2019-11-22 20:58:23 +00:00
Preston O'Neal
50c0fa136c Revert "Add settings for scheduling dark theme"
This reverts commit 7141b142df.

Reason for revert: This is breaking builds on git_qt-qpr1-dev

Change-Id: I7766826d3fc86a12fc8411b027a52eceb5a66019
2019-11-21 22:09:53 +00:00
Jay Aliomer
7141b142df Add settings for scheduling dark theme
Adding a settings page similar to night light for Dark theme. it will allow the user to schedule
dark mode from sunrise to sunset

Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.DarkUIPreferenceControllerTest" && \
make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.darkmode.DarkModeActivationPreferenceControllerTest" && \
make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.darkmode.DarkModeObserverTest" && \
make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.display.darkmode.DarkModeScheduleSelectorControllerTest"

Fixes: 141567787

Change-Id: I3094b655c04f59c23a95162a1be5ee8260e28a48
(cherry picked from commit 0828e6be9c)
2019-11-21 20:07:24 +00:00