75 Commits

Author SHA1 Message Date
Ansh
509da9db80 Maintainers: Update Maintainer Name for RM6785
Signed-off-by: Ansh <singhansh64321@gmail.com>
2023-02-23 23:43:01 +07:00
rdx420
2667545003 Cherish:Add 6 new QS Styles
Signed-off-by: rdx420 <padraramesh420@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-02-09 14:19:35 +07:00
ariffjenong
bac9fe6f2d Cherish: Introduce Dynamic System Bars (DSB) [2/2]
Signed-off-by: ariffjenong <arifbuditantodablekk@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-02-09 14:12:01 +07:00
Hưng Phan
c4589a0e08 Revert "Cherish:Drop volte/vowifi features"
This reverts commit 07c75efdbe.
2023-02-06 17:19:56 +07:00
Hưng Phan
92668a2071 Revert "Revert "Cherish: Make combined signal icons configurable at runtime [2/2]""
This reverts commit 1ecee0b4c1.
2023-02-06 17:19:46 +07:00
Hưng Phan
30a1e7b2d6 New Crowdin updates (#192)
* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Russian)
2023-02-06 17:18:23 +07:00
Hưng Phan
73e61ddecb New Crowdin updates (#191)
* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Chinese Simplified)
2023-01-26 21:39:38 +07:00
Hưng Phan
09d32114b4 New Crowdin updates (#190)
* New translations cherish_strings.xml (Romanian)

* New translations cherish_strings.xml (French)

* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Arabic)

* New translations cherish_strings.xml (Czech)

* New translations cherish_strings.xml (Danish)

* New translations cherish_strings.xml (German)

* New translations cherish_strings.xml (Greek)

* New translations cherish_strings.xml (Finnish)

* New translations cherish_strings.xml (Hebrew)

* New translations cherish_strings.xml (Hungarian)

* New translations cherish_strings.xml (Italian)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Korean)

* New translations cherish_strings.xml (Kurdish)

* New translations cherish_strings.xml (Dutch)

* New translations cherish_strings.xml (Norwegian)

* New translations cherish_strings.xml (Polish)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Slovak)

* New translations cherish_strings.xml (Serbian (Cyrillic))

* New translations cherish_strings.xml (Swedish)

* New translations cherish_strings.xml (Turkish)

* New translations cherish_strings.xml (Ukrainian)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Chinese Traditional)

* New translations cherish_strings.xml (English)

* New translations cherish_strings.xml (Vietnamese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Persian)

* New translations cherish_strings.xml (Hindi)

* New translations cherish_strings.xml (Malayalam)

* New translations cherish_strings.xml (Latin)

* New translations cherish_strings.xml (Nepali)

* New translations cherish_strings.xml (Kurmanji (Kurdish))

* New translations cherish_strings.xml (Sorani (Kurdish))

* New translations cherish_strings.xml (Lao)

* New translations cherish_strings.xml (Turkish, Cyprus)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Malayalam)

* New translations cherish_strings.xml (Romanian)

* New translations cherish_strings.xml (French)

* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Arabic)

* New translations cherish_strings.xml (Czech)

* New translations cherish_strings.xml (Danish)

* New translations cherish_strings.xml (German)

* New translations cherish_strings.xml (Greek)

* New translations cherish_strings.xml (Finnish)

* New translations cherish_strings.xml (Hebrew)

* New translations cherish_strings.xml (Hungarian)

* New translations cherish_strings.xml (Italian)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Korean)

* New translations cherish_strings.xml (Kurdish)

* New translations cherish_strings.xml (Dutch)

* New translations cherish_strings.xml (Norwegian)

* New translations cherish_strings.xml (Polish)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Slovak)

* New translations cherish_strings.xml (Serbian (Cyrillic))

* New translations cherish_strings.xml (Swedish)

* New translations cherish_strings.xml (Turkish)

* New translations cherish_strings.xml (Ukrainian)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Chinese Traditional)

* New translations cherish_strings.xml (English)

* New translations cherish_strings.xml (Vietnamese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Persian)

* New translations cherish_strings.xml (Hindi)

* New translations cherish_strings.xml (Malayalam)

* New translations cherish_strings.xml (Latin)

* New translations cherish_strings.xml (Nepali)

* New translations cherish_strings.xml (Kurmanji (Kurdish))

* New translations cherish_strings.xml (Sorani (Kurdish))

* New translations cherish_strings.xml (Lao)

* New translations cherish_strings.xml (Turkish, Cyprus)

* Update source file cherish_strings.xml

* New translations cherish_strings.xml (Turkish)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (German)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Romanian)

* New translations cherish_strings.xml (French)

* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Arabic)

* New translations cherish_strings.xml (Czech)

* New translations cherish_strings.xml (Danish)

* New translations cherish_strings.xml (German)

* New translations cherish_strings.xml (Greek)

* New translations cherish_strings.xml (Finnish)

* New translations cherish_strings.xml (Hebrew)

* New translations cherish_strings.xml (Hungarian)

* New translations cherish_strings.xml (Italian)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Korean)

* New translations cherish_strings.xml (Kurdish)

* New translations cherish_strings.xml (Dutch)

* New translations cherish_strings.xml (Norwegian)

* New translations cherish_strings.xml (Polish)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Slovak)

* New translations cherish_strings.xml (Serbian (Cyrillic))

* New translations cherish_strings.xml (Swedish)

* New translations cherish_strings.xml (Turkish)

* New translations cherish_strings.xml (Ukrainian)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Chinese Traditional)

* New translations cherish_strings.xml (English)

* New translations cherish_strings.xml (Vietnamese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Persian)

* New translations cherish_strings.xml (Hindi)

* New translations cherish_strings.xml (Malayalam)

* New translations cherish_strings.xml (Latin)

* New translations cherish_strings.xml (Nepali)

* New translations cherish_strings.xml (Kurmanji (Kurdish))

* New translations cherish_strings.xml (Sorani (Kurdish))

* New translations cherish_strings.xml (Lao)

* New translations cherish_strings.xml (Turkish, Cyprus)

* Update source file cherish_strings.xml

* New translations cherish_strings.xml (Romanian)

* New translations cherish_strings.xml (French)

* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Arabic)

* New translations cherish_strings.xml (Czech)

* New translations cherish_strings.xml (Danish)

* New translations cherish_strings.xml (German)

* New translations cherish_strings.xml (Greek)

* New translations cherish_strings.xml (Finnish)

* New translations cherish_strings.xml (Hebrew)

* New translations cherish_strings.xml (Hungarian)

* New translations cherish_strings.xml (Italian)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Korean)

* New translations cherish_strings.xml (Kurdish)

* New translations cherish_strings.xml (Dutch)

* New translations cherish_strings.xml (Norwegian)

* New translations cherish_strings.xml (Polish)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Slovak)

* New translations cherish_strings.xml (Serbian (Cyrillic))

* New translations cherish_strings.xml (Swedish)

* New translations cherish_strings.xml (Turkish)

* New translations cherish_strings.xml (Ukrainian)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Chinese Traditional)

* New translations cherish_strings.xml (English)

* New translations cherish_strings.xml (Vietnamese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Persian)

* New translations cherish_strings.xml (Hindi)

* New translations cherish_strings.xml (Malayalam)

* New translations cherish_strings.xml (Latin)

* New translations cherish_strings.xml (Nepali)

* New translations cherish_strings.xml (Kurmanji (Kurdish))

* New translations cherish_strings.xml (Sorani (Kurdish))

* New translations cherish_strings.xml (Lao)

* New translations cherish_strings.xml (Turkish, Cyprus)

* Update source file cherish_strings.xml

* New translations cherish_strings.xml (Vietnamese)
2023-01-18 12:05:50 +07:00
Hưng Phan
940fb89ace Cherish:Add note summary for aod customizations
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-18 11:52:47 +07:00
SagarMakhar
7b9d9e002d Cherish : Black theme [2/3]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-18 11:51:21 +07:00
RealSchnedi
ee8d896e41 Cherish: Color picker improvements
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-15 13:19:31 +07:00
TikkiTikki
d86c79377b Cherish: Add Ambient Customizations [2/2]
Co-authored-by: TikkiTikki <radstylemusic@gmail.com>
Co-authored-by: SuperDroidBond <superdroidbond@yahoo.com>
Signed-off-by: SuperDroidBond <superdroidbond@yahoo.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-15 13:19:16 +07:00
SuperDroidBond
865fb7286f Ambient Pulse Light: add layout style for top n bottom [2/2]
Signed-off-by: SuperDroidBond <superdroidbond@yahoo.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-13 14:37:39 +07:00
Michele Bono
248f5ea1a3 Cherish: Add light width [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-13 14:36:14 +07:00
Varun Date
174a363b2f EdgeLighting: Add option for random colors [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-13 14:34:58 +07:00
maxwen
2f720296ae [SQUASHED] Cherish: Add ambient pulse and aod notifications [2/2]
@/SKULSHADY - Clean up and adapted for A11

SDB: improvise the enabling/disabling of colorpicker preference to avoid fc

Co-authored-by: maxwen <max.weninger@gmail.com>
Co-authored-by: Ido Ben-Hur <idoybh2@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-13 14:32:59 +07:00
Hưng Phan
10b4dbc806 Revert "Cherish:add edge light customizations[2/2]"
This reverts commit c54c2eb6c2.

Revert "Cherish:update edge light preferences"

This reverts commit b88457ea22.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-13 13:43:32 +07:00
jhonboy121
f51e75a73e Cherish: Monet settings
This reverts commit f547af0ea1.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-12 21:46:22 +07:00
Hưng Phan
1ecee0b4c1 Revert "Cherish: Make combined signal icons configurable at runtime [2/2]"
This reverts commit 2581ff49a1.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-10 20:03:05 +07:00
Hưng Phan
07c75efdbe Cherish:Drop volte/vowifi features
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-10 19:16:01 +07:00
El Dainosor
52b3cff099 Cherish: Add support for Lockscreen clock fonts
After r16, a commit to cleanup the KeyguardClockSwtich and unify it's structure was merged.
Also, this added a new resource into the frameworks core, which allows us to overlay the custom clock font.
So, we need to overlays now to customize this. This makes me really happy because it removes the ugly method that we were doing years ago.

[nurkeinneid]:
- adapt to our ThemeUtils
- restore original copyright header - crdroid did nothing here

Change-Id: I70590910144141a534b926f884e9f08e4e3af5bc
Signed-off-by: NurKeinNeid <mralexman3000@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2023-01-05 13:16:01 +07:00
Hưng Phan
9786678851 New translations cherish_strings.xml (Greek) (#188) 2023-01-05 13:12:44 +07:00
Hưng Phan
1806e098e2 New Crowdin updates (#187)
* New translations cherish_strings.xml (French)

* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Italian)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)
2022-12-24 14:04:54 +07:00
Hưng Phan
4f91b592e3 New translations cherish_strings.xml (Vietnamese) (#186) 2022-12-22 11:07:11 +07:00
Hưng Phan
d8fffa5997 New Crowdin updates (#185)
* New translations cherish_strings.xml (Romanian)

* New translations cherish_strings.xml (French)

* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Arabic)

* New translations cherish_strings.xml (Czech)

* New translations cherish_strings.xml (Danish)

* New translations cherish_strings.xml (German)

* New translations cherish_strings.xml (Greek)

* New translations cherish_strings.xml (Finnish)

* New translations cherish_strings.xml (Hebrew)

* New translations cherish_strings.xml (Hungarian)

* New translations cherish_strings.xml (Italian)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Korean)

* New translations cherish_strings.xml (Kurdish)

* New translations cherish_strings.xml (Dutch)

* New translations cherish_strings.xml (Norwegian)

* New translations cherish_strings.xml (Polish)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Slovak)

* New translations cherish_strings.xml (Serbian (Cyrillic))

* New translations cherish_strings.xml (Swedish)

* New translations cherish_strings.xml (Turkish)

* New translations cherish_strings.xml (Ukrainian)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Chinese Traditional)

* New translations cherish_strings.xml (English)

* New translations cherish_strings.xml (Vietnamese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Persian)

* New translations cherish_strings.xml (Hindi)

* New translations cherish_strings.xml (Malayalam)

* New translations cherish_strings.xml (Latin)

* New translations cherish_strings.xml (Nepali)

* New translations cherish_strings.xml (Kurmanji (Kurdish))

* New translations cherish_strings.xml (Sorani (Kurdish))

* New translations cherish_strings.xml (Lao)

* New translations cherish_strings.xml (Turkish, Cyprus)
2022-12-22 03:11:49 +07:00
Hưng Phan
e808035eb5 New Crowdin updates (#184)
* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Vietnamese)
2022-12-22 02:41:41 +07:00
Adin Kwok
524e9baaaf Cherish: Smart Pixels [2/2]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-22 02:20:17 +07:00
minaripenguin37
2581ff49a1 Cherish: Make combined signal icons configurable at runtime [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-22 02:20:11 +07:00
00day0
0c6796ecca Cherish: Introduce OOS style notification clear all button [2/2]
aslo bring custom style notif clear

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-22 00:51:41 +07:00
travarilo
173d7e5697 Cherish:Toggle data usage view on QS footer [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-22 00:30:50 +07:00
Hưng Phan
cb2dd7b7ef Cherish:clean some changes in volte/vowifi
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-21 20:24:03 +07:00
Hưng Phan
d754c67a9b New Crowdin updates (#182)
* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Arabic)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Romanian)

* New translations cherish_strings.xml (French)

* New translations cherish_strings.xml (Czech)

* New translations cherish_strings.xml (Danish)

* New translations cherish_strings.xml (German)

* New translations cherish_strings.xml (Greek)

* New translations cherish_strings.xml (Finnish)

* New translations cherish_strings.xml (Hebrew)

* New translations cherish_strings.xml (Hungarian)

* New translations cherish_strings.xml (Italian)

* New translations cherish_strings.xml (Japanese)

* New translations cherish_strings.xml (Korean)

* New translations cherish_strings.xml (Kurdish)

* New translations cherish_strings.xml (Dutch)

* New translations cherish_strings.xml (Norwegian)

* New translations cherish_strings.xml (Polish)

* New translations cherish_strings.xml (Portuguese)

* New translations cherish_strings.xml (Slovak)

* New translations cherish_strings.xml (Serbian (Cyrillic))

* New translations cherish_strings.xml (Swedish)

* New translations cherish_strings.xml (Turkish)

* New translations cherish_strings.xml (Ukrainian)

* New translations cherish_strings.xml (Chinese Simplified)

* New translations cherish_strings.xml (Chinese Traditional)

* New translations cherish_strings.xml (English)

* New translations cherish_strings.xml (Vietnamese)

* New translations cherish_strings.xml (Portuguese, Brazilian)

* New translations cherish_strings.xml (Indonesian)

* New translations cherish_strings.xml (Persian)

* New translations cherish_strings.xml (Hindi)

* New translations cherish_strings.xml (Malayalam)

* New translations cherish_strings.xml (Latin)

* New translations cherish_strings.xml (Nepali)

* New translations cherish_strings.xml (Kurmanji (Kurdish))

* New translations cherish_strings.xml (Sorani (Kurdish))

* New translations cherish_strings.xml (Lao)

* New translations cherish_strings.xml (Turkish, Cyprus)

* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Russian)
2022-12-20 12:45:00 +07:00
El Dainosor
7df8e095af Cherish: Add support for UI Styles
Not a great previewer but for now it'll do the work

[nurkeinneid]:
- adapt to our ThemeUtils
- restore original copyright header - crdroid did nothing here

Change-Id: I432578a4b3c652d7ad3e00a93e11bfb3e199b4a5
Signed-off-by: NurKeinNeid <mralexman3000@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-19 20:45:19 +07:00
Hưng Phan
f0e2d0c06a New Crowdin updates (#181)
* New translations cherish_strings.xml (Spanish)

* New translations cherish_strings.xml (Russian)

* New translations cherish_strings.xml (Arabic)

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-19 11:10:29 +07:00
Hưng Phan
0155637105 New translations cherish_strings.xml (Spanish) (#180)
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-19 11:10:14 +07:00
jhonboy121
b88457ea22 Cherish:update edge light preferences
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 14:45:40 +07:00
Hưng Phan
3d397149c9 Import some SystemSettingColorPickerPreference
This reverts commit f547af0ea1.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 14:22:38 +07:00
Jesse Chan
e151956146 Cherish:Implement click to take partial screenshot [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 00:56:32 +07:00
ezio84
184cf4afbb Cherish:Less boring heads up option [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 00:54:36 +07:00
Hưng Phan
d86bf2d701 New Crowdin updates
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 00:51:09 +07:00
TikkiTikki
a1b356b32c Pulse: Vertical mirror [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 00:50:17 +07:00
TikkiTikki
b462d887bf Pulse: Custom gravity and Center mirrored [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 00:50:09 +07:00
TikkiTikki
5b6b1c5166 Cherish: Solid render: Round lines [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 00:49:50 +07:00
Pranav Vashi
238a7f000f Cherish:Pulse initial checkin for Android 12 [2/2]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-16 00:49:36 +07:00
jhonboy121
c54c2eb6c2 Cherish:add edge light customizations[2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-14 01:16:40 +07:00
Dil3mm4
a432d51465 Feature: reticker [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-14 01:14:41 +07:00
jhonboy121
9a2b851b32 Cherish: applock: early return in setChecked if backing field has the same value
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-14 00:59:33 +07:00
jhonboy121
9c831df1e0 AppLockSettingsPC: use DashboardFragment as the type for host
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-14 00:11:53 +07:00
jhonboy121
4aedefa4d7 Cherish: use a new task stack for app lock fragments
* fixes fragments staying in recents on going home
* also made other preferences do binder calls asynchronously

Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-14 00:11:32 +07:00
jhonboy121
7e7aa11228 applock: adapt for API changes
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-14 00:10:57 +07:00
jhonboy121
21d34ff4e4 Cherish:introduce app lock
* AppLockCredentialActivity is a stripped down version of ConfirmDeviceCredentialActivity in Settings

Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-14 00:10:44 +07:00
Hưng Phan
735a2a81ee cherish: Battery Styles: Added 9 more battery styles [2/2]
Thanks to Another substratum theme for many icons:- https://t.me/AnotherTheme
Thanks to @Fakeriz for battery icon style A.
Thanks to @Ndikarizki for battery icon style B.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
Signed-off-by: helliscloser <mrumais@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:29:46 +07:00
Pranav Vashi
0cbb9e2cbd Battery Styles: Introduce Battery Landscape [2/2]
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: helliscloser <mrumais@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:29:38 +07:00
Pranav Vashi
1526c11a2f cherish: Smart Charging (2/4)
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:29:23 +07:00
Beanstown
6857a13e3e Udfps authentication / error vibration [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:28:44 +07:00
DanipunK1
c045b4a2c9 UDFPS Haptic: re-enable it
This reverts commit 060f87564a.

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:28:36 +07:00
LorDClockaN
117c3c83fe Cherish: Power/reboot menu transparency (1/2)
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:28:30 +07:00
LorDClockaN
527b6b1421 Cherish: Rotation anim to Power and reboot menu [1/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:27:53 +07:00
westcripp
967434722f Cherish: Add 7 more power menu animations [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:27:46 +07:00
Nico60
de7d1336ff Cherish: [SQUASHED] Add animations to quick settings
- Add animations to quick settings tiles [1/2]
- Add faster qs tile animation speeds (1/2)
- Add interpolators to qs tiles animation [1/2]

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:27:35 +07:00
Alex Cruz
4cfd21f9d9 Cherish: Power Menu animations [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:27:01 +07:00
Hưng Phan
be4bc81a9d Cherish:Cherish:[SQUASH]Add tunables for clock position
Cherish: Add tunables for clock position
Author: Hendrik Hagendorn <git@finnq.de>
Date:   Sun Jan 15 10:00:12 2017 +0100
    Tuner: Move clock seconds option to status bar settings

    Change-Id: I532c179f06b934009d48433e50b69660247ee295

Author: Luca Stefani <luca.stefani.ge1@gmail.com>
Date:   Sun Jul 29 14:19:08 2018 +0200
    SystemUI: Fix default clock blacklist value

    Change-Id: Ibdc4f6a707569ddb417854760cf579daca989ebb

Author: LuK1337 <priv.luk@gmail.com>
Date:   Wed Aug 1 18:10:39 2018 +0200
    SystemUI: Initialize mClockVisibleByUser to android:visibility

    * Fixes ~ triple clock ~ after leaving from Google SUW.

    Change-Id: I3ceea4400b3057e2b6b1f221f9074b1d451133ea

Author: LuK1337 <priv.luk@gmail.com>
Date:   Thu Sep 27 12:24:19 2018 +0200
    SystemUI: Fix clock icon blacklist handling

    * This makes sure clock isn't on blacklist before
      calling showClock(animate);

    Change-Id: I7f77a83aa6c109e1682d764fb22701375ae5ba1e

Author: LuK1337 <priv.luk@gmail.com>
Date:   Tue Apr 2 20:56:25 2019 +0200
    SystemUI: Don't hide right clock when heads up is visible

    * https://gitlab.com/LineageOS/issues/android/issues/436

    Change-Id: I85a6cd2dff79e6b97d8a7db552c22d611bf25dbd

Author: LuK1337 <priv.luk@gmail.com>
Date:   Wed Oct 30 15:48:38 2019 +0100
    SystemUI: Fix up right clock handling when showing heads up

    * Oops, we somehow forgot to import this code from 16.0 ;-;

    Change-Id: Ic4195a30da2870f569f07fc323e4b939320ab6c8

Author: Michael W <baddaemon87@gmail.com>
Date:   Mon Jun 1 14:43:31 2020 +0200
    SystemUI: Make clock truly invisible

    * When the clock is set to left and then hidden, the notification
      icons, which would appear on the left first transition to the
      right to make place for the clock then finally snap into place
    * The same happens when the clock was set to show right and then
      is hidden: The battery, wifi, etc. icons do leave space for the
      (not displayed) clock and then snap to the right
    * This patch fixes the behavior

    Change-Id: Ic68b1001becb91da6f1aeaca95a7312b36e1d2a1

Author: LuK1337 <priv.luk@gmail.com>
Date:   Sat Apr 10 22:52:25 2021 +0200
    SystemUI: Make center clock layout safe insets aware

    This effectively fixes wrongly centered clock layout on
    devices with side notch / hole punch.

    Change-Id: I7cb8cbbe628397c50d37e23ba1853368e61a1fc9

Author: LuK1337 <priv.luk@gmail.com>
Date:   Sun Apr 11 09:47:17 2021 +0200
    SystemUI: Move network traffic monitor under same layout as clock

    This effectively fixes wrongly network monitor layout on
    devices with side notch / hole punch.

    Change-Id: I217b886d8da75eab7636066f4822f5fd6dbc9aff

Author: Volodymyr Zhdanov <wight554@gmail.com>
Date:   Tue Nov 9 20:53:56 2021 +0200
    SystemUI: fix clock dark/light mode switching

    * move ClockController init to PhoneStatusBarView
    * move add/remove dark receiver logic to ClockController

    Change-Id: I6464af6e8aa130ea54fe7bfa19858c8930a29b1e

Change-Id: Icdc039d13fd2676c1eb979a81fb77f9a6ec59b4a
Signed-off-by: Volodymyr Zhdanov <wight554@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>

Cherish:Add tunables for clock AM/PM style
Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java

Cherish: Add support for clock auto-hiding
Hide statusbar clock when launcher is visible. Useful when you already have a clock as widget.

Change-Id: I03dfc81bc055f2f865ac704e3bf9d9d104fac272
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>

CherishAdd separate tunable for clock seconds
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
Co-authored-by: LuK1337 <priv.luk@gmail.com>
Co-authored-by: Michael Bestas <mkbestas@lineageos.org>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:24:43 +07:00
jhonboy121
3ce2d1ae4f Cherish: improve app list fragment
* properly constrained image view and max lines of both label and package views
* use lifecycle scope inherent to fragments instead of creating new coroutine scopes
* fetch package list from pm every time refreshList is called
* early release locks when refreshing list
* properly annotate setDisplayCategory method
* keep AppListAdapter as a regular nested class instead of an inner class for reusability

Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 23:23:19 +07:00
Pranav Vashi
d87f7fc83d Cherish: QS layout customizations
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 09:22:52 +07:00
StarkDroid
89203d1e4a Cherish: Add QS Panel Styles [2/3]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-13 09:22:35 +07:00
ezio84
aa4ad58e36 Cherish: Allow doubletap/longpress power to toggle torch [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:44:47 +07:00
Pranav Vashi
4f1a57e28d Cherish:Add ability to toggle bluetooth battery level [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:43:07 +07:00
spkal01
9a73c5ca57 Cherish:Make app icons in statusbar optional [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:42:59 +07:00
Steve Kondik
0d73b73e46 Cherish:Forward-port notification counters [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:42:50 +07:00
jhonboy121
8613cce5f3 Cherish:Allow toggling privacy indicators [2/2]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:42:40 +07:00
Hưng Phan
d2ee255ca1 Cherish:Nuke udfp haptic feedback now
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:42:14 +07:00
Rishawn
0cd7b21c75 Cherish: Auth ripple toggle
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:41:50 +07:00
spkal01
b46dacfa96 Cherish: Configurable udfps color
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:41:44 +07:00
Vachounet
16c2a8fb30 Cherish: Custom fp icon
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:41:36 +07:00
SagarMakhar
a686f8748f Cherish: Bring back UDFPS icons and Animations [2/3]
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
2022-12-12 14:41:29 +07:00
52 changed files with 2826 additions and 1296 deletions

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:orientation="horizontal" >
<Button
android:id="@+id/apply_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="20dp"
android:enabled="false"
android:text="@string/qs_apply_change_button_title"
android:textAllCaps="false"
style="@style/ActionPrimaryButton" />
</LinearLayout>

View File

@@ -47,18 +47,18 @@
<!-- VoLTE Icon Type --> <!-- VoLTE Icon Type -->
<string-array name="volte_icon_type_entries" translatable="false"> <string-array name="volte_icon_type_entries" translatable="false">
<item>@string/volte_icon_off</item> <item>@string/volte_icon_vivo</item>
<item>@string/volte_icon_dynamic</item>
<item>@string/volte_icon_vo</item>
<item>@string/volte_icon_volte</item>
<item>@string/volte_icon_oos</item>
<item>@string/volte_icon_hd</item>
<item>@string/volte_icon_miui</item>
<item>@string/volte_icon_emui</item>
<item>@string/volte_icon_margaritov2</item> <item>@string/volte_icon_margaritov2</item>
<item>@string/volte_icon_margaritov</item> <item>@string/volte_icon_margaritov</item>
<item>@string/volte_icon_vivo</item> <item>@string/volte_icon_asus</item>
<item>@string/volte_icon_aris</item> <item>@string/volte_icon_hd</item>
<item>@string/volte_icon_hd2</item>
<item>@string/volte_icon_miui</item>
<item>@string/volte_icon_emui</item>
<item>@string/volte_icon_oos</item>
<item>@string/volte_icon_volte</item>
<item>@string/volte_icon_vo</item>
<item>@string/volte_icon_aris</item>
<item>@string/volte_icon_beast</item> <item>@string/volte_icon_beast</item>
<item>@string/volte_icon_ios</item> <item>@string/volte_icon_ios</item>
<item>@string/volte_icon_lr</item> <item>@string/volte_icon_lr</item>
@@ -75,18 +75,18 @@
</string-array> </string-array>
<string-array name="volte_icon_type_values" translatable="false"> <string-array name="volte_icon_type_values" translatable="false">
<item>0</item> <item>10</item>
<item>1</item> <item>9</item>
<item>2</item> <item>8</item>
<item>3</item>
<item>4</item> <item>4</item>
<item>3</item>
<item>5</item> <item>5</item>
<item>6</item> <item>6</item>
<item>7</item> <item>7</item>
<item>8</item> <item>2</item>
<item>9</item> <item>1</item>
<item>10</item> <item>0</item>
<item>11</item> <item>11</item>
<item>12</item> <item>12</item>
<item>13</item> <item>13</item>
<item>14</item> <item>14</item>
@@ -98,30 +98,9 @@
<item>20</item> <item>20</item>
<item>21</item> <item>21</item>
<item>22</item> <item>22</item>
<item>23</item> <item>23</item>
<item>24</item> <item>24</item>
<item>25</item>
<item>26</item>
</string-array> </string-array>
<!-- VoWiFi Icon Type -->
<string-array name="vowifi_icon_type_entries" translatable="false">
<item>@string/vowifi_icon_off</item>
<item>@string/vowifi_icon_dynamic</item>
<item>@string/vowifi_icon_asus</item>
<item>@string/vowifi_icon_oneplus</item>
<item>@string/vowifi_icon_moto</item>
<item>@string/vowifi_icon_emui</item>
</string-array>
<string-array name="vowifi_icon_type_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<!-- Battery --> <!-- Battery -->
<string-array name="status_bar_battery_percent_entries" translatable="false"> <string-array name="status_bar_battery_percent_entries" translatable="false">
@@ -163,8 +142,8 @@
<string-array name="status_bar_battery_style_values" translatable="false"> <string-array name="status_bar_battery_style_values" translatable="false">
<item>0</item> <item>0</item>
<item>6</item> <item>8</item>
<item>7</item> <item>9</item>
<item>10</item> <item>10</item>
<item>11</item> <item>11</item>
<item>12</item> <item>12</item>
@@ -177,27 +156,18 @@
<item>1</item> <item>1</item>
<item>2</item> <item>2</item>
<item>3</item> <item>3</item>
<item>8</item> <item>6</item>
<item>9</item> <item>7</item>
<item>4</item> <item>4</item>
<item>5</item> <item>5</item>
</string-array> </string-array>
<!-- QS battery style --> <!-- QS battery style -->
<!-- <string-array name="qs_battery_style_entries" translatable="false"> <string-array name="qs_battery_style_entries" translatable="false">
<item>@string/qs_use_status_bar_battery_style</item> <item>@string/qs_use_status_bar_battery_style</item>
<item>@string/status_bar_battery_style_icon_portrait</item> <item>@string/status_bar_battery_style_icon_portrait</item>
<item>@string/status_bar_battery_style_icon_rlandscape</item> <item>@string/status_bar_battery_style_icon_rlandscape</item>
<item>@string/status_bar_battery_style_icon_landscape</item> <item>@string/status_bar_battery_style_icon_landscape</item>
<item>@string/status_bar_battery_style_icon_landscape_buddy</item>
<item>@string/status_bar_battery_style_icon_landscape_line</item>
<item>@string/status_bar_battery_style_icon_landscape_musku</item>
<item>@string/status_bar_battery_style_icon_landscape_pill</item>
<item>@string/status_bar_battery_style_icon_landscape_signal</item>
<item>@string/status_bar_battery_style_icon_rlandscape_style_a</item>
<item>@string/status_bar_battery_style_icon_landscape_style_a</item>
<item>@string/status_bar_battery_style_icon_rlandscape_style_b</item>
<item>@string/status_bar_battery_style_icon_landscape_style_b</item>
<item>@string/status_bar_battery_style_circle</item> <item>@string/status_bar_battery_style_circle</item>
<item>@string/status_bar_battery_style_dotted_circle</item> <item>@string/status_bar_battery_style_dotted_circle</item>
<item>@string/status_bar_battery_style_filled_circle</item> <item>@string/status_bar_battery_style_filled_circle</item>
@@ -210,25 +180,16 @@
<string-array name="qs_battery_style_values" translatable="false"> <string-array name="qs_battery_style_values" translatable="false">
<item>-1</item> <item>-1</item>
<item>0</item> <item>0</item>
<item>6</item>
<item>7</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>1</item> <item>1</item>
<item>2</item> <item>2</item>
<item>3</item> <item>3</item>
<item>8</item> <item>6</item>
<item>9</item> <item>7</item>
<item>4</item> <item>4</item>
<item>5</item> <item>5</item>
</string-array> --> <item>8</item>
<item>9</item>
</string-array>
<!-- Quick Settings brightness slider --> <!-- Quick Settings brightness slider -->
<string-array name="qs_show_brightness_slider_entries" translatable="false"> <string-array name="qs_show_brightness_slider_entries" translatable="false">
@@ -534,14 +495,12 @@
<item>@string/pulse_color_accent</item> <item>@string/pulse_color_accent</item>
<item>@string/pulse_color_custom</item> <item>@string/pulse_color_custom</item>
<item>@string/pulse_color_lava_lamp</item> <item>@string/pulse_color_lava_lamp</item>
pulse_color_lava_lamp
</string-array> </string-array>
<string-array name="pulse_color_mode_values" translatable="false"> <string-array name="pulse_color_mode_values" translatable="false">
<item>0</item> <item>0</item>
<item>1</item> <item>1</item>
<item>2</item> <item>2</item>
<item>3</item>
</string-array> </string-array>
<string-array name="qs_tile_animation_duration_values" translatable="false"> <string-array name="qs_tile_animation_duration_values" translatable="false">
@@ -586,7 +545,73 @@
<item>6</item> <item>6</item>
<item>7</item> <item>7</item>
</string-array> </string-array>
<!-- App lock timeout -->
<string-array name="app_lock_timeout_entries">
<item>5 seconds</item>
<item>10 seconds</item>
<item>30 seconds</item>
<item>1 minute</item>
<item>5 minutes</item>
<item>10 minutes</item>
<item>30 minutes</item>
</string-array>
<string-array name="app_lock_timeout_values" translatable="false">
<item>5000</item>
<item>10000</item>
<item>30000</item>
<item>60000</item>
<item>300000</item>
<item>600000</item>
<item>1800000</item>
</string-array>
<!-- Smart Pixels -->
<string-array name="smart_pixels_percent_strings" translatable="false">
<item>12</item>
<item>25</item>
<item>38</item>
<item>50</item>
<item>62</item>
<item>75</item>
<item>88</item>
</string-array>
<string-array name="smart_pixels_percent_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="smart_pixels_shift_times" translatable="false">
<item>@string/custom_timeout_summary_15secs</item>
<item>@string/custom_timeout_summary_30secs</item>
<item>@string/custom_timeout_summary_1min</item>
<item>@string/custom_timeout_summary_2mins</item>
<item>@string/custom_timeout_summary_5mins</item>
<item>@string/custom_timeout_summary_10mins</item>
<item>@string/custom_timeout_summary_20mins</item>
<item>@string/custom_timeout_summary_30mins</item>
<item>@string/custom_timeout_summary_1hour</item>
</string-array>
<string-array name="smart_pixels_shift_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
</string-array>
<!-- Ambient light --> <!-- Ambient light -->
<string-array name="pulse_ambient_light_color_mode_entries"> <string-array name="pulse_ambient_light_color_mode_entries">
<item>@string/pulse_ambient_light_color_mode_notification</item> <item>@string/pulse_ambient_light_color_mode_notification</item>
@@ -682,69 +707,47 @@
<item>2</item> <item>2</item>
</string-array> </string-array>
<!-- Smart Pixels --> <!-- Lock Clock Fonts -->
<string-array name="smart_pixels_percent_strings" translatable="false"> <string-array name="lock_clock_fonts_entries">
<item>12</item> <item>@string/lock_clock_font_stock</item>
<item>25</item> <item>@string/lock_clock_font_italic</item>
<item>38</item> <item>@string/lock_clock_font_bold</item>
<item>50</item> <item>@string/lock_clock_font_bold_italic</item>
<item>62</item> <item>@string/lock_clock_font_light_italic</item>
<item>75</item> <item>@string/lock_clock_font_light</item>
<item>88</item> <item>@string/lock_clock_font_thin_italic</item>
<item>@string/lock_clock_font_thin</item>
<item>@string/lock_clock_font_condensed_normal</item>
<item>@string/lock_clock_font_condensed_italic</item>
<item>@string/lock_clock_font_condensed_bold</item>
<item>@string/lock_clock_font_condensed_bold_italic</item>
<item>@string/lock_clock_font_condensed_light</item>
<item>@string/lock_clock_font_condensed_light_italic</item>
<item>@string/lock_clock_font_medium_normal</item>
<item>@string/lock_clock_font_medium_italic</item>
<item>@string/lock_clock_font_black</item>
<item>@string/lock_clock_font_black_italic</item>
<item>@string/lock_clock_font_dancingscript</item>
<item>@string/lock_clock_font_dancingscript_bold</item>
<item>@string/lock_clock_font_comingsoon</item>
<item>@string/lock_clock_font_notoserif</item>
<item>@string/lock_clock_font_notoserif_italic</item>
<item>@string/lock_clock_font_notoserif_bold</item>
<item>@string/lock_clock_font_notoserif_bold_italic</item>
<item>@string/lock_clock_font_gobold</item>
<item>@string/lock_clock_font_roadrage</item>
<item>@string/lock_clock_font_snowstorm</item>
<item>@string/lock_clock_font_googlesans</item>
<item>@string/lock_clock_font_neoneon</item>
<item>@string/lock_clock_font_themeable</item>
<item>@string/lock_clock_font_samsung</item>
<item>@string/lock_clock_font_mexcellent</item>
<item>@string/lock_clock_font_burnstown</item>
<item>@string/lock_clock_font_dumbledor</item>
<item>@string/lock_clock_font_phantombold</item>
</string-array> </string-array>
<string-array name="smart_pixels_percent_values" translatable="false"> <string-array name="lock_clock_fonts_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>
<string-array name="smart_pixels_shift_times" translatable="false">
<item>@string/custom_timeout_summary_15secs</item>
<item>@string/custom_timeout_summary_30secs</item>
<item>@string/custom_timeout_summary_1min</item>
<item>@string/custom_timeout_summary_2mins</item>
<item>@string/custom_timeout_summary_5mins</item>
<item>@string/custom_timeout_summary_10mins</item>
<item>@string/custom_timeout_summary_20mins</item>
<item>@string/custom_timeout_summary_30mins</item>
<item>@string/custom_timeout_summary_1hour</item>
</string-array>
<string-array name="smart_pixels_shift_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
</string-array>
<!-- Status bar chip styles-->
<string-array name="statusbar_clock_chip_entries" translatable="false">
<item>@string/disabled</item>
<item>@string/solid_accent</item>
<item>@string/outline</item>
<item>@string/solid_accent_gradient</item>
<item>@string/solid_gradient</item>
<item>@string/solid_gradient_corner</item>
<item>@string/solid_gradient_void</item>
<item>@string/solid_gradient_neumorph</item>
<item>@string/solid_gradient_stroke</item>
<item>@string/solid_accent_transperent</item>
<item>@string/solid_gradient_light</item>
<item>@string/solid_gradient_shape</item>
<item>@string/solid_gradient_void_light</item>
</string-array>
<string-array name="statusbar_clock_chip_values" translatable="false">
<item>0</item> <item>0</item>
<item>1</item> <item>1</item>
<item>2</item> <item>2</item>
@@ -758,45 +761,28 @@
<item>10</item> <item>10</item>
<item>11</item> <item>11</item>
<item>12</item> <item>12</item>
</string-array> <item>13</item>
<item>14</item>
<!-- Monet theme styles --> <item>15</item>
<string-array name="theme_style_entries"> <item>16</item>
<item>@string/theme_style_tonal_spot</item> <item>17</item>
<item>@string/theme_style_vibrant</item> <item>18</item>
<item>@string/theme_style_expressive</item> <item>19</item>
<item>@string/theme_style_spritz</item> <item>20</item>
<item>@string/theme_style_rainbow</item> <item>21</item>
<item>@string/theme_style_fruit_salad</item> <item>22</item>
<item>@string/theme_style_muted</item> <item>23</item>
<item>@string/theme_style_content</item> <item>24</item>
<item>@string/theme_style_monochromatic</item> <item>25</item>
</string-array> <item>26</item>
<item>27</item>
<string-array name="theme_style_values" translatable="false"> <item>28</item>
<item>TONAL_SPOT</item> <item>29</item>
<item>VIBRANT</item> <item>30</item>
<item>EXPRESSIVE</item> <item>31</item>
<item>SPRITZ</item> <item>32</item>
<item>RAINBOW</item> <item>33</item>
<item>FRUIT_SALAD</item> <item>34</item>
<item>MUTED</item> <item>35</item>
<item>CONTENT</item>
<item>MONOCHROMATIC</item>
</string-array>
<!-- Monet color sources -->
<string-array name="color_source_entries">
<item>@string/color_source_both</item>
<item>@string/color_source_home</item>
<item>@string/color_source_lock</item>
<item>@string/color_source_preset</item>
</string-array>
<string-array name="color_source_values" translatable="false">
<item>both</item>
<item>home_wallpaper</item>
<item>lock_wallpaper</item>
<item>preset</item>
</string-array> </string-array>
</resources> </resources>

View File

@@ -102,13 +102,9 @@
<string name="santoni_maintainer">EvilAnsh</string> <string name="santoni_maintainer">EvilAnsh</string>
<string name="device_ysl">Xiaomi Redmi S2</string> <string name="device_ysl">Xiaomi Redmi S2</string>
<string name="ysl_maintainer">Iris</string> <string name="ysl_maintainer">Iris</string>
<string name="device_grus">Xiaomi Mi 9 SE</string>
<string name="grus_maintainer">Toyohama</string>
<!-- Realme Device maintainers --> <!-- Realme Device maintainers -->
<string name="device_RMX3461">Realme 9 SE 5g</string> <string name="device_RMX1971">Realme 5 Pro</string>
<string name="RMX3461_maintainer">Dhruv00</string>
<string name="device_RMX1971">Realme 5 Pro</string>
<string name="RMX1971_maintainer">Samba Siva Rao K</string> <string name="RMX1971_maintainer">Samba Siva Rao K</string>
<string name="device_RMX1901">Realme RMX1901</string> <string name="device_RMX1901">Realme RMX1901</string>
<string name="RMX1901_maintainer">Ritish</string> <string name="RMX1901_maintainer">Ritish</string>
@@ -150,7 +146,7 @@
<string name="device_lemonades">Oneplus 9R</string> <string name="device_lemonades">Oneplus 9R</string>
<string name="lemonades_maintainer">Viper_1057 or Amsal1</string> <string name="lemonades_maintainer">Viper_1057 or Amsal1</string>
<string name="device_avicii">Oneplus Nord</string> <string name="device_avicii">Oneplus Nord</string>
<string name="avicii_maintainer">PSavarMattas</string> <string name="avicii_maintainer">Snippetguy</string>
<!-- Lenovo Device maintainers --> <!-- Lenovo Device maintainers -->
<string name="device_jd2019">Lenovo Z5s</string> <string name="device_jd2019">Lenovo Z5s</string>
@@ -159,9 +155,4 @@
<!-- Motorola Device maintainers --> <!-- Motorola Device maintainers -->
<string name="device_chef">Motorola One Power</string> <string name="device_chef">Motorola One Power</string>
<string name="chef_maintainer">Rushi Ranpise</string> <string name="chef_maintainer">Rushi Ranpise</string>
<!-- Samsung Device maintainers -->
<string name="samsung_devices">Samsung</string>
<string name="device_s10_n10_series">Galaxy S10 / Galaxy N10 Series</string>
<string name="s10_n10_series_maintainer">FrEeRuNnEr4EvEr</string>
</resources> </resources>

View File

@@ -19,7 +19,6 @@
<string name="button_summary">Hardware keys, Navigation bar</string> <string name="button_summary">Hardware keys, Navigation bar</string>
<string name="gestures_title">Gestures</string> <string name="gestures_title">Gestures</string>
<string name="gestures_summary">Jump to camera, swipe to screenshot</string> <string name="gestures_summary">Jump to camera, swipe to screenshot</string>
<string name="fingerprint_category">Fingerprint</string>
<string name="lockscreen_title">Lock screen</string> <string name="lockscreen_title">Lock screen</string>
<string name="lockscreen_summary">Music visualizer, charging animation, clock style</string> <string name="lockscreen_summary">Music visualizer, charging animation, clock style</string>
<string name="misc_title">Miscellaneous</string> <string name="misc_title">Miscellaneous</string>
@@ -45,12 +44,12 @@
<string name="qs_category">QS category</string> <string name="qs_category">QS category</string>
<string name="navbar_title">Navigation bar</string> <string name="navbar_title">Navigation bar</string>
<string name="volume_keys_title">Volume keys</string> <string name="volume_keys_title">Volume keys</string>
<string name="udfps_category">UDFPS</string>
<!-- General strings --> <!-- General strings -->
<string name="ok">OK</string> <string name="ok">OK</string>
<string name="reset">Reset</string> <string name="reset">Reset</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
<string name="enable">Enable</string>
<string name="save">Save</string> <string name="save">Save</string>
<string name="none_string">None</string> <string name="none_string">None</string>
<string name="default_string">Default</string> <string name="default_string">Default</string>
@@ -255,13 +254,17 @@
<string name="lockscreen_albumart_filter_blur_radius_title">Blur amount for lockscreen media artwork</string> <string name="lockscreen_albumart_filter_blur_radius_title">Blur amount for lockscreen media artwork</string>
<!-- Show VoLTE icon on statusbar --> <!-- Show VoLTE icon on statusbar -->
<string name="volte_icon_style_title">Select VoLTE/HD Icon</string> <string name="volte_switch_title">VoLTE icon</string>
<string name="volte_icon_off">Off</string> <string name="volte_switch_summary">Display VoLTE icon</string>
<string name="volte_icon_dynamic">Dynamic VOLTE Icons</string> <string name="volte_icon_title">VoLTE icon</string>
<string name="volte_icon_summary">Display VoLTE icon</string>
<string name="volte_icon_style_title">Select VoLTE Icon</string>
<string name="volte_icon_asus">VoLTE Asus Icon</string>
<string name="volte_icon_vo">Vo Only Icon</string> <string name="volte_icon_vo">Vo Only Icon</string>
<string name="volte_icon_volte">VoLTE Icon</string> <string name="volte_icon_volte">VoLTE Icon</string>
<string name="volte_icon_oos">VoLTE OOS Icon</string> <string name="volte_icon_oos">VoLTE OOS Icon</string>
<string name="volte_icon_hd">HD Icon</string> <string name="volte_icon_hd">HD Icon</string>
<string name="volte_icon_hd2">HD CAF Icon</string>
<string name="volte_icon_miui">MIUI 11 Icon</string> <string name="volte_icon_miui">MIUI 11 Icon</string>
<string name="volte_icon_emui">EMUI Icon</string> <string name="volte_icon_emui">EMUI Icon</string>
<string name="volte_icon_margaritov">HD Filled Icon</string> <string name="volte_icon_margaritov">HD Filled Icon</string>
@@ -283,14 +286,10 @@
<string name="volte_icon_zirco">Ziroc Icon</string> <string name="volte_icon_zirco">Ziroc Icon</string>
<!-- VoWiFi icon --> <!-- VoWiFi icon -->
<string name="vowifi_icon_title">VoWiFi Icon</string> <string name="vowifi_icon_title">VoWiFi icon</string>
<string name="vowifi_icon_summary">Display VoWiFi icon when available</string> <string name="vowifi_icon_summary">Display VoWiFi icon when available</string>
<string name="vowifi_icon_off">Off</string> <string name="volte_vowifi_override_title">VoWiFi override</string>
<string name="vowifi_icon_dynamic">Dynamic VoWiFi Icon</string> <string name="volte_vowifi_override_summary">Hide VoLTE when VoWiFi is available</string>
<string name="vowifi_icon_asus">Asus VoWiFi Icon</string>
<string name="vowifi_icon_oneplus">OnePlus VoWiFi Icon</string>
<string name="vowifi_icon_moto">Moto VoWiFi Icons</string>
<string name="vowifi_icon_emui">EMUI Icons</string>
<!-- Statusbar Battery --> <!-- Statusbar Battery -->
<string name="battery_style_title">Battery icon style</string> <string name="battery_style_title">Battery icon style</string>
@@ -333,18 +332,6 @@
<!-- Statusbar Clock background chip --> <!-- Statusbar Clock background chip -->
<string name="statusbar_clock_chip_title">Background chip</string> <string name="statusbar_clock_chip_title">Background chip</string>
<string name="statusbar_clock_chip_summary">Display accented chip behind clock</string> <string name="statusbar_clock_chip_summary">Display accented chip behind clock</string>
<string name="solid_accent">Solid color accent</string>
<string name="outline">Outline</string>
<string name="solid_accent_gradient">Solid color accent gradient</string>
<string name="solid_gradient">Solid Gradient side</string>
<string name="solid_gradient_corner">Solid accent gradient sharp</string>
<string name="solid_gradient_void">Gradient Void</string>
<string name="solid_gradient_neumorph">Neumorph gradient</string>
<string name="solid_gradient_stroke">Sharp gradient stroke</string>
<string name="solid_accent_transperent">Accent transperent</string>
<string name="solid_gradient_light">Gradient light</string>
<string name="solid_gradient_shape">Sharp gradient corner</string>
<string name="solid_gradient_void_light">Gradient Void light</string>
<!-- Quick Settings brightness slider --> <!-- Quick Settings brightness slider -->
<string name="qs_show_brightness_slider_title">Brightness slider</string> <string name="qs_show_brightness_slider_title">Brightness slider</string>
@@ -371,7 +358,11 @@
<!-- QS Transparency --> <!-- QS Transparency -->
<string name="qs_transparency_title">Background transparency</string> <string name="qs_transparency_title">Background transparency</string>
<string name="qs_transparency_summary">Set transparency level for QS background</string> <string name="qs_transparency_summary">Set transparency level for QS background</string>
<!-- Brightness control -->
<string name="status_bar_brightness_control_title">Brightness control</string>
<string name="status_bar_brightness_control_summary">Adjust brightness by sliding across the status bar</string>
<!-- Power menu on lockscreen --> <!-- Power menu on lockscreen -->
<string name="power_menu_hide_on_secure_title">Hide power menu on lock screen</string> <string name="power_menu_hide_on_secure_title">Hide power menu on lock screen</string>
<string name="power_menu_hide_on_secure_summary">This will hide the power menu only on a secure lock screen</string> <string name="power_menu_hide_on_secure_summary">This will hide the power menu only on a secure lock screen</string>
@@ -545,15 +536,34 @@
<string name="udfps_haptic_feedback_title">UDFPS haptic feedback</string> <string name="udfps_haptic_feedback_title">UDFPS haptic feedback</string>
<string name="udfps_haptic_feedback_summary">Vibrate when touching UDFPS icon</string> <string name="udfps_haptic_feedback_summary">Vibrate when touching UDFPS icon</string>
<!-- UDFPS settings --> <!-- Udfps authentication / error vibration -->
<string name="udfps_category">UDFPS</string> <string name="udfps_success_vib_title">Udfps authentication vibration</string>
<string name="udfps_settings_title">UDFPS customization</string> <string name="udfps_success_vib_summary">Vibrate on successful fingerprint authentication</string>
<string name="udfps_settings_summary">Customize under-display fingerprint scanner</string> <string name="udfps_error_vib_title">Udfps error vibration</string>
<string name="udfps_icon_picker_title">UDFPS icon picker</string> <string name="udfps_error_vib_summary">Vibrate on unsuccessful fingerprint authentication</string>
<string name="udfps_icon_picker_summary">Choose your favorite fingerprint icon</string>
<!-- UDFPS Recog Animation -->
<string name="udfps_customization">UDFPS customization</string>
<string name="udfps_recog_animation">UDFPS animation</string>
<string name="udfps_recog_animation_summary">Shows an animation while reading your finger</string>
<string name="udfps_recog_animation_effect_title">UDFPS custom animation</string> <string name="udfps_recog_animation_effect_title">UDFPS custom animation</string>
<string name="udfps_recog_animation_effect_summary">Choose animation effect</string> <string name="udfps_recog_animation_effect_summary">Choose animation effect</string>
<string name="disable">Disable</string> <string name="udfps_settings_title">UDFPS settings</string>
<string name="udfps_settings_summary">Settings for customizing the UDFPS</string>
<!-- UDFPS icon picker -->
<string name="udfps_icon_picker_title">UDFPS icon picker</string>
<string name="udfps_icon_picker_summary">Choose your favorite fingerprint icon</string>
<!-- Custom FOD Icon -->
<string name="custom_fp_icon_title">Custom UDFPS Icon</string>
<string name="custom_fp_icon_summary">Enable custom UDFPS Icon from files</string>
<string name="custom_fp_select_title">Select Custom UDFPS Icon</string>
<string name="custom_fp_select_summary">Select custom image from your saved files or gallery</string>
<!-- UDFPS pressed color -->
<string name="udfps_pressed_color_title">Udfps pressed color</string>
<string name="udfps_pressed_color_summary">Choose your favorite udfps pressed color</string>
<!-- Fingerprint Ripple Effect --> <!-- Fingerprint Ripple Effect -->
<string name="enable_fingerprint_ripple_effect_title">Ripple effect</string> <string name="enable_fingerprint_ripple_effect_title">Ripple effect</string>
@@ -628,12 +638,36 @@
<!-- QS clock --> <!-- QS clock -->
<string name="qs_clock_title">Clock</string> <string name="qs_clock_title">Clock</string>
<string name="qs_clock_summary">Display clock in quick status bar header</string> <string name="qs_clock_summary">Display clock in quick status bar header</string>
<!-- QS date -->
<string name="qs_date_title">Date</string>
<string name="qs_date_summary">Display date in quick status bar header</string>
<!-- Footer --> <!-- Footer -->
<string name="qs_footer_category">QS Footer</string> <string name="qs_footer_category">QS Footer</string>
<string name="qs_footer_datausage_title">Data usage</string> <string name="qs_footer_datausage_title">Data usage</string>
<string name="qs_footer_datausage_summary">Display data usage summary in quick settings footer</string> <string name="qs_footer_datausage_summary">Display data usage summary in quick settings footer</string>
<!-- App lock -->
<string name="app_lock_title">App lock</string>
<string name="app_lock_summary">Apps will require fingerprint authentication to launch</string>
<string name="app_lock_authentication_dialog_title">Unlock</string>
<string name="enable_debugging">Enable debugging</string>
<string name="disable_debugging">Disable debugging</string>
<string name="app_lock_packages_title">Protected apps</string>
<string name="app_lock_packages_summary">Select the apps to protect with biometrics or device credentials</string>
<string name="app_lock_timeout_title">Auto lock timeout</string>
<string name="app_lock_timeout_summary">Duration of time after which an unlocked app in background should be locked</string>
<string name="app_lock_notifications_title">Redact notifications</string>
<string name="app_lock_notifications_summary">
Notification content will be hidden and collapsed for selected apps when they are locked.
Heads up notifications will be automatically disabled.
</string>
<string name="app_lock_notifications_disabled_summary">Protect an application first</string>
<string name="app_lock_biometrics_allowed_title">Enable biometrics for unlocking</string>
<string name="app_lock_footer_text">Bubbles will be automatically dismissed after timeout</string>
<string name="enable_protection">Enable protection</string>
<!-- Quick settings styling --> <!-- Quick settings styling -->
<string name="qs_styles_title">Combined QS Element Styles</string> <string name="qs_styles_title">Combined QS Element Styles</string>
<string name="qs_outline">Outline</string> <string name="qs_outline">Outline</string>
@@ -645,21 +679,37 @@
<string name="qs_reflected">Reflected</string> <string name="qs_reflected">Reflected</string>
<string name="qs_surround">Surround</string> <string name="qs_surround">Surround</string>
<string name="qs_thin">ThinLine</string> <string name="qs_thin">ThinLine</string>
<!-- QS tiles layout direction: vertical or horizontal -->
<string name="qs_tile_layout_category_title">Tile layout</string>
<string name="qs_tile_layout_title">Title Alignment</string>
<string name="qs_tile_layout_summary">Enable for centered layout.</string>
<!-- QS tiles title visibility -->
<string name="qs_tile_title_visibility_title">Hide tile titles</string>
<string name="qs_tile_title_visibility_summary">Toggle to hide tile titles</string>
<!-- QS tiles layout --> <!-- QS tiles layout -->
<string name="qs_layout_category_title">Quick Settings layout</string> <string name="qs_layout_category_title">Tiles layout</string>
<string name="qs_tile_layout_title">QS tiles layout</string> <string name="qs_tile_label_hide_title">Hide label</string>
<string name="qs_tile_layout_summary">Customize tiles layout in QS panel</string> <string name="qs_tile_label_hide_summary">Only show icon in tile</string>
<string name="qs_tiles_layout_category">Tiles layout</string> <string name="qs_tile_label_size_title">Label text size</string>
<string name="qs_rows_portrait_title">Rows (Portrait)</string> <string name="qs_columns_portrait_title">Columns (portrait)</string>
<string name="qqs_rows_portrait_title">Rows (Quick QS portrait)</string> <string name="qs_columns_landscape_title">Columns (landscape)</string>
<string name="qs_columns_portrait_title">Columns (Portrait)</string>
<string name="qs_apply_change_button_title">Apply change</string> <!-- Monet engine -->
<string name="qs_apply_change_failed">Failed to apply change</string> <string name="monet_engine_settings_title">Monet engine</string>
<string name="qs_tile_hide_label_title">Hide labels</string> <string name="monet_engine_settings_summary">Custom color, colorfulness, brightness</string>
<string name="qs_tile_hide_label_summary">Show only icon for QS tiles</string> <string name="accurate_shades_title">Use accurate shades</string>
<string name="qs_tile_vertical_layout_title">Vertical layout</string> <string name="color_override_title">Custom color picker</string>
<string name="qs_tile_vertical_layout_summary">Enable vertical layout for QS tiles</string> <string name="color_override_default_summary">Using wallpaper color</string>
<string name="custom_color_override_summary_placeholder">
Choosen color: <xliff:g example="#FF0000" id="Color">%1$s</xliff:g>. Set an empty value to use wallpaper color.
</string>
<string name="invalid_color_input">Invalid color input!</string>
<string name="chroma_factor_title">Colorfulness</string>
<string name="linear_lightness_title">Use custom lightness scale</string>
<string name="white_luminance_title">Brightness</string>
<!-- Power menu Animations --> <!-- Power menu Animations -->
<string name="power_menu_animation_title">Power menu animation</string> <string name="power_menu_animation_title">Power menu animation</string>
@@ -741,7 +791,6 @@
<string name="pulse_legacy_mode_advanced_category">Fading blocks mode settings</string> <string name="pulse_legacy_mode_advanced_category">Fading blocks mode settings</string>
<string name="pulse_custom_fudge_factor">Sanity level</string> <string name="pulse_custom_fudge_factor">Sanity level</string>
<string name="pulse_lavalamp_speed_title">Lava lamp speed</string> <string name="pulse_lavalamp_speed_title">Lava lamp speed</string>
<string name="pulse_color_auto">Album</string>
<string name="pulse_solid_units_count">Solid lines count</string> <string name="pulse_solid_units_count">Solid lines count</string>
<string name="pulse_solid_units_opacity">Solid lines opacity</string> <string name="pulse_solid_units_opacity">Solid lines opacity</string>
<string name="pulse_solid_units_rounded_title">Rounded corners</string> <string name="pulse_solid_units_rounded_title">Rounded corners</string>
@@ -772,6 +821,32 @@
<string name="click_partial_screenshot_title">Click to partial screenshot</string> <string name="click_partial_screenshot_title">Click to partial screenshot</string>
<string name="click_partial_screenshot_summary">Short click Volume Down and Power to take partial screenshot</string> <string name="click_partial_screenshot_summary">Short click Volume Down and Power to take partial screenshot</string>
<!-- UI styles -->
<string name="theme_customization_ui_style_title">UI Style</string>
<string name="theme_customization_ui_style_summary">Set custom style for your interface</string>
<!-- OOS style material dismiss all button for notifications -->
<string name="notification_material_dismiss_button_title">Material dimiss button</string>
<string name="notification_material_dismiss_button_summary">Replace clear all notification text with floating button</string>
<string name="clearall_style_title">Material dismiss button style</string>
<string name="clearall_bgstyle_title">Material dismiss background style</string>
<!-- Combined signal icons in status bar -->
<string name="combined_status_bar_signal_icons_title">Combined signal icons</string>
<string name="combined_status_bar_signal_icons_summary">Enable combined signal icons\n(WARNING: a soft reboot will occur upon enabling combined signal icons)</string>
<!-- Smart Pixels -->
<string name="smart_pixels_warning_text">Smart pixels is a power saving feature. Depending on how many pixels you decide to turn off, you could see improvement in battery life. Note that in some cases it can result in unresponsive areas on touch screen</string>
<string name="smart_pixels_title">Smart Pixels</string>
<string name="smart_pixels_summary">Save battery by shutting off extra pixels</string>
<string name="smart_pixels_enable_title">Enable Smart Pixels</string>
<string name="smart_pixels_enable_summary">Shut off pixels to reduce power consumption</string>
<string name="smart_pixels_on_power_save_title">Auto-enable on battery saver</string>
<string name="smart_pixels_on_power_save_summary">Enable Smart Pixels when battery saver is enabled</string>
<string name="smart_pixels_percent">Percent of pixels to disable</string>
<string name="smart_pixels_shift_title">Burn-in protection</string>
<string name="smart_pixels_shift_summary">Prevents burn-in on OLED devices by shifting pixels every so often</string>
<!-- Ambient edge lighting --> <!-- Ambient edge lighting -->
<string name="pulse_ambient_light_category">Screen edge lighting</string> <string name="pulse_ambient_light_category">Screen edge lighting</string>
<string name="pulse_ambient_light_title">Edge lighting</string> <string name="pulse_ambient_light_title">Edge lighting</string>
@@ -807,7 +882,7 @@
<!-- Edge Light --> <!-- Edge Light -->
<string name="pulse_ambient_light_width_title">Light width</string> <string name="pulse_ambient_light_width_title">Light width</string>
<!-- Pulse Light Layout Style --> <!-- Pulse Light Layout Style -->
<string name="pulse_light_layout_style_title">Light Layout Style</string> <string name="pulse_light_layout_style_title">Light Layout Style</string>
<string name="pulse_light_both">All Four Sides</string> <string name="pulse_light_both">All Four Sides</string>
@@ -843,61 +918,69 @@
<string name="file_header_select_title">Select local image</string> <string name="file_header_select_title">Select local image</string>
<string name="file_header_select_summary">Select image from storage(recommended use Gallery Go)</string> <string name="file_header_select_summary">Select image from storage(recommended use Gallery Go)</string>
<!-- Lock Clock Fonts -->
<string name="lock_clock_font_title">LS Clock font style</string>
<string name="lock_clock_font_dialog_title">Select lockscreen clock font</string>
<string name="lock_clock_font_stock">Normal (default)</string>
<string name="lock_clock_font_bold">Bold</string>
<string name="lock_clock_font_italic">Italic</string>
<string name="lock_clock_font_bold_italic">Bold Italic</string>
<string name="lock_clock_font_light_italic">Light Italic</string>
<string name="lock_clock_font_thin_italic">Thin Italic</string>
<string name="lock_clock_font_light">Light</string>
<string name="lock_clock_font_thin">Thin</string>
<string name="lock_clock_font_condensed_normal">Condensed</string>
<string name="lock_clock_font_condensed_italic">Condensed Italic</string>
<string name="lock_clock_font_condensed_bold">Condensed Bold</string>
<string name="lock_clock_font_condensed_bold_italic">Condensed Bold Italic</string>
<string name="lock_clock_font_condensed_light">Condensed Light</string>
<string name="lock_clock_font_condensed_light_italic">Condensed Light Italic</string>
<string name="lock_clock_font_medium_normal">Medium</string>
<string name="lock_clock_font_medium_italic">Medium Italic</string>
<string name="lock_clock_font_black">Black</string>
<string name="lock_clock_font_black_italic">Black Italic</string>
<string name="lock_clock_font_dancingscript">DancingScript</string>
<string name="lock_clock_font_dancingscript_bold">DancingScript Bold</string>
<string name="lock_clock_font_comingsoon">ComingSoon</string>
<string name="lock_clock_font_notoserif">NotoSerif Normal</string>
<string name="lock_clock_font_notoserif_italic">NotoSerif Italic</string>
<string name="lock_clock_font_notoserif_bold">NotoSerif Bold</string>
<string name="lock_clock_font_notoserif_bold_italic">NotoSerif Bold Italic</string>
<string name="lock_clock_font_gobold">GoBold Light</string>
<string name="lock_clock_font_roadrage">Road Rage</string>
<string name="lock_clock_font_snowstorm">Snowstorm</string>
<string name="lock_clock_font_googlesans">Google Sans</string>
<string name="lock_clock_font_neoneon">Neoneon</string>
<string name="lock_clock_font_themeable">Themeable (or VCR OSD Mono)</string>
<string name="lock_clock_font_samsung">Shamshung</string>
<string name="lock_clock_font_mexcellent">Mexcellent</string>
<string name="lock_clock_font_burnstown">Burnstown</string>
<string name="lock_clock_font_dumbledor">Dumbledor</string>
<string name="lock_clock_font_phantombold">PhantomBold</string>
<!-- Black theme --> <!-- Black theme -->
<string name="system_black_theme_title">Vivid Colors</string> <string name="system_black_theme_title">Vivid Colors</string>
<string name="system_black_theme_summary">Use colorful and darker monet shades</string> <string name="system_black_theme_summary">Use colorful and darker monet shades</string>
<!-- Fingerprint authentication vibration --> <!-- Dynamic System Bars -->
<string name="fprint_error_vib_title">Fingerprint error vibration</string> <string name="dynamic_accent_mode_status_bar_summary">Automatically change the dark intensity to Accent Color</string>
<string name="fprint_error_vib_summary">Vibrate on error fingerprint authentication</string> <string name="dynamic_accent_mode_status_bar_title">Accent Mode</string>
<string name="fprint_success_vib_title">Fingerprint authentication vibration</string> <string name="dynamic_icon_navigation_tint_summary">Use status bar Dynamic color as navigation bar icon Tint</string>
<string name="fprint_success_vib_summary">Vibrate on successful fingerprint authentication</string> <string name="dynamic_icon_navigation_tint_title">Status bar color Tint</string>
<string name="dynamic_linked_color_status_bar_summary">Automatically linked status bar dynamic color as navigation bar background</string>
<!-- Smart Pixels --> <string name="dynamic_linked_color_status_bar_title">Linked Color</string>
<string name="smart_pixels_warning_text">Smart pixels is a power saving feature. Depending on how many pixels you decide to turn off, you could see improvement in battery life. Note that in some cases it can result in unresponsive areas on touch screen</string> <string name="dynamic_navigation_bar_summary">Automatically update the background of the navigation bar</string>
<string name="smart_pixels_title">Smart Pixels</string> <string name="dynamic_navigation_bar_title">Dynamic navigation bar</string>
<string name="smart_pixels_summary">Save battery by shutting off extra pixels</string> <string name="dynamic_navigation_bars_gradient_summary">Overlay a gradient on the navigation bar</string>
<string name="smart_pixels_enable_title">Enable Smart Pixels</string> <string name="dynamic_navigation_bars_gradient_title">Navigation bar gradient</string>
<string name="smart_pixels_enable_summary">Shut off pixels to reduce power consumption</string> <string name="dynamic_silver_mode_status_bar_summary">Automatically change the dark intensity to Silver</string>
<string name="smart_pixels_on_power_save_title">Auto-enable on battery saver</string> <string name="dynamic_silver_mode_status_bar_title">Silver Mode</string>
<string name="smart_pixels_on_power_save_summary">Enable Smart Pixels when battery saver is enabled</string> <string name="dynamic_status_bar_filter_summary">Overlay a darkening filter on the status bar</string>
<string name="smart_pixels_percent">Percent of pixels to disable</string> <string name="dynamic_status_bar_filter_title">Darker status bar</string>
<string name="smart_pixels_shift_title">Burn-in protection</string> <string name="dynamic_status_bar_summary">Automatically update the background of the status bar</string>
<string name="smart_pixels_shift_summary">Prevents burn-in on OLED devices by shifting pixels every so often</string> <string name="dynamic_status_bar_title">Dynamic status bar</string>
<string name="dynamic_system_bars_category_summary">Automatically update the background of the status bar and navigation bar</string>
<!-- Combined signal icons in status bar --> <string name="dynamic_system_bars_category_title">Dynamic system bars</string>
<string name="combined_status_bar_signal_icons_title">Combined signal icons</string> <string name="dynamic_system_bars_gradient_summary">Overlay a gradient on the status bar</string>
<string name="combined_status_bar_signal_icons_summary">Enable combined signal icons\n(WARNING: a soft reboot will occur upon enabling combined signal icons)</string> <string name="dynamic_system_bars_gradient_title">Status bar gradient</string>
<!-- Monet settings -->
<string name="monet_settings_title">Monet theming</string>
<string name="monet_settings_sammary">A few extra settings to customize monet engine</string>
<string name="theme_style_title">Theme style</string>
<string name="theme_style_tonal_spot">Tonal Spot (Default)</string>
<string name="theme_style_vibrant">Vibrant</string>
<string name="theme_style_expressive">Exspressive</string>
<string name="theme_style_spritz">Spritz</string>
<string name="theme_style_rainbow">Rainbow</string>
<string name="theme_style_fruit_salad">Fruit Salad</string>
<string name="theme_style_muted">Muted</string>
<string name="theme_style_content">Content</string>
<string name="theme_style_monochromatic">Monochromatic</string>
<string name="color_source_title">Color source</string>
<string name="color_source_both">Both (Default)</string>
<string name="color_source_home">Home wallpaper</string>
<string name="color_source_lock">Lock wallpaper</string>
<string name="color_source_preset">Preset</string>
<string name="accent_color_title">Accent Color</string>
<string name="accent_color_summary">Override default accent color</string>
<string name="accent_background_title">Accent background</string>
<string name="accent_background_summary">Choose a different accent color for background</string>
<string name="bg_color_title">Background Color</string>
<string name="bg_color_summary">Override default background accent color</string>
<string name="luminance_factor_title">Luminance</string>
<string name="luminance_factor_summary">Higher values produce brighter colors</string>
<string name="chroma_factor_title">Chroma</string>
<string name="chroma_factor_summary">Higher values produce stronger colors</string>
<string name="tint_background_title">Tint Background</string>
<string name="tint_background_summary">Make Luminance and Chroma selection affect background colors as well</string>
</resources> </resources>

24
res/values/plurals.xml Normal file
View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 FlamingoOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- App Lock -->
<plurals name="app_lock_summary">
<item quantity="one"><xliff:g example="1" id="Number of applications">%1$d</xliff:g> application is protected</item>
<item quantity="other"><xliff:g example="10" id="Number of applications">%1$d</xliff:g> applications are protected</item>
</plurals>
</resources>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 CherishOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/app_lock_title">
<Preference
android:key="app_lock_packages"
android:title="@string/app_lock_packages_title"
android:summary="@string/app_lock_packages_summary"
android:fragment="com.cherish.settings.security.applock.AppLockPackageListFragment" />
<ListPreference
android:key="app_lock_timeout"
android:title="@string/app_lock_timeout_title"
android:summary="@string/app_lock_timeout_summary"
android:entries="@array/app_lock_timeout_entries"
android:entryValues="@array/app_lock_timeout_values"
android:defaultValue="0"
android:persistent="false"
settings:controller="com.cherish.settings.security.applock.AppLockTimeoutPreferenceController" />
<SwitchPreference
android:key="app_lock_biometrics_allowed"
android:title="@string/app_lock_biometrics_allowed_title"
android:persistent="false"
settings:controller="com.cherish.settings.security.applock.AppLockBiometricPreferenceController" />
</PreferenceScreen>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 FlamingoOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/app_lock_packages_title">
</PreferenceScreen>

View File

@@ -38,6 +38,17 @@
android:dependency="ambient_text" android:dependency="ambient_text"
android:defaultValue="#Welcome To Cherish" /> android:defaultValue="#Welcome To Cherish" />
<ListPreference
android:key="ambient_text_font"
android:title="@string/ambient_text_font_title"
android:dialogTitle="@string/ambient_text_font_title"
android:entries="@array/lock_clock_fonts_entries"
android:entryValues="@array/lock_clock_fonts_values"
android:summary="%s"
android:defaultValue="8"
android:dependency="ambient_text"
android:persistent="false" />
<ListPreference <ListPreference
android:key="ambient_text_type_color" android:key="ambient_text_type_color"
android:title="@string/ambient_text_type_color_title" android:title="@string/ambient_text_type_color_title"

View File

@@ -353,15 +353,6 @@
android:data="https://t.me/bruh_its_your_brother" /> android:data="https://t.me/bruh_its_your_brother" />
</Preference> </Preference>
<Preference
android:title="@string/grus_maintainer"
android:summary="@string/device_grus"
android:icon="@drawable/ic_devs_phone" >
<intent
android:action="android.intent.action.VIEW"
android:data="https://t.me/Tkiliay" />
</Preference>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
@@ -473,16 +464,7 @@
android:action="android.intent.action.VIEW" android:action="android.intent.action.VIEW"
android:data="https://t.me/EvilAnsh" /> android:data="https://t.me/EvilAnsh" />
</Preference> </Preference>
<Preference
android:title="@string/RMX3461_maintainer"
android:summary="@string/device_RMX3461"
android:icon="@drawable/ic_devs_phone">
<intent
android:action="android.intent.action.VIEW"
android:data="https://t.me/DRvP00" />
</Preference>
<Preference <Preference
android:title="@string/RMX1971_maintainer" android:title="@string/RMX1971_maintainer"
android:summary="@string/device_RMX1971" android:summary="@string/device_RMX1971"
@@ -599,18 +581,4 @@
android:data="https://t.me/Iris041" /> android:data="https://t.me/Iris041" />
</Preference> </Preference>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:key="samsung_devices"
android:title="@string/samsung_devices" >
<Preference
android:title="@string/s10_n10_series_maintainer"
android:summary="@string/device_s10_n10_series"
android:icon="@drawable/ic_devs_phone" >
<intent
android:action="android.intent.action.VIEW"
android:data="https://t.me/FreeRunner4ever" />
</Preference>
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 FlamingoOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/app_lock_title">
<Preference
android:key="app_lock_packages"
android:title="@string/app_lock_packages_title"
android:summary="@string/app_lock_packages_summary"
android:fragment="com.cherish.settings.security.applock.AppLockPackageListFragment" />
<ListPreference
android:key="app_lock_timeout"
android:title="@string/app_lock_timeout_title"
android:summary="@string/app_lock_timeout_summary"
android:entries="@array/app_lock_timeout_entries"
android:entryValues="@array/app_lock_timeout_values"
android:defaultValue="0"
android:persistent="false"
settings:controller="com.cherish.settings.security.applock.AppLockTimeoutPreferenceController" />
<SwitchPreference
android:key="app_lock_biometrics_allowed"
android:title="@string/app_lock_biometrics_allowed_title"
android:persistent="false" />
</PreferenceScreen>

View File

@@ -18,4 +18,4 @@
android:title="@string/gestures_title" android:title="@string/gestures_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"> xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
</PreferenceScreen> </PreferenceScreen>

View File

@@ -72,24 +72,6 @@
android:title="@string/enable_fingerprint_ripple_effect_title" android:title="@string/enable_fingerprint_ripple_effect_title"
android:summary="@string/enable_fingerprint_ripple_effect_summary" android:summary="@string/enable_fingerprint_ripple_effect_summary"
android:defaultValue="true" /> android:defaultValue="true" />
<PreferenceCategory
android:key="lockscreen_ui_finterprint_category"
android:title="@string/fingerprint_category">
<SwitchPreference
android:key="fingerprint_success_vib"
android:title="@string/fprint_success_vib_title"
android:summary="@string/fprint_success_vib_summary"
android:persistent="true" />
<SwitchPreference
android:key="fingerprint_error_vib"
android:title="@string/fprint_error_vib_title"
android:summary="@string/fprint_error_vib_summary"
android:persistent="true" />
</PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:key="lockscreen_media_art_options" android:key="lockscreen_media_art_options"
@@ -99,7 +81,7 @@
android:key="lockscreen_media_metadata" android:key="lockscreen_media_metadata"
android:title="@string/media_art_title" android:title="@string/media_art_title"
android:summary="@string/media_art_summary" android:summary="@string/media_art_summary"
android:defaultValue="false" /> android:defaultValue="true" />
<com.cherish.settings.preferences.SystemSettingListPreference <com.cherish.settings.preferences.SystemSettingListPreference
android:key="lockscreen_albumart_filter" android:key="lockscreen_albumart_filter"
@@ -116,12 +98,12 @@
android:summary="@string/pulse_settings_summary" android:summary="@string/pulse_settings_summary"
android:fragment="com.cherish.settings.fragments.sound.PulseSettings" /> android:fragment="com.cherish.settings.fragments.sound.PulseSettings" />
<!-- <com.cherish.settings.preferences.SystemSettingSeekBarPreference <com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="ls_media_filter_blur_radius" android:key="ls_media_filter_blur_radius"
android:title="@string/lockscreen_albumart_filter_blur_radius_title" android:title="@string/lockscreen_albumart_filter_blur_radius_title"
android:defaultValue="10" android:defaultValue="10"
android:max="25" android:max="25"
settings:min="1" /> --> settings:min="1" />
</PreferenceCategory> </PreferenceCategory>

View File

@@ -37,6 +37,13 @@
android:title="@string/smart_charging_title" android:title="@string/smart_charging_title"
android:summary="@string/smart_charging_summary" android:summary="@string/smart_charging_summary"
android:fragment="com.cherish.settings.fragments.SmartCharging"/> android:fragment="com.cherish.settings.fragments.SmartCharging"/>
<Preference
android:key="app_lock"
android:title="@string/app_lock_title"
android:summary="@string/app_lock_summary"
android:fragment="com.cherish.settings.security.applock.AppLockSettingsFragment"
settings:controller="com.cherish.settings.security.applock.AppLockSettingsPreferenceController" />
<!-- Smart Pixels --> <!-- Smart Pixels -->
<Preference <Preference

View File

@@ -37,6 +37,21 @@
android:entries="@array/quick_pulldown_entries" android:entries="@array/quick_pulldown_entries"
android:entryValues="@array/quick_pulldown_values" android:entryValues="@array/quick_pulldown_values"
android:defaultValue="0" /> android:defaultValue="0" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="qs_header_clock_size"
android:title="@string/clock_font_size_title"
android:max="27"
settings:min="10"
settings:interval="1"
android:defaultValue="14"
settings:units="@string/unit_pixels" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="show_qs_date"
android:title="@string/qs_date_title"
android:summary="@string/qs_date_summary"
android:defaultValue="true" />
</PreferenceCategory> </PreferenceCategory>
@@ -81,12 +96,43 @@
android:key="qs_layout_category" android:key="qs_layout_category"
android:title="@string/qs_layout_category_title"> android:title="@string/qs_layout_category_title">
<Preference <com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="qs_tile_layout" android:key="qs_tile_label_hide"
android:icon="@drawable/ic_qs_tile" android:title="@string/qs_tile_label_hide_title"
android:title="@string/qs_tile_layout_title" android:summary="@string/qs_tile_label_hide_summary"
android:summary="@string/qs_tile_layout_summary" android:defaultValue="false" />
android:fragment="com.cherish.settings.fragments.QsTileLayoutSettings" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="qs_tile_label_size"
android:title="@string/qs_tile_label_size_title"
android:max="15"
settings:min="10"
settings:interval="1"
settings:units="sp"
android:defaultValue="14" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="qs_tile_vertical_layout"
android:title="@string/qs_tile_layout_title"
android:summary="@string/qs_tile_layout_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="qs_layout_columns"
android:title="@string/qs_columns_portrait_title"
android:max="5"
settings:min="2"
settings:interval="1"
android:defaultValue="2" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="qs_layout_columns_landscape"
android:title="@string/qs_columns_landscape_title"
android:max="6"
settings:min="2"
settings:interval="1"
android:defaultValue="4" />
</PreferenceCategory> </PreferenceCategory>

View File

@@ -57,6 +57,15 @@
android:entryValues="@array/status_bar_am_pm_values" android:entryValues="@array/status_bar_am_pm_values"
android:defaultValue="2" /> android:defaultValue="2" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="status_bar_clock_size"
android:title="@string/clock_font_size_title"
android:max="20"
settings:min="4"
settings:interval="1"
android:defaultValue="14"
settings:units="@string/unit_pixels" />
<com.cherish.settings.preferences.SystemSettingListPreference <com.cherish.settings.preferences.SystemSettingListPreference
android:key="status_bar_clock_date_display" android:key="status_bar_clock_date_display"
android:title="@string/status_bar_date_title" android:title="@string/status_bar_date_title"

View File

@@ -27,13 +27,11 @@
</PreferenceCategory> </PreferenceCategory>
<com.cherish.settings.preferences.SystemSettingListPreference <com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="statusbar_clock_chip" android:key="statusbar_clock_chip"
android:title="@string/statusbar_clock_chip_title" android:title="@string/statusbar_clock_chip_title"
android:entries="@array/statusbar_clock_chip_entries" android:summary="@string/statusbar_clock_chip_summary"
android:entryValues="@array/statusbar_clock_chip_values" android:defaultValue="false" />
android:summary="%s"
android:defaultValue="0" />
<Preference <Preference
android:key="network_traffic_settings" android:key="network_traffic_settings"
@@ -73,6 +71,13 @@
android:targetPackage="com.android.systemui" android:targetPackage="com.android.systemui"
android:targetClass="com.android.systemui.tuner.StatusbarItemsActivity" /> android:targetClass="com.android.systemui.tuner.StatusbarItemsActivity" />
</Preference> </Preference>
<!-- DSB -->
<Preference
android:key="dynamic_system_bars"
android:title="@string/dynamic_system_bars_category_title"
android:summary="@string/dynamic_system_bars_category_summary"
android:fragment="com.cherish.settings.fragments.DsbSettings" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference <com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="data_disabled_icon" android:key="data_disabled_icon"
@@ -80,33 +85,43 @@
android:summary="@string/data_disabled_icon_summary" android:summary="@string/data_disabled_icon_summary"
android:defaultValue="true" /> android:defaultValue="true" />
<com.cherish.settings.preferences.SystemPropertySwitchPreference <com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="persist.sys.flags.combined_signal_icons" android:key="volte_icon_style"
android:title="@string/combined_status_bar_signal_icons_title" android:title="@string/volte_icon_style_title"
android:summary="@string/combined_status_bar_signal_icons_summary" android:summary="@string/volte_icon_summary"
android:defaultValue="false" /> android:defaultValue="0"
settings:defaultValueText="@string/disabled"
<com.cherish.settings.preferences.SystemSettingListPreference android:max="28"
android:key="volte_icon_style" settings:min="0"
android:title="@string/volte_icon_style_title" settings:units="" />
android:entries="@array/volte_icon_type_entries"
android:entryValues="@array/volte_icon_type_values"
android:summary="%s"
android:defaultValue="1"/>
<com.cherish.settings.preferences.SystemSettingListPreference <com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="vowifi_icon_style" android:key="vowifi_icon_style"
android:title="@string/vowifi_icon_title" android:title="@string/vowifi_icon_title"
android:entries="@array/vowifi_icon_type_entries" android:summary="@string/vowifi_icon_summary"
android:entryValues="@array/vowifi_icon_type_values" android:defaultValue="0"
android:summary="%s" settings:defaultValueText="@string/disabled"
android:defaultValue="1"/> android:max="8"
settings:min="0"
settings:units="" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="volte_vowifi_override"
android:title="@string/volte_vowifi_override_title"
android:summary="@string/volte_vowifi_override_summary"
android:defaultValue="true"/>
<com.cherish.settings.preferences.SystemSettingSwitchPreference <com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="use_old_mobiletype" android:key="use_old_mobiletype"
android:title="@string/use_old_mobiletype_title" android:title="@string/use_old_mobiletype_title"
android:summary="@string/use_old_mobiletype_summary" android:summary="@string/use_old_mobiletype_summary"
android:defaultValue="false" /> android:defaultValue="false" />
<SwitchPreference
android:key="enable_combined_signal_icons"
android:title="@string/combined_status_bar_signal_icons_title"
android:summary="@string/combined_status_bar_signal_icons_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference <com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="show_fourg_icon" android:key="show_fourg_icon"
@@ -156,6 +171,14 @@
android:summary="@string/bluetooth_battery_summary" android:summary="@string/bluetooth_battery_summary"
android:defaultValue="true"/> android:defaultValue="true"/>
<!-- Birghtness control -->
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="status_bar_brightness_control"
android:title="@string/status_bar_brightness_control_title"
android:summary="@string/status_bar_brightness_control_summary"
android:defaultValue="false" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -48,6 +48,33 @@
android:summary="@string/disable_usercard_summary" android:summary="@string/disable_usercard_summary"
android:defaultValue="false" /> android:defaultValue="false" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/notification_material_dismiss_button_title">
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="notification_material_dismiss"
android:title="@string/notification_material_dismiss_button_title"
android:summary="@string/notification_material_dismiss_button_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="notification_material_dismiss_style"
android:title="@string/clearall_style_title"
android:dependency="notification_material_dismiss"
android:defaultValue="0"
android:max="9"
settings:min="0" />
<com.cherish.settings.preferences.SystemSettingSeekBarPreference
android:key="notification_material_dismiss_bgstyle"
android:title="@string/clearall_bgstyle_title"
android:dependency="notification_material_dismiss"
android:defaultValue="0"
android:max="4"
settings:min="0" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
@@ -59,13 +86,12 @@
android:summary="@string/dark_ui_mode_summary" android:summary="@string/dark_ui_mode_summary"
android:fragment="com.android.settings.display.darkmode.DarkModeSettingsFragment" android:fragment="com.android.settings.display.darkmode.DarkModeSettingsFragment"
settings:controller="com.android.settings.display.DarkUIPreferenceController" /> settings:controller="com.android.settings.display.DarkUIPreferenceController" />
<!-- Monet settings --> <Preference
<Preference android:key="android.theme.customization.style"
android:key="monet_settings" android:title="@string/theme_customization_ui_style_title"
android:title="@string/monet_settings_title" android:summary="@string/theme_customization_ui_style_summary"
android:summary="@string/monet_settings_sammary" android:fragment="com.cherish.settings.fragments.ui.UIStyles"/>
android:fragment="com.cherish.settings.fragments.MonetSettings" />
<Preference <Preference
android:key="android.theme.customization.lockscreen_clock_font" android:key="android.theme.customization.lockscreen_clock_font"
@@ -83,14 +109,21 @@
android:summary="%s" android:summary="%s"
android:defaultValue="0" /> android:defaultValue="0" />
<!-- Black Theme --> <!-- Monet -->
<com.cherish.settings.preferences.SecureSettingSwitchPreference <Preference
android:key="monet_engine_settings"
android:title="@string/monet_engine_settings_title"
android:summary="@string/monet_engine_settings_summary"
android:fragment="com.cherish.settings.fragments.MonetEngineSettings" />
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="system_black_theme" android:key="system_black_theme"
android:title="@string/system_black_theme_title" android:title="@string/system_black_theme_title"
android:summary="@string/system_black_theme_summary" android:summary="@string/system_black_theme_summary"
android:dependency="dark_ui_mode" android:dependency="dark_ui_mode"
android:defaultValue="false" /> android:defaultValue="false" />
<!-- Font style --> <!-- Font style -->
<Preference <Preference
android:key="android.theme.customization.font" android:key="android.theme.customization.font"

View File

@@ -14,25 +14,55 @@
android:summary="@string/udfps_haptic_feedback_summary" android:summary="@string/udfps_haptic_feedback_summary"
android:defaultValue="true" /> android:defaultValue="true" />
<!-- Screen OFF FOD --> <com.cherish.settings.preferences.SystemSettingSwitchPreference
<com.cherish.settings.preferences.SecureSettingSwitchPreference android:key="udfps_success_vib"
android:key="screen_off_udfps_enabled" android:title="@string/udfps_success_vib_title"
android:title="@string/screen_off_udfps_title" android:summary="@string/udfps_success_vib_summary"
android:summary="@string/screen_off_udfps_summary" android:defaultValue="true" />
android:defaultValue="false"
settings:controller="com.android.settings.security.UdfpsGesturePreferenceController" />
<!-- UDFPS ICON PICKER --> <com.cherish.settings.preferences.SystemSettingSwitchPreference
<Preference android:key="udfps_error_vib"
android:key="udfps_icon_picker" android:title="@string/udfps_error_vib_title"
android:title="@string/udfps_icon_picker_title" android:summary="@string/udfps_error_vib_summary"
android:summary="@string/udfps_icon_picker_summary" android:defaultValue="true" />
android:fragment="com.cherish.settings.fragments.UdfpsIconPicker" />
<PreferenceCategory
android:key="udfps_customization"
android:title="@string/udfps_customization">
<Preference
android:key="udfps_icon_picker"
android:title="@string/udfps_icon_picker_title"
android:summary="@string/udfps_icon_picker_summary"
android:fragment="com.cherish.settings.fragments.UdfpsIconPicker" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="custom_fp_icon_enabled"
android:title="@string/custom_fp_icon_title"
android:summary="@string/custom_fp_icon_summary"
android:defaultValue="false" />
<Preference
android:key="custom_fp_file_select"
android:title="@string/custom_fp_select_title"
android:summary="@string/custom_fp_select_summary"
android:dependency="custom_fp_icon_enabled"
android:persistent="false">
</Preference>
<Preference
android:key="udfps_recognizing_animation_preview"
android:title="@string/udfps_recog_animation_effect_title"
android:summary="@string/udfps_recog_animation_effect_summary"
android:fragment="com.cherish.settings.fragments.UdfpsAnimation" />
<Preference
android:key="udfps_pressedicon_picker"
android:title="@string/udfps_pressed_color_title"
android:summary="@string/udfps_pressed_color_summary"
android:fragment="com.cherish.settings.fragments.UdfpsPressedIconPicker" />
</PreferenceCategory>
<!-- UDFPS ANIMATIONS -->
<Preference
android:key="udfps_recognizing_animation_preview"
android:title="@string/udfps_recog_animation_effect_title"
android:summary="@string/udfps_recog_animation_effect_summary"
android:fragment="com.cherish.settings.fragments.UdfpsAnimation" />
</PreferenceScreen> </PreferenceScreen>

52
res/xml/dsb_settings.xml Normal file
View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 The Nusantara Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen android:title="@string/dynamic_system_bars_category_title"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto">
<SwitchPreference
android:title="@string/dynamic_status_bar_title"
android:key="DYNAMIC_STATUS_BAR_STATE"
android:summary="@string/dynamic_status_bar_summary" />
<SwitchPreference
android:title="@string/dynamic_navigation_bar_title"
android:key="DYNAMIC_NAVIGATION_BAR_STATE"
android:summary="@string/dynamic_navigation_bar_summary" />
<SwitchPreference
android:title="@string/dynamic_linked_color_status_bar_title"
android:key="LINKED_COLOR"
android:summary="@string/dynamic_linked_color_status_bar_summary" />
<SwitchPreference
android:title="@string/dynamic_icon_navigation_tint_title"
android:key="UI_COLOR"
android:summary="@string/dynamic_icon_navigation_tint_summary" />
<SwitchPreference
android:title="@string/dynamic_status_bar_filter_title"
android:key="DYNAMIC_STATUS_BAR_FILTER_STATE"
android:summary="@string/dynamic_status_bar_filter_summary" />
<SwitchPreference
android:title="@string/dynamic_silver_mode_status_bar_title"
android:key="ABU_ABU"
android:summary="@string/dynamic_silver_mode_status_bar_summary" />
<SwitchPreference
android:title="@string/dynamic_accent_mode_status_bar_title"
android:key="ACCENT_COLOR"
android:summary="@string/dynamic_accent_mode_status_bar_summary" />
</PreferenceScreen>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 FlamingoOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/monet_engine_settings_title">
<!-- Accurate shades -->
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="monet_engine_accurate_shades"
android:title="@string/accurate_shades_title"
android:defaultValue="true" />
<!-- Color override -->
<com.cherish.settings.preferences.SecureSettingColorPickerPreference
android:key="monet_engine_color_override"
android:title="@string/color_override_title"
settings:controller="com.cherish.settings.fragments.MonetCustomColorPreferenceController" />
<!-- Chroma factor -->
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="chroma_factor"
android:title="@string/chroma_factor_title"
android:defaultValue="100"
android:max="100"
android:persistent="false"
android:min="0"
settings:interval="10"
settings:controller="com.cherish.settings.fragments.MonetChromaFactorPreferenceController" />
<!-- Custom lightness scale -->
<com.cherish.settings.preferences.SecureSettingSwitchPreference
android:key="monet_engine_linear_lightness"
android:title="@string/linear_lightness_title"
android:defaultValue="0" />
<!-- Brightness -->
<com.cherish.settings.preferences.SecureSettingSeekBarPreference
android:key="monet_engine_white_luminance"
android:title="@string/white_luminance_title"
android:defaultValue="425"
android:max="1000"
settings:min="1"
settings:interval="100" />
</PreferenceScreen>

View File

@@ -1,79 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 Yet Another AOSP Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/monet_settings_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<ListPreference
android:key="theme_style"
android:title="@string/theme_style_title"
android:entries="@array/theme_style_entries"
android:entryValues="@array/theme_style_values"
android:defaultValue="0" />
<ListPreference
android:key="color_source"
android:title="@string/color_source_title"
android:entries="@array/color_source_entries"
android:entryValues="@array/color_source_values"
android:defaultValue="0" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="accent_color"
android:title="@string/accent_color_title"
android:summary="@string/accent_color_summary" />
<SwitchPreference
android:key="accent_background"
android:title="@string/accent_background_title"
android:summary="@string/accent_background_summary"
android:defaultValue="false" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="bg_color"
android:title="@string/bg_color_title"
android:summary="@string/bg_color_summary" />
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="luminance_factor"
android:title="@string/luminance_factor_title"
android:summary="@string/luminance_factor_summary"
android:max="100"
settings:min="-95"
settings:interval="5"
settings:defaultValue="0"
settings:units="%"
settings:showSign="true" />
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="chroma_factor"
android:title="@string/chroma_factor_title"
android:summary="@string/chroma_factor_summary"
android:max="100"
settings:min="-95"
settings:interval="5"
settings:defaultValue="0"
settings:units="%"
settings:showSign="true" />
<SwitchPreference
android:key="tint_background"
android:title="@string/tint_background_title"
android:summary="@string/tint_background_summary"
android:defaultValue="false" />
</PreferenceScreen>

View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/qs_tile_layout_title">
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="qs_tile_label_hide"
android:title="@string/qs_tile_hide_label_title"
android:summary="@string/qs_tile_hide_label_summary"
android:defaultValue="false" />
<com.cherish.settings.preferences.SystemSettingSwitchPreference
android:key="qs_tile_vertical_layout"
android:title="@string/qs_tile_vertical_layout_title"
android:summary="@string/qs_tile_vertical_layout_summary"
android:defaultValue="false" />
<PreferenceCategory
android:key="tiles_layout"
android:title="@string/qs_tiles_layout_category">
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="qs_layout_columns"
android:title="@string/qs_columns_portrait_title"
android:defaultValue="2"
android:max="6"
settings:min="2" />
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="qs_layout_rows"
android:title="@string/qs_rows_portrait_title"
android:defaultValue="4"
android:max="6"
settings:min="2" />
<com.cherish.settings.preferences.CustomSeekBarPreference
android:key="qqs_layout_rows"
android:title="@string/qqs_rows_portrait_title"
android:defaultValue="2"
android:max="5"
settings:min="1" />
<com.android.settingslib.widget.LayoutPreference
android:key="apply_change_button"
android:layout="@layout/qs_tile_apply_change_button" />
</PreferenceCategory>
</PreferenceScreen>

View File

@@ -46,7 +46,7 @@
</PreferenceCategory> </PreferenceCategory>
<!-- QS panel battery customizations --> <!-- QS panel battery customizations -->
<!-- <PreferenceCategory <PreferenceCategory
android:title="@string/qs_battery_category_title"> android:title="@string/qs_battery_category_title">
<com.cherish.settings.preferences.SystemSettingListPreference <com.cherish.settings.preferences.SystemSettingListPreference
@@ -63,6 +63,6 @@
android:entryValues="@array/status_bar_battery_percent_values" android:entryValues="@array/status_bar_battery_percent_values"
android:defaultValue="2" /> android:defaultValue="2" />
</PreferenceCategory> --> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings
import android.content.Context
import android.widget.Switch
import androidx.preference.Preference
import androidx.preference.PreferenceScreen
import com.android.settings.R
import com.android.settings.core.TogglePreferenceController
import com.android.settingslib.widget.MainSwitchPreference
import com.android.settingslib.widget.OnMainSwitchChangeListener
abstract class CherishTogglePreferenceController(
context: Context,
key: String,
) : TogglePreferenceController(context, key),
OnMainSwitchChangeListener {
override fun displayPreference(screen: PreferenceScreen) {
super.displayPreference(screen)
val preference = screen.findPreference<Preference>(preferenceKey) ?: return
if (preference is MainSwitchPreference) {
preference.addOnSwitchChangeListener(this)
}
}
override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) {
setChecked(isChecked)
}
override fun getSliceHighlightMenuRes() = R.string.menu_key_cherish
}

View File

@@ -63,6 +63,7 @@ public class AmbientCustomizations extends SettingsPreferenceFragment implements
private static final String AMBIENT_TEXT_STRING = "ambient_text_string"; private static final String AMBIENT_TEXT_STRING = "ambient_text_string";
private static final String AMBIENT_TEXT_ALIGNMENT = "ambient_text_alignment"; private static final String AMBIENT_TEXT_ALIGNMENT = "ambient_text_alignment";
private static final String AMBIENT_TEXT_FONT = "ambient_text_font";
private static final String AMBIENT_TEXT_TYPE_COLOR = "ambient_text_type_color"; private static final String AMBIENT_TEXT_TYPE_COLOR = "ambient_text_type_color";
private static final String AMBIENT_TEXT_COLOR = "ambient_text_color"; private static final String AMBIENT_TEXT_COLOR = "ambient_text_color";
private static final String FILE_AMBIENT_SELECT = "file_ambient_select"; private static final String FILE_AMBIENT_SELECT = "file_ambient_select";
@@ -94,6 +95,13 @@ public class AmbientCustomizations extends SettingsPreferenceFragment implements
mAmbientTextAlign.setSummary(mAmbientTextAlign.getEntry()); mAmbientTextAlign.setSummary(mAmbientTextAlign.getEntry());
mAmbientTextAlign.setOnPreferenceChangeListener(this); mAmbientTextAlign.setOnPreferenceChangeListener(this);
// ambient text Fonts
mAmbientTextFonts = (ListPreference) findPreference(AMBIENT_TEXT_FONT);
mAmbientTextFonts.setValue(String.valueOf(Settings.System.getInt(
getContentResolver(), Settings.System.AMBIENT_TEXT_FONT, 8)));
mAmbientTextFonts.setSummary(mAmbientTextFonts.getEntry());
mAmbientTextFonts.setOnPreferenceChangeListener(this);
// ambient text color type // ambient text color type
mAmbientTextTypeColor = (ListPreference) findPreference(AMBIENT_TEXT_TYPE_COLOR); mAmbientTextTypeColor = (ListPreference) findPreference(AMBIENT_TEXT_TYPE_COLOR);
mAmbientTextTypeColor.setValue(String.valueOf(Settings.System.getInt( mAmbientTextTypeColor.setValue(String.valueOf(Settings.System.getInt(
@@ -143,6 +151,12 @@ public class AmbientCustomizations extends SettingsPreferenceFragment implements
Settings.System.AMBIENT_TEXT_ALIGNMENT, align); Settings.System.AMBIENT_TEXT_ALIGNMENT, align);
mAmbientTextAlign.setSummary(mAmbientTextAlign.getEntries()[index]); mAmbientTextAlign.setSummary(mAmbientTextAlign.getEntries()[index]);
return true; return true;
} else if (preference == mAmbientTextFonts) {
Settings.System.putInt(getContentResolver(), Settings.System.AMBIENT_TEXT_FONT,
Integer.valueOf((String) newValue));
mAmbientTextFonts.setValue(String.valueOf(newValue));
mAmbientTextFonts.setSummary(mAmbientTextFonts.getEntry());
return true;
} else if (preference == mAmbientTextTypeColor) { } else if (preference == mAmbientTextTypeColor) {
int value = Integer.valueOf((String) newValue); int value = Integer.valueOf((String) newValue);
int vIndex = mAmbientTextTypeColor.findIndexOfValue((String) newValue); int vIndex = mAmbientTextTypeColor.findIndexOfValue((String) newValue);

View File

@@ -0,0 +1,266 @@
/*
* Copyright (C) 2022 The Nusantara Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.UserHandle;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import com.android.internal.logging.nano.MetricsProto;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable;
import java.util.ArrayList;
import java.util.List;
import com.android.settings.R;
import androidx.preference.SeekBarPreference;
@SearchIndexable
public class DsbSettings extends SettingsPreferenceFragment
implements Preference.OnPreferenceChangeListener {
private static final String KEY_DYNAMIC_STATUS_BAR = "DYNAMIC_STATUS_BAR_STATE";
private static final String KEY_DYNAMIC_NAVIGATION_BAR = "DYNAMIC_NAVIGATION_BAR_STATE";
private static final String KEY_DYNAMIC_STATUS_BAR_FILTER = "DYNAMIC_STATUS_BAR_FILTER_STATE";
private static final String KEY_DYNAMIC_LINKED_COLOR = "LINKED_COLOR";
private static final String KEY_DYNAMIC_ABU_ABU = "ABU_ABU";
private static final String KEY_DYNAMIC_UI_COLOR = "UI_COLOR";
private static final String KEY_DYNAMIC_ACCENT_COLOR = "ACCENT_COLOR";
private SwitchPreference mDynamicStatusBar;
private SwitchPreference mDynamicNavigationBar;
private SwitchPreference mDynamicStatusBarFilter;
private SwitchPreference mDynamicLinkedColor;
private SwitchPreference mDynamicAbuAbu;
private SwitchPreference mDynamicUiColor;
private SwitchPreference mDynamicAccentColor;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context ctx = getContext();
String name = ctx.getPackageName();
addPreferencesFromResource(getResources().getIdentifier("dsb_settings", "xml", name));
PreferenceScreen prefSet = getPreferenceScreen();
ContentResolver resolver = ctx.getContentResolver();
SwitchPreference statusBar = mDynamicStatusBar = prefSet.findPreference(KEY_DYNAMIC_STATUS_BAR);
statusBar.setOnPreferenceChangeListener(this);
boolean status = Settings.System.getIntForUser(resolver, "DYNAMIC_STATUS_BAR_STATE", 0, UserHandle.USER_CURRENT) != 0;
statusBar.setChecked(status);
SwitchPreference navi = mDynamicNavigationBar = prefSet.findPreference(KEY_DYNAMIC_NAVIGATION_BAR);
navi.setOnPreferenceChangeListener(this);
boolean naviEnable = Settings.System.getIntForUser(resolver, "DYNAMIC_NAVIGATION_BAR_STATE", 0, UserHandle.USER_CURRENT) != 0;
navi.setChecked(naviEnable);
Resources res = getResources();
final boolean hasNavigationBar = res.getDimensionPixelSize(res.getIdentifier(
"navigation_bar_height", "dimen", "android")) > 0;
navi.setEnabled(hasNavigationBar);
final boolean isAnyBarDynamic = status || naviEnable;
SwitchPreference linkedColor = mDynamicLinkedColor = prefSet.findPreference(KEY_DYNAMIC_LINKED_COLOR);
linkedColor.setOnPreferenceChangeListener(this);
boolean linkedColorEnabled = Settings.System.getIntForUser(resolver, "LINKED_COLOR", 0, UserHandle.USER_CURRENT) != 0;
boolean uiEnabled = Settings.System.getIntForUser(resolver, "UI_COLOR", 0, UserHandle.USER_CURRENT) != 0;
linkedColor.setChecked(linkedColorEnabled);
linkedColor.setEnabled(status && naviEnable && !uiEnabled);
SwitchPreference ui = mDynamicUiColor = prefSet.findPreference(KEY_DYNAMIC_UI_COLOR);
ui.setOnPreferenceChangeListener(this);
ui.setChecked(uiEnabled);
ui.setEnabled(status && naviEnable && !linkedColorEnabled);
SwitchPreference filter = mDynamicStatusBarFilter = prefSet.findPreference(KEY_DYNAMIC_STATUS_BAR_FILTER);
filter.setOnPreferenceChangeListener(this);
boolean filterEnabled = Settings.System.getIntForUser(resolver, "DYNAMIC_STATUS_BAR_FILTER_STATE", 0, UserHandle.USER_CURRENT) != 0;
filter.setChecked(filterEnabled);
filter.setEnabled(status);
SwitchPreference abu = mDynamicAbuAbu = prefSet.findPreference(KEY_DYNAMIC_ABU_ABU);
abu.setOnPreferenceChangeListener(this);
boolean abuEnabled = Settings.System.getIntForUser(resolver, "ABU_ABU", 0, UserHandle.USER_CURRENT) != 0;
boolean accentEnabled = Settings.System.getIntForUser(resolver, "ACCENT_COLOR", 0, UserHandle.USER_CURRENT) != 0;
abu.setChecked(abuEnabled);
abu.setEnabled(isAnyBarDynamic && !accentEnabled);
SwitchPreference accent = mDynamicAccentColor = prefSet.findPreference(KEY_DYNAMIC_ACCENT_COLOR);
accent.setOnPreferenceChangeListener(this);
accent.setChecked(accentEnabled);
accent.setEnabled(isAnyBarDynamic && !abuEnabled);
updatePrefAll();
}
protected void updatePrefAll() {
Context ctx = getContext();
ContentResolver resolver = ctx.getContentResolver();
boolean status = Settings.System.getIntForUser(resolver, "DYNAMIC_STATUS_BAR_STATE", 0, UserHandle.USER_CURRENT) != 0;
SwitchPreference navi = mDynamicNavigationBar;
boolean naviEnable = Settings.System.getIntForUser(resolver, "DYNAMIC_NAVIGATION_BAR_STATE", 0, UserHandle.USER_CURRENT) != 0;
Resources res = getResources();
final boolean hasNavigationBar = res.getDimensionPixelSize(res.getIdentifier(
"navigation_bar_height", "dimen", "android")) > 0;
navi.setEnabled(hasNavigationBar);
final boolean isAnyBarDynamic = status || naviEnable;
SwitchPreference linkedColor = mDynamicLinkedColor;
boolean linkedColorEnabled = Settings.System.getIntForUser(resolver, "LINKED_COLOR", 0, UserHandle.USER_CURRENT) != 0;
boolean uiEnabled = Settings.System.getIntForUser(resolver, "UI_COLOR", 0, UserHandle.USER_CURRENT) != 0;
linkedColor.setEnabled(status && naviEnable && !uiEnabled);
SwitchPreference ui = mDynamicUiColor;
ui.setEnabled(status && naviEnable && !linkedColorEnabled);
SwitchPreference filter = mDynamicStatusBarFilter;
boolean filterEnabled = Settings.System.getIntForUser(resolver, "DYNAMIC_STATUS_BAR_FILTER_STATE", 0, UserHandle.USER_CURRENT) != 0;
filter.setEnabled(status);
SwitchPreference abu = mDynamicAbuAbu;
boolean abuEnabled = Settings.System.getIntForUser(resolver, "ABU_ABU", 0, UserHandle.USER_CURRENT) != 0;
boolean accentEnabled = Settings.System.getIntForUser(resolver, "ACCENT_COLOR", 0, UserHandle.USER_CURRENT) != 0;
abu.setEnabled(isAnyBarDynamic && !accentEnabled);
SwitchPreference accent = mDynamicAccentColor;
accent.setEnabled(isAnyBarDynamic && !abuEnabled);
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
ContentResolver resolver = getContext().getContentResolver();
if (preference == mDynamicStatusBar) {
boolean value = (Boolean) newValue;
Settings.System.putIntForUser(resolver,
"DYNAMIC_STATUS_BAR_STATE",
value ? 1 : 0, UserHandle.USER_CURRENT);
updatePrefAll();
return true;
} else if (preference == mDynamicNavigationBar) {
boolean value = (Boolean) newValue;
final Resources res = getResources();
Settings.System.putIntForUser(resolver,
"DYNAMIC_NAVIGATION_BAR_STATE",
value && res.getDimensionPixelSize(
res.getIdentifier("navigation_bar_height", "dimen", "android")) > 0 ?
1 : 0, UserHandle.USER_CURRENT);
updatePrefAll();
return true;
} else if (preference == mDynamicLinkedColor) {
boolean value = (Boolean) newValue;
Settings.System.putIntForUser(resolver, "LINKED_COLOR",
value ? 1 : 0, UserHandle.USER_CURRENT);
if (value) {
Settings.System.putIntForUser(resolver,
"UI_COLOR", 0, UserHandle.USER_CURRENT);
}
updatePrefAll();
return true;
} else if (preference == mDynamicUiColor) {
boolean value = (Boolean) newValue;
Settings.System.putIntForUser(resolver, "UI_COLOR",
value ? 1 : 0, UserHandle.USER_CURRENT);
if (value) {
Settings.System.putIntForUser(resolver,
"LINKED_COLOR", 0, UserHandle.USER_CURRENT);
}
updatePrefAll();
return true;
} else if (preference == mDynamicStatusBarFilter) {
boolean value = (Boolean) newValue;
Settings.System.putIntForUser(resolver,
"DYNAMIC_STATUS_BAR_FILTER_STATE",
value ? 1 : 0, UserHandle.USER_CURRENT);
updatePrefAll();
return true;
} else if (preference == mDynamicAbuAbu) {
boolean value = (Boolean) newValue;
Settings.System.putIntForUser(resolver,
"ABU_ABU",
value ? 1 : 0, UserHandle.USER_CURRENT);
if (value) {
Settings.System.putIntForUser(resolver,
"ACCENT_COLOR", 0, UserHandle.USER_CURRENT);
}
updatePrefAll();
return true;
} else if (preference == mDynamicAccentColor) {
boolean value = (Boolean) newValue;
Settings.System.putIntForUser(resolver,
"ACCENT_COLOR",
value ? 1 : 0, UserHandle.USER_CURRENT);
if (value) {
Settings.System.putIntForUser(resolver,
"ABU_ABU", 0, UserHandle.USER_CURRENT);
}
updatePrefAll();
return true;
}
return false;
}
public int getMetricsCategory() {
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
}
public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
boolean enabled) {
ArrayList<SearchIndexableResource> result =
new ArrayList<SearchIndexableResource>();
SearchIndexableResource sir = new SearchIndexableResource(context);
sir.xmlResId = R.xml.dsb_settings;
result.add(sir);
return result;
}
@Override
public List<String> getNonIndexableKeys(Context context) {
List<String> keys = super.getNonIndexableKeys(context);
return keys;
}
};
}

View File

@@ -53,8 +53,19 @@ import com.android.settingslib.search.SearchIndexable;
import android.provider.SearchIndexableResource; import android.provider.SearchIndexableResource;
import android.widget.Toast; import android.widget.Toast;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Collections;
import java.io.FileDescriptor;
import java.util.Arrays;
import org.json.JSONException;
import org.json.JSONObject;
import static android.os.UserHandle.USER_SYSTEM;
import android.os.RemoteException;
import android.os.ServiceManager;
import static android.os.UserHandle.USER_CURRENT;
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class LockScreenSettings extends SettingsPreferenceFragment implements public class LockScreenSettings extends SettingsPreferenceFragment implements
@@ -62,13 +73,6 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
private static final String UDFPS_CATEGORY = "udfps_category"; private static final String UDFPS_CATEGORY = "udfps_category";
private static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture"; private static final String TORCH_POWER_BUTTON_GESTURE = "torch_power_button_gesture";
private static final String FINGERPRINT_SUCCESS_VIB = "fingerprint_success_vib";
private static final String FINGERPRINT_ERROR_VIB = "fingerprint_error_vib";
private FingerprintManager mFingerprintManager;
private SwitchPreference mFingerprintSuccessVib;
private SwitchPreference mFingerprintErrorVib;
private ListPreference mLockClockStyles; private ListPreference mLockClockStyles;
@@ -82,7 +86,6 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
addPreferencesFromResource(R.xml.cherish_settings_lockscreen); addPreferencesFromResource(R.xml.cherish_settings_lockscreen);
final ContentResolver resolver = getActivity().getContentResolver(); final ContentResolver resolver = getActivity().getContentResolver();
final PreferenceScreen prefSet = getPreferenceScreen(); final PreferenceScreen prefSet = getPreferenceScreen();
final PackageManager mPm = getActivity().getPackageManager();
Resources res = null; Resources res = null;
Context ctx = getContext(); Context ctx = getContext();
@@ -106,27 +109,6 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
mTorchPowerButton.setValue(Integer.toString(mTorchPowerButtonValue)); mTorchPowerButton.setValue(Integer.toString(mTorchPowerButtonValue));
mTorchPowerButton.setSummary(mTorchPowerButton.getEntry()); mTorchPowerButton.setSummary(mTorchPowerButton.getEntry());
mTorchPowerButton.setOnPreferenceChangeListener(this); mTorchPowerButton.setOnPreferenceChangeListener(this);
mFingerprintManager = (FingerprintManager) getActivity().getSystemService(Context.FINGERPRINT_SERVICE);
mFingerprintSuccessVib = (SwitchPreference) findPreference(FINGERPRINT_SUCCESS_VIB);
mFingerprintErrorVib = (SwitchPreference) findPreference(FINGERPRINT_ERROR_VIB);
if (mPm.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT) &&
mFingerprintManager != null) {
if (!mFingerprintManager.isHardwareDetected()){
prefSet.removePreference(mFingerprintSuccessVib);
prefSet.removePreference(mFingerprintErrorVib);
} else {
mFingerprintSuccessVib.setChecked((Settings.System.getInt(getContentResolver(),
Settings.System.FP_SUCCESS_VIBRATE, 1) == 1));
mFingerprintSuccessVib.setOnPreferenceChangeListener(this);
mFingerprintErrorVib.setChecked((Settings.System.getInt(getContentResolver(),
Settings.System.FP_ERROR_VIBRATE, 1) == 1));
mFingerprintErrorVib.setOnPreferenceChangeListener(this);
}
} else {
prefSet.removePreference(mFingerprintSuccessVib);
prefSet.removePreference(mFingerprintErrorVib);
}
} }
@Override @Override
@@ -144,16 +126,6 @@ public class LockScreenSettings extends SettingsPreferenceFragment implements
Settings.System.putInt(resolver, Settings.System.TORCH_POWER_BUTTON_GESTURE, Settings.System.putInt(resolver, Settings.System.TORCH_POWER_BUTTON_GESTURE,
mTorchPowerButtonValue); mTorchPowerButtonValue);
return true; return true;
} else if (preference == mFingerprintSuccessVib) {
boolean value = (Boolean) newValue;
Settings.System.putInt(getActivity().getContentResolver(),
Settings.System.FP_SUCCESS_VIBRATE, value ? 1 : 0);
return true;
} else if (preference == mFingerprintErrorVib) {
boolean value = (Boolean) newValue;
Settings.System.putInt(getActivity().getContentResolver(),
Settings.System.FP_ERROR_VIBRATE, value ? 1 : 0);
return true;
} }
return false; return false;
} }

View File

@@ -0,0 +1,61 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments
import android.content.Context
import android.os.UserHandle
import android.provider.Settings
import androidx.preference.Preference
import com.android.settings.core.BasePreferenceController
import com.cherish.settings.preferences.CustomSeekBarPreference
class MonetChromaFactorPreferenceController(
context: Context,
key: String,
) : BasePreferenceController(context, key),
Preference.OnPreferenceChangeListener {
override fun getAvailabilityStatus(): Int = AVAILABLE
override fun updateState(preference: Preference) {
super.updateState(preference)
val chromaFactor = Settings.Secure.getFloatForUser(
mContext.contentResolver,
Settings.Secure.MONET_ENGINE_CHROMA_FACTOR,
CHROMA_DEFAULT,
UserHandle.USER_CURRENT
) * 100
(preference as CustomSeekBarPreference).apply {
setValue(chromaFactor.toInt())
}
}
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
return Settings.Secure.putFloatForUser(
mContext.contentResolver,
Settings.Secure.MONET_ENGINE_CHROMA_FACTOR,
(newValue as Int) / 100f,
UserHandle.USER_CURRENT
)
}
companion object {
private const val CHROMA_DEFAULT = 1f
}
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments
import android.content.Context
import android.os.UserHandle
import android.provider.Settings
import com.android.settings.R
import com.android.settings.core.BasePreferenceController
class MonetCustomColorPreferenceController(
context: Context,
key: String,
) : BasePreferenceController(context, key) {
override fun getAvailabilityStatus(): Int = AVAILABLE
override fun getSummary(): CharSequence? {
val customColor = Settings.Secure.getStringForUser(
mContext.contentResolver,
Settings.Secure.MONET_ENGINE_COLOR_OVERRIDE,
UserHandle.USER_CURRENT,
)
return if (customColor == null || customColor.isBlank()) {
mContext.getString(R.string.color_override_default_summary)
} else {
mContext.getString(
R.string.custom_color_override_summary_placeholder,
customColor
)
}
}
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments
import com.android.settings.R
import com.android.settings.search.BaseSearchIndexProvider
import com.android.settingslib.search.SearchIndexable
import com.cherish.settings.fragments.CherishDashboardFragment
@SearchIndexable
class MonetEngineSettings : CherishDashboardFragment() {
override protected fun getPreferenceScreenResId() = R.xml.monet_engine_settings
override protected fun getLogTag() = TAG
companion object {
private const val TAG = "MonetEngineSettings"
@JvmField
val SEARCH_INDEX_DATA_PROVIDER = BaseSearchIndexProvider(R.xml.monet_engine_settings)
}
}

View File

@@ -1,350 +0,0 @@
/*
* Copyright (C) 2022 Yet Another AOSP Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments;
import android.content.ContentResolver;
import android.os.Bundle;
import android.os.UserHandle;
import android.provider.Settings;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.SwitchPreference;
import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.R;
import com.android.settingslib.search.SearchIndexable;
import net.margaritov.preference.colorpicker.ColorPickerPreference;
import com.cherish.settings.preferences.CustomSeekBarPreference;
import java.lang.CharSequence;
import org.json.JSONException;
import org.json.JSONObject;
@SearchIndexable
public class MonetSettings extends SettingsPreferenceFragment implements
OnPreferenceChangeListener {
private static final String OVERLAY_CATEGORY_ACCENT_COLOR =
"android.theme.customization.accent_color";
private static final String OVERLAY_CATEGORY_SYSTEM_PALETTE =
"android.theme.customization.system_palette";
private static final String OVERLAY_CATEGORY_THEME_STYLE =
"android.theme.customization.theme_style";
private static final String OVERLAY_CATEGORY_BG_COLOR =
"android.theme.customization.bg_color";
private static final String OVERLAY_COLOR_SOURCE =
"android.theme.customization.color_source";
private static final String OVERLAY_COLOR_BOTH =
"android.theme.customization.color_both";
private static final String OVERLAY_LUMINANCE_FACTOR =
"android.theme.customization.luminance_factor";
private static final String OVERLAY_CHROMA_FACTOR =
"android.theme.customization.chroma_factor";
private static final String OVERLAY_TINT_BACKGROUND =
"android.theme.customization.tint_background";
private static final String COLOR_SOURCE_PRESET = "preset";
private static final String COLOR_SOURCE_HOME = "home_wallpaper";
private static final String COLOR_SOURCE_LOCK = "lock_wallpaper";
private static final String PREF_THEME_STYLE = "theme_style";
private static final String PREF_COLOR_SOURCE = "color_source";
private static final String PREF_ACCENT_COLOR = "accent_color";
private static final String PREF_ACCENT_BACKGROUND = "accent_background";
private static final String PREF_BG_COLOR = "bg_color";
private static final String PREF_LUMINANCE_FACTOR = "luminance_factor";
private static final String PREF_CHROMA_FACTOR = "chroma_factor";
private static final String PREF_TINT_BACKGROUND = "tint_background";
private ListPreference mThemeStylePref;
private ListPreference mColorSourcePref;
private ColorPickerPreference mAccentColorPref;
private SwitchPreference mAccentBackgroundPref;
private ColorPickerPreference mBgColorPref;
private CustomSeekBarPreference mLuminancePref;
private CustomSeekBarPreference mChromaPref;
private SwitchPreference mTintBackgroundPref;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.monet_settings);
mThemeStylePref = findPreference(PREF_THEME_STYLE);
mColorSourcePref = findPreference(PREF_COLOR_SOURCE);
mAccentColorPref = findPreference(PREF_ACCENT_COLOR);
mAccentBackgroundPref = findPreference(PREF_ACCENT_BACKGROUND);
mBgColorPref = findPreference(PREF_BG_COLOR);
mLuminancePref = findPreference(PREF_LUMINANCE_FACTOR);
mChromaPref = findPreference(PREF_CHROMA_FACTOR);
mTintBackgroundPref = findPreference(PREF_TINT_BACKGROUND);
updatePreferences();
mThemeStylePref.setOnPreferenceChangeListener(this);
mColorSourcePref.setOnPreferenceChangeListener(this);
mAccentColorPref.setOnPreferenceChangeListener(this);
mAccentBackgroundPref.setOnPreferenceChangeListener(this);
mBgColorPref.setOnPreferenceChangeListener(this);
mLuminancePref.setOnPreferenceChangeListener(this);
mChromaPref.setOnPreferenceChangeListener(this);
mTintBackgroundPref.setOnPreferenceChangeListener(this);
}
@Override
public void onResume() {
super.onResume();
updatePreferences();
}
private void updatePreferences() {
final String overlayPackageJson = Settings.Secure.getStringForUser(
getActivity().getContentResolver(),
Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
UserHandle.USER_CURRENT);
if (overlayPackageJson != null && !overlayPackageJson.isEmpty()) {
try {
final JSONObject object = new JSONObject(overlayPackageJson);
final String style = object.optString(OVERLAY_CATEGORY_THEME_STYLE, null);
final String source = object.optString(OVERLAY_COLOR_SOURCE, null);
final String color = object.optString(OVERLAY_CATEGORY_SYSTEM_PALETTE, null);
final int bgColor = object.optInt(OVERLAY_CATEGORY_BG_COLOR);
final boolean both = object.optInt(OVERLAY_COLOR_BOTH, 0) == 1;
final boolean tintBG = object.optInt(OVERLAY_TINT_BACKGROUND, 0) == 1;
final float lumin = (float) object.optDouble(OVERLAY_LUMINANCE_FACTOR, 1d);
final float chroma = (float) object.optDouble(OVERLAY_CHROMA_FACTOR, 1d);
// style handling
boolean styleUpdated = false;
if (style != null && !style.isEmpty()) {
for (CharSequence value : mThemeStylePref.getEntryValues()) {
if (value.toString().equals(style)) {
styleUpdated = true;
break;
}
}
if (styleUpdated) {
updateListByValue(mThemeStylePref, style);
}
}
if (!styleUpdated) {
updateListByValue(mThemeStylePref,
mThemeStylePref.getEntryValues()[0].toString());
}
// color handling
final String sourceVal = (source == null || source.isEmpty() ||
(source.equals(COLOR_SOURCE_HOME) && both)) ? "both" : source;
updateListByValue(mColorSourcePref, sourceVal);
final boolean enabled = updateAccentEnablement(sourceVal);
if (enabled && color != null && !color.isEmpty()) {
mAccentColorPref.setNewPreviewColor(
ColorPickerPreference.convertToColorInt(color));
}
final boolean bgEnabled = enabled && bgColor != 0;
if (bgEnabled) {
mBgColorPref.setNewPreviewColor(bgColor);
} else if (!enabled) {
mAccentBackgroundPref.setEnabled(false);
}
mAccentBackgroundPref.setChecked(bgEnabled);
mBgColorPref.setEnabled(bgEnabled);
// etc
int luminV = 0;
if (lumin > 1d) luminV = Math.round((lumin - 1f) * 100f);
else if (lumin < 1d) luminV = -1 * Math.round((1f - lumin) * 100f);
mLuminancePref.setValue(luminV);
int chromaV = 0;
if (chroma > 1d) chromaV = Math.round((chroma - 1f) * 100f);
else if (chroma < 1d) chromaV = -1 * Math.round((1f - chroma) * 100f);
mChromaPref.setValue(chromaV);
mTintBackgroundPref.setChecked(tintBG);
} catch (JSONException | IllegalArgumentException ignored) {}
}
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
final ContentResolver resolver = getActivity().getContentResolver();
if (preference == mThemeStylePref) {
String value = (String) newValue;
setStyleValue(value);
updateListByValue(mThemeStylePref, value, false);
return true;
} else if (preference == mColorSourcePref) {
String value = (String) newValue;
setSourceValue(value);
updateListByValue(mColorSourcePref, value, false);
updateAccentEnablement(value);
return true;
} else if (preference == mAccentColorPref) {
int value = (Integer) newValue;
setColorValue(value);
return true;
} else if (preference == mAccentBackgroundPref) {
boolean value = (Boolean) newValue;
if (!value) setBgColorValue(0);
mBgColorPref.setEnabled(value);
return true;
} else if (preference == mBgColorPref) {
int value = (Integer) newValue;
setBgColorValue(value);
return true;
} else if (preference == mLuminancePref) {
int value = (Integer) newValue;
setLuminanceValue(value);
return true;
} else if (preference == mChromaPref) {
int value = (Integer) newValue;
setChromaValue(value);
return true;
} else if (preference == mTintBackgroundPref) {
boolean value = (Boolean) newValue;
setTintBackgroundValue(value);
return true;
}
return false;
}
private void updateListByValue(ListPreference pref, String value) {
updateListByValue(pref, value, true);
}
private void updateListByValue(ListPreference pref, String value, boolean set) {
if (set) pref.setValue(value);
final int index = pref.findIndexOfValue(value);
pref.setSummary(pref.getEntries()[index]);
}
private boolean updateAccentEnablement(String source) {
final boolean shouldEnable = source != null && source.equals(COLOR_SOURCE_PRESET);
mAccentColorPref.setEnabled(shouldEnable);
mAccentBackgroundPref.setEnabled(shouldEnable);
if (!shouldEnable) {
mBgColorPref.setEnabled(false);
mAccentBackgroundPref.setEnabled(false);
mAccentBackgroundPref.setChecked(false);
}
return shouldEnable;
}
private JSONObject getSettingsJson() throws JSONException {
final String overlayPackageJson = Settings.Secure.getStringForUser(
getActivity().getContentResolver(),
Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
UserHandle.USER_CURRENT);
JSONObject object;
if (overlayPackageJson == null || overlayPackageJson.isEmpty())
return new JSONObject();
return new JSONObject(overlayPackageJson);
}
private void putSettingsJson(JSONObject object) {
Settings.Secure.putStringForUser(
getActivity().getContentResolver(),
Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES,
object.toString(), UserHandle.USER_CURRENT);
}
private void setStyleValue(String style) {
try {
JSONObject object = getSettingsJson();
object.putOpt(OVERLAY_CATEGORY_THEME_STYLE, style);
putSettingsJson(object);
} catch (JSONException | IllegalArgumentException ignored) {}
}
private void setSourceValue(String source) {
try {
JSONObject object = getSettingsJson();
if (source.equals("both")) {
object.putOpt(OVERLAY_COLOR_BOTH, 1);
object.putOpt(OVERLAY_COLOR_SOURCE, COLOR_SOURCE_HOME);
} else {
object.remove(OVERLAY_COLOR_BOTH);
object.putOpt(OVERLAY_COLOR_SOURCE, source);
}
if (!source.equals(COLOR_SOURCE_PRESET)) {
object.remove(OVERLAY_CATEGORY_ACCENT_COLOR);
object.remove(OVERLAY_CATEGORY_SYSTEM_PALETTE);
}
putSettingsJson(object);
} catch (JSONException | IllegalArgumentException ignored) {}
}
private void setColorValue(int color) {
try {
JSONObject object = getSettingsJson();
final String rgbColor = ColorPickerPreference.convertToRGB(color).replace("#", "");
object.putOpt(OVERLAY_CATEGORY_ACCENT_COLOR, rgbColor);
object.putOpt(OVERLAY_CATEGORY_SYSTEM_PALETTE, rgbColor);
object.putOpt(OVERLAY_COLOR_SOURCE, COLOR_SOURCE_PRESET);
putSettingsJson(object);
} catch (JSONException | IllegalArgumentException ignored) {}
}
private void setBgColorValue(int color) {
try {
JSONObject object = getSettingsJson();
if (color != 0) object.putOpt(OVERLAY_CATEGORY_BG_COLOR, color);
else object.remove(OVERLAY_CATEGORY_BG_COLOR);
putSettingsJson(object);
} catch (JSONException | IllegalArgumentException ignored) {}
}
private void setLuminanceValue(int lumin) {
try {
JSONObject object = getSettingsJson();
if (lumin == 0)
object.remove(OVERLAY_LUMINANCE_FACTOR);
else
object.putOpt(OVERLAY_LUMINANCE_FACTOR, 1d + ((double) lumin / 100d));
putSettingsJson(object);
} catch (JSONException | IllegalArgumentException ignored) {}
}
private void setChromaValue(int chroma) {
try {
JSONObject object = getSettingsJson();
if (chroma == 0)
object.remove(OVERLAY_CHROMA_FACTOR);
else
object.putOpt(OVERLAY_CHROMA_FACTOR, 1d + ((double) chroma / 100d));
putSettingsJson(object);
} catch (JSONException | IllegalArgumentException ignored) {}
}
private void setTintBackgroundValue(boolean tint) {
try {
JSONObject object = getSettingsJson();
if (!tint) object.remove(OVERLAY_TINT_BACKGROUND);
else object.putOpt(OVERLAY_TINT_BACKGROUND, 1);
putSettingsJson(object);
} catch (JSONException | IllegalArgumentException ignored) {}
}
@Override
public int getMetricsCategory() {
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
}
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.monet_settings);
}

View File

@@ -1,171 +0,0 @@
/*
* Copyright (C) 2022 The Nameless-AOSP Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.cherish.settings.fragments;
import android.content.Context;
import android.os.Bundle;
import android.os.UserHandle;
import android.provider.Settings;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import androidx.preference.Preference;
import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.util.systemui.qs.QSLayoutUtils;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settingslib.widget.LayoutPreference;
import com.cherish.settings.preferences.CustomSeekBarPreference;
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
public class QsTileLayoutSettings extends SettingsPreferenceFragment
implements Preference.OnPreferenceChangeListener {
private static final String KEY_QS_HIDE_LABEL = "qs_tile_label_hide";
private static final String KEY_QS_VERTICAL_LAYOUT = "qs_tile_vertical_layout";
private static final String KEY_QS_COLUMN_PORTRAIT = "qs_layout_columns";
private static final String KEY_QS_ROW_PORTRAIT = "qs_layout_rows";
private static final String KEY_QQS_ROW_PORTRAIT = "qqs_layout_rows";
private static final String KEY_APPLY_CHANGE_BUTTON = "apply_change_button";
private Context mContext;
private CustomSeekBarPreference mQsColumns;
private CustomSeekBarPreference mQsRows;
private CustomSeekBarPreference mQqsRows;
private Button mApplyChange;
private SystemSettingSwitchPreference mHide;
private SystemSettingSwitchPreference mVertical;
private int[] currentValue = new int[2];
@Override
public void onCreate(Bundle savedInstance) {
super.onCreate(savedInstance);
addPreferencesFromResource(R.xml.qs_tile_layout);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mQsColumns = (CustomSeekBarPreference) findPreference(KEY_QS_COLUMN_PORTRAIT);
mQsColumns.setOnPreferenceChangeListener(this);
mQsRows = (CustomSeekBarPreference) findPreference(KEY_QS_ROW_PORTRAIT);
mQsRows.setOnPreferenceChangeListener(this);
mQqsRows = (CustomSeekBarPreference) findPreference(KEY_QQS_ROW_PORTRAIT);
mQqsRows.setOnPreferenceChangeListener(this);
mContext = getContext();
LayoutPreference preference = findPreference(KEY_APPLY_CHANGE_BUTTON);
mApplyChange = (Button) preference.findViewById(R.id.apply_change);
mApplyChange.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mApplyChange.isEnabled()) {
final int[] newValue = {
mQsRows.getValue() * 10 + mQsColumns.getValue(),
mQqsRows.getValue() * 10 + mQsColumns.getValue()
};
Settings.System.putIntForUser(getContentResolver(),
Settings.System.QS_LAYOUT, newValue[0], UserHandle.USER_CURRENT);
Settings.System.putIntForUser(getContentResolver(),
Settings.System.QQS_LAYOUT, newValue[1], UserHandle.USER_CURRENT);
if (QSLayoutUtils.updateLayout(mContext)) {
currentValue[0] = newValue[0];
currentValue[1] = newValue[1];
mApplyChange.setEnabled(false);
} else {
Settings.System.putIntForUser(getContentResolver(),
Settings.System.QS_LAYOUT, currentValue[0], UserHandle.USER_CURRENT);
Settings.System.putIntForUser(getContentResolver(),
Settings.System.QQS_LAYOUT, currentValue[1], UserHandle.USER_CURRENT);
Toast.makeText(mContext, R.string.qs_apply_change_failed, Toast.LENGTH_LONG).show();
}
}
}
});
initPreference();
final boolean hideLabel = Settings.System.getIntForUser(getContentResolver(),
Settings.System.QS_TILE_LABEL_HIDE, 0, UserHandle.USER_CURRENT) == 1;
mHide = (SystemSettingSwitchPreference) findPreference(KEY_QS_HIDE_LABEL);
mHide.setOnPreferenceChangeListener(this);
mVertical = (SystemSettingSwitchPreference) findPreference(KEY_QS_VERTICAL_LAYOUT);
mVertical.setEnabled(!hideLabel);
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
if (preference == mHide) {
boolean hideLabel = (Boolean) newValue;
mVertical.setEnabled(!hideLabel);
} else if (preference == mQsColumns) {
int qs_columns = Integer.parseInt(newValue.toString());
mApplyChange.setEnabled(
currentValue[0] != mQsRows.getValue() * 10 + qs_columns ||
currentValue[1] != mQqsRows.getValue() * 10 + qs_columns
);
} else if (preference == mQsRows) {
int qs_rows = Integer.parseInt(newValue.toString());
mQqsRows.setMax(qs_rows - 1);
if (mQqsRows.getValue() > qs_rows - 1) {
mQqsRows.setValue(qs_rows - 1);
}
mApplyChange.setEnabled(
currentValue[0] != qs_rows * 10 + mQsColumns.getValue() ||
currentValue[1] != mQqsRows.getValue() * 10 + mQsColumns.getValue()
);
} else if (preference == mQqsRows) {
int qqs_rows = Integer.parseInt(newValue.toString());
mApplyChange.setEnabled(
currentValue[0] != mQsRows.getValue() * 10 + mQsColumns.getValue() ||
currentValue[1] != qqs_rows * 10 + mQsColumns.getValue()
);
}
return true;
}
@Override
public int getMetricsCategory() {
return MetricsProto.MetricsEvent.CHERISH_SETTINGS;
}
private void initPreference() {
final int index_qs = Settings.System.getIntForUser(getContentResolver(),
Settings.System.QS_LAYOUT, 42, UserHandle.USER_CURRENT);
final int index_qqs = Settings.System.getIntForUser(getContentResolver(),
Settings.System.QQS_LAYOUT, 22, UserHandle.USER_CURRENT);
mQsColumns.setValue(index_qs % 10);
mQsRows.setValue(index_qs / 10);
mQqsRows.setValue(index_qqs / 10);
mQqsRows.setMax(mQsRows.getValue() - 1);
currentValue[0] = index_qs;
currentValue[1] = index_qqs;
}
}

View File

@@ -109,6 +109,10 @@ public class StatusBarBattery extends SettingsPreferenceFragment
Settings.System.STATUS_BAR_SHOW_BATTERY_PERCENT, 0, UserHandle.USER_CURRENT); Settings.System.STATUS_BAR_SHOW_BATTERY_PERCENT, 0, UserHandle.USER_CURRENT);
Settings.System.putIntForUser(resolver, Settings.System.putIntForUser(resolver,
Settings.System.STATUS_BAR_BATTERY_TEXT_CHARGING, 1, UserHandle.USER_CURRENT); Settings.System.STATUS_BAR_BATTERY_TEXT_CHARGING, 1, UserHandle.USER_CURRENT);
Settings.System.putIntForUser(resolver,
Settings.System.QS_BATTERY_STYLE, -1, UserHandle.USER_CURRENT);
Settings.System.putIntForUser(resolver,
Settings.System.QS_SHOW_BATTERY_PERCENT, 2, UserHandle.USER_CURRENT);
} }
@Override @Override

View File

@@ -20,23 +20,29 @@ import androidx.preference.PreferenceFragment;
import androidx.preference.SwitchPreference; import androidx.preference.SwitchPreference;
import android.provider.Settings; import android.provider.Settings;
import com.android.settings.R; import com.android.settings.R;
import android.content.DialogInterface;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import java.util.Locale; import java.util.Locale;
import android.os.SystemProperties;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import com.android.settings.SettingsPreferenceFragment;
import com.cherish.settings.preferences.CustomSeekBarPreference;
import com.cherish.settings.preferences.SystemSettingSeekBarPreference;
import com.cherish.settings.preferences.SystemSettingListPreference;
import com.cherish.settings.preferences.SystemSettingSwitchPreference; import com.cherish.settings.preferences.SystemSettingSwitchPreference;
import com.cherish.settings.preferences.SystemSettingMasterSwitchPreference; import com.cherish.settings.preferences.SystemSettingSeekBarPreference;
import com.cherish.settings.preferences.SecureSettingSwitchPreference;
import com.cherish.settings.preferences.SystemSettingListPreference;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settingslib.development.SystemPropPoker;
import com.cherish.settings.preferences.SystemSettingSeekBarPreference;
import com.android.settings.Utils; import com.android.settings.Utils;
import com.android.internal.util.cherish.CherishUtils; import com.android.internal.util.cherish.CherishUtils;
import android.util.Log; import android.util.Log;
import com.android.settings.search.BaseSearchIndexProvider; import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable; import com.android.settingslib.search.SearchIndexable;
import android.provider.SearchIndexableResource; import android.provider.SearchIndexableResource;
import com.android.settings.SettingsPreferenceFragment;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
@@ -46,16 +52,12 @@ import java.util.Collections;
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class StatusBarSettings extends SettingsPreferenceFragment implements public class StatusBarSettings extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener { OnPreferenceChangeListener {
private static final String VOLTE_ICON_STYLE = "volte_icon_style"; private static final String KEY_COMBINED_SIGNAL_ICONS = "enable_combined_signal_icons";
private static final String VOWIFI_ICON_STYLE = "vowifi_icon_style"; private static final String SYS_COMBINED_SIGNAL_ICONS = "persist.sys.enable.combined_signal_icons";
private Preference mCombinedSignalIcons; private SwitchPreference mCombinedSignalIcons;
private SystemSettingListPreference mVolteIconStyle;
private SystemSettingListPreference mVowifiIconStyle;
@Override @Override
public void onCreate(Bundle icicle) { public void onCreate(Bundle icicle) {
super.onCreate(icicle); super.onCreate(icicle);
@@ -65,43 +67,23 @@ public class StatusBarSettings extends SettingsPreferenceFragment implements
ContentResolver resolver = getActivity().getContentResolver(); ContentResolver resolver = getActivity().getContentResolver();
PreferenceScreen prefSet = getPreferenceScreen(); PreferenceScreen prefSet = getPreferenceScreen();
mVowifiIconStyle = (SystemSettingListPreference) findPreference(VOWIFI_ICON_STYLE);
mVolteIconStyle = (SystemSettingListPreference) findPreference(VOLTE_ICON_STYLE); mCombinedSignalIcons = (SwitchPreference) findPreference(KEY_COMBINED_SIGNAL_ICONS);
mCombinedSignalIcons.setChecked(SystemProperties.getBoolean(SYS_COMBINED_SIGNAL_ICONS, false));
int vowifiIconStyle = Settings.System.getInt(getActivity().getContentResolver(),
Settings.System.VOWIFI_ICON_STYLE, 1);
mVowifiIconStyle.setValue(String.valueOf(vowifiIconStyle));
mVowifiIconStyle.setOnPreferenceChangeListener(this);
if (vowifiIconStyle == 0) {
mVolteIconStyle.setEnabled(true);
} else {
mVolteIconStyle.setEnabled(false);
}
mCombinedSignalIcons = findPreference("persist.sys.flags.combined_signal_icons");
mCombinedSignalIcons.setOnPreferenceChangeListener(this); mCombinedSignalIcons.setOnPreferenceChangeListener(this);
} }
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object objValue) {
ContentResolver resolver = getActivity().getContentResolver(); ContentResolver resolver = getActivity().getContentResolver();
if (preference == mVowifiIconStyle) { if (preference == mCombinedSignalIcons) {
int vowifiIconStyle = Integer.parseInt(((String) newValue).toString()); boolean value = (Boolean) objValue;
Settings.System.putInt(resolver,
Settings.System.VOWIFI_ICON_STYLE, vowifiIconStyle);
mVowifiIconStyle.setValue(String.valueOf(vowifiIconStyle));
if (vowifiIconStyle == 0) {
mVolteIconStyle.setEnabled(true);
} else {
mVolteIconStyle.setEnabled(false);
}
return true;
} else if (preference == mCombinedSignalIcons) {
boolean value = (Boolean) newValue;
Settings.Secure.putIntForUser(getContentResolver(), Settings.Secure.putIntForUser(getContentResolver(),
Settings.Secure.ENABLE_COMBINED_SIGNAL_ICONS, value ? 1 : 0, UserHandle.USER_CURRENT); Settings.Secure.ENABLE_COMBINED_SIGNAL_ICONS, value ? 1 : 0, UserHandle.USER_CURRENT);
SystemProperties.set(SYS_COMBINED_SIGNAL_ICONS, value ? "true" : "false");
SystemPropPoker.getInstance().poke();
return true; return true;
} }
return false; return false;
} }

View File

@@ -16,6 +16,16 @@
package com.cherish.settings.fragments; package com.cherish.settings.fragments;
import android.app.Activity; import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.BitmapDrawable;
import android.os.UserHandle;
import android.os.ParcelFileDescriptor;
import com.cherish.settings.fragments.UdfpsIconPicker;
import android.text.TextUtils;
import android.app.WallpaperManager; import android.app.WallpaperManager;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
@@ -35,61 +45,124 @@ import androidx.preference.PreferenceFragment;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference; import androidx.preference.SwitchPreference;
import com.cherish.settings.preferences.SystemSettingSwitchPreference;
import com.android.internal.logging.nano.MetricsProto; import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.util.cherish.CherishUtils; import com.android.internal.util.cherish.CherishUtils;
import com.android.internal.util.cherish.udfps.UdfpsUtils;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment; import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.search.BaseSearchIndexProvider; import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable; import com.android.settingslib.search.SearchIndexable;
import java.io.FileDescriptor;
import java.util.Arrays;
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC) @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class Udfps extends SettingsPreferenceFragment implements public class Udfps extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener { Preference.OnPreferenceChangeListener {
private static final String UDFPS_ICON_PICKER = "udfps_icon_picker"; private static final String UDFPS_CUSTOMIZATION = "udfps_customization";
private static final String UDFPS_ANIM_PREVIEW = "udfps_recognizing_animation_preview"; private static final String CUSTOM_FOD_ICON_KEY = "custom_fp_icon_enabled";
private static final String CUSTOM_FP_FILE_SELECT = "custom_fp_file_select";
private static final int REQUEST_PICK_IMAGE = 0;
private PreferenceCategory mUdfpsCustomization;
private Preference mCustomFPImage;
private SystemSettingSwitchPreference mCustomFodIcon;
private Preference mUdfpsIconPicker; private Preference mUdfpsIconPicker;
private Preference mUdfpsAnimPreview;
private static final String UDFPS_CATEGORY = "udfps_category";
private PreferenceCategory mUdfpsCategory;
@Override @Override
public void onCreate(Bundle icicle) { public void onCreate(Bundle icicle) {
super.onCreate(icicle); super.onCreate(icicle);
addPreferencesFromResource(R.xml.cherish_settings_udfps); addPreferencesFromResource(R.xml.cherish_settings_udfps);
ContentResolver resolver = getActivity().getContentResolver();
final PreferenceScreen prefSet = getPreferenceScreen(); final PreferenceScreen prefSet = getPreferenceScreen();
Resources resources = getResources(); Resources resources = getResources();
mUdfpsCategory = findPreference(UDFPS_CATEGORY);
if (!UdfpsUtils.hasUdfpsSupport(getContext())) {
prefSet.removePreference(mUdfpsCategory);
}
final boolean udfpsResPkgInstalled = CherishUtils.isPackageInstalled(getContext(), final boolean udfpsResPkgInstalled = CherishUtils.isPackageInstalled(getContext(),
"com.cherish.udfps.resources"); "com.cherish.udfps.resources");
mUdfpsIconPicker = findPreference(UDFPS_ICON_PICKER); mUdfpsCustomization = (PreferenceCategory) findPreference(UDFPS_CUSTOMIZATION);
mUdfpsAnimPreview = findPreference(UDFPS_ANIM_PREVIEW);
if (!udfpsResPkgInstalled) { if (!udfpsResPkgInstalled) {
prefSet.removePreference(mUdfpsIconPicker); prefSet.removePreference(mUdfpsCustomization);
prefSet.removePreference(mUdfpsAnimPreview); }
mUdfpsIconPicker = (Preference) prefSet.findPreference("udfps_icon_picker");
mCustomFPImage = findPreference(CUSTOM_FP_FILE_SELECT);
final String customIconURI = Settings.System.getString(getContext().getContentResolver(),
Settings.System.OMNI_CUSTOM_FP_ICON);
if (!TextUtils.isEmpty(customIconURI)) {
setPickerIcon(customIconURI);
} }
mCustomFodIcon = (SystemSettingSwitchPreference) findPreference(CUSTOM_FOD_ICON_KEY);
boolean val = Settings.System.getIntForUser(getActivity().getContentResolver(),
Settings.System.OMNI_CUSTOM_FP_ICON_ENABLED, 0, UserHandle.USER_CURRENT) == 1;
mCustomFodIcon.setOnPreferenceChangeListener(this);
if (val) {
mUdfpsIconPicker.setEnabled(false);
} else {
mUdfpsIconPicker.setEnabled(true);
}
} }
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newValue) { public boolean onPreferenceChange(Preference preference, Object newValue) {
ContentResolver resolver = getActivity().getContentResolver(); ContentResolver resolver = getActivity().getContentResolver();
if (preference == mCustomFodIcon) {
boolean val = (Boolean) newValue;
Settings.System.putIntForUser(getActivity().getContentResolver(),
Settings.System.OMNI_CUSTOM_FP_ICON_ENABLED, val ? 1 : 0,
UserHandle.USER_CURRENT);
if (val) {
mUdfpsIconPicker.setEnabled(false);
} else {
mUdfpsIconPicker.setEnabled(true);
}
return true;
}
return false; return false;
} }
@Override
public boolean onPreferenceTreeClick(Preference preference) {
if (preference == mCustomFPImage) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, REQUEST_PICK_IMAGE);
return true;
}
return super.onPreferenceTreeClick(preference);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent result) {
if (requestCode == REQUEST_PICK_IMAGE && resultCode == Activity.RESULT_OK) {
Uri uri = null;
if (result != null) {
uri = result.getData();
setPickerIcon(uri.toString());
Settings.System.putString(getContentResolver(), Settings.System.OMNI_CUSTOM_FP_ICON,
uri.toString());
}
} else if (requestCode == REQUEST_PICK_IMAGE && resultCode == Activity.RESULT_CANCELED) {
mCustomFPImage.setIcon(new ColorDrawable(Color.TRANSPARENT));
Settings.System.putString(getContentResolver(), Settings.System.OMNI_CUSTOM_FP_ICON, "");
}
}
private void setPickerIcon(String uri) {
try {
ParcelFileDescriptor parcelFileDescriptor =
getContext().getContentResolver().openFileDescriptor(Uri.parse(uri), "r");
FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
Bitmap image = BitmapFactory.decodeFileDescriptor(fileDescriptor);
parcelFileDescriptor.close();
Drawable d = new BitmapDrawable(getResources(), image);
mCustomFPImage.setIcon(d);
}
catch (Exception e) {}
}
@Override @Override
public int getMetricsCategory() { public int getMetricsCategory() {
return MetricsProto.MetricsEvent.CHERISH_SETTINGS; return MetricsProto.MetricsEvent.CHERISH_SETTINGS;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 ColtsOS Project * Copyright (C) 2021 AospExtended ROM Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.cherish.settings.fragments; package com.cherish.settings.fragments;
import android.content.ContentResolver; import android.content.ContentResolver;
@@ -134,7 +133,7 @@ public class UdfpsAnimation extends SettingsPreferenceFragment implements
Settings.System.UDFPS_ANIM, 0) == 1; Settings.System.UDFPS_ANIM, 0) == 1;
mSwitch.setChecked(mEnabled); mSwitch.setChecked(mEnabled);
setEnabled(mEnabled); setEnabled(mEnabled);
switchBar.setTitle(getActivity().getString(R.string.enable)); switchBar.setTitle(getActivity().getString(R.string.udfps_recog_animation));
switchBar.addOnSwitchChangeListener(this); switchBar.addOnSwitchChangeListener(this);
switchBar.show(); switchBar.show();
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2022 ColtOS Project * Copyright (C) 2021 AospExtended ROM Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.cherish.settings.fragments; package com.cherish.settings.fragments;
import android.content.ContentResolver; import android.content.ContentResolver;

View File

@@ -0,0 +1,210 @@
/*
* Copyright (C) 2021 AospExtended ROM Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments;
import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.net.Uri;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.res.ResourcesCompat;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceViewHolder;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.Indexable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;
public class UdfpsPressedIconPicker extends SettingsPreferenceFragment {
private RecyclerView mRecyclerView;
private Resources udfpsRes;
private String mPkg = "com.cherish.udfps.resources";
private String[] mIcons;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActivity().setTitle(R.string.udfps_pressed_color_title);
loadResources();
}
private void loadResources() {
try {
PackageManager pm = getActivity().getPackageManager();
udfpsRes = pm.getResourcesForApplication(mPkg);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
mIcons = udfpsRes.getStringArray(udfpsRes.getIdentifier("udfps_pressedicons",
"array", mPkg));
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(
R.layout.item_view, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 3);
mRecyclerView.setLayoutManager(gridLayoutManager);
UdfpsPressedIconAdapter mUdfpsPressedIconAdapter = new UdfpsPressedIconAdapter(getActivity());
mRecyclerView.setAdapter(mUdfpsPressedIconAdapter);
return view;
}
@Override
public int getMetricsCategory() {
return MetricsEvent.CHERISH_SETTINGS;
}
@Override
public void onResume() {
super.onResume();
}
public class UdfpsPressedIconAdapter extends RecyclerView.Adapter<UdfpsPressedIconAdapter.UdfpsPressedIconViewHolder> {
Context context;
String mSelectedIcon;
String mAppliedIcon;
public UdfpsPressedIconAdapter(Context context) {
this.context = context;
}
@Override
public UdfpsPressedIconViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_option, parent, false);
UdfpsPressedIconViewHolder vh = new UdfpsPressedIconViewHolder(v);
return vh;
}
@Override
public void onBindViewHolder(UdfpsPressedIconViewHolder holder, final int position) {
String iconRes = mIcons[position];
Glide.with(holder.image.getContext())
.load("")
.placeholder(getDrawable(holder.image.getContext(), mIcons[position]))
.into(holder.image);
holder.image.setPadding(20,20,20,20);
holder.name.setVisibility(View.GONE);
if (position == Settings.System.getInt(context.getContentResolver(),
Settings.System.UDFPS_COLOR, 0)) {
mAppliedIcon = iconRes;
if (mSelectedIcon == null) {
mSelectedIcon = iconRes;
}
}
holder.itemView.setActivated(iconRes == mSelectedIcon);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
updateActivatedStatus(mSelectedIcon, false);
updateActivatedStatus(iconRes, true);
mSelectedIcon = iconRes;
Settings.System.putInt(getActivity().getContentResolver(),
Settings.System.UDFPS_COLOR, position);
}
});
}
@Override
public int getItemCount() {
return mIcons.length;
}
public class UdfpsPressedIconViewHolder extends RecyclerView.ViewHolder {
TextView name;
ImageView image;
public UdfpsPressedIconViewHolder(View itemView) {
super(itemView);
name = (TextView) itemView.findViewById(R.id.option_label);
image = (ImageView) itemView.findViewById(R.id.option_thumbnail);
}
}
private void updateActivatedStatus(String icon, boolean isActivated) {
int index = Arrays.asList(mIcons).indexOf(icon);
if (index < 0) {
return;
}
RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(index);
if (holder != null && holder.itemView != null) {
holder.itemView.setActivated(isActivated);
}
}
}
public Drawable getDrawable(Context context, String drawableName) {
try {
PackageManager pm = context.getPackageManager();
Resources res = pm.getResourcesForApplication(mPkg);
Context ctx = context.createPackageContext(
mPkg, Context.CONTEXT_IGNORE_SECURITY);
return ctx.getDrawable(res.getIdentifier(drawableName, "drawable", mPkg));
}
catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return null;
}
}

View File

@@ -0,0 +1,264 @@
/*
* Copyright (C) 2021 AospExtended ROM Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.fragments.ui;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;
import android.text.TextUtils;
import androidx.preference.PreferenceViewHolder;
import android.view.ViewGroup.LayoutParams;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
import androidx.recyclerview.widget.RecyclerView;
import android.net.Uri;
import androidx.core.content.res.ResourcesCompat;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceScreen;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.Indexable;
import com.android.settings.SettingsPreferenceFragment;
import com.android.internal.util.cherish.ThemeUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Arrays;
import org.json.JSONObject;
import org.json.JSONException;
public class UIStyles extends SettingsPreferenceFragment {
private RecyclerView mRecyclerView;
private ThemeUtils mThemeUtils;
private String mCategory = "android.theme.customization.style.android";
private List<String> mPkgs;
private ExecutorService mExecutor = Executors.newSingleThreadExecutor();
private Handler mHandler = new Handler();
private final AtomicBoolean mApplyingOverlays = new AtomicBoolean(false);
Map<String, String> overlayMap = new HashMap<String, String>();
{
overlayMap.put("com.android.settings", "android.theme.customization.style.settings");
overlayMap.put("com.android.systemui", "android.theme.customization.style.systemui");
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActivity().setTitle(R.string.theme_customization_ui_style_title);
mThemeUtils = new ThemeUtils(getActivity());
mPkgs = mThemeUtils.getOverlayPackagesForCategory(mCategory, "android");
Collections.sort(mPkgs);
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(
R.layout.item_view, container, false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 1);
mRecyclerView.setLayoutManager(gridLayoutManager);
Adapter mAdapter = new Adapter(getActivity());
mRecyclerView.setAdapter(mAdapter);
return view;
}
@Override
public int getMetricsCategory() {
return MetricsEvent.CHERISH_SETTINGS;
}
@Override
public void onResume() {
super.onResume();
}
public class Adapter extends RecyclerView.Adapter<Adapter.CustomViewHolder> {
Context context;
String mSelectedPkg;
String mAppliedPkg;
public Adapter(Context context) {
this.context = context;
}
@Override
public CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.fonts_option, parent, false);
CustomViewHolder vh = new CustomViewHolder(v);
return vh;
}
@Override
public void onBindViewHolder(CustomViewHolder holder, final int position) {
String pkg = mPkgs.get(position);
String label = getLabel(holder.itemView.getContext(), pkg);
String currentPackageName = mThemeUtils.getOverlayInfos(mCategory).stream()
.filter(info -> info.isEnabled())
.map(info -> info.packageName)
.findFirst()
.orElse("android");
holder.title.setText("android".equals(pkg) ? "Default" : label);
holder.title.setTextSize(20);
holder.title.setBackgroundColor(getStyleColor(holder.title.getContext(), pkg));
holder.name.setVisibility(View.GONE);
if (currentPackageName.equals(pkg)) {
mAppliedPkg = pkg;
if (mSelectedPkg == null) {
mSelectedPkg = pkg;
}
}
holder.itemView.setActivated(pkg == mSelectedPkg);
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mApplyingOverlays.get()) return;
updateActivatedStatus(mSelectedPkg, false);
updateActivatedStatus(pkg, true);
mSelectedPkg = pkg;
enableOverlays(position);
}
});
}
@Override
public int getItemCount() {
return mPkgs.size();
}
public class CustomViewHolder extends RecyclerView.ViewHolder {
TextView name;
TextView title;
public CustomViewHolder(View itemView) {
super(itemView);
title = (TextView) itemView.findViewById(R.id.option_title);
name = (TextView) itemView.findViewById(R.id.option_label);
}
}
private void updateActivatedStatus(String pkg, boolean isActivated) {
int index = mPkgs.indexOf(pkg);
if (index < 0) {
return;
}
RecyclerView.ViewHolder holder = mRecyclerView.findViewHolderForAdapterPosition(index);
if (holder != null && holder.itemView != null) {
holder.itemView.setActivated(isActivated);
}
}
}
public @ColorInt int getStyleColor(Context context, String pkg) {
try {
PackageManager pm = context.getPackageManager();
Resources res = pkg.equals("android") ? Resources.getSystem()
: pm.getResourcesForApplication(pkg);
Configuration configuration = context.getResources().getConfiguration();
boolean nightMode = (configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK)
== Configuration.UI_MODE_NIGHT_YES ? true : false;
@ColorInt int styleColor = nightMode ? res.getColor(res.getIdentifier(
"system_neutral1_900", "color", pkg), null) : res.getColor(
res.getIdentifier(
"system_neutral1_100", "color", pkg), null);
return styleColor;
}
catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
e.printStackTrace();
}
return Color.TRANSPARENT;
}
public String getLabel(Context context, String pkg) {
PackageManager pm = context.getPackageManager();
try {
return pm.getApplicationInfo(pkg, 0)
.loadLabel(pm).toString();
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
return pkg;
}
public void enableOverlays(int position) {
mApplyingOverlays.set(true);
mExecutor.execute(() -> {
mThemeUtils.setOverlayEnabled(mCategory, mPkgs.get(position));
String pattern = "android".equals(mPkgs.get(position)) ? ""
: mPkgs.get(position).split("\\.")[4];
for (Map.Entry<String, String> entry : overlayMap.entrySet()) {
enableOverlay(entry.getValue(), entry.getKey(), pattern);
}
mHandler.post(() -> mApplyingOverlays.set(false));
});
}
public void enableOverlay(String category, String target, String pattern) {
if (pattern.isEmpty()) {
mThemeUtils.setOverlayEnabled(category, "android");
return;
}
for (String pkg: mThemeUtils.getOverlayPackagesForCategory(category, target)) {
if (pkg.contains(pattern)) {
mThemeUtils.setOverlayEnabled(category, pkg);
}
}
}
}

View File

@@ -1,60 +0,0 @@
/*
* Copyright (C) 2022 Project Kaleidoscope
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.preferences;
import android.os.SystemProperties;
import android.preference.PreferenceDataStore;
public class SystemPropertiesStore extends androidx.preference.PreferenceDataStore
implements PreferenceDataStore {
public SystemPropertiesStore() {
}
public boolean getBoolean(String key, boolean defValue) {
return SystemProperties.getBoolean(key, defValue);
}
public int getInt(String key, int defValue) {
return SystemProperties.getInt(key, defValue);
}
public long getLong(String key, long defValue) {
return SystemProperties.getLong(key, defValue);
}
public String getString(String key, String defValue) {
return SystemProperties.get(key, defValue);
}
public void putBoolean(String key, boolean value) {
putString(key, value ? "1" : "0");
}
public void putInt(String key, int value) {
putString(key, Integer.toString(value));
}
public void putLong(String key, long value) {
putString(key, Long.toString(value));
}
public void putString(String key, String value) {
SystemProperties.set(key, value);
}
}

View File

@@ -1,53 +0,0 @@
/*
* Copyright (C) 2014 The CyanogenMod Project
* Copyright (C) 2017 AICP
* Copyright (C) 2022 Project Kaleidoscope
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.preferences;
import android.content.Context;
import android.util.AttributeSet;
import androidx.preference.SwitchPreference;
public class SystemPropertySwitchPreference extends SwitchPreference {
public SystemPropertySwitchPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
setPreferenceDataStore(new SystemPropertiesStore());
}
public SystemPropertySwitchPreference(Context context, AttributeSet attrs) {
super(context, attrs);
setPreferenceDataStore(new SystemPropertiesStore());
}
public SystemPropertySwitchPreference(Context context) {
super(context);
setPreferenceDataStore(new SystemPropertiesStore());
}
@Override
protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
// This is what default TwoStatePreference implementation is doing without respecting
// real default value:
//setChecked(restoreValue ? getPersistedBoolean(mChecked)
// : (Boolean) defaultValue);
// Instead, we better do
setChecked(restoreValue ? getPersistedBoolean((Boolean) defaultValue)
: (Boolean) defaultValue);
}
}

View File

@@ -0,0 +1,78 @@
/*
* Copyright (C) 2022 cherishOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.app.AppLockManager
import android.content.Context
import android.hardware.biometrics.BiometricManager
import android.hardware.biometrics.BiometricManager.Authenticators.BIOMETRIC_STRONG
import androidx.preference.Preference
import androidx.preference.PreferenceScreen
import com.cherish.settings.CherishTogglePreferenceController
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
private const val KEY = "app_lock_biometrics_allowed"
class AppLockBiometricPreferenceController(
context: Context,
private val coroutineScope: CoroutineScope
) : CherishTogglePreferenceController(context, KEY) {
private val appLockManager = context.getSystemService(AppLockManager::class.java)
private val biometricManager = context.getSystemService(BiometricManager::class.java)
private var preference: Preference? = null
private var isBiometricsAllowed = false
init {
coroutineScope.launch {
isBiometricsAllowed = withContext(Dispatchers.Default) {
appLockManager.isBiometricsAllowed()
}
preference?.let {
updateState(it)
}
}
}
override fun getAvailabilityStatus(): Int {
val result = biometricManager.canAuthenticate(BIOMETRIC_STRONG)
return if (result == BiometricManager.BIOMETRIC_SUCCESS) AVAILABLE else CONDITIONALLY_UNAVAILABLE
}
override fun isChecked() = isBiometricsAllowed
override fun setChecked(checked: Boolean): Boolean {
if (isBiometricsAllowed == checked) return false
isBiometricsAllowed = checked
coroutineScope.launch(Dispatchers.Default) {
appLockManager.setBiometricsAllowed(isBiometricsAllowed)
}
return true
}
override fun displayPreference(screen: PreferenceScreen) {
super.displayPreference(screen)
preference = screen.findPreference(preferenceKey)
}
}

View File

@@ -0,0 +1,204 @@
/*
* Copyright (C) 2014 The Android Open Source Project
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.app.Activity
import android.app.AppLockManager
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.hardware.biometrics.BiometricConstants
import android.hardware.biometrics.BiometricManager.Authenticators
import android.hardware.biometrics.BiometricPrompt
import android.hardware.biometrics.BiometricPrompt.AuthenticationCallback
import android.hardware.biometrics.PromptInfo
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.UserHandle.USER_NULL
import android.os.UserManager
import android.util.Log
import android.view.WindowManager
import androidx.fragment.app.commit
import androidx.fragment.app.FragmentActivity
import com.android.internal.widget.LockPatternUtils
import com.android.settings.R
import com.android.settings.password.BiometricFragment
import com.android.settings.password.ConfirmDeviceCredentialUtils
class AppLockCredentialActivity : FragmentActivity() {
private val handler = Handler(Looper.getMainLooper())
private lateinit var lockPatternUtils: LockPatternUtils
private lateinit var userManager: UserManager
private lateinit var appLockManager: AppLockManager
private var packageName: String? = null
private var title: String? = null
private var userId: Int = USER_NULL
private var biometricFragment: BiometricFragment? = null
private var goingToBackground = false
private var waitingForBiometricCallback = false
private val authenticationCallback = object : AuthenticationCallback() {
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
if (!goingToBackground) {
waitingForBiometricCallback = false
if (errorCode == BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED
|| errorCode == BiometricPrompt.BIOMETRIC_ERROR_CANCELED) {
finish()
}
} else if (waitingForBiometricCallback) { // goingToBackground is true
waitingForBiometricCallback = false
finish()
}
}
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
waitingForBiometricCallback = false
appLockManager.unlockPackage(packageName)
ConfirmDeviceCredentialUtils.checkForPendingIntent(this@AppLockCredentialActivity)
setResult(Activity.RESULT_OK)
finish()
}
override fun onAuthenticationFailed() {
waitingForBiometricCallback = false
}
override fun onSystemEvent(event: Int) {
if (event == BiometricConstants.BIOMETRIC_SYSTEM_EVENT_EARLY_USER_CANCEL) {
finish()
}
}
}
override protected fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.apply {
addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
statusBarColor = Color.TRANSPARENT
}
appLockManager = getSystemService(AppLockManager::class.java)
userManager = UserManager.get(this)
lockPatternUtils = LockPatternUtils(this)
packageName = intent.getStringExtra(Intent.EXTRA_PACKAGE_NAME)
if (packageName == null) {
Log.e(TAG, "Failed to get package name, aborting unlock")
finish()
return
}
title = intent.getStringExtra(AppLockManager.EXTRA_PACKAGE_LABEL)
userId = intent.getIntExtra(Intent.EXTRA_USER_ID, USER_NULL)
if (userId == USER_NULL) {
Log.e(TAG, "Invalid user id, aborting")
finish()
return
}
val biometricsAllowed = intent.getBooleanExtra(
AppLockManager.EXTRA_ALLOW_BIOMETRICS,
AppLockManager.DEFAULT_BIOMETRICS_ALLOWED
)
var authenticators = Authenticators.DEVICE_CREDENTIAL
if (biometricsAllowed) {
authenticators = authenticators or Authenticators.BIOMETRIC_STRONG
}
val promptInfo = PromptInfo().also {
it.title = getString(com.android.internal.R.string.unlock_application, title)
it.isDisallowBiometricsIfPolicyExists = true
it.authenticators = authenticators
}
if (isBiometricAllowed()) {
// Don't need to check if biometrics / pin/pattern/pass are enrolled. It will go to
// onAuthenticationError and do the right thing automatically.
showBiometricPrompt(promptInfo)
waitingForBiometricCallback = true
} else {
finish()
}
}
override protected fun onStart() {
super.onStart()
// Translucent activity that is "visible", so it doesn't complain about finish()
// not being called before onResume().
setVisible(true)
}
override fun onPause() {
super.onPause()
if (!isChangingConfigurations()) {
goingToBackground = true
if (!waitingForBiometricCallback) {
finish()
}
} else {
goingToBackground = false
}
}
// User could be locked while Effective user is unlocked even though the effective owns the
// credential. Otherwise, biometric can't unlock fbe/keystore through
// verifyTiedProfileChallenge. In such case, we also wanna show the user message that
// biometric is disabled due to device restart.
private fun isStrongAuthRequired() =
!lockPatternUtils.isBiometricAllowedForUser(userId) ||
!userManager.isUserUnlocked(userId)
private fun isBiometricAllowed() =
!isStrongAuthRequired() && !lockPatternUtils.hasPendingEscrowToken(userId)
private fun showBiometricPrompt(promptInfo: PromptInfo) {
biometricFragment = supportFragmentManager.findFragmentByTag(TAG_BIOMETRIC_FRAGMENT)
as? BiometricFragment
var newFragment = false
if (biometricFragment == null) {
biometricFragment = BiometricFragment.newInstance(promptInfo)
newFragment = true
}
biometricFragment?.also {
it.setCallbacks({
handler.post(it)
}, authenticationCallback)
it.setUser(userId)
}
if (newFragment) {
biometricFragment?.let {
supportFragmentManager.commit {
add(it, TAG_BIOMETRIC_FRAGMENT)
}
}
}
}
companion object {
private const val TAG = "AppLockCredentialActivity"
private const val TAG_BIOMETRIC_FRAGMENT = "fragment"
}
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.app.AppLockManager
import android.content.Context
import androidx.preference.Preference
import androidx.preference.PreferenceScreen
import com.cherish.settings.CherishTogglePreferenceController
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
private const val KEY = "redact_notifications"
class AppLockNotificationRedactionPC(
context: Context,
private val packageName: String,
private val coroutineScope: CoroutineScope
) : CherishTogglePreferenceController(context, KEY) {
private val appLockManager = context.getSystemService(AppLockManager::class.java)
private var shouldRedactNotification = false
private var preference: Preference? = null
init {
coroutineScope.launch {
shouldRedactNotification = withContext(Dispatchers.Default) {
appLockManager.packageData.find {
it.packageName == packageName
}?.shouldRedactNotification == true
}
preference?.let {
updateState(it)
}
}
}
override fun getAvailabilityStatus() = AVAILABLE
override fun isChecked() = shouldRedactNotification
override fun setChecked(checked: Boolean): Boolean {
if (shouldRedactNotification == checked) return false
shouldRedactNotification = checked
coroutineScope.launch(Dispatchers.Default) {
appLockManager.setShouldRedactNotification(packageName, checked)
}
return true
}
override fun displayPreference(screen: PreferenceScreen) {
super.displayPreference(screen)
preference = screen.findPreference(preferenceKey)
}
}

View File

@@ -0,0 +1,81 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.content.Context
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.os.Bundle
import androidx.lifecycle.lifecycleScope
import com.android.settings.R
import com.android.settings.widget.EntityHeaderController
import com.android.settingslib.core.AbstractPreferenceController
import com.android.settingslib.widget.LayoutPreference
import com.cherish.settings.fragments.CherishDashboardFragment
private val TAG = AppLockPackageConfigFragment::class.simpleName
private const val KEY_HEADER = "header_view"
class AppLockPackageConfigFragment : CherishDashboardFragment() {
private lateinit var pm: PackageManager
private lateinit var packageInfo: PackageInfo
override fun onAttach(context: Context) {
pm = context.packageManager
packageInfo = arguments?.getParcelable(PACKAGE_INFO, PackageInfo::class.java)!!
super.onAttach(context)
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
super.onCreatePreferences(savedInstanceState, rootKey)
val header = preferenceScreen.findPreference<LayoutPreference>(KEY_HEADER)
EntityHeaderController.newInstance(
requireActivity(),
this,
header?.findViewById(R.id.entity_header)
).setRecyclerView(listView, settingsLifecycle)
.setPackageName(packageInfo.packageName)
.setButtonActions(
EntityHeaderController.ActionType.ACTION_NONE,
EntityHeaderController.ActionType.ACTION_NONE
)
.bindHeaderButtons()
.setLabel(getLabel(packageInfo))
.setIcon(getIcon(packageInfo))
.done(requireActivity(), false /* rebindActions */)
}
private fun getLabel(packageInfo: PackageInfo) =
packageInfo.applicationInfo.loadLabel(pm).toString()
private fun getIcon(packageInfo: PackageInfo) =
packageInfo.applicationInfo.loadIcon(pm)
override protected fun createPreferenceControllers(
context: Context
) : List<AbstractPreferenceController> = listOf(
AppLockPackageProtectionPC(context, packageInfo.packageName, lifecycleScope),
AppLockNotificationRedactionPC(context, packageInfo.packageName, lifecycleScope),
)
override protected fun getPreferenceScreenResId() = R.xml.app_lock_package_config_settings
override protected fun getLogTag() = TAG
}

View File

@@ -0,0 +1,139 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.app.AppLockManager
import android.content.Context
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.content.pm.PackageManager.PackageInfoFlags
import android.os.Bundle
import android.view.View
import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import androidx.preference.forEach
import com.android.settings.R
import com.android.settings.core.SubSettingLauncher
import com.android.settingslib.PrimarySwitchPreference
import com.android.settingslib.widget.TwoTargetPreference.ICON_SIZE_SMALL
import com.cherish.settings.fragments.CherishDashboardFragment
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
private val TAG = AppLockPackageListFragment::class.simpleName
internal const val PACKAGE_INFO = "package_info"
class AppLockPackageListFragment : CherishDashboardFragment() {
private lateinit var appLockManager: AppLockManager
private lateinit var pm: PackageManager
private lateinit var whiteListedPackages: Array<String>
override fun onAttach(context: Context) {
super.onAttach(context)
appLockManager = context.getSystemService(AppLockManager::class.java)
pm = context.packageManager
whiteListedPackages = resources.getStringArray(
com.android.internal.R.array.config_appLockAllowedSystemApps)
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
super.onCreatePreferences(savedInstanceState, rootKey)
lifecycleScope.launch {
val selectedPackages = getSelectedPackages()
val preferences = withContext(Dispatchers.Default) {
pm.getInstalledPackages(
PackageInfoFlags.of(PackageManager.MATCH_ALL.toLong())
).filter {
!it.applicationInfo.isSystemApp() || whiteListedPackages.contains(it.packageName)
}.sortedWith { first, second ->
getLabel(first).compareTo(getLabel(second))
}
}.map { packageInfo ->
createPreference(packageInfo, selectedPackages.contains(packageInfo.packageName))
}
preferenceScreen?.let {
preferences.forEach { pref ->
it.addPreference(pref)
}
}
}
}
override fun onResume() {
super.onResume()
lifecycleScope.launch {
val selectedPackages = getSelectedPackages()
preferenceScreen?.forEach {
if (it is PrimarySwitchPreference) {
it.isChecked = selectedPackages.contains(it.key)
}
}
}
}
private suspend fun getSelectedPackages(): Set<String> {
return withContext(Dispatchers.IO) {
appLockManager.packageData.map { it.packageName }.toSet()
}
}
private fun getLabel(packageInfo: PackageInfo) =
packageInfo.applicationInfo.loadLabel(pm).toString()
private fun createPreference(packageInfo: PackageInfo, isProtected: Boolean): Preference {
val label = getLabel(packageInfo)
return PrimarySwitchPreference(requireContext()).apply {
key = packageInfo.packageName
title = label
icon = packageInfo.applicationInfo.loadIcon(pm)
setIconSize(ICON_SIZE_SMALL)
isChecked = isProtected
setOnPreferenceChangeListener { _, newValue ->
lifecycleScope.launch(Dispatchers.IO) {
if (newValue as Boolean) {
appLockManager.addPackage(packageInfo.packageName)
} else {
appLockManager.removePackage(packageInfo.packageName)
}
}
return@setOnPreferenceChangeListener true
}
setOnPreferenceClickListener {
SubSettingLauncher(requireContext())
.setDestination(AppLockPackageConfigFragment::class.qualifiedName)
.setSourceMetricsCategory(metricsCategory)
.setTitleText(label)
.setArguments(
Bundle(1).apply {
putParcelable(PACKAGE_INFO, packageInfo)
}
)
.launch()
true
}
}
}
override protected fun getPreferenceScreenResId() = R.xml.app_lock_package_list_settings
override protected fun getLogTag() = TAG
}

View File

@@ -0,0 +1,79 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.app.AppLockManager
import android.content.Context
import androidx.lifecycle.lifecycleScope
import androidx.preference.Preference
import androidx.preference.PreferenceScreen
import com.cherish.settings.CherishTogglePreferenceController
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
private const val KEY = "main_switch"
class AppLockPackageProtectionPC(
context: Context,
private val packageName: String,
private val coroutineScope: CoroutineScope
) : CherishTogglePreferenceController(context, KEY) {
private val appLockManager = context.getSystemService(AppLockManager::class.java)
private var isProtected = false
private var preference: Preference? = null
init {
coroutineScope.launch {
isProtected = withContext(Dispatchers.Default) {
appLockManager.packageData.any {
it.packageName == packageName
}
}
preference?.let {
updateState(it)
}
}
}
override fun getAvailabilityStatus() = AVAILABLE
override fun isChecked() = isProtected
override fun setChecked(checked: Boolean): Boolean {
if (isProtected == checked) return false
isProtected = checked
coroutineScope.launch(Dispatchers.Default) {
if (isProtected) {
appLockManager.addPackage(packageName)
} else {
appLockManager.removePackage(packageName)
}
}
return true
}
override fun displayPreference(screen: PreferenceScreen) {
super.displayPreference(screen)
preference = screen.findPreference(preferenceKey)
}
}

View File

@@ -0,0 +1,83 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.content.Context
import android.os.SystemProperties
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import androidx.lifecycle.lifecycleScope
import com.android.settings.R
import com.android.settings.search.BaseSearchIndexProvider
import com.android.settingslib.core.AbstractPreferenceController
import com.android.settingslib.search.SearchIndexable
import com.cherish.settings.fragments.CherishDashboardFragment
@SearchIndexable
class AppLockSettingsFragment : CherishDashboardFragment(),
MenuItem.OnMenuItemClickListener {
private var debugEnabled = SystemProperties.get(DEBUG_PROPERTY, null) == LEVEL_DEBUG
private var handledClick = false
override protected fun getPreferenceScreenResId() = R.xml.cherish_settings_app_lock
override protected fun getLogTag() = TAG
override fun onCreateOptionsMenu(menu: Menu, menuInflater: MenuInflater) {
super.onCreateOptionsMenu(menu, menuInflater)
menu.add(
0 /* groupId */,
MENU_ITEM_DEBUG_ID,
0 /* order */,
getDebugMenuItemTitle(),
).setOnMenuItemClickListener(this)
}
private fun getDebugMenuItemTitle(): Int =
if (debugEnabled) R.string.disable_debugging else R.string.enable_debugging
override fun onMenuItemClick(item: MenuItem): Boolean {
if (item.itemId == MENU_ITEM_DEBUG_ID) {
debugEnabled = !debugEnabled
SystemProperties.set(DEBUG_PROPERTY, if (debugEnabled) LEVEL_DEBUG else null)
item.setTitle(getDebugMenuItemTitle())
return true
}
return false
}
override protected fun createPreferenceControllers(
context: Context
) : List<AbstractPreferenceController> = listOf(
AppLockBiometricPreferenceController(context, lifecycleScope)
)
companion object {
private const val TAG = "AppLockSettingsFragment"
private const val DEBUG_PROPERTY = "log.tag.AppLockManagerService"
private const val LEVEL_DEBUG = "DEBUG"
private const val MENU_ITEM_DEBUG_ID = 101
@JvmField
val SEARCH_INDEX_DATA_PROVIDER = BaseSearchIndexProvider(R.xml.cherish_settings_app_lock)
}
}

View File

@@ -0,0 +1,126 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.app.Activity
import android.app.AppLockManager
import android.content.Context
import android.content.Intent
import android.os.UserHandle
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
import androidx.lifecycle.Lifecycle.Event
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import androidx.preference.Preference
import androidx.preference.PreferenceScreen
import com.android.internal.widget.LockPatternUtils
import com.android.settings.R
import com.android.settings.core.SubSettingLauncher
import com.android.settings.dashboard.DashboardFragment
import com.android.settings.password.ConfirmDeviceCredentialActivity
import com.android.settingslib.core.lifecycle.Lifecycle
import com.android.settingslib.transition.SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE
import com.android.settings.core.BasePreferenceController
import com.android.settings.SettingsActivity
import com.android.settings.core.SettingsBaseActivity
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider
class AppLockSettingsPreferenceController(
context: Context,
preferenceKey: String,
lifecycle: Lifecycle?,
private val host: DashboardFragment?
) : BasePreferenceController(context, preferenceKey),
LifecycleEventObserver {
private val lockPatternUtils = LockPatternUtils(context)
private val appLockManager = context.getSystemService(AppLockManager::class.java)
private var preference: Preference? = null
private val securityPromptLauncher: ActivityResultLauncher<Intent>?
init {
lifecycle?.addObserver(this)
securityPromptLauncher = host?.registerForActivityResult(
StartActivityForResult()
) {
if (it?.resultCode == Activity.RESULT_OK) {
val intent = SubSettingLauncher(mContext)
.setDestination(AppLockSettingsFragment::class.qualifiedName)
.setSourceMetricsCategory(host.metricsCategory)
.setTransitionType(TRANSITION_SLIDE)
.toIntent()
intent.setClass(mContext, AppLockSubSettings::class.java)
mContext.startActivity(intent)
}
}
}
override fun getAvailabilityStatus() =
if (lockPatternUtils.isSecure(UserHandle.myUserId()))
AVAILABLE
else
DISABLED_DEPENDENT_SETTING
override fun onStateChanged(owner: LifecycleOwner, event: Event) {
if (event == Event.ON_START) {
preference?.let {
updateState(it)
}
}
}
override fun displayPreference(screen: PreferenceScreen) {
super.displayPreference(screen)
preference = screen.findPreference(preferenceKey)
}
override fun updateState(preference: Preference) {
preference.apply {
if (getAvailabilityStatus() == AVAILABLE) {
setEnabled(true)
summary = getSummaryForListSize(appLockManager.packageData.size)
} else {
setEnabled(false)
summary = mContext.getString(R.string.disabled_because_no_backup_security)
}
}
}
private fun getSummaryForListSize(size: Int): CharSequence? =
if (size == 0) {
null
} else {
mContext.resources.getQuantityString(R.plurals.app_lock_summary, size, size)
}
override fun handlePreferenceTreeClick(preference: Preference): Boolean {
if (preference.key == preferenceKey && securityPromptLauncher != null) {
securityPromptLauncher.launch(
ConfirmDeviceCredentialActivity.createIntent(
mContext.getString(R.string.app_lock_authentication_dialog_title),
null /* details */,
)
)
return true
}
return super.handlePreferenceTreeClick(preference)
}
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import com.android.settings.SettingsActivity
class AppLockSubSettings : SettingsActivity() {
override protected fun isValidFragment(fragmentName: String): Boolean {
return AppLockSettingsFragment::class.qualifiedName == fragmentName
}
}

View File

@@ -0,0 +1,47 @@
/*
* Copyright (C) 2022 FlamingoOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cherish.settings.security.applock
import android.app.AppLockManager
import android.content.Context
import androidx.preference.ListPreference
import androidx.preference.Preference
import com.android.settings.core.BasePreferenceController
class AppLockTimeoutPreferenceController(
context: Context,
key: String,
) : BasePreferenceController(context, key),
Preference.OnPreferenceChangeListener {
private val appLockManager = context.getSystemService(AppLockManager::class.java)
override fun getAvailabilityStatus() = AVAILABLE
override fun updateState(preference: Preference) {
(preference as ListPreference).value = appLockManager.timeout.takeIf {
it != -1L
}?.toString()
}
override fun onPreferenceChange(preference: Preference, newValue: Any): Boolean {
appLockManager.timeout = (newValue as String).toLong()
return true
}
}

View File

@@ -96,7 +96,7 @@ public class ColorPickerPreference extends Preference implements
mAlphaSliderEnabled = attrs.getAttributeBooleanValue(null, "alphaSlider", false); mAlphaSliderEnabled = attrs.getAttributeBooleanValue(null, "alphaSlider", false);
int defVal = attrs.getAttributeIntValue(SETTINGS_NS, "defaultColorValue", DEF_VALUE_DEFAULT); int defVal = attrs.getAttributeIntValue(SETTINGS_NS, "defaultColorValue", DEF_VALUE_DEFAULT);
if (defVal != DEF_VALUE_DEFAULT) { if (defVal != DEF_VALUE_DEFAULT) {
mUsesDefaultButton = true; mUsesDefaultButton = true;
mDefValue = defVal; mDefValue = defVal;
} }
mShowLedPreview = attrs.getAttributeBooleanValue(null, "ledPreview", false); mShowLedPreview = attrs.getAttributeBooleanValue(null, "ledPreview", false);