From bf662bcd3dee23cdc0bdedef3ba9c373060b3bca Mon Sep 17 00:00:00 2001 From: Lais Andrade Date: Thu, 28 May 2020 18:55:10 +0000 Subject: [PATCH] Add sample app for haptic assessment. Fix: 157889698 Test: N/A Change-Id: Iff2cf51e779b9e016f50080cdac0da90c6ffce38 --- samples/demo/haptic-assessment/Android.bp | 34 ++++ .../haptic-assessment/AndroidManifest.xml | 38 ++++ samples/demo/haptic-assessment/README.txt | 13 ++ .../drawable-v24/ic_launcher_foreground.xml | 46 +++++ .../res/drawable/bluebar.png | Bin 0 -> 3883 bytes .../res/drawable/cross_60x60.gif | Bin 0 -> 1252 bytes .../res/drawable/ic_launcher_background.xml | 185 ++++++++++++++++++ .../res/layout/activity_main.xml | 93 +++++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 20 ++ .../mipmap-anydpi-v26/ic_launcher_round.xml | 20 ++ .../res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3593 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5339 bytes .../res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2636 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3388 bytes .../res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4926 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7472 bytes .../res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7909 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 11873 bytes .../res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10652 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 16570 bytes .../haptic-assessment/res/values/colors.xml | 21 ++ .../haptic-assessment/res/values/dimen.xml | 25 +++ .../haptic-assessment/res/values/strings.xml | 24 +++ .../haptic-assessment/res/values/styles.xml | 28 +++ .../android/hapticassessment/MainActivity.kt | 71 +++++++ 25 files changed, 618 insertions(+) create mode 100644 samples/demo/haptic-assessment/Android.bp create mode 100644 samples/demo/haptic-assessment/AndroidManifest.xml create mode 100644 samples/demo/haptic-assessment/README.txt create mode 100644 samples/demo/haptic-assessment/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 samples/demo/haptic-assessment/res/drawable/bluebar.png create mode 100644 samples/demo/haptic-assessment/res/drawable/cross_60x60.gif create mode 100644 samples/demo/haptic-assessment/res/drawable/ic_launcher_background.xml create mode 100644 samples/demo/haptic-assessment/res/layout/activity_main.xml create mode 100644 samples/demo/haptic-assessment/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 samples/demo/haptic-assessment/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 samples/demo/haptic-assessment/res/mipmap-hdpi/ic_launcher.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-mdpi/ic_launcher.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-xhdpi/ic_launcher.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 samples/demo/haptic-assessment/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 samples/demo/haptic-assessment/res/values/colors.xml create mode 100644 samples/demo/haptic-assessment/res/values/dimen.xml create mode 100644 samples/demo/haptic-assessment/res/values/strings.xml create mode 100644 samples/demo/haptic-assessment/res/values/styles.xml create mode 100644 samples/demo/haptic-assessment/src/com/example/android/hapticassessment/MainActivity.kt 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 0000000000000000000000000000000000000000..ae163df4295a5ae00aedb70e5e20bdf7501d9502 GIT binary patch literal 3883 zcmeHKzi;G36m~dqgo8BDp(`wh;!a|0&)Dl-&z%W5Z@8?4LzG)Yu46niyK80bF}9O+ zqJ!dugpercpg^LcLsUo<6dZ^GBq|#I1PX*GL4tzuuGgGSdm)OhLc7w+&okfq{k<9a zz1^LgYnPt8q$tW-Z@arEpI<1-g?CmTlhV81`>)Bzlj-*DTv7D(>c3Kcx^bi^7r%@8 z`^A3n3Z^2~2@@gL%Q%&2MY+CFri32wLJj#aN<8iNufEpQhT#Pz|%G>hw6T?tNJ42YD;$j zg?3AAyE=3%+jU=1kqJA7*)gC6po47_Bc#?pO?u1N0Pl5Qu6@ZjPa73QiVb5jndlQs z7unE&uIm~mG7th10rKOdASFoh^|^&E&uJE=MI;invPeR4Sa_O@be2M#HfEE&E|V;n zQIgbvx>=<(1v1*;(!*>#bqvTBp9hwXL?QB#ct{@2c9Ttt{fv`BWPKsV^G5B?t*E|VHO5u11cXLO zW%_F6s@CFNQgBa0CNhC(1JmuBHnuI?l5!iH<_sE0GB8q*g<$7Fuwc>P_&=eH;(^Fw zB1;v;WXO#)8BVQTh77WE(LJVv4PD@3PKJM2wN^2w29jy ztTWf|3VK+zajws#K4Uh5+@gR(%K^5-5OCWa1R!l$p=HyM*v?%4)hv=@M8@a0)3gcu zVl1*iFj-|wQ~zD>`TlMu2GLk<B#-V_lPqxs^fJ=IO9PsPWSFRie*cuOY(fL#O7j=FU{4&6IrZGUOXSYowXEY zb*a(SU;p}}`kd`;?Q}oC@y6YM03C@e@Bjb+ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..cf3561757e38f45116ef20b77bbad7c745df5f98 GIT binary patch literal 1252 zcmZ?wbhEHbv|+GeXkcKFJO1nc|Nn~rxg&f76kHNZ5`naheMLcHa&~HoLQ-maW}dCm z``!DM6f#q6mBLMZ4SWlnQ!_F>s)|yBtNcQetFn_VQ=?Nk^)#sNw%$$BS=C4WT$g}QL2Keo|$g4p^2%2xuu?=nX!qb zrH+D;fuV)IfrY-Iv96(+m5G6sk&yxvC;@FNN=dT{a&d#&1?1T(Wt5Z@Sn2DRmzV36 z8|&p4rRy77T3YHG80i}s=>k>g7FXt#Bv$C=6)VF`a7isrF3Kz@$;{7F0GXJWlwVq6 zs|0i@#0$9vaAWg|^}ycIOU}>LuShJ=H`Fr#c?qV_*B8Ii++4Wo;*y|LgnO|XTpUta zkg6Y)TAW{6l$;7wt_-rOz{P^Az7BifB^?{Dj2SqPZbi;&zX$ZuGCte^2p8QkufN8!6n7A4L|NHyr_phHn zzJL4r<@2YHAKt%v`{wnlmoJ__d-~+@qlXXf-@AL~_N|*Yu3x))1N{AbeZ0LqJ>1<~U7Vd99qjFFZLF;(7*vEi;#79 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ + + + + +