-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gear: Add pulse ambient edge lightning settings
Strings are adapted from AICP resources_devicesettings. Change-Id: I2c25ea044bc23e3e5fdf4e41f98243d297cc3f27
- Loading branch information
Showing
17 changed files
with
668 additions
and
18 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
res/drawable/ambient_edge_light_color_selector_inner_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2023 The LibreMobileOS Foundation | ||
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. | ||
--> | ||
|
||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="oval"> | ||
<corners android:radius="@dimen/ambient_edge_light_color_selector_inner_bg_radius" /> | ||
<solid android:color="@android:color/white" /> | ||
</shape> |
22 changes: 22 additions & 0 deletions
22
res/drawable/ambient_edge_light_color_selector_outer_bg.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2023 The LibreMobileOS Foundation | ||
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. | ||
--> | ||
|
||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<corners android:radius="@dimen/ambient_edge_light_color_selector_outer_bg_radius" /> | ||
<solid android:color="@color/ambient_edge_light_color_selector_item_outer_bg_color" /> | ||
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2023 The LibreMobileOS Foundation | ||
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. | ||
--> | ||
|
||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:tint="#000000" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2023 The LibreMobileOS Foundation | ||
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. | ||
--> | ||
|
||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/color_container" | ||
android:layout_width="@dimen/ambient_edge_light_color_selector_item_width" | ||
android:layout_height="@dimen/ambient_edge_light_color_selector_item_height" | ||
android:layout_margin="@dimen/ambient_edge_light_color_selector_item_margin" | ||
android:background="@drawable/ambient_edge_light_color_selector_outer_bg" | ||
android:padding="@dimen/ambient_edge_light_color_selector_item_padding"> | ||
|
||
<View | ||
android:id="@+id/color_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:background="@drawable/ambient_edge_light_color_selector_inner_bg" /> | ||
|
||
<androidx.appcompat.widget.AppCompatImageView | ||
android:id="@+id/select_icon" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:src="@drawable/ic_color_selected" | ||
android:tint="@color/ambient_edge_light_color_selector_selected_icon_tint_color" /> | ||
</FrameLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2023 The LibreMobileOS Foundation | ||
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. | ||
--> | ||
|
||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/color_selector_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingHorizontal="@dimen/ambient_edge_light_color_selector_view_padding_horizontal" | ||
android:scrollbars="none" | ||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" | ||
app:spanCount="@integer/ambient_edge_light_color_selector_view_span_count" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2021-2023 BananaDroid | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<resources> | ||
|
||
<!-- Preference Category --> | ||
<color name="preference_background_color">@*android:color/accent_device_default</color> | ||
|
||
<color name="white">#FFF</color> | ||
|
||
<color name="about_logo">@*android:color/system_neutral1_100</color> | ||
|
||
<color name="option_border_default">#5f6368</color> | ||
|
||
<color name="user_crd_bg">@*android:color/system_neutral1_0</color> | ||
</resources> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2021-2023 BananaDroid | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<resources> | ||
|
||
<!-- Preference Category --> | ||
<color name="preference_background_color">@*android:color/accent_device_default</color> | ||
|
||
<color name="white">#FFF</color> | ||
|
||
<color name="about_logo">@*android:color/system_neutral1_100</color> | ||
|
||
<color name="option_border_default">#5f6368</color> | ||
|
||
<color name="user_crd_bg">@*android:color/system_neutral1_0</color> | ||
|
||
<!-- Ambient edge light --> | ||
<color name="ambient_edge_light_color_selector_item_outer_bg_color">@android:color/white</color> | ||
<color name="ambient_edge_light_color_selector_selected_icon_tint_color">#AA000000</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2024 BananaDroid | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<resources> | ||
<!-- Ambient edge light --> | ||
<dimen name="ambient_edge_light_color_selector_inner_bg_radius">40dp</dimen> | ||
<dimen name="ambient_edge_light_color_selector_outer_bg_radius">12.5dp</dimen> | ||
<dimen name="ambient_edge_light_color_selector_item_width">48dp</dimen> | ||
<dimen name="ambient_edge_light_color_selector_item_height">48dp</dimen> | ||
<dimen name="ambient_edge_light_color_selector_item_margin">8dp</dimen> | ||
<dimen name="ambient_edge_light_color_selector_item_padding">4dp</dimen> | ||
<dimen name="ambient_edge_light_color_selector_view_padding_horizontal">24dp</dimen> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2024 BananaDroid | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<resources> | ||
|
||
<integer name="ambient_edge_light_color_selector_view_span_count">5</integer> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
Copyright (C) 2023 The LibreMobileOS Foundation | ||
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/com.android.settings" | ||
android:key="ambient_edge_lights" | ||
android:title="@string/ambient_edge_light_action_title"> | ||
|
||
<com.banana.support.preferences.SecureSettingMainSwitchPreference | ||
android:key="pulse_ambient_light" | ||
android:title="@string/ambient_edge_light_enable_title" /> | ||
|
||
<PreferenceCategory | ||
android:key="pulse_ambient_light_color_category" | ||
android:title="@string/ambient_edge_light_color_mode_category_title" | ||
android:dependency="pulse_ambient_light" > | ||
|
||
<com.android.settingslib.widget.SelectorWithWidgetPreference | ||
android:key="pulse_ambient_light_color_mode_auto" | ||
android:title="@string/ambient_edge_light_color_mode_auto" | ||
android:summary="@string/ambient_edge_light_color_mode_auto_summary" /> | ||
|
||
<com.android.settingslib.widget.SelectorWithWidgetPreference | ||
android:key="pulse_ambient_light_color_mode_app" | ||
android:title="@string/ambient_edge_light_color_mode_app" | ||
android:summary="@string/ambient_edge_light_color_mode_app_summary" /> | ||
|
||
<com.android.settingslib.widget.SelectorWithWidgetPreference | ||
android:key="pulse_ambient_light_color_mode_manual" | ||
android:title="@string/ambient_edge_light_color_mode_manual" | ||
android:summary="@string/ambient_edge_light_color_mode_manual_summary" /> | ||
|
||
<com.android.settingslib.widget.LayoutPreference | ||
android:key="pulse_ambient_light_color_selector" | ||
android:layout="@layout/ambient_edge_light_color_selector_view" /> | ||
|
||
</PreferenceCategory> | ||
|
||
<PreferenceCategory | ||
android:key="pulse_ambient_light_advanced_category" | ||
android:title="@string/ambient_edge_light_advanced_category_title" | ||
android:dependency="pulse_ambient_light" > | ||
|
||
<com.banana.support.preferences.CustomSecureSeekBarPreference | ||
android:key="pulse_ambient_light_duration" | ||
android:title="@string/ambient_edge_light_duration_title" | ||
android:max="10" | ||
android:min="1" | ||
android:defaultValue="2" | ||
android:dependency="pulse_ambient_light" | ||
settings:units="sec" /> | ||
|
||
<com.banana.support.preferences.CustomSecureSeekBarPreference | ||
android:key="pulse_ambient_light_repeat_count" | ||
android:title="@string/ambient_edge_light_repeat_count_title" | ||
android:max="10" | ||
android:min="0" | ||
android:defaultValue="0" | ||
android:dependency="pulse_ambient_light" | ||
settings:units="times" /> | ||
|
||
<com.banana.support.preferences.CustomSecureSeekBarPreference | ||
android:key="pulse_ambient_light_width" | ||
android:title="@string/ambient_edge_light_width_title" | ||
android:max="150" | ||
android:min="1" | ||
android:defaultValue="125" | ||
android:dependency="pulse_ambient_light" | ||
settings:units="px" /> | ||
|
||
</PreferenceCategory> | ||
|
||
</PreferenceScreen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.