diff options
author | Dan Sandler <dsandler@android.com> | 2014-10-08 18:16:01 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-08 18:16:01 +0000 |
commit | 9eef8749232c00afad5ca3c26736c0be785cb8c1 (patch) | |
tree | c6fa261c27d2b1126be8b97ba6964c66c5eeefc2 /packages | |
parent | c4ad87539a117714854ac56931db5b7289f78d3c (diff) | |
parent | 2200f86f800876d005f911e6864708fa9772d03a (diff) | |
download | frameworks_base-9eef8749232c00afad5ca3c26736c0be785cb8c1.zip frameworks_base-9eef8749232c00afad5ca3c26736c0be785cb8c1.tar.gz frameworks_base-9eef8749232c00afad5ca3c26736c0be785cb8c1.tar.bz2 |
am 2200f86f: All (er, L) is finally revealed.
* commit '2200f86f800876d005f911e6864708fa9772d03a':
All (er, L) is finally revealed.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/AndroidManifest.xml | 4 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable-nodpi/icon.xml | 60 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable-nodpi/lollipop.xml | 48 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/placeholder.xml | 51 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/pop_belt.xml | 33 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/pop_droid.xml | 33 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/pop_pizza.xml | 45 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/pop_stripes.xml | 36 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/pop_swirl.xml | 57 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/pop_vortex.xml | 27 | ||||
-rw-r--r-- | packages/SystemUI/res/drawable/pop_vortex2.xml | 27 | ||||
-rw-r--r-- | packages/SystemUI/res/values/lland_config.xml | 11 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/egg/LLand.java | 301 |
13 files changed, 625 insertions, 108 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index eeb79b9..b3e60d1 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -121,7 +121,7 @@ android:allowBackup="false" android:hardwareAccelerated="true" android:label="@string/app_label" - android:icon="@*android:drawable/platlogo" + android:icon="@drawable/icon" android:process="com.android.systemui" android:supportsRtl="true" android:theme="@style/systemui_theme"> @@ -288,7 +288,7 @@ </activity> <activity android:name=".egg.LLandActivity" - android:theme="@android:style/Theme.Material.Light.NoActionBar.TranslucentDecor" + android:theme="@android:style/Theme.Material.Light.NoActionBar" android:exported="true" android:label="@string/lland" android:hardwareAccelerated="true" diff --git a/packages/SystemUI/res/drawable-nodpi/icon.xml b/packages/SystemUI/res/drawable-nodpi/icon.xml new file mode 100644 index 0000000..dc1e633 --- /dev/null +++ b/packages/SystemUI/res/drawable-nodpi/icon.xml @@ -0,0 +1,60 @@ +<!-- +Copyright (C) 2014 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="48dp" + android:height="48dp" + android:viewportWidth="560.0" + android:viewportHeight="560.0"> + <path + android:pathData="M280.000000,288.000000m-260.000000,0.000000a260.000000,260.000000 0.000000,1.000000 1.000000,520.000000 0.000000a260.000000,260.000000 0.000000,1.000000 1.000000,-520.000000 0.000000" + android:fillColor="#14000000"/> + <path + android:pathData="M280.000000,285.000000m-255.000000,0.000000a255.000000,255.000000 0.000000,1.000000 1.000000,510.000000 0.000000a255.000000,255.000000 0.000000,1.000000 1.000000,-510.000000 0.000000" + android:fillColor="#26000000"/> + <path + android:pathData="M280.000000,282.000000m-252.000000,0.000000a252.000000,252.000000 0.000000,1.000000 1.000000,504.000000 0.000000a252.000000,252.000000 0.000000,1.000000 1.000000,-504.000000 0.000000" + android:fillColor="#26000000"/> + <path + android:pathData="M280.000000,280.000000m-250.000000,0.000000a250.000000,250.000000 0.000000,1.000000 1.000000,500.000000 0.000000a250.000000,250.000000 0.000000,1.000000 1.000000,-500.000000 0.000000" + android:fillColor="#9C27B0"/> + <path + android:pathData="M265.786011,244.938004l0.000000,8.768000c6.527000,-6.384000 15.303000,-10.321000 25.063000,-10.321000c20.214001,0.000000 36.429001,16.500000 36.429001,36.714001c0.000000,20.072001 -16.215000,36.500000 -36.429001,36.500000c-9.759000,0.000000 -18.107000,-3.651000 -24.634001,-9.759000l0.000000,25.839001l-10.107000,0.000000l0.000000,-87.740997L265.786011,244.937988L265.786011,244.938004zM267.330994,266.490997c-0.420000,0.706000 -1.125000,1.821000 -1.125000,4.277000l0.000000,18.813000c0.000000,1.759000 0.420000,2.740000 0.982000,3.723000c4.634000,7.929000 13.197000,13.339000 22.882999,13.339000c14.671000,0.000000 26.742001,-11.999000 26.742001,-26.669001c0.000000,-14.536000 -12.071000,-26.607000 -26.742001,-26.607000C280.454987,253.365997 271.963989,258.625000 267.330994,266.490997z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M427.973999,244.938004l0.000000,8.768000c6.526000,-6.384000 15.304000,-10.321000 25.062000,-10.321000c20.215000,0.000000 36.429001,16.500000 36.429001,36.714001c0.000000,20.072001 -16.214001,36.500000 -36.429001,36.500000c-9.758000,0.000000 -18.106001,-3.651000 -24.634001,-9.759000l0.000000,25.839001l-10.107000,0.000000l0.000000,-87.740997L427.973999,244.937988L427.973999,244.938004zM429.518005,266.490997c-0.419000,0.706000 -1.125000,1.821000 -1.125000,4.277000l0.000000,18.813000c0.000000,1.759000 0.420000,2.740000 0.982000,3.723000c4.634000,7.929000 13.196000,13.339000 22.884001,13.339000c14.670000,0.000000 26.740999,-11.999000 26.740999,-26.669001c0.000000,-14.536000 -12.071000,-26.607000 -26.740999,-26.607000C442.643005,253.365997 434.152008,258.625000 429.518005,266.490997z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M181.330994,279.893005c0.000000,20.214001 -16.357000,36.715000 -36.438000,36.715000c-20.214001,0.000000 -36.643002,-16.500999 -36.643002,-36.715000c0.000000,-20.070999 16.419001,-36.500000 36.643002,-36.500000C164.973007,243.393005 181.330994,259.821014 181.330994,279.893005zM171.151993,280.036011c0.000000,-14.669000 -11.723000,-26.669001 -26.259001,-26.669001c-14.741000,0.000000 -26.250000,12.000000 -26.250000,26.669001c0.000000,14.536000 11.509000,26.607000 26.250000,26.607000C159.429001,306.634003 171.151993,294.562012 171.151993,280.036011z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M408.384003,279.893005c0.000000,20.214001 -16.357000,36.715000 -36.437000,36.715000c-20.215000,0.000000 -36.644001,-16.500999 -36.644001,-36.715000c0.000000,-20.070999 16.420000,-36.500000 36.644001,-36.500000C392.026001,243.393005 408.384003,259.821014 408.384003,279.893005zM398.204987,280.036011c0.000000,-14.669000 -11.723000,-26.669001 -26.257999,-26.669001c-14.742000,0.000000 -26.250999,12.000000 -26.250999,26.669001c0.000000,14.536000 11.509000,26.607000 26.250999,26.607000C386.481995,306.634003 398.204987,294.562012 398.204987,280.036011z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M234.481995,227.320999l9.973000,0.000000l0.000000,10.250000l-9.973000,0.000000z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M234.481995,244.865997l9.973000,0.000000l0.000000,70.195999l-9.973000,0.000000z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M88.392998,227.320999l9.973000,0.000000l0.000000,87.740997l-9.973000,0.000000z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M191.231995,227.320999l9.973000,0.000000l0.000000,87.740997l-9.973000,0.000000z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M212.856995,227.320999l9.974000,0.000000l0.000000,87.740997l-9.974000,0.000000z" + android:fillColor="#FFFFFF"/> +</vector> diff --git a/packages/SystemUI/res/drawable-nodpi/lollipop.xml b/packages/SystemUI/res/drawable-nodpi/lollipop.xml new file mode 100644 index 0000000..cb63af0 --- /dev/null +++ b/packages/SystemUI/res/drawable-nodpi/lollipop.xml @@ -0,0 +1,48 @@ +<!-- +Copyright (C) 2014 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.0apache.0org/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.0android.0com/apk/res/android" + android:width="560.0dp" + android:height="560.0dp" + android:viewportWidth="560.0" + android:viewportHeight="560.0"> + <path + android:pathData="M264.079987,240.736l0.0,9.82c7.31,-7.15 17.139999,-11.56 28.07,-11.56c22.639999,0.0 40.799999,18.48 40.799999,41.12c0.0,22.48 -18.16,40.880 -40.799999,40.880c-10.93,0.0 -20.280,-4.09 -27.59,-10.93L264.559998,339.0l-11.32,0.0l0.0,-98.269997L264.079987,240.731zM265.809998,264.869995c-0.47,0.79 -1.26,2.04 -1.26,4.79l0.0,21.07c0.0,1.97 0.47,3.07 1.1,4.17c5.19,8.88 14.78,14.94 25.63,14.94c16.43,0.0 29.950,-13.44 29.950,-29.870c0.0,-16.280 -13.52,-29.799999 -29.950,-29.799999C280.51,250.169998 271.0,256.059998 265.809998,264.869995z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M445.731,240.736l0.0,9.82c7.31,-7.15 17.139999,-11.56 28.07,-11.56c22.639999,0.0 40.799999,18.48 40.799999,41.12c0.0,22.48 -18.16,40.880 -40.799999,40.880c-10.93,0.0 -20.280,-4.09 -27.59,-10.93L446.210052,339.0l-11.32,0.0l0.0,-98.269997L445.731,240.731zM447.459991,264.869995c-0.47,0.79 -1.26,2.04 -1.26,4.79l0.0,21.07c0.0,1.97 0.47,3.07 1.1,4.17c5.19,8.88 14.78,14.94 25.63,14.94c16.43,0.0 29.950,-13.44 29.950,-29.870c0.0,-16.280 -13.52,-29.799999 -29.950,-29.799999C462.160004,250.169998 452.649994,256.059998 447.459991,264.869995z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M169.490005,279.880005c0.0,22.639999 -18.32,41.12 -40.810,41.12c-22.639999,0.0 -41.040,-18.48 -41.040,-41.12c0.0,-22.48 18.389999,-40.880 41.040,-40.880C151.169998,239.0 169.490005,257.399994 169.490005,279.880005zM158.089996,280.040009c0.0,-16.43 -13.13,-29.870 -29.41,-29.870c-16.51,0.0 -29.4,13.44 -29.4,29.870c0.0,16.280 12.89,29.799999 29.4,29.799999C144.960007,309.8387 158.089996,296.309998 158.089996,280.040009z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M423.790009,279.880005c0.0,22.639999 -18.32,41.12 -40.810,41.12c-22.639999,0.0 -41.040,-18.48 -41.040,-41.12c0.0,-22.48 18.389999,-40.880 41.040,-40.880C405.470,239.0 423.790009,257.399994 423.790009,279.880005zM412.395,280.040009c0.0,-16.43 -13.13,-29.870 -29.41,-29.870c-16.51,0.0 -29.4,13.44 -29.4,29.870c0.0,16.280 12.89,29.799999 29.4,29.799999C399.26,309.8387 412.395,296.309998 412.395,280.040009z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M229.02,221.0l11.17,0.0l0.0,11.48l-11.17,0.0z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M229.02,240.65l11.17,0.0l0.0,78.62l-11.17,0.0z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M65.4,221.0l11.17,0.0l0.0,98.27l-11.17,0.0z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M180.58,221.0l11.17,0.0l0.0,98.27l-11.17,0.0z" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M204.8,221.0l11.17,0.0l0.0,98.27l-11.17,0.0z" + android:fillColor="#FFFFFF"/> +</vector> diff --git a/packages/SystemUI/res/drawable/placeholder.xml b/packages/SystemUI/res/drawable/placeholder.xml deleted file mode 100644 index 1933145..0000000 --- a/packages/SystemUI/res/drawable/placeholder.xml +++ /dev/null @@ -1,51 +0,0 @@ -<!-- -Copyright (C) 2014 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="100dp" - android:height="400dp" - android:viewportWidth="100" - android:viewportHeight="400"> - - <!-- future site of real artwork --> - - <path android:fillColor="#FFFFFF00" - android:pathData="M 0,0 L 100,0 L 100,400 L 0,400 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,0 L 100,25 L 100,50 L 0,25 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,50 L 100,75 L 100,100 L 0,75 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,100 L 100,125 L 100,150 L 0,125 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,150 L 100,175 L 100,200 L 0,175 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,200 L 100,225 L 100,250 L 0,225 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,250 L 100,275 L 100,300 L 0,275 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,300 L 100,325 L 100,350 L 0,325 z" /> - <path - android:fillColor="#FF000000" - android:pathData="M 0,350 L 100,375 L 100,400 L 0,375 z" /> -</vector> - diff --git a/packages/SystemUI/res/drawable/pop_belt.xml b/packages/SystemUI/res/drawable/pop_belt.xml new file mode 100644 index 0000000..5c0c3d7 --- /dev/null +++ b/packages/SystemUI/res/drawable/pop_belt.xml @@ -0,0 +1,33 @@ +<!-- +Copyright (C) 2014 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="100.0dp" + android:height="100.0dp" + android:viewportWidth="100.0" + android:viewportHeight="100.0"> + <path + android:pathData="M50.000000,50.000000m-47.599998,0.000000a47.599998,47.599998 0.000000,1.000000 1.000000,95.199997 0.000000a47.599998,47.599998 0.000000,1.000000 1.000000,-95.199997 0.000000" + android:fillColor="#D81B60"/> + <path + android:pathData="M50.000000,2.429000c-26.337999,0.000000 -47.688999,21.351000 -47.688999,47.688999c0.000000,13.168000 5.337000,25.091000 13.968000,33.722000l67.444000,-67.443001C75.092003,7.766000 63.168999,2.429000 50.000000,2.429000z" + android:fillColor="#F06292"/> + <path + android:pathData="M0.000000,41.573002l100.000000,0.000000l0.000000,17.090000l-100.000000,0.000000z" + android:fillColor="#D81B60"/> + <path + android:pathData="M0.000000,58.662998l0.000000,-17.089996 100.000000,0.000000z" + android:fillColor="#F06292"/> +</vector> diff --git a/packages/SystemUI/res/drawable/pop_droid.xml b/packages/SystemUI/res/drawable/pop_droid.xml new file mode 100644 index 0000000..eed325c --- /dev/null +++ b/packages/SystemUI/res/drawable/pop_droid.xml @@ -0,0 +1,33 @@ +<!-- +Copyright (C) 2014 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="100.0dp" + android:height="100.0dp" + android:viewportWidth="100.0" + android:viewportHeight="100.0"> + <path + android:pathData="M50.000000,50.000000m-50.000000,0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,100.000000 0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,-100.000000 0.000000" + android:fillColor="#9E9D24"/> + <path + android:pathData="M30.775999,24.528000m-4.209000,0.000000a4.209000,4.209000 0.000000,1.000000 1.000000,8.418000 0.000000a4.209000,4.209000 0.000000,1.000000 1.000000,-8.418000 0.000000" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M69.226997,24.528000m-4.210000,0.000000a4.210000,4.210000 0.000000,1.000000 1.000000,8.420000 0.000000a4.210000,4.210000 0.000000,1.000000 1.000000,-8.420000 0.000000" + android:fillColor="#FFFFFF"/> + <path + android:pathData="M85.352997,14.648000C65.829002,-4.877000 34.168999,-4.877000 14.646000,14.646000C4.882000,24.410000 0.002000,37.207001 0.000000,50.000999l99.996002,0.002000C99.996002,37.207001 95.115997,24.410000 85.352997,14.648000z" + android:fillColor="#C0CA33"/> +</vector> diff --git a/packages/SystemUI/res/drawable/pop_pizza.xml b/packages/SystemUI/res/drawable/pop_pizza.xml new file mode 100644 index 0000000..b6d2bb3 --- /dev/null +++ b/packages/SystemUI/res/drawable/pop_pizza.xml @@ -0,0 +1,45 @@ +<!-- +Copyright (C) 2014 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="100.0dp" + android:height="100.0dp" + android:viewportWidth="100.0" + android:viewportHeight="100.0"> + <path + android:pathData="M14.645000,14.645000C5.597000,23.693001 0.000000,36.193001 0.000000,50.000000l50.000000,0.000000L14.645000,14.645000z" + android:fillColor="#7BAAF7"/> + <path + android:pathData="M100.000000,50.000000c0.000000,-13.807000 -5.597000,-26.306999 -14.645000,-35.355000L50.000000,50.000000L100.000000,50.000000z" + android:fillColor="#D81B60"/> + <path + android:pathData="M85.355003,14.645000C76.306999,5.597000 63.806999,0.000000 50.000000,0.000000l0.000000,50.000000L85.355003,14.645000z" + android:fillColor="#F06292"/> + <path + android:pathData="M50.000000,0.000000C36.193001,0.000000 23.693001,5.597000 14.645000,14.645000L50.000000,50.000000L50.000000,0.000000z" + android:fillColor="#FFF176"/> + <path + android:pathData="M50.000000,50.000000l35.355000,35.355000C94.403000,76.307999 100.000000,63.807999 100.000000,50.000000L50.000000,50.000000z" + android:fillColor="#7BAAF7"/> + <path + android:pathData="M50.000000,100.000000c13.807000,0.000000 26.306999,-5.596000 35.355000,-14.645000L50.000000,50.000000L50.000000,100.000000z" + android:fillColor="#FFF176"/> + <path + android:pathData="M14.645000,85.355003C23.693001,94.403999 36.193001,100.000000 50.000000,100.000000L50.000000,50.000000L14.645000,85.355003z" + android:fillColor="#F06292"/> + <path + android:pathData="M0.000000,50.000000c0.000000,13.808000 5.597000,26.308001 14.645000,35.355000L50.000000,50.000000L0.000000,50.000000z" + android:fillColor="#D81B60"/> +</vector> diff --git a/packages/SystemUI/res/drawable/pop_stripes.xml b/packages/SystemUI/res/drawable/pop_stripes.xml new file mode 100644 index 0000000..ef6c8e8 --- /dev/null +++ b/packages/SystemUI/res/drawable/pop_stripes.xml @@ -0,0 +1,36 @@ +<!-- +Copyright (C) 2014 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="100.0dp" + android:height="100.0dp" + android:viewportWidth="100.0" + android:viewportHeight="100.0"> + <path + android:pathData="M50.000000,50.000000m-50.000000,0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,100.000000 0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,-100.000000 0.000000" + android:fillColor="#F57C00"/> + <path + android:pathData="M50.000999,100.000000c14.136000,0.000000 26.893000,-5.876000 35.987000,-15.308000L14.013000,84.692001C23.106001,94.124001 35.862999,100.000000 50.000999,100.000000z" + android:fillColor="#E65100"/> + <path + android:pathData="M50.000999,0.000000C35.862999,0.000000 23.106001,5.876000 14.013000,15.308000l71.974998,0.000000C76.893997,5.876000 64.137001,0.000000 50.000999,0.000000z" + android:fillColor="#FFA726"/> + <path + android:pathData="M96.501999,31.631001c-2.423000,-6.127000 -6.020000,-11.660000 -10.514000,-16.323000L14.013000,15.308001C9.517000,19.971001 5.922000,25.503000 3.499000,31.631001L96.501999,31.631001z" + android:fillColor="#FB8C00"/> + <path + android:pathData="M3.499000,68.370003c2.423000,6.128000 6.018000,11.658000 10.514000,16.322001l71.974998,0.000000c4.494000,-4.664000 8.091000,-10.194000 10.514000,-16.322001L3.499000,68.370003z" + android:fillColor="#EF6C00"/> +</vector> diff --git a/packages/SystemUI/res/drawable/pop_swirl.xml b/packages/SystemUI/res/drawable/pop_swirl.xml new file mode 100644 index 0000000..acd6d3d --- /dev/null +++ b/packages/SystemUI/res/drawable/pop_swirl.xml @@ -0,0 +1,57 @@ +<!-- +Copyright (C) 2014 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="100.0dp" + android:height="100.0dp" + android:viewportWidth="100.0" + android:viewportHeight="100.0"> + <path + android:pathData="M50.000000,50.000000C86.898003,27.834999 79.244003,11.688000 76.177002,7.399000c-7.240000,-4.459000 -15.703000,-7.112000 -24.770000,-7.363000C56.247002,2.253000 70.815002,12.456000 50.000000,50.000000z" + android:fillColor="#82B1FF"/> + <path + android:pathData="M50.000000,50.000000c20.815001,-37.543999 6.247000,-47.747002 1.407000,-49.964001C50.938000,0.022000 50.472000,0.000000 50.000000,0.000000c-8.627000,0.000000 -16.743999,2.186000 -23.827000,6.032000C31.392000,5.514000 49.251999,6.903000 50.000000,50.000000z" + android:fillColor="#76FF03"/> + <path + android:pathData="M50.000000,50.000000c37.543999,20.816000 47.747002,6.248000 49.965000,1.408000C99.977997,50.938000 100.000000,50.473000 100.000000,50.000000c0.000000,-8.627000 -2.186000,-16.743999 -6.032000,-23.827000C94.486000,31.393000 93.098000,49.251999 50.000000,50.000000z" + android:fillColor="#76FF03"/> + <path + android:pathData="M50.000000,50.000000c43.098000,-0.748000 44.486000,-18.607000 43.967999,-23.827000c-4.186000,-7.708000 -10.344000,-14.188000 -17.791000,-18.773001C79.244003,11.688000 86.898003,27.834999 50.000000,50.000000z" + android:fillColor="#303F9F"/> + <path + android:pathData="M50.000000,50.000000C27.834000,13.103000 11.687000,20.757000 7.398000,23.823999C2.940000,31.063000 0.287000,39.527000 0.035000,48.592999C2.253000,43.752998 12.456000,29.184999 50.000000,50.000000z" + android:fillColor="#FAFAFA"/> + <path + android:pathData="M50.000000,50.000000C49.251999,6.903000 31.392000,5.514000 26.173000,6.032000c-7.709000,4.187000 -14.188000,10.344000 -18.774000,17.792000C11.687000,20.757000 27.834000,13.103000 50.000000,50.000000z" + android:fillColor="#303F9F"/> + <path + android:pathData="M50.000000,50.000000C12.456000,29.184999 2.253000,43.752998 0.035000,48.592999C0.022000,49.062000 0.000000,49.528000 0.000000,50.000000c0.000000,8.628000 2.186000,16.743999 6.032000,23.827999C5.514000,68.609001 6.902000,50.749001 50.000000,50.000000z" + android:fillColor="#76FF03"/> + <path + android:pathData="M50.000000,50.000000c0.748000,43.098000 18.608000,44.486000 23.827000,43.969002c7.709000,-4.187000 14.188000,-10.344000 18.774000,-17.791000C88.313004,79.244003 72.166000,86.898003 50.000000,50.000000z" + android:fillColor="#303F9F"/> + <path + android:pathData="M50.000000,50.000000c22.166000,36.897999 38.313000,29.243999 42.602001,26.177999c4.458000,-7.240000 7.111000,-15.703000 7.363000,-24.770000C97.747002,56.248001 87.543999,70.816002 50.000000,50.000000z" + android:fillColor="#FAFAFA"/> + <path + android:pathData="M50.000000,50.000000c-20.815001,37.544998 -6.247000,47.748001 -1.407000,49.965000C49.062000,99.978996 49.528000,100.000000 50.000000,100.000000c8.627000,0.000000 16.743999,-2.185000 23.827000,-6.031000C68.608002,94.486000 50.748001,93.098000 50.000000,50.000000z" + android:fillColor="#76FF03"/> + <path + android:pathData="M50.000000,50.000000C13.103000,72.166000 20.757000,88.313004 23.823000,92.601997c7.240000,4.459000 15.703000,7.112000 24.770000,7.363000C43.752998,97.748001 29.184999,87.544998 50.000000,50.000000z" + android:fillColor="#82B1FF"/> + <path + android:pathData="M50.000000,50.000000C6.902000,50.749001 5.514000,68.609001 6.032000,73.828003c4.186000,7.708000 10.344000,14.188000 17.791000,18.773001C20.757000,88.313004 13.103000,72.166000 50.000000,50.000000z" + android:fillColor="#303F9F"/> +</vector> diff --git a/packages/SystemUI/res/drawable/pop_vortex.xml b/packages/SystemUI/res/drawable/pop_vortex.xml new file mode 100644 index 0000000..faefcb1 --- /dev/null +++ b/packages/SystemUI/res/drawable/pop_vortex.xml @@ -0,0 +1,27 @@ +<!-- +Copyright (C) 2014 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="100.0dp" + android:height="100.0dp" + android:viewportWidth="100.0" + android:viewportHeight="100.0"> + <path + android:pathData="M50.000000,50.000000m-50.000000,0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,100.000000 0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,-100.000000 0.000000" + android:fillColor="#FFF176"/> + <path + android:pathData="M58.658001,89.648003c-19.330000,0.000000 -35.000000,-15.670000 -35.000000,-35.000000c0.000000,-13.531000 10.969000,-24.500000 24.500000,-24.500000c9.472000,0.000000 17.150000,7.679000 17.150000,17.150000c0.000000,6.631000 -5.375000,12.006000 -12.006000,12.006000c-3.798000,0.000000 -7.004000,-2.522000 -8.045000,-5.982000c1.021000,1.136000 2.497000,1.854000 4.145000,1.854000c2.644000,0.000000 4.853000,-1.841000 5.428000,-4.310000c0.175000,-0.558000 0.271000,-1.150000 0.271000,-1.766000c0.000000,-4.642000 -3.763000,-8.404000 -8.403000,-8.404000c-6.631000,0.000000 -12.006000,5.375000 -12.006000,12.006000c0.000000,9.472000 7.679000,17.149000 17.150000,17.149000c13.531000,0.000000 24.500000,-10.969000 24.500000,-24.500000c0.000000,-19.330000 -15.670000,-35.000000 -35.000000,-35.000000c-12.963000,0.000000 -24.773001,4.935000 -33.657001,13.025000C2.824000,31.087000 0.000000,40.212002 0.000000,50.000000c0.000000,27.615000 22.386000,50.000000 50.000000,50.000000c17.825001,0.000000 33.462002,-9.335000 42.313999,-23.375999C83.431000,84.714996 71.621002,89.648003 58.658001,89.648003z" + android:fillColor="#7BAAF7"/> +</vector> diff --git a/packages/SystemUI/res/drawable/pop_vortex2.xml b/packages/SystemUI/res/drawable/pop_vortex2.xml new file mode 100644 index 0000000..0a96b74 --- /dev/null +++ b/packages/SystemUI/res/drawable/pop_vortex2.xml @@ -0,0 +1,27 @@ +<!-- +Copyright (C) 2014 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="100.0dp" + android:height="100.0dp" + android:viewportWidth="100.0" + android:viewportHeight="100.0"> + <path + android:pathData="M50.000000,50.000000m-50.000000,0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,100.000000 0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,-100.000000 0.000000" + android:fillColor="#D81B60"/> + <path + android:pathData="M21.250000,78.369003c-13.200000,-16.000000 -10.930000,-39.671001 5.070000,-52.870998c12.799000,-10.560000 31.737000,-8.743000 42.294998,4.057000c8.448000,10.239000 6.996000,25.389000 -3.244000,33.837002c-8.191000,6.759000 -20.311001,5.596000 -27.068001,-2.596000c-5.408000,-6.554000 -4.478000,-16.249001 2.076000,-21.656000c5.242000,-4.325000 12.998000,-3.581000 17.323999,1.661000c3.460000,4.194000 2.865000,10.399000 -1.330000,13.859000c-3.354000,2.769000 -8.318000,2.293000 -11.087000,-1.062000c-2.214000,-2.685000 -1.833000,-6.655000 0.851000,-8.870000c2.147000,-1.771000 5.324000,-1.468000 7.096000,0.681000c1.393000,1.688000 1.174000,4.165000 -0.464000,5.596000c0.409000,-0.564000 0.657000,-1.253000 0.657000,-2.004000c0.000000,-1.021000 -0.455000,-1.928000 -1.165000,-2.556000c-0.067000,-0.112000 -0.134000,-0.226000 -0.220000,-0.329000c-1.135000,-1.373000 -3.168000,-1.568000 -4.542000,-0.435000c-1.719000,1.417000 -1.962000,3.958000 -0.544000,5.677000c1.771000,2.146000 4.949000,2.451000 7.096000,0.680000c2.684000,-2.215000 3.064000,-6.186000 0.851000,-8.870000c-2.769000,-3.356000 -7.732000,-3.831000 -11.087000,-1.063000c-4.195000,3.460000 -4.790000,9.665000 -1.330000,13.859000c4.326000,5.244000 12.082000,5.987000 17.323999,1.662000c6.554000,-5.407000 7.484000,-15.102000 2.076000,-21.656000c-6.758000,-8.191000 -18.875999,-9.354000 -27.069000,-2.596000c-10.239000,8.448000 -11.691000,23.598000 -3.244000,33.837002c10.560000,12.800000 29.497000,14.616000 42.296001,4.056000c16.000000,-13.199000 18.270000,-36.869999 5.070000,-52.868999C68.397003,5.620000 52.516998,-0.139000 37.205002,1.659000c-8.665000,2.287000 -16.410999,6.836000 -22.561001,12.985000C5.597000,23.693001 0.000000,36.193001 0.000000,50.000000c0.000000,13.808000 5.597000,26.308001 14.645000,35.355000C23.693001,94.403999 36.193001,100.000000 50.000000,100.000000c11.935000,0.000000 22.886999,-4.187000 31.482000,-11.164000C61.909000,100.523003 36.202999,96.495003 21.250000,78.369003z" + android:fillColor="#F06292"/> +</vector> diff --git a/packages/SystemUI/res/values/lland_config.xml b/packages/SystemUI/res/values/lland_config.xml index 56125a5..5d74082 100644 --- a/packages/SystemUI/res/values/lland_config.xml +++ b/packages/SystemUI/res/values/lland_config.xml @@ -20,10 +20,11 @@ <resources> <dimen name="obstacle_spacing">380dp</dimen> <dimen name="translation_per_sec">100dp</dimen> - <dimen name="boost_dv">600dp</dimen> + <dimen name="boost_dv">550dp</dimen> <dimen name="player_hit_size">40dp</dimen> <dimen name="player_size">40dp</dimen> - <dimen name="obstacle_width">80dp</dimen> + <dimen name="obstacle_width">90dp</dimen> + <dimen name="obstacle_stem_width">12dp</dimen> <dimen name="obstacle_gap">170dp</dimen> <dimen name="obstacle_height_min">40dp</dimen> <dimen name="building_width_min">20dp</dimen> @@ -38,8 +39,8 @@ <dimen name="G">30dp</dimen> <dimen name="max_v">1000dp</dimen> <dimen name="scenery_z">6dp</dimen> - <dimen name="obstacle_z">15dp</dimen> - <dimen name="player_z">15dp</dimen> - <dimen name="player_z_boost">18dp</dimen> + <dimen name="obstacle_z">18dp</dimen> + <dimen name="player_z">18dp</dimen> + <dimen name="player_z_boost">20dp</dimen> <dimen name="hud_z">35dp</dimen> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/egg/LLand.java b/packages/SystemUI/src/com/android/systemui/egg/LLand.java index d1c02dd..cdfe6e5 100644 --- a/packages/SystemUI/src/com/android/systemui/egg/LLand.java +++ b/packages/SystemUI/src/com/android/systemui/egg/LLand.java @@ -19,26 +19,37 @@ package com.android.systemui.egg; import android.animation.TimeAnimator; import android.content.Context; import android.content.res.Resources; -import android.graphics.*; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Matrix; +import android.graphics.Outline; +import android.graphics.Paint; +import android.graphics.Path; +import android.graphics.PorterDuff; +import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.util.AttributeSet; import android.util.Log; -import android.view.*; +import android.view.Gravity; +import android.view.KeyEvent; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewOutlineProvider; import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; -import java.util.ArrayList; - import com.android.systemui.R; +import java.util.ArrayList; + public class LLand extends FrameLayout { public static final String TAG = "LLand"; public static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); - public static final boolean DEBUG_DRAW = false && DEBUG; + public static final boolean DEBUG_DRAW = false; // DEBUG public static final void L(String s, Object ... objects) { if (DEBUG) { @@ -52,13 +63,24 @@ public class LLand extends FrameLayout { public static final float DEBUG_SPEED_MULTIPLIER = 1f; // 0.1f; public static final boolean DEBUG_IDDQD = false; + final static int[] POPS = { + // resid // spinny! + R.drawable.pop_belt, 0, + R.drawable.pop_droid, 0, + R.drawable.pop_pizza, 1, + R.drawable.pop_stripes, 0, + R.drawable.pop_swirl, 1, + R.drawable.pop_vortex, 1, + R.drawable.pop_vortex2, 1, + }; + private static class Params { public float TRANSLATION_PER_SEC; public int OBSTACLE_SPACING, OBSTACLE_PERIOD; public int BOOST_DV; public int PLAYER_HIT_SIZE; public int PLAYER_SIZE; - public int OBSTACLE_WIDTH; + public int OBSTACLE_WIDTH, OBSTACLE_STEM_WIDTH; public int OBSTACLE_GAP; public int OBSTACLE_MIN; public int BUILDING_WIDTH_MIN, BUILDING_WIDTH_MAX; @@ -76,6 +98,7 @@ public class LLand extends FrameLayout { PLAYER_HIT_SIZE = res.getDimensionPixelSize(R.dimen.player_hit_size); PLAYER_SIZE = res.getDimensionPixelSize(R.dimen.player_size); OBSTACLE_WIDTH = res.getDimensionPixelSize(R.dimen.obstacle_width); + OBSTACLE_STEM_WIDTH = res.getDimensionPixelSize(R.dimen.obstacle_stem_width); OBSTACLE_GAP = res.getDimensionPixelSize(R.dimen.obstacle_gap); OBSTACLE_MIN = res.getDimensionPixelSize(R.dimen.obstacle_height_min); BUILDING_HEIGHT_MIN = res.getDimensionPixelSize(R.dimen.building_height_min); @@ -112,6 +135,7 @@ public class LLand extends FrameLayout { private int mWidth, mHeight; private boolean mAnimating, mPlaying; private boolean mFrozen; // after death, a short backoff + private boolean mFlipped; private int mTimeOfDay; private static final int DAY = 0, NIGHT = 1, TWILIGHT = 2, SUNSET = 3; @@ -119,7 +143,7 @@ public class LLand extends FrameLayout { { 0xFFc0c0FF, 0xFFa0a0FF }, // DAY { 0xFF000010, 0xFF000000 }, // NIGHT { 0xFF000040, 0xFF000010 }, // TWILIGHT - { 0xFF805010, 0xFF202080 }, // SUNSET + { 0xFFa08020, 0xFF204080 }, // SUNSET }; private static Params PARAMS; @@ -183,7 +207,8 @@ public class LLand extends FrameLayout { sky.setDither(true); setBackground(sky); - setScaleX(frand() > 0.5f ? 1 : -1); + mFlipped = frand() > 0.5f; + setScaleX(mFlipped ? -1 : 1); setScore(0); @@ -276,9 +301,7 @@ public class LLand extends FrameLayout { mDroid.setX(mWidth / 2); mDroid.setY(mHeight / 2); addView(mDroid, new LayoutParams(PARAMS.PLAYER_SIZE, PARAMS.PLAYER_SIZE)); - if (mAnim != null) { - Log.wtf(TAG, "reseting while animating??!?"); - } + mAnim = new TimeAnimator(); mAnim.setTimeListener(new TimeAnimator.TimeListener() { @Override @@ -303,7 +326,8 @@ public class LLand extends FrameLayout { mPlaying = true; t = 0; - mLastPipeTime = getGameTime() - PARAMS.OBSTACLE_PERIOD; // queue up a obstacle + // there's a sucker born every OBSTACLE_PERIOD + mLastPipeTime = getGameTime() - PARAMS.OBSTACLE_PERIOD; if (mSplash != null && mSplash.getAlpha() > 0f) { mSplash.setTranslationZ(PARAMS.HUD_Z); @@ -407,7 +431,7 @@ public class LLand extends FrameLayout { L("player hit an obstacle"); stop(); } else if (ob.cleared(mDroid)) { - passedBarrier = true; + if (ob instanceof Stem) passedBarrier = true; mObstaclesInPlay.remove(j); } } @@ -438,52 +462,91 @@ public class LLand extends FrameLayout { final int obstacley = (int) (Math.random() * (mHeight - 2*PARAMS.OBSTACLE_MIN - PARAMS.OBSTACLE_GAP)) + PARAMS.OBSTACLE_MIN; - final Obstacle p1 = new Obstacle(getContext(), obstacley); + final int inset = (PARAMS.OBSTACLE_WIDTH - PARAMS.OBSTACLE_STEM_WIDTH) / 2; + final int yinset = PARAMS.OBSTACLE_WIDTH/2; + + final int d1 = irand(0,250); + final Obstacle s1 = new Stem(getContext(), obstacley - yinset, false); + addView(s1, new LayoutParams( + PARAMS.OBSTACLE_STEM_WIDTH, + (int) s1.h, + Gravity.TOP|Gravity.LEFT)); + s1.setTranslationX(mWidth+inset); + s1.setTranslationY(-s1.h-yinset); + s1.setTranslationZ(PARAMS.OBSTACLE_Z*0.75f); + s1.animate() + .translationY(0) + .setStartDelay(d1) + .setDuration(250); + mObstaclesInPlay.add(s1); + + final Obstacle p1 = new Pop(getContext(), PARAMS.OBSTACLE_WIDTH); addView(p1, new LayoutParams( PARAMS.OBSTACLE_WIDTH, - mHeight, + PARAMS.OBSTACLE_WIDTH, Gravity.TOP|Gravity.LEFT)); p1.setTranslationX(mWidth); - p1.setTranslationY(-mHeight); - p1.setTranslationZ(0); + p1.setTranslationY(-PARAMS.OBSTACLE_WIDTH); + p1.setTranslationZ(PARAMS.OBSTACLE_Z); + p1.setScaleX(0.25f); + p1.setScaleY(0.25f); p1.animate() - .translationY(-mHeight+p1.h) - .translationZ(PARAMS.OBSTACLE_Z) - .setStartDelay(irand(0,250)) + .translationY(s1.h-inset) + .scaleX(1f) + .scaleY(1f) + .setStartDelay(d1) .setDuration(250); mObstaclesInPlay.add(p1); - final Obstacle p2 = new Obstacle(getContext(), - mHeight - obstacley - PARAMS.OBSTACLE_GAP); + final int d2 = irand(0,250); + final Obstacle s2 = new Stem(getContext(), + mHeight - obstacley - PARAMS.OBSTACLE_GAP - yinset, + true); + addView(s2, new LayoutParams( + PARAMS.OBSTACLE_STEM_WIDTH, + (int) s2.h, + Gravity.TOP|Gravity.LEFT)); + s2.setTranslationX(mWidth+inset); + s2.setTranslationY(mHeight+yinset); + s2.setTranslationZ(PARAMS.OBSTACLE_Z*0.75f); + s2.animate() + .translationY(mHeight-s2.h) + .setStartDelay(d2) + .setDuration(400); + mObstaclesInPlay.add(s2); + + final Obstacle p2 = new Pop(getContext(), PARAMS.OBSTACLE_WIDTH); addView(p2, new LayoutParams( PARAMS.OBSTACLE_WIDTH, - mHeight, + PARAMS.OBSTACLE_WIDTH, Gravity.TOP|Gravity.LEFT)); p2.setTranslationX(mWidth); p2.setTranslationY(mHeight); - p2.setTranslationZ(0); + p2.setTranslationZ(PARAMS.OBSTACLE_Z); + p2.setScaleX(0.25f); + p2.setScaleY(0.25f); p2.animate() - .translationY(mHeight-p2.h) - .translationZ(PARAMS.OBSTACLE_Z) - .setStartDelay(irand(0,100)) + .translationY(mHeight-s2.h-yinset) + .scaleX(1f) + .scaleY(1f) + .setStartDelay(d2) .setDuration(400); mObstaclesInPlay.add(p2); } - if (DEBUG) { - final Rect r = new Rect(); - mDroid.getHitRect(r); - r.inset(-4, -4); - invalidate(r); - } + if (DEBUG_DRAW) invalidate(); } @Override public boolean onTouchEvent(MotionEvent ev) { if (DEBUG) L("touch: %s", ev); - if (ev.getAction() == MotionEvent.ACTION_DOWN) { - poke(); - return true; + switch (ev.getAction()) { + case MotionEvent.ACTION_DOWN: + poke(); + return true; + case MotionEvent.ACTION_UP: + unpoke(); + return true; } return false; } @@ -491,9 +554,13 @@ public class LLand extends FrameLayout { @Override public boolean onTrackballEvent(MotionEvent ev) { if (DEBUG) L("trackball: %s", ev); - if (ev.getAction() == MotionEvent.ACTION_DOWN) { - poke(); - return true; + switch (ev.getAction()) { + case MotionEvent.ACTION_DOWN: + poke(); + return true; + case MotionEvent.ACTION_UP: + unpoke(); + return true; } return false; } @@ -514,6 +581,21 @@ public class LLand extends FrameLayout { } @Override + public boolean onKeyUp(int keyCode, KeyEvent ev) { + if (DEBUG) L("keyDown: %d", keyCode); + switch (keyCode) { + case KeyEvent.KEYCODE_DPAD_CENTER: + case KeyEvent.KEYCODE_DPAD_UP: + case KeyEvent.KEYCODE_SPACE: + case KeyEvent.KEYCODE_ENTER: + case KeyEvent.KEYCODE_BUTTON_A: + unpoke(); + return true; + } + return false; + } + + @Override public boolean onGenericMotionEvent (MotionEvent ev) { if (DEBUG) L("generic: %s", ev); return false; @@ -535,6 +617,13 @@ public class LLand extends FrameLayout { } } + private void unpoke() { + L("unboost"); + if (mFrozen) return; + if (!mAnimating) return; + mDroid.unboost(); + } + @Override public void onDraw(Canvas c) { super.onDraw(c); @@ -555,15 +644,23 @@ public class LLand extends FrameLayout { pt); } + pt.setStyle(Paint.Style.STROKE); + pt.setStrokeWidth(getResources().getDisplayMetrics().density); + final int M = getChildCount(); - pt.setColor(0x6000FF00); + pt.setColor(0x8000FF00); for (int i=0; i<M; i++) { final View v = getChildAt(i); if (v == mDroid) continue; if (!(v instanceof GameView)) continue; - final Rect r = new Rect(); - v.getHitRect(r); - c.drawRect(r, pt); + if (v instanceof Pop) { + final Pop p = (Pop) v; + c.drawCircle(p.cx, p.cy, p.r, pt); + } else { + final Rect r = new Rect(); + v.getHitRect(r); + c.drawRect(r, pt); + } } pt.setColor(Color.BLACK); @@ -585,6 +682,8 @@ public class LLand extends FrameLayout { private class Player extends ImageView implements GameView { public float dv; + private boolean mBoosting; + private final float[] sHull = new float[] { 0.3f, 0f, // left antenna 0.7f, 0f, // right antenna @@ -639,7 +738,11 @@ public class LLand extends FrameLayout { public void step(long t_ms, long dt_ms, float t, float dt) { if (getVisibility() != View.VISIBLE) return; // not playing yet - dv += PARAMS.G; + if (mBoosting) { + dv = -PARAMS.BOOST_DV; + } else { + dv += PARAMS.G; + } if (dv < -PARAMS.MAX_V) dv = -PARAMS.MAX_V; else if (dv > PARAMS.MAX_V) dv = PARAMS.MAX_V; @@ -652,15 +755,28 @@ public class LLand extends FrameLayout { } public void boost() { + mBoosting = true; dv = -PARAMS.BOOST_DV; - setTranslationZ(PARAMS.PLAYER_Z_BOOST); + + animate().cancel(); + animate() + .scaleX(1.25f) + .scaleY(1.25f) + .translationZ(PARAMS.PLAYER_Z_BOOST) + .setDuration(100); setScaleX(1.25f); setScaleY(1.25f); + } + + public void unboost() { + mBoosting = false; + + animate().cancel(); animate() - .scaleX(1f) - .scaleY(1f) - .translationZ(PARAMS.PLAYER_Z) - .setDuration(200); + .scaleX(1f) + .scaleY(1f) + .translationZ(PARAMS.PLAYER_Z) + .setDuration(200); } } @@ -671,7 +787,7 @@ public class LLand extends FrameLayout { public Obstacle(Context context, float h) { super(context); - setBackgroundResource(R.drawable.placeholder); + setBackgroundColor(0xFFFF0000); this.h = h; } @@ -701,6 +817,91 @@ public class LLand extends FrameLayout { } } + private class Pop extends Obstacle { + int mRotate; + int cx, cy, r; + public Pop(Context context, float h) { + super(context, h); + int idx = 2*irand(0, POPS.length/2); + setBackgroundResource(POPS[idx]); + setScaleX(frand() < 0.5f ? -1 : 1); + mRotate = POPS[idx+1] == 0 ? 0 : (frand() < 0.5f ? -1 : 1); + setOutlineProvider(new ViewOutlineProvider() { + @Override + public void getOutline(View view, Outline outline) { + final int pad = (int) (getWidth() * 0.02f); + outline.setOval(pad, pad, getWidth()-pad, getHeight()-pad); + } + }); + } + + public boolean intersects(Player p) { + final int N = p.corners.length/2; + for (int i=0; i<N; i++) { + final int x = (int) p.corners[i*2]; + final int y = (int) p.corners[i*2+1]; + if (Math.hypot(x-cx, y-cy) <= r) return true; + } + return false; + } + + @Override + public void step(long t_ms, long dt_ms, float t, float dt) { + super.step(t_ms, dt_ms, t, dt); + if (mRotate != 0) { + setRotation(getRotation() + dt * 45 * mRotate); + } + + cx = (hitRect.left + hitRect.right)/2; + cy = (hitRect.top + hitRect.bottom)/2; + r = getWidth()/2; + } + } + + private class Stem extends Obstacle { + Paint mPaint = new Paint(); + Path mShadow = new Path(); + boolean mDrawShadow; + + public Stem(Context context, float h, boolean drawShadow) { + super(context, h); + mDrawShadow = drawShadow; + mPaint.setColor(0xFFAAAAAA); + setBackground(null); + } + + @Override + public void onAttachedToWindow() { + super.onAttachedToWindow(); + setWillNotDraw(false); + setOutlineProvider(new ViewOutlineProvider() { + @Override + public void getOutline(View view, Outline outline) { + outline.setRect(0, 0, getWidth(), getHeight()); + } + }); + } + @Override + public void onDraw(Canvas c) { + final int w = c.getWidth(); + final int h = c.getHeight(); + final GradientDrawable g = new GradientDrawable(); + g.setOrientation(GradientDrawable.Orientation.LEFT_RIGHT); + g.setGradientCenter(w * 0.75f, 0); + g.setColors(new int[] { 0xFFFFFFFF, 0xFFAAAAAA }); + g.setBounds(0, 0, w, h); + g.draw(c); + if (!mDrawShadow) return; + mShadow.reset(); + mShadow.moveTo(0,0); + mShadow.lineTo(w, 0); + mShadow.lineTo(w, PARAMS.OBSTACLE_WIDTH/2+w*1.5f); + mShadow.lineTo(0, PARAMS.OBSTACLE_WIDTH/2); + mShadow.close(); + c.drawPath(mShadow, mPaint); + } + } + private class Scenery extends FrameLayout implements GameView { public float z; public float v; |