Implement Flash Notifications UI for Settings app.
Bug: 237628564 Test: make RunSettingsRoboTests ROBOTEST_FILTER=CameraFlashNotificationPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=ColorSelectorLayoutTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreferenceFragmentTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreviewPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsPreviewPreferenceTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=FlashNotificationsUtilTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=ScreenFlashNotificationColorDialogFragmentTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=ScreenFlashNotificationColorTest Change-Id: I0987590ddfcfd0873ec419db263f6a7eade81844 Signed-off-by: yw.bae <yw.bae@samsung.corp-partner.google.com> Signed-off-by: Angela Wang <angelala@google.com>
This commit is contained in:
45
res/layout/flash_notification_preview_preference.xml
Normal file
45
res/layout/flash_notification_preview_preference.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingVertical="@dimen/settingslib_switchbar_margin"
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:paddingStart="@dimen/settingslib_switchbar_padding_left"
|
||||
android:paddingEnd="@dimen/settingslib_switchbar_padding_right"
|
||||
android:background="@drawable/settingslib_switch_bar_bg_on">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/title"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingVertical="@dimen/settingslib_switch_title_margin"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:hyphenationFrequency="normalFast"
|
||||
android:lineBreakWordStyle="phrase"
|
||||
style="@style/MainSwitchText.Settingslib"/>
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
174
res/layout/layout_color_selector.xml
Normal file
174
res/layout/layout_color_selector.xml
Normal file
@@ -0,0 +1,174 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/color_selector_root_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_00"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_01_selector"
|
||||
android:contentDescription="@string/screen_flash_color_blue" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_01"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_02_selector"
|
||||
android:contentDescription="@string/screen_flash_color_azure" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_02"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_03_selector"
|
||||
android:contentDescription="@string/screen_flash_color_cyan" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_03"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_04_selector"
|
||||
android:contentDescription="@string/screen_flash_color_spring_green" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_04"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_05_selector"
|
||||
android:contentDescription="@string/screen_flash_color_green" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_05"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_06_selector"
|
||||
android:contentDescription="@string/screen_flash_color_chartreuse_green" />
|
||||
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_06"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_07_selector"
|
||||
android:contentDescription="@string/screen_flash_color_yellow" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_07"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_08_selector"
|
||||
android:contentDescription="@string/screen_flash_color_orange" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_08"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_09_selector"
|
||||
android:contentDescription="@string/screen_flash_color_red" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_09"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_10_selector"
|
||||
android:contentDescription="@string/screen_flash_color_rose" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_10"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_11_selector"
|
||||
android:contentDescription="@string/screen_flash_color_magenta" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/color_radio_button_11"
|
||||
android:layout_width="@dimen/screen_flash_color_button_frame_size"
|
||||
android:layout_height="@dimen/screen_flash_color_button_frame_size"
|
||||
android:button="@drawable/screen_flash_color_12_selector"
|
||||
android:contentDescription="@string/screen_flash_color_violet" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
32
res/layout/layout_color_selector_dialog.xml
Normal file
32
res/layout/layout_color_selector_dialog.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2023 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<com.android.settings.accessibility.ColorSelectorLayout
|
||||
android:id="@+id/color_selector_preference"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginHorizontal="25dp"
|
||||
android:layout_marginTop="21dp"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</LinearLayout>
|
Reference in New Issue
Block a user