diff --git a/samples/demo/haptic-assessment/Android.bp b/samples/demo/haptic-assessment/Android.bp new file mode 100644 index 0000000000000..1c006091a755d --- /dev/null +++ b/samples/demo/haptic-assessment/Android.bp @@ -0,0 +1,34 @@ +// +// Copyright (C) 2020 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. +// + +android_app { + name: "HapticAssessment", + manifest: "AndroidManifest.xml", + sdk_version: "current", + min_sdk_version: "29", + srcs: [ + "src/**/*.java", + "src/**/*.kt", + ], + static_libs: [ + "androidx.appcompat_appcompat", + "androidx-constraintlayout_constraintlayout", + ], + resource_dirs: [ + "res", + ], + dxflags: ["--multi-dex"], +} \ No newline at end of file diff --git a/samples/demo/haptic-assessment/AndroidManifest.xml b/samples/demo/haptic-assessment/AndroidManifest.xml new file mode 100644 index 0000000000000..251646eb975e0 --- /dev/null +++ b/samples/demo/haptic-assessment/AndroidManifest.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/demo/haptic-assessment/README.txt b/samples/demo/haptic-assessment/README.txt new file mode 100644 index 0000000000000..8b84cd8c6807e --- /dev/null +++ b/samples/demo/haptic-assessment/README.txt @@ -0,0 +1,13 @@ +README +====== + +This haptic assessment sample app allows the user to play with three different +types of VibrationEffects: + +1) Predefined click effect with default strength. + +2) One shot vibration with 20ms duration at max amplitude. + +3) Waveform vibration with 500ms duration at half amplitude, then 500ms duration + at max amplitude. This will pass if the device supports vibration amplitude + control, and visibly fail otherwise. diff --git a/samples/demo/haptic-assessment/res/drawable-v24/ic_launcher_foreground.xml b/samples/demo/haptic-assessment/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000000000..134813eb4d684 --- /dev/null +++ b/samples/demo/haptic-assessment/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/demo/haptic-assessment/res/drawable/bluebar.png b/samples/demo/haptic-assessment/res/drawable/bluebar.png new file mode 100644 index 0000000000000..ae163df4295a5 Binary files /dev/null and b/samples/demo/haptic-assessment/res/drawable/bluebar.png differ diff --git a/samples/demo/haptic-assessment/res/drawable/cross_60x60.gif b/samples/demo/haptic-assessment/res/drawable/cross_60x60.gif new file mode 100644 index 0000000000000..cf3561757e38f Binary files /dev/null and b/samples/demo/haptic-assessment/res/drawable/cross_60x60.gif differ diff --git a/samples/demo/haptic-assessment/res/drawable/ic_launcher_background.xml b/samples/demo/haptic-assessment/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000000000..5634f725f245b --- /dev/null +++ b/samples/demo/haptic-assessment/res/drawable/ic_launcher_background.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/demo/haptic-assessment/res/layout/activity_main.xml b/samples/demo/haptic-assessment/res/layout/activity_main.xml new file mode 100644 index 0000000000000..47d45a60a6a49 --- /dev/null +++ b/samples/demo/haptic-assessment/res/layout/activity_main.xml @@ -0,0 +1,93 @@ + + + + +