diff options
Diffstat (limited to 'tests/res')
26 files changed, 713 insertions, 79 deletions
diff --git a/tests/res/drawable/test_widget_dynamic_colors_icon.xml b/tests/res/drawable/test_widget_dynamic_colors_icon.xml new file mode 100644 index 0000000000..69f66757f6 --- /dev/null +++ b/tests/res/drawable/test_widget_dynamic_colors_icon.xml @@ -0,0 +1,29 @@ +<?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. +--> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@android:color/white"/> + <foreground> + <color android:color="#964B00"/> + </foreground> + <monochrome> + <vector android:width="48dp" android:height="48dp" android:viewportWidth="48.0" android:viewportHeight="48.0"> + <path + android:fillColor="#FF000000" + android:pathData="M0,24L48,24 48,48, 0,48 Z"/> + </vector> + </monochrome> +</adaptive-icon> diff --git a/tests/res/drawable/test_widget_no_config_icon.xml b/tests/res/drawable/test_widget_no_config_icon.xml new file mode 100644 index 0000000000..e3d012529d --- /dev/null +++ b/tests/res/drawable/test_widget_no_config_icon.xml @@ -0,0 +1,29 @@ +<?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. +--> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@android:color/white"/> + <foreground> + <color android:color="#00FFFF"/> + </foreground> + <monochrome> + <vector android:width="48dp" android:height="48dp" android:viewportWidth="48.0" android:viewportHeight="48.0"> + <path + android:fillColor="#FF000000" + android:pathData="M0,24L48,24 48,48, 0,48 Z"/> + </vector> + </monochrome> +</adaptive-icon> diff --git a/tests/res/drawable/test_widget_with_config_icon.xml b/tests/res/drawable/test_widget_with_config_icon.xml new file mode 100644 index 0000000000..98b797b870 --- /dev/null +++ b/tests/res/drawable/test_widget_with_config_icon.xml @@ -0,0 +1,29 @@ +<?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. +--> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@android:color/white"/> + <foreground> + <color android:color="#008000" /> + </foreground> + <monochrome> + <vector android:width="48dp" android:height="48dp" android:viewportWidth="48.0" android:viewportHeight="48.0"> + <path + android:fillColor="#FF000000" + android:pathData="M0,24L48,24 48,48, 0,48 Z"/> + </vector> + </monochrome> +</adaptive-icon> diff --git a/tests/res/drawable/test_widget_with_dialog_icon.xml b/tests/res/drawable/test_widget_with_dialog_icon.xml new file mode 100644 index 0000000000..d2879d281b --- /dev/null +++ b/tests/res/drawable/test_widget_with_dialog_icon.xml @@ -0,0 +1,29 @@ +<?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. +--> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@android:color/white"/> + <foreground> + <color android:color="#800080"/> + </foreground> + <monochrome> + <vector android:width="48dp" android:height="48dp" android:viewportWidth="48.0" android:viewportHeight="48.0"> + <path + android:fillColor="#FF000000" + android:pathData="M0,24L48,24 48,48, 0,48 Z"/> + </vector> + </monochrome> +</adaptive-icon> diff --git a/tests/res/raw/cache_data_updated_task_data.txt b/tests/res/raw/cache_data_updated_task_data.txt deleted file mode 100644 index 603dbe3f92..0000000000 --- a/tests/res/raw/cache_data_updated_task_data.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Model data used by CacheDataUpdatedTaskTest - -classMap s com.android.launcher3.model.data.WorkspaceItemInfo - -# Items for the BgDataModel - -# App shortcuts -bgItem s itemType=0 title=app1-class1 intent=component=app1/class1 id=1 -bgItem s itemType=0 title=app1-class2 intent=component=app1/class2 id=2 -bgItem s itemType=0 title=app2-class1 intent=component=app2/class1 id=3 -bgItem s itemType=0 title=app2-class2 intent=component=app2/class2 id=4 - -# Auto install app shortcut -bgItem s itemType=0 status=2 title=app3-class1 intent=component=app3/class1 id=5 -bgItem s itemType=0 status=2 title=app3-class2 intent=component=app3/class2 id=6 - -# Custom shortcuts -bgItem s itemType=1 title=app1-shrt intent=component=app1/class3 id=7 -bgItem s itemType=1 title=app4-shrt intent=component=app4/class1 id=8 - -# Restored custom shortcut -bgItem s itemType=1 status=1 title=app3-shrt intent=component=app3/class3 id=9 -bgItem s itemType=1 status=1 title=app5-shrt intent=component=app5/class1 id=10 - -allApps componentName=app1/class1 intent=component=app1/class1 -allApps componentName=app1/class2 intent=component=app1/class2 -allApps componentName=app2/class1 intent=component=app2/class1 -allApps componentName=app2/class2 intent=component=app2/class2
\ No newline at end of file diff --git a/tests/res/raw/package_install_state_change_task_data.txt b/tests/res/raw/package_install_state_change_task_data.txt deleted file mode 100644 index e82ea9d4d6..0000000000 --- a/tests/res/raw/package_install_state_change_task_data.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Model data used by PackageInstallStateChangeTaskTest - -classMap s com.android.launcher3.model.data.WorkspaceItemInfo -classMap w com.android.launcher3.model.data.LauncherAppWidgetInfo - -# Items for the BgDataModel - -# App shortcuts -bgItem s itemType=0 title=app1-class1 intent=component=app1/class1 id=1 -bgItem s itemType=0 title=app1-class2 intent=component=app1/class2 id=2 -bgItem s itemType=0 title=app2-class1 intent=component=app2/class1 id=3 -bgItem s itemType=0 title=app2-class2 intent=component=app2/class2 id=4 - -# Promise icons for app3 -bgItem s itemType=0 status=2 title=app3-class1 intent=component=app3/class1 id=5 -bgItem s itemType=0 status=2 title=app3-class2 intent=component=app3/class2 id=6 -bgItem s itemType=1 status=1 title=app3-shrt intent=component=app3/class3 id=7 - -# Promise icon for app4 -bgItem s itemType=1 status=1 title=app4-shrt intent=component=app4/class1 id=8 - -# Widget -bgItem w providerName=app4/provider1 id=9 -bgItem w providerName=app5/provider1 id=10
\ No newline at end of file diff --git a/tests/res/raw/widgets_predication_update_task_data.txt b/tests/res/raw/widgets_predication_update_task_data.txt deleted file mode 100644 index 941d1954e2..0000000000 --- a/tests/res/raw/widgets_predication_update_task_data.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Model data used by WidgetsPredictionUpdateTasksTest - -classMap s com.android.launcher3.model.data.WorkspaceItemInfo -classMap w com.android.launcher3.model.data.LauncherAppWidgetInfo - -# Items for the BgDataModel - -# App shortcuts -bgItem s itemType=0 title=app1-class1 intent=component=app1/class1 id=1 -bgItem s itemType=0 title=app1-class2 intent=component=app1/class2 id=2 -bgItem s itemType=0 title=app2-class1 intent=component=app2/class1 id=3 -bgItem s itemType=0 title=app2-class2 intent=component=app2/class2 id=4 - -# Promise icons for app3 -bgItem s itemType=0 status=2 title=app3-class1 intent=component=app3/class1 id=5 -bgItem s itemType=0 status=2 title=app3-class2 intent=component=app3/class2 id=6 -bgItem s itemType=1 status=1 title=app3-shrt intent=component=app3/class3 id=7 - -# Promise icon for app4 -bgItem s itemType=1 status=1 title=app4-shrt intent=component=app4/class1 id=8 - -# Widget -bgItem w providerName=app4/provider1 id=9 -bgItem w providerName=app5/provider1 id=10
\ No newline at end of file diff --git a/tests/res/values/attrs.xml b/tests/res/values/attrs.xml index 2310d9ef66..e5ee06473c 100644 --- a/tests/res/values/attrs.xml +++ b/tests/res/values/attrs.xml @@ -18,7 +18,7 @@ <!-- Attributes have to be copied to test for correct parsing of files --> <resources> <!-- Responsive grids attributes --> - <declare-styleable name="WorkspaceSpec"> + <declare-styleable name="ResponsiveSpec"> <attr name="specType" format="integer"> <enum name="height" value="0" /> <enum name="width" value="1" /> @@ -26,10 +26,26 @@ <attr name="maxAvailableSize" format="dimension" /> </declare-styleable> - <declare-styleable name="SpecSize"> + <declare-styleable name="WorkspaceSpec"> + <attr name="specType" /> + <attr name="maxAvailableSize" /> + </declare-styleable> + + <declare-styleable name="FolderSpec"> + <attr name="specType" /> + <attr name="maxAvailableSize" /> + </declare-styleable> + + <declare-styleable name="AllAppsSpec"> + <attr name="specType" /> + <attr name="maxAvailableSize" /> + </declare-styleable> + + <declare-styleable name="SizeSpec"> <attr name="fixedSize" format="dimension" /> <attr name="ofAvailableSpace" format="float" /> <attr name="ofRemainderSpace" format="float" /> + <attr name="matchWorkspace" format="boolean" /> + <attr name="maxSize" format="dimension" /> </declare-styleable> - </resources> diff --git a/tests/res/values/strings.xml b/tests/res/values/strings.xml index 0ad87fb9cd..54ade56f19 100644 --- a/tests/res/values/strings.xml +++ b/tests/res/values/strings.xml @@ -3,4 +3,5 @@ <string name="shortcut1" translatable="false">Shortcut 1</string> <string name="shortcut2" translatable="false">Shortcut 2</string> <string name="shortcut3" translatable="false">Shortcut 3</string> + <string name="shortcut4" translatable="false">Shortcut 4</string> </resources> diff --git a/tests/res/xml/appwidget_no_config_large.xml b/tests/res/xml/appwidget_no_config_large.xml new file mode 100644 index 0000000000..b3b69d92d7 --- /dev/null +++ b/tests/res/xml/appwidget_no_config_large.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<appwidget-provider + xmlns:android="http://schemas.android.com/apk/res/android" + android:minWidth="1dp" + android:minHeight="1dp" + android:minResizeWidth="1dp" + android:maxResizeWidth="3000dp" + android:targetCellHeight="1" + android:targetCellWidth="5" + android:updatePeriodMillis="86400000" + android:initialLayout="@layout/test_layout_appwidget_red" + android:previewLayout="@layout/test_layout_appwidget_red" + android:resizeMode="horizontal|vertical" + android:widgetCategory="home_screen"> +</appwidget-provider>
\ No newline at end of file diff --git a/tests/res/xml/invalid_all_apps_file_case_1.xml b/tests/res/xml/invalid_all_apps_file_case_1.xml new file mode 100644 index 0000000000..6fd35b161c --- /dev/null +++ b/tests/res/xml/invalid_all_apps_file_case_1.xml @@ -0,0 +1,36 @@ +<?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. + --> +<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <allAppsSpec + launcher:specType="height" + launcher:maxAvailableSize="9999dp"> + <!-- missing startPadding --> + <endPadding launcher:fixedSize="0dp" /> + <gutter launcher:matchWorkspace="true" /> + <cellSize launcher:matchWorkspace="true" /> + </allAppsSpec> + + <allAppsSpec + launcher:specType="width" + launcher:maxAvailableSize="9999dp"> + <startPadding launcher:matchWorkspace="true" /> + <endPadding launcher:matchWorkspace="true" /> + <gutter launcher:matchWorkspace="true" /> + <cellSize launcher:matchWorkspace="true" /> + </allAppsSpec> + +</allAppsSpecs> + diff --git a/tests/res/xml/invalid_all_apps_file_case_2.xml b/tests/res/xml/invalid_all_apps_file_case_2.xml new file mode 100644 index 0000000000..de9c1ac89b --- /dev/null +++ b/tests/res/xml/invalid_all_apps_file_case_2.xml @@ -0,0 +1,38 @@ +<?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. + --> +<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <allAppsSpec + launcher:specType="height" + launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="0dp" /> + <endPadding launcher:fixedSize="0dp" /> + <!-- more than 1 value in one tag --> + <gutter + launcher:matchWorkspace="true" + launcher:fixedSize="16dp" /> + <cellSize launcher:matchWorkspace="true" /> + </allAppsSpec> + + <allAppsSpec + launcher:specType="width" + launcher:maxAvailableSize="9999dp"> + <startPadding launcher:matchWorkspace="true" /> + <endPadding launcher:matchWorkspace="true" /> + <gutter launcher:matchWorkspace="true" /> + <cellSize launcher:matchWorkspace="true" /> + </allAppsSpec> + +</allAppsSpecs>
\ No newline at end of file diff --git a/tests/res/xml/invalid_all_apps_file_case_3.xml b/tests/res/xml/invalid_all_apps_file_case_3.xml new file mode 100644 index 0000000000..7af0af4971 --- /dev/null +++ b/tests/res/xml/invalid_all_apps_file_case_3.xml @@ -0,0 +1,37 @@ +<?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. + --> +<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <allAppsSpec + launcher:specType="height" + launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="0dp" /> + <endPadding launcher:fixedSize="0dp" /> + <gutter launcher:matchWorkspace="true" /> + <!-- value bigger than 1 --> + <cellSize launcher:ofRemainderSpace="1.001" /> + </allAppsSpec> + + <allAppsSpec + launcher:specType="width" + launcher:maxAvailableSize="9999dp"> + <startPadding launcher:matchWorkspace="true" /> + <endPadding launcher:matchWorkspace="true" /> + <gutter launcher:matchWorkspace="true" /> + <cellSize launcher:matchWorkspace="true" /> + </allAppsSpec> + +</allAppsSpecs> + diff --git a/tests/res/xml/invalid_folders_specs_1.xml b/tests/res/xml/invalid_folders_specs_1.xml new file mode 100644 index 0000000000..0864249f02 --- /dev/null +++ b/tests/res/xml/invalid_folders_specs_1.xml @@ -0,0 +1,40 @@ +<?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. + --> + +<!-- Tablet - 6x5 portrait --> +<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp"> + <!-- missing startPadding --> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:matchWorkspace="true" /> + </folderSpec> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="102dp" /> + </folderSpec> + + <!-- Height spec is fixed --> + <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="24dp" /> + <!-- mapped to footer height size --> + <endPadding launcher:fixedSize="64dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="104dp" /> + </folderSpec> +</folderSpecs> diff --git a/tests/res/xml/invalid_folders_specs_2.xml b/tests/res/xml/invalid_folders_specs_2.xml new file mode 100644 index 0000000000..0b7dd627d6 --- /dev/null +++ b/tests/res/xml/invalid_folders_specs_2.xml @@ -0,0 +1,43 @@ +<?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. + --> + +<!-- Tablet - 6x5 portrait --> +<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <!-- more than 1 value in one tag --> + <gutter + launcher:ofAvailableSpace="0.0125" + launcher:fixedSize="16dp" /> + <cellSize launcher:matchWorkspace="true" /> + </folderSpec> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="102dp" /> + </folderSpec> + + <!-- Height spec is fixed --> + <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="24dp" /> + <!-- mapped to footer height size --> + <endPadding launcher:fixedSize="64dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="104dp" /> + </folderSpec> +</folderSpecs> diff --git a/tests/res/xml/invalid_folders_specs_3.xml b/tests/res/xml/invalid_folders_specs_3.xml new file mode 100644 index 0000000000..83fd3e167f --- /dev/null +++ b/tests/res/xml/invalid_folders_specs_3.xml @@ -0,0 +1,41 @@ +<?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. + --> + +<!-- Tablet - 6x5 portrait - More the one value first gutter --> +<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <!-- value bigger than 1 --> + <cellSize launcher:ofRemainderSpace="1.001" /> + </folderSpec> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="102dp" /> + </folderSpec> + + <!-- Height spec is fixed --> + <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="24dp" /> + <!-- mapped to footer height size --> + <endPadding launcher:fixedSize="64dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="104dp" /> + </folderSpec> +</folderSpecs> diff --git a/tests/res/xml/invalid_folders_specs_4.xml b/tests/res/xml/invalid_folders_specs_4.xml new file mode 100644 index 0000000000..2d8c730164 --- /dev/null +++ b/tests/res/xml/invalid_folders_specs_4.xml @@ -0,0 +1,24 @@ +<?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. + --> +<!-- missing height spec --> +<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:matchWorkspace="true" /> + </folderSpec> +</folderSpecs> diff --git a/tests/res/xml/invalid_folders_specs_5.xml b/tests/res/xml/invalid_folders_specs_5.xml new file mode 100644 index 0000000000..b4f1f4dce9 --- /dev/null +++ b/tests/res/xml/invalid_folders_specs_5.xml @@ -0,0 +1,33 @@ +<?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. + --> +<!-- missing breakpoints > 800dp --> +<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:matchWorkspace="true" /> + </folderSpec> + + <!-- Height spec is fixed --> + <folderSpec launcher:specType="height" launcher:maxAvailableSize="800dp"> + <startPadding launcher:fixedSize="24dp" /> + <!-- mapped to footer height size --> + <endPadding launcher:fixedSize="64dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="104dp" /> + </folderSpec> +</folderSpecs> diff --git a/tests/res/xml/invalid_hotseat_file_case_1.xml b/tests/res/xml/invalid_hotseat_file_case_1.xml new file mode 100644 index 0000000000..fcbc5ead8d --- /dev/null +++ b/tests/res/xml/invalid_hotseat_file_case_1.xml @@ -0,0 +1,30 @@ +<?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. + --> +<hotseatSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + + <hotseatSpec + launcher:specType="height" + launcher:maxAvailableSize="847dp"> + <hotseatQsbSpace launcher:ofAvailableSpace="1" /> + </hotseatSpec> + + <hotseatSpec + launcher:specType="height" + launcher:maxAvailableSize="9999dp"> + <hotseatQsbSpace launcher:fixedSize="36dp" /> + </hotseatSpec> + +</hotseatSpecs>
\ No newline at end of file diff --git a/tests/res/xml/invalid_workspace_file_case_4.xml b/tests/res/xml/invalid_workspace_file_case_4.xml new file mode 100644 index 0000000000..9e74c852b3 --- /dev/null +++ b/tests/res/xml/invalid_workspace_file_case_4.xml @@ -0,0 +1,58 @@ +<?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. + --> + +<workspaceSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <workspaceSpec + launcher:specType="height" + launcher:maxAvailableSize="648dp"> + <startPadding + launcher:ofAvailableSpace="0.0125" /> + <endPadding + launcher:ofAvailableSpace="0.05" /> + <!-- value in workspace spec using matchWorkspace --> + <gutter + launcher:matchWorkspace="true" /> + <cellSize + launcher:ofRemainderSpace="0.2" /> + </workspaceSpec> + + <workspaceSpec + launcher:specType="height" + launcher:maxAvailableSize="9999dp"> + <startPadding + launcher:ofAvailableSpace="0.0306" /> + <endPadding + launcher:ofAvailableSpace="0.068" /> + <gutter + launcher:fixedSize="16dp" /> + <cellSize + launcher:ofRemainderSpace="0.2" /> + </workspaceSpec> + + <!-- Width spec is always the same --> + <workspaceSpec + launcher:specType="width" + launcher:maxAvailableSize="9999dp"> + <startPadding + launcher:ofRemainderSpace="0.21436227" /> + <endPadding + launcher:ofRemainderSpace="0.21436227" /> + <gutter + launcher:ofRemainderSpace="0.11425509" /> + <cellSize + launcher:fixedSize="120dp" /> + </workspaceSpec> +</workspaceSpecs> diff --git a/tests/res/xml/max_shortcuts.xml b/tests/res/xml/max_shortcuts.xml new file mode 100644 index 0000000000..312a24c918 --- /dev/null +++ b/tests/res/xml/max_shortcuts.xml @@ -0,0 +1,39 @@ +<?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. + --> +<shortcuts xmlns:android="http://schemas.android.com/apk/res/android" > + <shortcut + android:shortcutId="max_shortcut1" + android:icon="@drawable/test_theme_icon" + android:shortcutShortLabel="@string/shortcut1"> + <intent android:action="com.android.launcher3.intent.action.test_shortcut_max"/> + </shortcut> + <shortcut + android:shortcutId="max_shortcut2" + android:shortcutShortLabel="@string/shortcut2"> + <intent android:action="com.android.launcher3.intent.action.test_shortcut_max"/> + </shortcut> + <shortcut + android:shortcutId="max_shortcut3" + android:shortcutShortLabel="@string/shortcut3"> + <intent android:action="com.android.launcher3.intent.action.test_shortcut_max"/> + </shortcut> + <shortcut + android:shortcutId="max_shortcut4" + android:shortcutShortLabel="@string/shortcut4"> + <intent android:action="com.android.launcher3.intent.action.test_shortcut_max"/> + </shortcut> +</shortcuts> diff --git a/tests/res/xml/shortcuts.xml b/tests/res/xml/shortcuts.xml index 94e8edd936..2ba9d7fb11 100644 --- a/tests/res/xml/shortcuts.xml +++ b/tests/res/xml/shortcuts.xml @@ -1,4 +1,19 @@ <?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. + --> <shortcuts xmlns:android="http://schemas.android.com/apk/res/android" > <shortcut android:shortcutId="shortcut1_themed" diff --git a/tests/res/xml/single_shortcut.xml b/tests/res/xml/single_shortcut.xml new file mode 100644 index 0000000000..e8d938fa11 --- /dev/null +++ b/tests/res/xml/single_shortcut.xml @@ -0,0 +1,24 @@ +<?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. + --> +<shortcuts xmlns:android="http://schemas.android.com/apk/res/android" > + <shortcut + android:shortcutId="single_shortcut_themed" + android:icon="@drawable/test_theme_icon" + android:shortcutShortLabel="@string/shortcut1"> + <intent android:action="com.android.launcher3.intent.action.test_shortcut_single"/> + </shortcut> +</shortcuts> diff --git a/tests/res/xml/valid_all_apps_file.xml b/tests/res/xml/valid_all_apps_file.xml new file mode 100644 index 0000000000..0be55d13aa --- /dev/null +++ b/tests/res/xml/valid_all_apps_file.xml @@ -0,0 +1,36 @@ +<?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. + --> + +<allAppsSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <allAppsSpec + launcher:specType="height" + launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="0dp" /> + <endPadding launcher:fixedSize="0dp" /> + <gutter launcher:matchWorkspace="true" /> + <cellSize launcher:matchWorkspace="true" /> + </allAppsSpec> + + <allAppsSpec + launcher:specType="width" + launcher:maxAvailableSize="9999dp"> + <startPadding launcher:matchWorkspace="true" /> + <endPadding launcher:matchWorkspace="true" /> + <gutter launcher:matchWorkspace="true" /> + <cellSize launcher:matchWorkspace="true" /> + </allAppsSpec> + +</allAppsSpecs> diff --git a/tests/res/xml/valid_folders_specs.xml b/tests/res/xml/valid_folders_specs.xml new file mode 100644 index 0000000000..0c45544752 --- /dev/null +++ b/tests/res/xml/valid_folders_specs.xml @@ -0,0 +1,38 @@ +<?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. + --> +<folderSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="800dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:matchWorkspace="true" /> + </folderSpec> + <folderSpec launcher:specType="width" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="16dp" /> + <endPadding launcher:fixedSize="16dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:fixedSize="102dp" /> + </folderSpec> + + <!-- Height spec is fixed --> + <folderSpec launcher:specType="height" launcher:maxAvailableSize="9999dp"> + <startPadding launcher:fixedSize="24dp" /> + <!-- mapped to footer height size --> + <endPadding launcher:fixedSize="64dp" /> + <gutter launcher:fixedSize="16dp" /> + <cellSize launcher:matchWorkspace="true" /> + </folderSpec> +</folderSpecs> diff --git a/tests/res/xml/valid_hotseat_file.xml b/tests/res/xml/valid_hotseat_file.xml new file mode 100644 index 0000000000..c7f52e82c2 --- /dev/null +++ b/tests/res/xml/valid_hotseat_file.xml @@ -0,0 +1,30 @@ +<?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. + --> +<hotseatSpecs xmlns:launcher="http://schemas.android.com/apk/res-auto"> + + <hotseatSpec + launcher:specType="height" + launcher:maxAvailableSize="847dp"> + <hotseatQsbSpace launcher:fixedSize="24dp" /> + </hotseatSpec> + + <hotseatSpec + launcher:specType="height" + launcher:maxAvailableSize="9999dp"> + <hotseatQsbSpace launcher:fixedSize="36dp" /> + </hotseatSpec> + +</hotseatSpecs>
\ No newline at end of file |