aboutsummaryrefslogtreecommitdiff
path: root/TestMediaApp/res
diff options
context:
space:
mode:
authorArnaud Berry <arnaudberry@google.com>2019-05-16 16:52:30 -0700
committerArnaud Berry <arnaudberry@google.com>2019-05-21 18:56:32 -0700
commitb6d873275f754b1dbd72f02ff2295219adf5373a (patch)
tree1bb51843a2f9c6f01e9568d658d404f392368a21 /TestMediaApp/res
parentd003b9e3fc81bb6fbf2ab320c0c9351cc2347075 (diff)
downloadtests-b6d873275f754b1dbd72f02ff2295219adf5373a.tar.gz
Create Test Media App
This application is intended to help test the Car/Media app by making it easy to send it media items and playback states. Those media items are bundled within the assets of the TestMediaApp, as very readable json files. Quick overview: - loader package interprets the json files - prefs package implements the app's preferences (account type, root node, reply delay) - TmaBrowser implements the MediaBrowserService. It send replies based on the content of the prefs and the json files - TmaLibrary caches the interpreted files - TmaPlayer simulates all media interactions (without playing any sound) - TmaMediaItem represents the media items of the test app - TmaMediaEvent represents playback events to send to the media session Test: manual Change-Id: I5f4e6c537d8d0e49d4f5a1dc958e73722b78534e
Diffstat (limited to 'TestMediaApp/res')
-rw-r--r--TestMediaApp/res/drawable/button_ripple_bg.xml20
-rw-r--r--TestMediaApp/res/drawable/ic_close.xml27
-rw-r--r--TestMediaApp/res/layout/tma_launcher_activity.xml36
-rw-r--r--TestMediaApp/res/layout/tma_prefs_activity.xml60
-rw-r--r--TestMediaApp/res/mipmap-xxxhdpi/ic_launcher.pngbin0 -> 10486 bytes
-rw-r--r--TestMediaApp/res/mipmap-xxxhdpi/ic_launcher_round.pngbin0 -> 14696 bytes
-rw-r--r--TestMediaApp/res/values/strings.xml28
-rw-r--r--TestMediaApp/res/values/styles.xml23
8 files changed, 194 insertions, 0 deletions
diff --git a/TestMediaApp/res/drawable/button_ripple_bg.xml b/TestMediaApp/res/drawable/button_ripple_bg.xml
new file mode 100644
index 0000000..d012c94
--- /dev/null
+++ b/TestMediaApp/res/drawable/button_ripple_bg.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 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.
+-->
+
+<ripple
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="@*android:color/car_card_ripple_background" />
diff --git a/TestMediaApp/res/drawable/ic_close.xml b/TestMediaApp/res/drawable/ic_close.xml
new file mode 100644
index 0000000..f955ed5
--- /dev/null
+++ b/TestMediaApp/res/drawable/ic_close.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 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.
+-->
+
+<vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="56dp"
+ android:height="56dp"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0">
+ <path
+ android:fillColor="#FFF"
+ android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
+</vector>
diff --git a/TestMediaApp/res/layout/tma_launcher_activity.xml b/TestMediaApp/res/layout/tma_launcher_activity.xml
new file mode 100644
index 0000000..d2590de
--- /dev/null
+++ b/TestMediaApp/res/layout/tma_launcher_activity.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 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.
+-->
+
+<androidx.constraintlayout.widget.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+
+ <Button
+ android:id="@+id/prefs_button"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="Open Prefs"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/TestMediaApp/res/layout/tma_prefs_activity.xml b/TestMediaApp/res/layout/tma_prefs_activity.xml
new file mode 100644
index 0000000..990a033
--- /dev/null
+++ b/TestMediaApp/res/layout/tma_prefs_activity.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 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.
+-->
+
+<androidx.constraintlayout.widget.ConstraintLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
+
+ <FrameLayout
+ android:id="@+id/close_target"
+ android:layout_width="112dp"
+ android:layout_height="96dp"
+ android:background="@drawable/button_ripple_bg"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintStart_toStartOf="parent">
+ <ImageView
+ android:layout_width="56dp"
+ android:layout_height="56dp"
+ android:layout_gravity="center"
+ android:scaleType="fitCenter"
+ android:src="@drawable/ic_close"/>
+ </FrameLayout>
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:maxLines="1"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:text="TMA Preferences"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/close_target"
+ app:layout_constraintBottom_toBottomOf="@+id/close_target"/>
+
+ <FrameLayout
+ android:id="@+id/prefs_content"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ app:layout_constraintTop_toBottomOf="@+id/close_target"
+ app:layout_constraintBottom_toBottomOf="parent">
+ </FrameLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/TestMediaApp/res/mipmap-xxxhdpi/ic_launcher.png b/TestMediaApp/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..aee44e1
--- /dev/null
+++ b/TestMediaApp/res/mipmap-xxxhdpi/ic_launcher.png
Binary files differ
diff --git a/TestMediaApp/res/mipmap-xxxhdpi/ic_launcher_round.png b/TestMediaApp/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..34947cd
--- /dev/null
+++ b/TestMediaApp/res/mipmap-xxxhdpi/ic_launcher_round.png
Binary files differ
diff --git a/TestMediaApp/res/values/strings.xml b/TestMediaApp/res/values/strings.xml
new file mode 100644
index 0000000..e35fcd4
--- /dev/null
+++ b/TestMediaApp/res/values/strings.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2019, 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.
+-->
+<resources>
+ <string name="app_name" translatable="false">Test Media App</string>
+
+ <string name="select_account" translatable="false">Please select an account type</string>
+
+ <string name="no_account" translatable="false"> A test account is required to use this test
+ media app. Thankfully you can simply pick the test account type in the preferences of the
+ test media app. This message is intentionally extra long to make sure driving restrictions
+ will truncate it when needed.
+ </string>
+
+</resources>
diff --git a/TestMediaApp/res/values/styles.xml b/TestMediaApp/res/values/styles.xml
new file mode 100644
index 0000000..cf316c5
--- /dev/null
+++ b/TestMediaApp/res/values/styles.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (c) 2019, 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.
+ */
+-->
+<resources>
+ <style name="TestMediaAppTheme" parent="Theme.Car.Light.NoActionBar">
+ <item name="android:windowBackground">@color/car_card_dark</item>
+ </style>
+
+</resources>