├── Android.mk
├── README.md
├── res
├── color
│ └── option_border_color.xml
├── drawable
│ ├── ic_code.xml
│ ├── ic_customisation.xml
│ ├── ic_design.xml
│ ├── ic_devs_info.xml
│ ├── ic_devs_mention.xml
│ ├── ic_devs_pc.xml
│ ├── ic_devs_phone.xml
│ ├── ic_settings_buttons.xml
│ ├── ic_settings_lockscreen.xml
│ ├── ic_settings_misc.xml
│ ├── ic_settings_navbar.xml
│ ├── ic_settings_notifications.xml
│ ├── ic_settings_powermenu.xml
│ ├── ic_settings_quicksettings.xml
│ ├── ic_settings_statusbar.xml
│ ├── ic_settings_superior.xml
│ ├── ic_superior_about.xml
│ ├── ic_superior_gestures.xml
│ ├── icon_background.xml
│ ├── option_border_custom.xml
│ ├── option_border_edge_custom.xml
│ ├── superior_chevron_right.xml
│ ├── superior_preference_background_bottom.xml
│ ├── superior_preference_background_full.xml
│ ├── superior_preference_background_full_accent.xml
│ ├── superior_preference_background_middle.xml
│ ├── superior_preference_background_phone.xml
│ └── superior_preference_background_top.xml
├── layout
│ ├── fonts_option.xml
│ ├── headsup_preference_applist.xml
│ ├── icon_option.xml
│ ├── item_option.xml
│ ├── item_view.xml
│ ├── preference_cardview.xml
│ ├── superior_dashboard_pref.xml
│ ├── superior_dashboard_preference_bottom.xml
│ ├── superior_dashboard_preference_middle.xml
│ ├── superior_dashboard_preference_phone.xml
│ └── superior_dashboard_preference_top.xml
├── values-az
│ └── superior_strings.xml
├── values-cs
│ └── superior_strings.xml
├── values-de
│ └── superior_strings.xml
├── values-es
│ └── superior_strings.xml
├── values-in
│ └── superior_strings.xml
├── values-it
│ └── superior_strings.xml
├── values-ja
│ └── superior_strings.xml
├── values-night
│ └── superior_colors.xml
├── values-pt-rBR
│ └── superior_strings.xml
├── values-ru
│ └── superior_strings.xml
├── values-sk
│ └── superior_strings.xml
├── values-sv
│ └── superior_strings.xml
├── values-tr
│ └── superior_strings.xml
├── values-vi
│ └── superior_strings.xml
├── values-zh-rTW
│ └── superior_strings.xml
├── values
│ ├── styles.xml
│ ├── superior_arrays.xml
│ ├── superior_attrs.xml
│ ├── superior_colors.xml
│ ├── superior_dimens.xml
│ └── superior_strings.xml
└── xml
│ ├── battery_settings.xml
│ ├── clock_date_settings.xml
│ ├── customisation.xml
│ ├── heads_up_settings.xml
│ ├── monet_engine_settings.xml
│ ├── network_traffic.xml
│ ├── superior_devs_info.xml
│ ├── superior_settings.xml
│ ├── superior_settings_button.xml
│ ├── superior_settings_gestures.xml
│ ├── superior_settings_lockscreen.xml
│ ├── superior_settings_misc.xml
│ ├── superior_settings_navbar.xml
│ ├── superior_settings_notifications.xml
│ ├── superior_settings_powermenu.xml
│ ├── superior_settings_quicksettings.xml
│ ├── superior_settings_statusbar.xml
│ └── visualizer_settings.xml
└── src
└── com
├── android
└── settings
│ └── custom
│ └── SuperiorDevsInfoFragment.java
└── superior
└── settings
├── SuperiorSettings.java
├── fragments
├── BatterySettings.java
├── ButtonSettings.java
├── ClockDateSettings.java
├── Customisation.java
├── FontsPicker.java
├── GestureSettings.java
├── HeadsUpSettings.java
├── IconShapes.java
├── LockscreenSettings.java
├── MiscSettings.java
├── MonetSettings.java
├── NavbarSettings.java
├── NetworkTraffic.java
├── NotificationSettings.java
├── PowermenuSettings.java
├── QuickSettings.java
├── SignalIcons.java
├── StatusbarIcons.java
├── StatusbarSettings.java
├── Visualizer.java
└── WifiIcons.java
└── preferences
└── CardviewPreference.java
/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Superiorsettings:
2 | ================
3 |
4 |
5 |
6 |
7 | What is Superiorsettings:
8 | ------------------------
9 |
10 | **Superiorsettings** Is The Feature Centre of **Superior OS** [ We call it **Superior Goodies** ], This Tab Contains All The Features / Tweaks Which Are Added To Superior OS.
11 |
12 | Under **Superior Goodies** U can find All Your Needed Fatures In Their Respective Tabs.
13 |
14 |
15 |
16 | Credits:
17 | -------
18 | * [**Alexey Derendyaev**](https://github.com/alexxxdev) - For the Base.
19 | * [**Max**](https://github.com/xyyx) - For the Idea about tabs & drawables.
20 | * [**Rohit Poroli**](https://github.com/rohitporoli) - For the About ROM Tab.
21 | * [**Sam Grande**](https://github.com/samgrande) - For the About ROM banner.
22 | * [**DarkNess reDefined ROM**](https://github.com/DarkNess-reDefined) - For some drawables.
--------------------------------------------------------------------------------
/res/color/option_border_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
18 |
22 |
25 |
26 |
--------------------------------------------------------------------------------
/res/drawable/ic_code.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/res/drawable/ic_customisation.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
22 |
25 |
26 |
--------------------------------------------------------------------------------
/res/drawable/ic_design.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
14 |
15 |
--------------------------------------------------------------------------------
/res/drawable/ic_devs_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
24 |
--------------------------------------------------------------------------------
/res/drawable/ic_devs_mention.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
27 |
28 |
--------------------------------------------------------------------------------
/res/drawable/ic_devs_pc.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
24 |
27 |
30 |
33 |
--------------------------------------------------------------------------------
/res/drawable/ic_devs_phone.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_buttons.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_lockscreen.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
25 |
26 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
25 |
26 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_navbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_notifications.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
34 |
35 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_powermenu.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
25 |
26 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_quicksettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
26 |
27 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
27 |
28 |
--------------------------------------------------------------------------------
/res/drawable/ic_settings_superior.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
22 |
25 |
--------------------------------------------------------------------------------
/res/drawable/ic_superior_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
23 |
27 |
31 |
35 |
36 |
--------------------------------------------------------------------------------
/res/drawable/ic_superior_gestures.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
22 |
31 |
32 |
--------------------------------------------------------------------------------
/res/drawable/icon_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/res/drawable/option_border_custom.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 | -
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/res/drawable/option_border_edge_custom.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 | -
16 |
17 |
20 |
21 |
22 |
23 | -
24 |
25 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/res/drawable/superior_chevron_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
19 |
20 |
22 |
25 |
26 |
--------------------------------------------------------------------------------
/res/drawable/superior_preference_background_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
16 | -
17 |
18 |
19 |
25 |
26 |
27 | -
28 |
29 |
30 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/res/drawable/superior_preference_background_full.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
16 | -
17 |
18 |
19 |
20 |
21 |
22 | -
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/drawable/superior_preference_background_full_accent.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
16 | -
17 |
18 |
19 |
20 |
21 |
22 | -
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/drawable/superior_preference_background_middle.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
16 | -
17 |
18 |
19 |
20 |
21 |
22 | -
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/drawable/superior_preference_background_phone.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
16 | -
17 |
18 |
19 |
24 |
25 |
26 | -
27 |
28 |
29 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/res/drawable/superior_preference_background_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
16 | -
17 |
18 |
19 |
24 |
25 |
26 | -
27 |
28 |
29 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/res/layout/fonts_option.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
33 |
34 |
39 |
40 |
41 |
42 |
48 |
49 |
--------------------------------------------------------------------------------
/res/layout/headsup_preference_applist.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
27 |
28 |
29 |
36 |
37 |
44 |
45 |
46 |
47 |
48 |
53 |
54 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/res/layout/icon_option.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
21 |
22 |
31 |
32 |
37 |
38 |
45 |
46 |
53 |
54 |
55 |
56 |
61 |
62 |
69 |
70 |
77 |
78 |
79 |
80 |
81 |
82 |
88 |
89 |
--------------------------------------------------------------------------------
/res/layout/item_option.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
23 |
24 |
32 |
36 |
37 |
38 |
39 |
45 |
46 |
--------------------------------------------------------------------------------
/res/layout/item_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/res/layout/preference_cardview.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
30 |
31 |
35 |
36 |
40 |
41 |
46 |
47 |
48 |
49 |
54 |
55 |
62 |
63 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/res/layout/superior_dashboard_pref.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
23 |
24 |
31 |
32 |
39 |
40 |
49 |
50 |
51 |
52 |
58 |
59 |
65 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/res/layout/superior_dashboard_preference_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/res/layout/superior_dashboard_preference_middle.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/res/layout/superior_dashboard_preference_phone.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
20 |
21 |
28 |
29 |
36 |
37 |
45 |
46 |
56 |
57 |
58 |
59 |
65 |
66 |
72 |
73 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/res/layout/superior_dashboard_preference_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/res/values-it/superior_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | Icona orizzontale (a destra)
19 | Icona orizzontale (a sinistra)
20 | Grande cerchio
21 | Grande cerchio tratteggiato
22 | Icona VoLTE
23 | Visualizza l\'icona VoLTE quando disponibile
24 | Icona VoWiFi
25 | Visualizza l\'icona VoWiFi quando disponibile
26 | Annullare VoWiFi
27 | Nascondi VoLTE quando VoWiFi è disponibile
28 |
29 |
--------------------------------------------------------------------------------
/res/values-night/superior_colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | @android:color/system_neutral1_800
20 | @android:color/system_neutral1_900
21 | @android:color/system_neutral1_800
22 | @android:color/system_accent1_200
23 |
24 |
--------------------------------------------------------------------------------
/res/values-sv/superior_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | Vakna med volymknappar
19 | Väck enheten genom att trycka på volymknapparna
20 |
21 |
--------------------------------------------------------------------------------
/res/values-vi/superior_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 | Cài đặt Superior
19 | Superior OS
20 | Thông báo
21 | Bổ sung
22 | Cử chỉ vuốt 3 ngón tay
23 | Vuốt ba ngón tay để ảnh chụp ảnh màn hình
24 | Thiết lập hệ thống
25 | Các cử chỉ gốc đi kèm với AOSP
26 | Cài đặt menu thanh điều hướng
27 | Biểu tượng thanh trạng thái
28 | Biểu tượng thanh trạng thái
29 | Tổng thể
30 | Bổ sung
31 | Biểu Tượng
32 | Nhấn đúp để tắt màn hình
33 | Trình đơn nguồn
34 | Biểu tượng 4G
35 | Hiển thị biểu tượng 4G trong cột sóng thay vì LTE
36 | Hiển thị tương tác
37 | Cử chỉ màn hình hiển thị xung quanh
38 | Hiển thị tính năng Hiển thị nhanh thay cho màn hình khoá bình thường khi sử dụng vuốt đánh thức.
39 | Nhấn đúp trên màn hình khóa
40 | Nhấn đúp vào bất kỳ đâu trên màn hình khóa để đặt điện thoại vào chế độ ngủ
41 | Nhấn đúp trên thanh trạng thái
42 | Chạm 2 lần vào thanh trạng thái để ngủ
43 | Tùy chọn rung trong cuộc gọi
44 | Rung khi kết nối
45 | Rung khi chờ cuộc gọi
46 | Rung khi ngắt kết nối
47 | Bật tắt đèn khi màn hình
48 | Đã tắt
49 | Nhấn đúp nút nguồn (phản hồi nhấn một lần chậm hơn), Tắt nhấn đúp cho máy ảnh.
50 | Bấm giữ phím nguồn
51 | Thông báo cho nhạc
52 | Hiển thị màn hình luôn bật khi một bản nhạc mới được phát
53 | Thanh trượt độ sáng
54 | Hiện thanh trượt điều chỉnh độ sáng
55 | Hiển thị thanh trượt độ sáng trong bảng cài đặt nhanh
56 | Hiển thị thanh trượt chỉnh độ sáng ở dưới
57 | Hiển thị thanh trượt độ sáng trên cài đặt nhanh phía dưới
58 | Nút độ sáng thích nghi
59 | Hiển thị nút độ sáng thích nghi
60 | Hiển thị thanh trượt độ sáng trong bảng điều khiển nhanh
61 | Hiển thị thanh trượt độ sáng trong bảng cài đặt nhanh
62 | Thông báo làm phiền
63 | Phát âm thanh và rung cho thông báo khi màn hình đang bật
64 | Thông báo nổi vừa phải
65 | Nhanh chóng tắt thông báo nổi cho tất cả các ứng dụng nhưng vẫn bật cho ứng dụng quay số và nhắn tin
66 | Nghệ thuật truyền thông
67 | Hiển thị ảnh bìa
68 | Hiển thị ảnh nền media ở màn hình khóa
69 | Mức độ mờ ảnh bìa
70 | Kéo từ cạnh trái của thanh trạng thái
71 | Thiết lập Pin
72 | Kiểu pin
73 | Chọn kiểu biểu tượng pin
74 | Phần trăm pin
75 | Kiểu biểu tượng pin
76 | Biểu tượng dọc (mặc định)
77 | Biểu tượng nằm ngang (Phải)
78 | Biểu tượng nằm ngang (Trái)
79 | Vòng tròn
80 | Vòng tròn (Chấm)
81 | Vòng tròn (Đầy)
82 | Vòng tròn lớn
83 | Vòng chấm lớn
84 | Văn bản
85 | Ẩn
86 | Tỷ lệ phần trăm pin
87 | Ẩn (mặc định)
88 | Trong biểu tượng pin
89 | Cạnh biểu tượng pin
90 | Tốc độ mạng
91 | Hiển thị tốc độ mạng trên thanh trạng thái
92 | Vị trí
93 | Thanh trạng thái
94 | Thanh trạng thái mở rộng
95 | Chế độ hiển thị
96 | Động
97 | Tải xuống
98 | Tải lên
99 | Tự động ẩn mạng (KB/s)
100 | Thời khoảng làm mới
101 | Bật khởi động lại nâng cao
102 | Hiển thị thêm mục khởi động lại vào recovery và bootloader
103 | Hiệu ứng gợn sóng
104 | Hiển thị hiệu ứng gợn sóng khi mở khóa bằng vân tay
105 | Công cụ Monet
106 |
107 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
21 |
22 |
23 |
28 |
29 |
32 |
33 |
37 |
38 |
39 |
42 |
43 |
46 |
47 |
51 |
52 |
55 |
56 |
59 |
60 |
61 |
66 |
67 |
72 |
73 |
77 |
78 |
82 |
83 |
88 |
89 |
94 |
95 |
--------------------------------------------------------------------------------
/res/values/superior_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/res/values/superior_colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | #5f6368
20 | @color/google_grey700
21 | @color/edit_background_base
22 |
23 | #1f000000
24 | @android:color/system_neutral1_10
25 | #33FFFFFF
26 | @android:color/system_neutral1_50
27 | @android:color/system_neutral1_100
28 | @android:color/system_accent1_400
29 |
30 |
31 |
--------------------------------------------------------------------------------
/res/values/superior_dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 2dp
20 | 12dp
21 | 2dp
22 | 2dp
23 | 2dp
24 | 2dp
25 |
26 | 28dp
27 | 5dp
28 | 16dp
29 | -16dp
30 |
31 |
--------------------------------------------------------------------------------
/res/xml/battery_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
18 |
19 |
27 |
28 |
35 |
36 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/res/xml/clock_date_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
18 |
19 |
23 |
24 |
31 |
32 |
39 |
40 |
45 |
46 |
53 |
54 |
60 |
61 |
67 |
68 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/res/xml/customisation.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
18 |
19 |
22 |
23 |
24 |
29 |
30 |
35 |
36 |
41 |
42 |
47 |
48 |
53 |
54 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/res/xml/heads_up_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
21 |
22 |
28 |
29 |
35 |
36 |
40 |
45 |
46 |
47 |
51 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/res/xml/monet_engine_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
19 |
20 |
25 |
26 |
27 |
31 |
32 |
33 |
37 |
38 |
39 |
42 |
43 |
44 |
53 |
54 |
55 |
59 |
60 |
61 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/res/xml/network_traffic.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
28 |
29 |
35 |
36 |
43 |
44 |
51 |
52 |
--------------------------------------------------------------------------------
/res/xml/superior_devs_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
22 |
23 |
26 |
27 |
30 |
33 |
34 |
35 |
36 |
39 |
40 |
45 |
48 |
49 |
50 |
55 |
58 |
59 |
60 |
65 |
68 |
69 |
70 |
75 |
78 |
79 |
80 |
85 |
88 |
89 |
90 |
91 |
92 |
95 |
96 |
101 |
104 |
105 |
106 |
111 |
114 |
115 |
116 |
121 |
124 |
125 |
126 |
127 |
128 |
131 |
132 |
135 |
138 |
139 |
140 |
141 |
142 |
145 |
146 |
150 |
153 |
154 |
155 |
156 |
159 |
160 |
164 |
167 |
168 |
169 |
173 |
176 |
177 |
178 |
182 |
185 |
186 |
187 |
188 |
189 |
--------------------------------------------------------------------------------
/res/xml/superior_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
23 |
30 |
31 |
32 |
38 |
39 |
40 |
46 |
47 |
48 |
54 |
55 |
56 |
62 |
63 |
64 |
70 |
71 |
72 |
78 |
79 |
80 |
86 |
87 |
88 |
94 |
95 |
96 |
102 |
103 |
104 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
28 |
29 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_gestures.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
25 |
26 |
32 |
33 |
38 |
39 |
40 |
41 |
44 |
45 |
50 |
51 |
56 |
57 |
58 |
59 |
62 |
63 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_lockscreen.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
27 |
28 |
31 |
32 |
37 |
38 |
43 |
44 |
45 |
46 |
49 |
50 |
55 |
56 |
65 |
66 |
67 |
70 |
71 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
24 |
25 |
30 |
31 |
36 |
37 |
38 |
40 |
41 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_navbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_notifications.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
27 |
28 |
33 |
34 |
39 |
40 |
43 |
44 |
48 |
49 |
53 |
54 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_powermenu.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_quicksettings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
25 |
26 |
32 |
33 |
38 |
39 |
44 |
45 |
46 |
49 |
50 |
55 |
56 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/res/xml/superior_settings_statusbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
21 |
22 |
25 |
26 |
30 |
33 |
34 |
35 |
43 |
44 |
52 |
53 |
58 |
59 |
64 |
65 |
70 |
71 |
76 |
77 |
82 |
83 |
88 |
89 |
90 |
93 |
94 |
99 |
100 |
105 |
106 |
107 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/res/xml/visualizer_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
20 |
21 |
26 |
27 |
32 |
33 |
42 |
43 |
46 |
47 |
54 |
55 |
61 |
62 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/src/com/android/settings/custom/SuperiorDevsInfoFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 Cardinal-AOSP
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 | implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.android.settings.custom;
19 |
20 | import android.os.Bundle;
21 | import com.android.settings.SettingsPreferenceFragment;
22 | import androidx.preference.Preference;
23 | import androidx.preference.PreferenceCategory;
24 | import com.android.settings.R;
25 |
26 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
27 |
28 | public class SuperiorDevsInfoFragment extends SettingsPreferenceFragment {
29 |
30 | @Override
31 | public void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 |
34 | addPreferencesFromResource(R.xml.superior_devs_info);
35 | }
36 |
37 | @Override
38 | public int getMetricsCategory() {
39 | return MetricsEvent.SUPERIOR;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/com/superior/settings/SuperiorSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright © 2018 Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings;
18 |
19 | import android.os.Bundle;
20 | import androidx.preference.Preference;
21 | import androidx.preference.PreferenceCategory;
22 | import androidx.preference.PreferenceScreen;
23 |
24 | import com.android.settings.R;
25 | import com.android.settings.SettingsPreferenceFragment;
26 |
27 | import com.android.internal.logging.nano.MetricsProto;
28 |
29 | public class SuperiorSettings extends SettingsPreferenceFragment {
30 |
31 | @Override
32 | public void onCreate(Bundle icicle) {
33 | super.onCreate(icicle);
34 | addPreferencesFromResource(R.xml.superior_settings);
35 | }
36 |
37 | @Override
38 | public int getMetricsCategory() {
39 | return MetricsProto.MetricsEvent.SUPERIOR;
40 | }
41 | }
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/BatterySettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 SuperiorOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.superior.settings.fragments;
17 |
18 | import android.content.ContentResolver;
19 | import android.content.Context;
20 | import android.content.res.Resources;
21 | import android.graphics.Color;
22 | import android.os.Bundle;
23 | import android.os.Handler;
24 | import android.os.UserHandle;
25 | import android.provider.Settings;
26 |
27 | import androidx.preference.ListPreference;
28 | import androidx.preference.Preference;
29 | import androidx.preference.Preference.OnPreferenceChangeListener;
30 | import androidx.preference.PreferenceScreen;
31 | import androidx.preference.SwitchPreference;
32 |
33 | import com.android.internal.logging.nano.MetricsProto;
34 | import com.android.settings.SettingsPreferenceFragment;
35 |
36 | import com.android.settings.R;
37 |
38 | public class BatterySettings extends SettingsPreferenceFragment
39 | implements Preference.OnPreferenceChangeListener {
40 |
41 | private static final String PREF_STATUS_BAR_SHOW_BATTERY_PERCENT = "status_bar_show_battery_percent";
42 | private static final String PREF_STATUS_BAR_BATTERY_STYLE = "status_bar_battery_style";
43 |
44 | private static final int BATTERY_STYLE_PORTRAIT = 0;
45 | private static final int BATTERY_STYLE_TEXT = 4;
46 | private static final int BATTERY_STYLE_HIDDEN = 5;
47 | private static final int BATTERY_PERCENT_HIDDEN = 0;
48 | //private static final int BATTERY_PERCENT_SHOW_INSIDE = 1;
49 | //private static final int BATTERY_PERCENT_SHOW_OUTSIDE = 2;
50 |
51 | private ListPreference mBatteryPercent;
52 | private ListPreference mBatteryStyle;
53 | private int mBatteryPercentValue;
54 |
55 | @Override
56 | public void onCreate(Bundle savedInstanceState) {
57 | super.onCreate(savedInstanceState);
58 |
59 | addPreferencesFromResource(R.xml.battery_settings);
60 |
61 | PreferenceScreen prefSet = getPreferenceScreen();
62 | ContentResolver resolver = getActivity().getContentResolver();
63 |
64 | int batterystyle = Settings.System.getIntForUser(getContentResolver(),
65 | Settings.System.STATUS_BAR_BATTERY_STYLE, BATTERY_STYLE_PORTRAIT, UserHandle.USER_CURRENT);
66 |
67 | mBatteryStyle = (ListPreference) findPreference(PREF_STATUS_BAR_BATTERY_STYLE);
68 | mBatteryStyle.setValue(String.valueOf(batterystyle));
69 | mBatteryStyle.setSummary(mBatteryStyle.getEntry());
70 | mBatteryStyle.setOnPreferenceChangeListener(this);
71 |
72 | mBatteryPercentValue = Settings.System.getIntForUser(getContentResolver(),
73 | Settings.System.STATUS_BAR_SHOW_BATTERY_PERCENT, BATTERY_PERCENT_HIDDEN, UserHandle.USER_CURRENT);
74 |
75 | mBatteryPercent = (ListPreference) findPreference(PREF_STATUS_BAR_SHOW_BATTERY_PERCENT);
76 | mBatteryPercent.setValue(String.valueOf(mBatteryPercentValue));
77 | mBatteryPercent.setSummary(mBatteryPercent.getEntry());
78 | mBatteryPercent.setOnPreferenceChangeListener(this);
79 |
80 | mBatteryPercent.setEnabled(
81 | batterystyle != BATTERY_STYLE_TEXT && batterystyle != BATTERY_STYLE_HIDDEN);
82 | }
83 |
84 | @Override
85 | public boolean onPreferenceChange(Preference preference, Object newValue) {
86 | ContentResolver resolver = getActivity().getContentResolver();
87 | if (preference == mBatteryStyle) {
88 | int batterystyle = Integer.parseInt((String) newValue);
89 | Settings.System.putIntForUser(resolver,
90 | Settings.System.STATUS_BAR_BATTERY_STYLE, batterystyle,
91 | UserHandle.USER_CURRENT);
92 | int index = mBatteryStyle.findIndexOfValue((String) newValue);
93 | mBatteryStyle.setSummary(mBatteryStyle.getEntries()[index]);
94 | mBatteryPercent.setEnabled(
95 | batterystyle != BATTERY_STYLE_TEXT && batterystyle != BATTERY_STYLE_HIDDEN);
96 | return true;
97 | } else if (preference == mBatteryPercent) {
98 | mBatteryPercentValue = Integer.parseInt((String) newValue);
99 | Settings.System.putIntForUser(resolver,
100 | Settings.System.STATUS_BAR_SHOW_BATTERY_PERCENT, mBatteryPercentValue,
101 | UserHandle.USER_CURRENT);
102 | int index = mBatteryPercent.findIndexOfValue((String) newValue);
103 | mBatteryPercent.setSummary(mBatteryPercent.getEntries()[index]);
104 | return true;
105 | }
106 | return false;
107 | }
108 |
109 | @Override
110 | public int getMetricsCategory() {
111 | return MetricsProto.MetricsEvent.SUPERIOR;
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/ButtonSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import androidx.preference.SwitchPreference;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceScreen;
27 | import androidx.preference.PreferenceCategory;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import android.provider.Settings;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 |
34 | import com.android.settings.SettingsPreferenceFragment;
35 | import com.android.internal.logging.nano.MetricsProto;
36 |
37 | import com.android.settings.R;
38 |
39 | public class ButtonSettings extends SettingsPreferenceFragment implements
40 | Preference.OnPreferenceChangeListener {
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | addPreferencesFromResource(R.xml.superior_settings_button);
46 | ContentResolver resolver = getActivity().getContentResolver();
47 | final PreferenceScreen prefScreen = getPreferenceScreen();
48 | }
49 |
50 | @Override
51 | public int getMetricsCategory() {
52 | return MetricsProto.MetricsEvent.SUPERIOR;
53 | }
54 |
55 | @Override
56 | public void onResume() {
57 | super.onResume();
58 | }
59 |
60 | @Override
61 | public void onPause() {
62 | super.onPause();
63 | }
64 |
65 | public boolean onPreferenceChange(Preference preference, Object newValue) {
66 | return false;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/Customisation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 SuperiorOS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import static android.os.UserHandle.USER_SYSTEM;
20 |
21 | import android.app.ActivityManagerNative;
22 | import android.app.UiModeManager;
23 | import android.content.Context;
24 | import android.content.ContentResolver;
25 | import android.content.om.IOverlayManager;
26 | import android.content.om.OverlayInfo;
27 | import android.content.pm.PackageManager;
28 | import android.content.pm.PackageManager.NameNotFoundException;
29 | import android.content.res.Resources;
30 | import android.graphics.Color;
31 | import android.os.AsyncTask;
32 | import android.os.Bundle;
33 | import android.os.UserHandle;
34 | import android.os.RemoteException;
35 | import android.os.ServiceManager;
36 | import androidx.annotation.VisibleForTesting;
37 | import androidx.preference.Preference;
38 | import androidx.preference.ListPreference;
39 | import androidx.preference.PreferenceCategory;
40 | import androidx.preference.PreferenceScreen;
41 | import androidx.preference.Preference.OnPreferenceChangeListener;
42 | import android.provider.Settings;
43 | import android.text.TextUtils;
44 | import android.util.Log;
45 | import android.view.WindowManagerGlobal;
46 | import android.view.IWindowManager;
47 | import android.widget.Toast;
48 |
49 | import java.util.regex.Matcher;
50 | import java.util.regex.Pattern;
51 |
52 | import java.util.Locale;
53 | import android.text.TextUtils;
54 | import android.view.View;
55 |
56 | import com.android.settings.R;
57 | import com.android.settings.SettingsPreferenceFragment;
58 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
59 | import com.android.settings.Utils;
60 |
61 | import com.superior.support.colorpicker.ColorPickerPreference;
62 |
63 | import java.util.ArrayList;
64 | import java.util.Comparator;
65 | import java.util.List;
66 |
67 | public class Customisation extends SettingsPreferenceFragment implements OnPreferenceChangeListener {
68 |
69 | private static final String TAG = "Customisation";
70 |
71 | private Context mContext;
72 |
73 | @Override
74 | public void onCreate(Bundle savedInstanceState) {
75 | super.onCreate(savedInstanceState);
76 |
77 | addPreferencesFromResource(R.xml.customisation);
78 |
79 | mContext = getActivity();
80 |
81 | final ContentResolver resolver = getActivity().getContentResolver();
82 | final PreferenceScreen screen = getPreferenceScreen();
83 | }
84 |
85 | @Override
86 | public int getMetricsCategory() {
87 | return MetricsEvent.SUPERIOR;
88 | }
89 |
90 | @Override
91 | public void onResume() {
92 | super.onResume();
93 | }
94 |
95 | @Override
96 | public boolean onPreferenceChange(Preference preference, Object newValue) {
97 | return false;
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/GestureSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import androidx.preference.SwitchPreference;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceScreen;
27 | import androidx.preference.PreferenceCategory;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import android.provider.Settings;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 |
34 | import com.android.settings.SettingsPreferenceFragment;
35 | import com.android.internal.logging.nano.MetricsProto;
36 |
37 | import com.android.settings.R;
38 |
39 | public class GestureSettings extends SettingsPreferenceFragment implements
40 | Preference.OnPreferenceChangeListener {
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | addPreferencesFromResource(R.xml.superior_settings_gestures);
46 | ContentResolver resolver = getActivity().getContentResolver();
47 | final PreferenceScreen prefScreen = getPreferenceScreen();
48 | }
49 |
50 | @Override
51 | public int getMetricsCategory() {
52 | return MetricsProto.MetricsEvent.SUPERIOR;
53 | }
54 |
55 | @Override
56 | public void onResume() {
57 | super.onResume();
58 | }
59 |
60 | @Override
61 | public void onPause() {
62 | super.onPause();
63 | }
64 |
65 | public boolean onPreferenceChange(Preference preference, Object newValue) {
66 | return false;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/IconShapes.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 AospExtended ROM Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import static com.android.internal.util.superior.ThemeUtils.ICON_SHAPE_KEY;
20 |
21 | import android.content.ContentResolver;
22 | import android.content.Context;
23 | import android.content.res.ColorStateList;
24 | import android.content.res.Resources;
25 | import android.content.pm.PackageManager;
26 | import android.graphics.drawable.AnimationDrawable;
27 | import android.graphics.drawable.Drawable;
28 | import android.graphics.drawable.ShapeDrawable;
29 | import android.os.Bundle;
30 | import android.provider.SearchIndexableResource;
31 | import android.provider.Settings;
32 | import android.view.LayoutInflater;
33 | import android.view.View;
34 | import android.view.Gravity;
35 | import android.view.ViewGroup;
36 | import android.widget.ImageView;
37 | import android.widget.LinearLayout;
38 | import android.widget.FrameLayout;
39 | import android.widget.TextView;
40 | import android.widget.Toast;
41 | import android.text.TextUtils;
42 | import androidx.preference.PreferenceViewHolder;
43 | import android.view.ViewGroup.LayoutParams;
44 |
45 | import androidx.annotation.NonNull;
46 | import androidx.annotation.Nullable;
47 | import androidx.core.graphics.ColorUtils;
48 | import androidx.recyclerview.widget.GridLayoutManager;
49 | import androidx.recyclerview.widget.RecyclerView.ViewHolder;
50 | import androidx.recyclerview.widget.RecyclerView;
51 | import android.net.Uri;
52 | import androidx.core.content.res.ResourcesCompat;
53 | import androidx.preference.Preference;
54 | import androidx.preference.Preference.OnPreferenceChangeListener;
55 | import androidx.preference.PreferenceScreen;
56 |
57 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
58 | import com.android.settings.R;
59 | import com.android.settings.search.BaseSearchIndexProvider;
60 | import com.android.settingslib.search.Indexable;
61 | import com.android.settings.SettingsPreferenceFragment;
62 | import com.android.settingslib.Utils;
63 |
64 | import com.bumptech.glide.Glide;
65 |
66 | import com.android.internal.util.superior.ThemeUtils;
67 |
68 | import java.util.ArrayList;
69 | import java.util.Collections;
70 | import java.util.List;
71 | import java.util.Arrays;
72 |
73 | import org.json.JSONObject;
74 | import org.json.JSONException;
75 |
76 | public class IconShapes extends SettingsPreferenceFragment {
77 |
78 | private RecyclerView mRecyclerView;
79 | private ThemeUtils mThemeUtils;
80 |
81 | private String mCategory = ICON_SHAPE_KEY;
82 |
83 | private List mPkgs;
84 |
85 | @Override
86 | public void onCreate(Bundle savedInstanceState) {
87 | super.onCreate(savedInstanceState);
88 | getActivity().setTitle(R.string.theme_customization_icon_shape_title);
89 |
90 | mThemeUtils = new ThemeUtils(getActivity());
91 | mPkgs = mThemeUtils.getOverlayPackagesForCategory(mCategory, "android");
92 | Collections.sort(mPkgs);
93 | }
94 |
95 | @Override
96 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
97 | @Nullable Bundle savedInstanceState) {
98 | View view = inflater.inflate(
99 | R.layout.item_view, container, false);
100 |
101 | mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
102 | GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 3);
103 | mRecyclerView.setLayoutManager(gridLayoutManager);
104 | Adapter mAdapter = new Adapter(getActivity());
105 | mRecyclerView.setAdapter(mAdapter);
106 |
107 | return view;
108 | }
109 |
110 | @Override
111 | public int getMetricsCategory() {
112 | return MetricsEvent.SUPERIOR;
113 | }
114 |
115 | @Override
116 | public void onResume() {
117 | super.onResume();
118 | }
119 |
120 | public class Adapter extends RecyclerView.Adapter {
121 | Context context;
122 | String mSelectedPkg;
123 | String mAppliedPkg;
124 |
125 | public Adapter(Context context) {
126 | this.context = context;
127 | }
128 |
129 | @Override
130 | public CustomViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
131 | View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_option, parent, false);
132 | CustomViewHolder vh = new CustomViewHolder(v);
133 | return vh;
134 | }
135 |
136 | @Override
137 | public void onBindViewHolder(CustomViewHolder holder, final int position) {
138 | String pkg = mPkgs.get(position);
139 |
140 | holder.image.setBackgroundDrawable(mThemeUtils.createShapeDrawable(pkg));
141 |
142 | String currentPackageName = mThemeUtils.getOverlayInfos(mCategory).stream()
143 | .filter(info -> info.isEnabled())
144 | .map(info -> info.packageName)
145 | .findFirst()
146 | .orElse("android");
147 |
148 | holder.name.setText("android".equals(pkg) ? "Default" : getLabel(holder.name.getContext(), pkg));
149 |
150 | final boolean isDefault = "android".equals(currentPackageName) && "android".equals(pkg);
151 | final int color = ColorUtils.setAlphaComponent(
152 | Utils.getColorAttrDefaultColor(getContext(), android.R.attr.colorAccent),
153 | pkg.equals(currentPackageName) || isDefault ? 170 : 75);
154 | holder.image.setBackgroundTintList(ColorStateList.valueOf(color));
155 |
156 | holder.itemView.findViewById(R.id.option_tile).setBackgroundDrawable(null);
157 | holder.itemView.setOnClickListener(new View.OnClickListener() {
158 | @Override
159 | public void onClick(View v) {
160 | enableOverlays(position);
161 | }
162 | });
163 | }
164 |
165 | @Override
166 | public int getItemCount() {
167 | return mPkgs.size();
168 | }
169 |
170 | public class CustomViewHolder extends RecyclerView.ViewHolder {
171 | TextView name;
172 | ImageView image;
173 | public CustomViewHolder(View itemView) {
174 | super(itemView);
175 | name = (TextView) itemView.findViewById(R.id.option_label);
176 | image = (ImageView) itemView.findViewById(R.id.option_thumbnail);
177 | }
178 | }
179 | }
180 |
181 | public Drawable getDrawable(Context context, String pkg, String drawableName) {
182 | try {
183 | PackageManager pm = context.getPackageManager();
184 | Resources res = pkg.equals("android") ? Resources.getSystem()
185 | : pm.getResourcesForApplication(pkg);
186 | return res.getDrawable(res.getIdentifier(drawableName, "drawable", pkg));
187 | }
188 | catch (PackageManager.NameNotFoundException e) {
189 | e.printStackTrace();
190 | }
191 | return null;
192 | }
193 |
194 | public String getLabel(Context context, String pkg) {
195 | PackageManager pm = context.getPackageManager();
196 | try {
197 | return pm.getApplicationInfo(pkg, 0)
198 | .loadLabel(pm).toString();
199 | } catch (PackageManager.NameNotFoundException e) {
200 | e.printStackTrace();
201 | }
202 | return pkg;
203 | }
204 |
205 | public void enableOverlays(int position) {
206 | mThemeUtils.setOverlayEnabled(mCategory, mPkgs.get(position));
207 | }
208 | }
209 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/LockscreenSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import androidx.preference.SwitchPreference;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceScreen;
27 | import androidx.preference.PreferenceCategory;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import android.provider.Settings;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 |
34 | import com.android.settings.SettingsPreferenceFragment;
35 | import com.android.internal.logging.nano.MetricsProto;
36 |
37 | import com.android.settings.R;
38 |
39 | public class LockscreenSettings extends SettingsPreferenceFragment implements
40 | Preference.OnPreferenceChangeListener {
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | addPreferencesFromResource(R.xml.superior_settings_lockscreen);
46 | ContentResolver resolver = getActivity().getContentResolver();
47 | final PreferenceScreen prefScreen = getPreferenceScreen();
48 | }
49 |
50 | @Override
51 | public int getMetricsCategory() {
52 | return MetricsProto.MetricsEvent.SUPERIOR;
53 | }
54 |
55 | @Override
56 | public void onResume() {
57 | super.onResume();
58 | }
59 |
60 | @Override
61 | public void onPause() {
62 | super.onPause();
63 | }
64 |
65 | public boolean onPreferenceChange(Preference preference, Object newValue) {
66 | return false;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/MiscSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import androidx.preference.SwitchPreference;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceScreen;
27 | import androidx.preference.PreferenceCategory;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import android.provider.Settings;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 |
34 | import com.android.settings.SettingsPreferenceFragment;
35 | import com.android.internal.logging.nano.MetricsProto;
36 |
37 | import com.android.settings.R;
38 |
39 | public class MiscSettings extends SettingsPreferenceFragment implements
40 | Preference.OnPreferenceChangeListener {
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | addPreferencesFromResource(R.xml.superior_settings_misc);
46 | ContentResolver resolver = getActivity().getContentResolver();
47 | final PreferenceScreen prefScreen = getPreferenceScreen();
48 | }
49 |
50 | @Override
51 | public int getMetricsCategory() {
52 | return MetricsProto.MetricsEvent.SUPERIOR;
53 | }
54 |
55 | @Override
56 | public void onResume() {
57 | super.onResume();
58 | }
59 |
60 | @Override
61 | public void onPause() {
62 | super.onPause();
63 | }
64 |
65 | public boolean onPreferenceChange(Preference preference, Object newValue) {
66 | return false;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/MonetSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2021 Yet Another AOSP Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.superior.settings.fragments;
17 |
18 | import android.content.ContentResolver;
19 | import android.os.Bundle;
20 | import android.provider.Settings;
21 |
22 | import androidx.preference.Preference;
23 | import androidx.preference.SwitchPreference;
24 |
25 | import com.android.internal.logging.nano.MetricsProto;
26 | import com.android.settings.R;
27 | import com.android.settings.search.BaseSearchIndexProvider;
28 | import com.android.settings.SettingsPreferenceFragment;
29 | import com.android.settingslib.search.SearchIndexable;
30 |
31 | import com.superior.support.colorpicker.ColorPickerPreference;
32 | import com.superior.support.preferences.CustomSeekBarPreference;
33 |
34 | import java.lang.Math;
35 |
36 | @SearchIndexable
37 | public class MonetSettings extends SettingsPreferenceFragment
38 | implements Preference.OnPreferenceChangeListener {
39 |
40 | private static final String WALLPAPER_KEY = "monet_engine_use_wallpaper_color";
41 | private static final String COLOR_KEY = "monet_engine_color_override";
42 | private static final String CHROMA_KEY = "monet_engine_chroma_factor";
43 |
44 | SwitchPreference mUseWall;
45 | ColorPickerPreference mColorOvr;
46 | CustomSeekBarPreference mChroma;
47 |
48 | @Override
49 | public void onCreate(Bundle icicle) {
50 | super.onCreate(icicle);
51 | final ContentResolver resolver = getActivity().getContentResolver();
52 |
53 | addPreferencesFromResource(R.xml.monet_engine_settings);
54 |
55 | mUseWall = findPreference(WALLPAPER_KEY);
56 | mColorOvr = findPreference(COLOR_KEY);
57 | String color = Settings.Secure.getString(resolver, COLOR_KEY);
58 | boolean useWall = color == null || color.isEmpty();
59 | mUseWall.setChecked(useWall);
60 | mColorOvr.setEnabled(!useWall);
61 | if (!useWall) mColorOvr.setNewPreviewColor(
62 | ColorPickerPreference.convertToColorInt(color));
63 | mUseWall.setOnPreferenceChangeListener(this);
64 | mColorOvr.setOnPreferenceChangeListener(this);
65 |
66 | mChroma = findPreference(CHROMA_KEY);
67 | float chroma = Settings.Secure.getFloat(resolver, CHROMA_KEY, 1) * 100;
68 | mChroma.setValue(Math.round(chroma));
69 | mChroma.setOnPreferenceChangeListener(this);
70 | }
71 |
72 | @Override
73 | public boolean onPreferenceChange(Preference preference, Object newValue) {
74 | final ContentResolver resolver = getActivity().getContentResolver();
75 | if (preference == mUseWall) {
76 | boolean value = (Boolean) newValue;
77 | mColorOvr.setEnabled(!value);
78 | if (value) Settings.Secure.putString(resolver, COLOR_KEY, "");
79 | return true;
80 | } else if (preference == mColorOvr) {
81 | int value = (Integer) newValue;
82 | Settings.Secure.putString(resolver, COLOR_KEY,
83 | ColorPickerPreference.convertToRGB(value));
84 | return true;
85 | } else if (preference == mChroma) {
86 | int value = (Integer) newValue;
87 | Settings.Secure.putFloat(resolver, CHROMA_KEY, value / 100f);
88 | return true;
89 | }
90 | return false;
91 | }
92 |
93 | @Override
94 | public int getMetricsCategory() {
95 | return MetricsProto.MetricsEvent.SUPERIOR;
96 | }
97 |
98 | public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
99 | new BaseSearchIndexProvider(R.xml.monet_engine_settings);
100 | }
101 |
102 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/NavbarSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import androidx.preference.SwitchPreference;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceScreen;
27 | import androidx.preference.PreferenceCategory;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import android.provider.Settings;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 |
34 | import com.android.settings.SettingsPreferenceFragment;
35 | import com.android.internal.logging.nano.MetricsProto;
36 |
37 | import com.android.settings.R;
38 |
39 | public class NavbarSettings extends SettingsPreferenceFragment implements
40 | Preference.OnPreferenceChangeListener {
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | addPreferencesFromResource(R.xml.superior_settings_navbar);
46 | ContentResolver resolver = getActivity().getContentResolver();
47 | final PreferenceScreen prefScreen = getPreferenceScreen();
48 | }
49 |
50 | @Override
51 | public int getMetricsCategory() {
52 | return MetricsProto.MetricsEvent.SUPERIOR;
53 | }
54 |
55 | @Override
56 | public void onResume() {
57 | super.onResume();
58 | }
59 |
60 | @Override
61 | public void onPause() {
62 | super.onPause();
63 | }
64 |
65 | public boolean onPreferenceChange(Preference preference, Object newValue) {
66 | return false;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/NetworkTraffic.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2020 Havoc-OS
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.ContentResolver;
20 | import android.content.Context;
21 | import android.content.Intent;
22 | import android.content.res.Resources;
23 | import android.os.Bundle;
24 | import android.os.UserHandle;
25 | import android.provider.Settings;
26 | import android.text.format.DateFormat;
27 | import android.text.TextUtils;
28 | import android.util.Log;
29 | import android.view.View;
30 |
31 | import androidx.preference.ListPreference;
32 | import androidx.preference.Preference;
33 | import androidx.preference.PreferenceGroup;
34 | import androidx.preference.PreferenceScreen;
35 | import androidx.preference.PreferenceCategory;
36 | import androidx.preference.Preference.OnPreferenceChangeListener;
37 | import androidx.preference.PreferenceFragment;
38 | import androidx.preference.SwitchPreference;
39 |
40 | import com.android.internal.logging.nano.MetricsProto;
41 | import com.android.settings.R;
42 | import com.android.settings.search.BaseSearchIndexProvider;
43 | import com.android.settings.SettingsPreferenceFragment;
44 |
45 | import java.util.ArrayList;
46 | import java.util.Collections;
47 | import java.util.List;
48 |
49 | import com.superior.support.preferences.SystemSettingListPreference;
50 | import com.superior.support.preferences.SystemSettingSeekBarPreference;
51 |
52 | public class NetworkTraffic extends SettingsPreferenceFragment implements
53 | Preference.OnPreferenceChangeListener {
54 |
55 | private static final String NETWORK_TRAFFIC_LOCATION = "network_traffic_location";
56 | private static final String NETWORK_TRAFFIC_MODE = "network_traffic_mode";
57 | private static final String NETWORK_TRAFFIC_AUTOHIDE_THRESHOLD = "network_traffic_autohide_threshold";
58 | private static final String NETWORK_TRAFFIC_REFRESH_INTERVAL = "network_traffic_refresh_interval";
59 |
60 |
61 | private SystemSettingListPreference mNetTrafficLocation;
62 | private SystemSettingListPreference mNetTrafficMode;
63 | private SystemSettingSeekBarPreference mThreshold;
64 | private SystemSettingSeekBarPreference mNetTrafficRefreshInterval;
65 |
66 |
67 | @Override
68 | public void onCreate(Bundle savedInstance) {
69 | super.onCreate(savedInstance);
70 | addPreferencesFromResource(R.xml.network_traffic);
71 | PreferenceScreen prefSet = getPreferenceScreen();
72 | final ContentResolver resolver = getActivity().getContentResolver();
73 |
74 | mNetTrafficLocation = (SystemSettingListPreference) findPreference(NETWORK_TRAFFIC_LOCATION);
75 | int location = Settings.System.getIntForUser(resolver,
76 | Settings.System.NETWORK_TRAFFIC_LOCATION, 0, UserHandle.USER_CURRENT);
77 | mNetTrafficLocation.setOnPreferenceChangeListener(this);
78 | mNetTrafficLocation.setValue(String.valueOf(location));
79 | mNetTrafficLocation.setSummary(mNetTrafficLocation.getEntry());
80 |
81 | mNetTrafficMode = (SystemSettingListPreference) findPreference(NETWORK_TRAFFIC_MODE);
82 | int mode = Settings.System.getIntForUser(resolver,
83 | Settings.System.NETWORK_TRAFFIC_MODE, 0, UserHandle.USER_CURRENT);
84 | mNetTrafficMode.setOnPreferenceChangeListener(this);
85 | mNetTrafficMode.setValue(String.valueOf(mode));
86 | mNetTrafficMode.setSummary(mNetTrafficMode.getEntry());
87 |
88 | mThreshold = (SystemSettingSeekBarPreference) findPreference(NETWORK_TRAFFIC_AUTOHIDE_THRESHOLD);
89 | int value = Settings.System.getIntForUser(resolver,
90 | Settings.System.NETWORK_TRAFFIC_AUTOHIDE_THRESHOLD, 1, UserHandle.USER_CURRENT);
91 | mThreshold.setValue(value);
92 | mThreshold.setOnPreferenceChangeListener(this);
93 |
94 | mNetTrafficRefreshInterval = (SystemSettingSeekBarPreference) findPreference(NETWORK_TRAFFIC_REFRESH_INTERVAL);
95 | int refresh = Settings.System.getIntForUser(resolver,
96 | Settings.System.NETWORK_TRAFFIC_REFRESH_INTERVAL, 1, UserHandle.USER_CURRENT);
97 | mNetTrafficRefreshInterval.setValue(refresh);
98 | mNetTrafficRefreshInterval.setOnPreferenceChangeListener(this);
99 |
100 | }
101 |
102 | @Override
103 | public void onResume() {
104 | super.onResume();
105 | }
106 |
107 | @Override
108 | public boolean onPreferenceChange(Preference preference, Object newValue) {
109 | if (preference == mNetTrafficLocation) {
110 | int location = Integer.valueOf((String) newValue);
111 | // 0=sb; 1=expanded sb
112 | Settings.System.putIntForUser(getActivity().getContentResolver(),
113 | Settings.System.NETWORK_TRAFFIC_LOCATION, location, UserHandle.USER_CURRENT);
114 | int index = mNetTrafficLocation.findIndexOfValue((String) newValue);
115 | mNetTrafficLocation.setSummary(mNetTrafficLocation.getEntries()[index]);
116 | mNetTrafficLocation.setValue(String.valueOf(location));
117 | return true;
118 | } else if (preference == mNetTrafficMode) {
119 | int mode = Integer.valueOf((String) newValue);
120 | // 0=sb; 1=expanded sb
121 | Settings.System.putIntForUser(getActivity().getContentResolver(),
122 | Settings.System.NETWORK_TRAFFIC_MODE, mode, UserHandle.USER_CURRENT);
123 | int index = mNetTrafficMode.findIndexOfValue((String) newValue);
124 | mNetTrafficMode.setSummary(mNetTrafficMode.getEntries()[index]);
125 | mNetTrafficMode.setValue(String.valueOf(mode));
126 | return true;
127 | } else if (preference == mThreshold) {
128 | int val = (Integer) newValue;
129 | Settings.System.putIntForUser(getContentResolver(),
130 | Settings.System.NETWORK_TRAFFIC_AUTOHIDE_THRESHOLD, val,
131 | UserHandle.USER_CURRENT);
132 | return true;
133 | } else if (preference == mNetTrafficRefreshInterval) {
134 | int val = (Integer) newValue;
135 | Settings.System.putIntForUser(getContentResolver(),
136 | Settings.System.NETWORK_TRAFFIC_REFRESH_INTERVAL, val,
137 | UserHandle.USER_CURRENT);
138 | return true;
139 | }
140 | return false;
141 | }
142 |
143 | @Override
144 | public int getMetricsCategory() {
145 | return MetricsProto.MetricsEvent.SUPERIOR;
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/NotificationSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import androidx.preference.SwitchPreference;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceScreen;
27 | import androidx.preference.PreferenceCategory;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import android.provider.Settings;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 |
34 | import com.android.settings.SettingsPreferenceFragment;
35 | import com.android.internal.logging.nano.MetricsProto;
36 |
37 | import com.android.settings.R;
38 |
39 | public class NotificationSettings extends SettingsPreferenceFragment implements
40 | Preference.OnPreferenceChangeListener {
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | addPreferencesFromResource(R.xml.superior_settings_notifications);
46 | ContentResolver resolver = getActivity().getContentResolver();
47 | final PreferenceScreen prefScreen = getPreferenceScreen();
48 | }
49 |
50 | @Override
51 | public int getMetricsCategory() {
52 | return MetricsProto.MetricsEvent.SUPERIOR;
53 | }
54 |
55 | @Override
56 | public void onResume() {
57 | super.onResume();
58 | }
59 |
60 | @Override
61 | public void onPause() {
62 | super.onPause();
63 | }
64 |
65 | public boolean onPreferenceChange(Preference preference, Object newValue) {
66 | return false;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/PowermenuSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import androidx.preference.SwitchPreference;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceScreen;
27 | import androidx.preference.PreferenceCategory;
28 | import androidx.preference.Preference.OnPreferenceChangeListener;
29 | import android.provider.Settings;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 |
34 | import com.android.settings.SettingsPreferenceFragment;
35 | import com.android.internal.logging.nano.MetricsProto;
36 |
37 | import com.android.settings.R;
38 |
39 | public class PowermenuSettings extends SettingsPreferenceFragment implements
40 | Preference.OnPreferenceChangeListener {
41 |
42 | @Override
43 | public void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | addPreferencesFromResource(R.xml.superior_settings_powermenu);
46 | ContentResolver resolver = getActivity().getContentResolver();
47 | final PreferenceScreen prefScreen = getPreferenceScreen();
48 | }
49 |
50 | @Override
51 | public int getMetricsCategory() {
52 | return MetricsProto.MetricsEvent.SUPERIOR;
53 | }
54 |
55 | @Override
56 | public void onResume() {
57 | super.onResume();
58 | }
59 |
60 | @Override
61 | public void onPause() {
62 | super.onPause();
63 | }
64 |
65 | public boolean onPreferenceChange(Preference preference, Object newValue) {
66 | return false;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/QuickSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.Context;
20 | import android.content.ContentResolver;
21 | import android.content.res.Resources;
22 | import android.os.Bundle;
23 | import android.os.UserHandle;
24 | import androidx.preference.SwitchPreference;
25 | import androidx.preference.ListPreference;
26 | import androidx.preference.Preference;
27 | import androidx.preference.PreferenceScreen;
28 | import androidx.preference.PreferenceCategory;
29 | import androidx.preference.Preference.OnPreferenceChangeListener;
30 | import android.provider.Settings;
31 | import android.view.LayoutInflater;
32 | import android.view.View;
33 | import android.view.ViewGroup;
34 |
35 | import com.android.settings.SettingsPreferenceFragment;
36 | import com.android.internal.logging.nano.MetricsProto;
37 |
38 | import com.android.settings.R;
39 |
40 | public class QuickSettings extends SettingsPreferenceFragment implements
41 | Preference.OnPreferenceChangeListener {
42 |
43 | private ListPreference mQuickPulldown;
44 |
45 | @Override
46 | public void onCreate(Bundle savedInstanceState) {
47 | super.onCreate(savedInstanceState);
48 | addPreferencesFromResource(R.xml.superior_settings_quicksettings);
49 | ContentResolver resolver = getActivity().getContentResolver();
50 | final PreferenceScreen prefScreen = getPreferenceScreen();
51 |
52 | int qpmode = Settings.System.getIntForUser(getContentResolver(),
53 | Settings.System.STATUS_BAR_QUICK_QS_PULLDOWN, 0, UserHandle.USER_CURRENT);
54 | mQuickPulldown = (ListPreference) findPreference("status_bar_quick_qs_pulldown");
55 | mQuickPulldown.setValue(String.valueOf(qpmode));
56 | mQuickPulldown.setSummary(mQuickPulldown.getEntry());
57 | mQuickPulldown.setOnPreferenceChangeListener(this);
58 | }
59 |
60 | @Override
61 | public int getMetricsCategory() {
62 | return MetricsProto.MetricsEvent.SUPERIOR;
63 | }
64 |
65 | @Override
66 | public void onResume() {
67 | super.onResume();
68 | }
69 |
70 | @Override
71 | public void onPause() {
72 | super.onPause();
73 | }
74 |
75 | public boolean onPreferenceChange(Preference preference, Object newValue) {
76 | ContentResolver resolver = getActivity().getContentResolver();
77 | if (preference == mQuickPulldown) {
78 | int value = Integer.parseInt((String) newValue);
79 | Settings.System.putIntForUser(resolver,
80 | Settings.System.STATUS_BAR_QUICK_QS_PULLDOWN, value,
81 | UserHandle.USER_CURRENT);
82 | int index = mQuickPulldown.findIndexOfValue((String) newValue);
83 | mQuickPulldown.setSummary(
84 | mQuickPulldown.getEntries()[index]);
85 | return true;
86 | }
87 | return false;
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/StatusbarSettings.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.ContentResolver;
20 | import android.content.Context;
21 | import android.content.Intent;
22 | import android.content.res.Resources;
23 | import android.os.Bundle;
24 |
25 | import android.os.UserHandle;
26 | import android.provider.SearchIndexableResource;
27 | import android.provider.Settings;
28 | import android.text.format.DateFormat;
29 | import android.text.TextUtils;
30 | import android.util.Log;
31 | import android.view.View;
32 |
33 | import androidx.preference.Preference;
34 | import androidx.preference.PreferenceGroup;
35 | import androidx.preference.PreferenceScreen;
36 | import androidx.preference.PreferenceCategory;
37 | import androidx.preference.Preference.OnPreferenceChangeListener;
38 | import androidx.preference.PreferenceFragment;
39 | import androidx.preference.SwitchPreference;
40 |
41 | import com.android.internal.logging.nano.MetricsProto;
42 | import com.android.settings.R;
43 | import com.android.settings.SettingsPreferenceFragment;
44 |
45 | import java.util.ArrayList;
46 | import java.util.Collections;
47 | import java.util.List;
48 |
49 | import com.superior.support.preferences.SystemSettingMasterSwitchPreference;
50 | import com.superior.support.preferences.SecureSettingSwitchPreference;
51 |
52 | public class StatusbarSettings extends SettingsPreferenceFragment implements
53 | Preference.OnPreferenceChangeListener {
54 |
55 | private static final String NETWORK_TRAFFIC_STATE = "network_traffic_state";
56 | private static final String SYSTEMUI_PACKAGE = "com.android.systemui";
57 | private static final String CONFIG_RESOURCE_NAME = "flag_combined_status_bar_signal_icons";
58 | private static final String COBINED_STATUSBAR_ICONS = "show_combined_status_bar_signal_icons";
59 |
60 | private SystemSettingMasterSwitchPreference mNetTrafficState;
61 | private SecureSettingSwitchPreference mCombinedIcons;
62 |
63 | @Override
64 | public void onCreate(Bundle savedInstanceState) {
65 | super.onCreate(savedInstanceState);
66 | addPreferencesFromResource(R.xml.superior_settings_statusbar);
67 | final PreferenceScreen prefScreen = getPreferenceScreen();
68 | ContentResolver resolver = getActivity().getContentResolver();
69 |
70 | mNetTrafficState = (SystemSettingMasterSwitchPreference) findPreference(NETWORK_TRAFFIC_STATE);
71 | mNetTrafficState.setChecked(Settings.System.getInt(resolver,
72 | Settings.System.NETWORK_TRAFFIC_STATE, 0) == 1);
73 | mNetTrafficState.setOnPreferenceChangeListener(this);
74 |
75 | mCombinedIcons = (SecureSettingSwitchPreference)
76 | findPreference(COBINED_STATUSBAR_ICONS);
77 | Resources sysUIRes = null;
78 | boolean def = false;
79 | int resId = 0;
80 | try {
81 | sysUIRes = getActivity().getPackageManager()
82 | .getResourcesForApplication(SYSTEMUI_PACKAGE);
83 | } catch (Exception ignored) {
84 | // If you don't have system UI you have bigger issues
85 | }
86 | if (sysUIRes != null) {
87 | resId = sysUIRes.getIdentifier(
88 | CONFIG_RESOURCE_NAME, "bool", SYSTEMUI_PACKAGE);
89 | if (resId != 0) def = sysUIRes.getBoolean(resId);
90 | }
91 | boolean enabled = Settings.Secure.getInt(resolver,
92 | COBINED_STATUSBAR_ICONS, def ? 1 : 0) == 1;
93 | mCombinedIcons.setChecked(enabled);
94 | mCombinedIcons.setOnPreferenceChangeListener(this);
95 | }
96 |
97 | @Override
98 | public int getMetricsCategory() {
99 | return MetricsProto.MetricsEvent.SUPERIOR;
100 | }
101 |
102 | @Override
103 | public void onResume() {
104 | super.onResume();
105 | }
106 |
107 | @Override
108 | public void onPause() {
109 | super.onPause();
110 | }
111 |
112 | @Override
113 | public boolean onPreferenceChange(Preference preference, Object newValue) {
114 | ContentResolver resolver = getActivity().getContentResolver();
115 | if (preference == mNetTrafficState) {
116 | boolean value = (Boolean) newValue;
117 | Settings.System.putInt(resolver, Settings.System.NETWORK_TRAFFIC_STATE, value ? 1 : 0);
118 | return true;
119 | } else if (preference == mCombinedIcons) {
120 | boolean enabled = (boolean) newValue;
121 | Settings.Secure.putInt(resolver,
122 | COBINED_STATUSBAR_ICONS, enabled ? 1 : 0);
123 | return true;
124 | }
125 | return false;
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/com/superior/settings/fragments/Visualizer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2019 AospExtended ROM Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.fragments;
18 |
19 | import android.content.ContentResolver;
20 | import android.content.Context;
21 | import android.os.Bundle;
22 | import android.os.UserHandle;
23 | import android.provider.Settings;
24 | import androidx.preference.ListPreference;
25 | import androidx.preference.Preference;
26 | import androidx.preference.PreferenceCategory;
27 | import androidx.preference.Preference.OnPreferenceChangeListener;
28 | import androidx.preference.SwitchPreference;
29 |
30 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
31 |
32 | import com.android.settings.R;
33 | import com.android.settings.SettingsPreferenceFragment;
34 |
35 | import android.widget.Switch;
36 | import com.android.settings.SettingsActivity;
37 | import com.android.settings.widget.SettingsMainSwitchBar;
38 | import com.android.settingslib.widget.OnMainSwitchChangeListener;
39 |
40 | public class Visualizer extends SettingsPreferenceFragment implements
41 | OnPreferenceChangeListener, OnMainSwitchChangeListener {
42 |
43 | private static final String KEY_AUTOCOLOR = "lockscreen_visualizer_autocolor";
44 | private static final String KEY_LAVALAMP = "lockscreen_lavalamp_enabled";
45 |
46 | private SwitchPreference mAutoColor;
47 | private SwitchPreference mLavaLamp;
48 |
49 | private Switch mSwitch;
50 |
51 | private PreferenceCategory pc;
52 |
53 | @Override
54 | public void onCreate(Bundle savedInstanceState) {
55 | super.onCreate(savedInstanceState);
56 |
57 | addPreferencesFromResource(R.xml.visualizer_settings);
58 |
59 | ContentResolver resolver = getActivity().getContentResolver();
60 |
61 | pc = (PreferenceCategory) findPreference("lockscreen_solid_lines_category");
62 |
63 | boolean mLavaLampEnabled = Settings.System.getIntForUser(resolver,
64 | Settings.System.LOCKSCREEN_LAVALAMP_ENABLED, 1,
65 | UserHandle.USER_CURRENT) != 0;
66 |
67 | mAutoColor = (SwitchPreference) findPreference(KEY_AUTOCOLOR);
68 | mAutoColor.setEnabled(!mLavaLampEnabled);
69 |
70 | if (mLavaLampEnabled) {
71 | mAutoColor.setSummary(getActivity().getString(
72 | R.string.lockscreen_autocolor_lavalamp));
73 | } else {
74 | mAutoColor.setSummary(getActivity().getString(
75 | R.string.lockscreen_autocolor_summary));
76 | }
77 |
78 | mLavaLamp = (SwitchPreference) findPreference(KEY_LAVALAMP);
79 | mLavaLamp.setOnPreferenceChangeListener(this);
80 | }
81 |
82 | @Override
83 | public void onActivityCreated(Bundle savedInstanceState) {
84 | super.onActivityCreated(savedInstanceState);
85 | final SettingsActivity activity = (SettingsActivity) getActivity();
86 | final SettingsMainSwitchBar switchBar = activity.getSwitchBar();
87 | mSwitch = switchBar.getSwitch();
88 | boolean enabled = Settings.System.getInt(getActivity().getContentResolver(),
89 | Settings.System.LOCKSCREEN_VISUALIZER_ENABLED, 0) ==1;
90 | mSwitch.setChecked(enabled);
91 | mAutoColor.setEnabled(enabled);
92 | mLavaLamp.setEnabled(enabled);
93 | pc.setEnabled(enabled);
94 | switchBar.setTitle(getActivity().getString(R.string.enable_visualizer));
95 | switchBar.addOnSwitchChangeListener(this);
96 | switchBar.show();
97 | }
98 |
99 | @Override
100 | public void onSwitchChanged(Switch switchView, boolean isChecked) {
101 | Settings.System.putInt(getActivity().getContentResolver(),
102 | Settings.System.LOCKSCREEN_VISUALIZER_ENABLED, isChecked ? 1 : 0);
103 | mAutoColor.setEnabled(isChecked);
104 | mLavaLamp.setEnabled(isChecked);
105 | pc.setEnabled(isChecked);
106 | }
107 |
108 | @Override
109 | public boolean onPreferenceChange(Preference preference, Object newValue) {
110 | ContentResolver resolver = getActivity().getContentResolver();
111 | if (preference == mLavaLamp) {
112 | boolean mLavaLampEnabled = (Boolean) newValue;
113 | if (mLavaLampEnabled) {
114 | mAutoColor.setSummary(getActivity().getString(
115 | R.string.lockscreen_autocolor_lavalamp));
116 | } else {
117 | mAutoColor.setSummary(getActivity().getString(
118 | R.string.lockscreen_autocolor_summary));
119 | }
120 | mAutoColor.setEnabled(!mLavaLampEnabled);
121 | return true;
122 | }
123 | return false;
124 | }
125 |
126 | @Override
127 | public int getMetricsCategory() {
128 | return MetricsEvent.SUPERIOR;
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/src/com/superior/settings/preferences/CardviewPreference.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2018 The Superior OS Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.superior.settings.preferences;
18 |
19 | import android.content.Context;
20 | import android.content.om.IOverlayManager;
21 | import android.content.om.OverlayInfo;
22 | import android.content.res.TypedArray;
23 | import android.graphics.drawable.Drawable;
24 | import android.graphics.PorterDuff;
25 | import android.os.RemoteException;
26 | import android.os.ServiceManager;
27 | import android.os.UserHandle;
28 | import androidx.annotation.VisibleForTesting;
29 | import androidx.core.content.res.TypedArrayUtils;
30 | import androidx.preference.Preference;
31 | import androidx.preference.PreferenceViewHolder;
32 | import android.text.TextUtils;
33 | import android.util.AttributeSet;
34 | import android.view.LayoutInflater;
35 | import android.view.View;
36 | import android.view.ViewGroup;
37 | import android.widget.FrameLayout;
38 | import android.widget.ImageView;
39 | import android.widget.TextView;
40 |
41 | import com.android.settings.R;
42 | import com.android.settings.Utils;
43 |
44 | public class CardviewPreference extends Preference {
45 |
46 | private final View.OnClickListener mClickListener = v -> performClick(v);
47 |
48 | private boolean mAllowDividerAbove;
49 | private boolean mAllowDividerBelow;
50 |
51 | public CardviewPreference(Context context, AttributeSet attrs) {
52 | super(context, attrs);
53 |
54 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Preference);
55 |
56 | mAllowDividerAbove = TypedArrayUtils.getBoolean(a, R.styleable.Preference_allowDividerAbove,
57 | R.styleable.Preference_allowDividerAbove, false);
58 | mAllowDividerBelow = TypedArrayUtils.getBoolean(a, R.styleable.Preference_allowDividerBelow,
59 | R.styleable.Preference_allowDividerBelow, false);
60 | a.recycle();
61 |
62 | setLayoutResource(R.layout.preference_cardview);
63 | }
64 |
65 | public CardviewPreference(Context context, View view) {
66 | super(context);
67 | }
68 |
69 | @Override
70 | public void onBindViewHolder(PreferenceViewHolder holder) {
71 | super.onBindViewHolder(holder);
72 | holder.itemView.setOnClickListener(mClickListener);
73 |
74 | final boolean selectable = isSelectable();
75 | holder.itemView.setFocusable(selectable);
76 | holder.itemView.setClickable(selectable);
77 | holder.setDividerAllowedAbove(mAllowDividerAbove);
78 | holder.setDividerAllowedBelow(mAllowDividerBelow);
79 | }
80 | }
81 |
--------------------------------------------------------------------------------