diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..d002f45bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# built application files +*.apk +*.ap_ + +# files for the dex VM +*.dex + +# Java class files +*.class + +# generated files +bin/ +build/ +gen/ +out/ + +# Local configuration file (sdk path, etc) +local.properties + +# Eclipse project files +.classpath +.project + +# Windows thumbnail db +.DS_Store + +# Idea project fileS +*.iml +*.ipr +*.iws +.idea/ + +# Gradle config files +.gradle/ + +# Sandbox stuff +_sandbox diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 14a4fcffa..ebbb59e53 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,35 +1,28 @@ -# How to become a contributor and submit your own code +# How to Contribute -## Contributor License Agreements +We'd love to accept your patches and contributions to this project. There are +just a few small guidelines you need to follow. -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. +## Contributor License Agreement -Please fill out either the individual or corporate Contributor License Agreement (CLA). +Contributions to this project must be accompanied by a Contributor License +Agreement. You (or your employer) retain the copyright to your contribution; +this simply gives us permission to use and redistribute your contributions as +part of the project. Head over to to see +your current agreements on file or to sign a new one. - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA] - (https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA] - (https://developers.google.com/open-source/cla/corporate). +You generally only need to submit a CLA once, so if you've already submitted one +(even if it was for a different project), you probably don't need to do it +again. -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. +## Code reviews -## Contributing A Patch +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the sample to which - you are contributing. Refer to the - [Android Code Style Guide] - (https://source.android.com/source/code-style.html) for the - recommended coding standards for this organization. -1. Ensure that your code has an appropriate set of unit tests which all pass. -1. Submit a pull request. +## Community Guidelines +This project follows +[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/). \ No newline at end of file diff --git a/LICENSE b/LICENSE index 5779f2605..95f8e3802 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,9 @@ All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are +and *.ogg) are licensed under the CC-BY license. All other files are licensed under the Apache 2 license. -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 4.0 International +Attribution 4.0 International ======================================================================= @@ -41,7 +38,7 @@ exhaustive, and do not form part of our licenses. material not subject to the license. This includes other CC- licensed material, or material used under an exception or limitation to copyright. More considerations for licensors: - wiki.creativecommons.org/Considerations_for_licensors + wiki.creativecommons.org/Considerations_for_licensors Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the @@ -56,24 +53,22 @@ exhaustive, and do not form part of our licenses. rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to - respect those requests where reasonable. More_considerations - for the public: - wiki.creativecommons.org/Considerations_for_licensees + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees ======================================================================= -Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International -Public License +Creative Commons Attribution 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons -Attribution-NonCommercial-ShareAlike 4.0 International Public License -("Public License"). To the extent this Public License may be -interpreted as a contract, You are granted the Licensed Rights in -consideration of Your acceptance of these terms and conditions, and the -Licensor grants You such rights in consideration of benefits the -Licensor receives from making the Licensed Material available under -these terms and conditions. +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. Section 1 -- Definitions. @@ -92,11 +87,7 @@ Section 1 -- Definitions. and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. - c. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. Copyright and Similar Rights means copyright and/or similar rights + c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or @@ -104,41 +95,29 @@ Section 1 -- Definitions. specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. - e. Effective Technological Measures means those measures that, in the + d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. - f. Exceptions and Limitations means fair use, fair dealing, and/or + e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, + f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. - i. Licensed Rights means the rights granted to You subject to the + g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. - j. Licensor means the individual(s) or entity(ies) granting rights + h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. Share means to provide material to the public by any means or + i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material @@ -146,13 +125,13 @@ Section 1 -- Definitions. public may access the material from a place and at a time individually chosen by them. - m. Sui Generis Database Rights means rights other than copyright + j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. - n. You means the individual or entity exercising the Licensed Rights + k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. @@ -166,10 +145,9 @@ Section 2 -- Scope. exercise the Licensed Rights in the Licensed Material to: a. reproduce and Share the Licensed Material, in whole or - in part, for NonCommercial purposes only; and + in part; and - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. + b. produce, reproduce, and Share Adapted Material. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public @@ -199,13 +177,7 @@ Section 2 -- Scope. Licensed Rights under the terms and conditions of this Public License. - b. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. No downstream restrictions. You may not offer or impose + b. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the @@ -237,9 +209,7 @@ Section 2 -- Scope. Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly - reserves any right to collect such royalties, including when - the Licensed Material is used other than for NonCommercial - purposes. + reserves any right to collect such royalties. Section 3 -- License Conditions. @@ -284,28 +254,14 @@ following conditions. reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. + 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. Section 4 -- Sui Generis Database Rights. @@ -315,14 +271,12 @@ apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial - portion of the contents of the database for NonCommercial purposes - only; + portion of the contents of the database; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database - Rights (but not its individual contents) is Adapted Material, - including for purposes of Section 3(b); and + Rights (but not its individual contents) is Adapted Material; and c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. @@ -423,13 +377,16 @@ Section 8 -- Interpretation. that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. + ======================================================================= -Creative Commons is not a party to its public licenses. -Notwithstanding, Creative Commons may elect to apply one of its public -licenses to material it publishes and in those instances will be -considered the "Licensor." Except for the limited purpose of indicating -that material is shared under a Creative Commons public license or as +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark "Creative Commons" or any other trademark or logo @@ -437,8 +394,8 @@ of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For -the avoidance of doubt, this paragraph does not form part of the public -licenses. +the avoidance of doubt, this paragraph does not form part of the +public licenses. Creative Commons may be contacted at creativecommons.org. diff --git a/README.md b/README.md index 8facad97b..ce9357c7b 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,65 @@ -Google Santa Tracker for Android -================================ +Status: Archived +================ + +This repository has been archived and is no longer maintained. + + +## Google Santa Tracker for Android 🎅🤶 ## About -[Google Santa Tracker app for Android][play-store] is an educational and entertaining tradition that brings joy to millions of children (and children at heart) across the world over the December holiday period. The app is a companion to the [Google Santa Tracker][santa-web] website ([repository here](https://github.com/google/santa-tracker-web)), showcasing unique platform capabilities like Android Wear watchfaces, device notifications and more. -![Analytics](https://ga-beacon.appspot.com/UA-12846745-20/santa-tracker-android/readme?pixel) +[Google Santa Tracker app for Android][play-store] is an educational and entertaining tradition +that brings joy to millions of children (and children at heart) across the world over the December +holiday period. -![Village Screenshot](res/village.png) +The app is a companion to the [Google Santa Tracker][santa-web] website +([repository here](https://github.com/google/santa-tracker-web)), showcasing unique platform +capabilities like Android Wear watchfaces, device notifications and more. + +![Village Screenshot](docs/village.png) ## Features -* A beautiful parallax-scrolling village -* 3 exciting games -* 2 Android Wear watchfaces -* Hidden Easter Eggs! +* A beautiful designed village +* Exciting games like Penguin Swim and Rocket Sleigh +* Use of Dynamic Feature Modules (each game is a separate module, fetched dynamically on first run) +* Interactive Android Wear watchfaces (with sound!) +* Videos, animations and more. ## Building the app -It's simple. Plug your phone in (or fire up an emulator) and run: +First up, Santa Tracker is powered by [Firebase][firebase], so you'll need to enable it +on your Google account over at the [Firebase console][fire-console]. Once you're in the +console, follow these steps: + + * Create a new project + * Add Firebase to your Android app + * Package name: `com.google.android.apps.santatracker.debug` + * Debug signing certificate can be blank, or follow the instructions in the tooltip to find yours. + * Save the `google-services.json` file to the `santa-tracker/` directory - ./gradlew installDebug +Now you should be able to plug your phone in (or fire up an emulator) and run: + + ./gradlew santa-tracker:installDebug Alternatively, import the source code into Android Studio (File, Import Project). +Note: You'll need Android SDK version 28. If you're unsure about this, use +Android Studio and tick the appropriate boxes in the SDK Manager. + ## License -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. See the LICENSE file for details. +All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav, *.ogg, *.m4a, *.webp) are +licensed under the CC-BY license. All other files are licensed under the Apache 2 license. +See the LICENSE file for details. + Copyright 2019 Google LLC - Copyright 2015 Google Inc. All rights reserved. - 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 - + + https://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. @@ -46,3 +69,5 @@ licensed under the Apache 2 license. See the LICENSE file for details. [play-store]: https://play.google.com/store/apps/details?id=com.google.android.apps.santatracker [santa-web]: http://g.co/santatracker +[firebase]: https://firebase.google.com/ +[fire-console]: https://firebase.google.com/console/ diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 3bb7ba402..000000000 --- a/app/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath androidToolsDependency - } -} diff --git a/app/common/build.gradle b/app/common/build.gradle deleted file mode 100644 index 5d7210c1a..000000000 --- a/app/common/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -apply plugin: 'com.android.library' - -android { - compileSdkVersion 21 - buildToolsVersion toolsVersion - - defaultConfig { - minSdkVersion 15 - targetSdkVersion 21 - } -} - -repositories { - jcenter() -} - -dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile playServices -} diff --git a/app/common/proguard-rules.pro b/app/common/proguard-rules.pro deleted file mode 100644 index e2c580fb8..000000000 --- a/app/common/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/lwray/Desktop/Stuff/adt-bundle-mac-x86_64-20131030/sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/app/common/src/main/AndroidManifest.xml b/app/common/src/main/AndroidManifest.xml deleted file mode 100644 index 9900c60ce..000000000 --- a/app/common/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/app/common/src/main/java/com/google/android/apps/santatracker/common/NotificationConstants.java b/app/common/src/main/java/com/google/android/apps/santatracker/common/NotificationConstants.java deleted file mode 100644 index 0014581f1..000000000 --- a/app/common/src/main/java/com/google/android/apps/santatracker/common/NotificationConstants.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.common; - -/** - * Constants that define notifications for the application and wearable. - */ -public final class NotificationConstants { - - public static final String KEY_LOCATION = "location"; - - private NotificationConstants() { - } - - ; - - // Only one ID because we only show one notification at a time. - - /** - * ID that identifies all notifications from Santa Tracker. - * Reusing the same ID ensures that only one notification is shown at a time. - */ - public static final int NOTIFICATION_ID = 4672682; // GOSANTA - - /** - * Take-off notification. - */ - public static final int NOTIFICATION_TAKEOFF = 1; - - /** - * Santa status update or factoid notification. - */ - public static final int NOTIFICATION_INFO = 2; - - /** - * Path to identify take-off notifications on wear. - */ - public static final String TAKEOFF_PATH = "/takeoff"; - - /** - * Key for notification ID. - * - * @see #NOTIFICATION_ID - */ - public static final String KEY_NOTIFICATION_ID = "notification-id"; - - /** - * Key for the type of notification. - * - * @see #NOTIFICATION_TAKEOFF - * @see #NOTIFICATION_INFO - */ - public static final String KEY_NOTIFICATION_TYPE = "notification-type"; - - /** - * Key for the title in a notification. - */ - public static final String KEY_TITLE = "title"; - - /** - * Key for the content text in a notification. - */ - public static final String KEY_CONTENT = "content"; - - /** - * Key for the timestamp of a notification. - */ - public static final String KEY_TIMESTAMP = "timestap"; - - /** - * Key for Santa's final arrival (after which the notification should not be displayed.) - */ - public static final String KEY_FINAL_ARRIVAL = "finalArrival"; - - /** - * Key for the fact text in a notification. - */ - public static final String KEY_FACT = "fact"; - - /** - * Key for Santa's status in a notification. - */ - public static final String KEY_STATUS = "status"; - - /** - * Key for the image in a notification. - */ - public static final String KEY_IMAGEURL = "imageurl"; - - /** - * Action string that identifies a dismiss action. - */ - public static final String ACTION_DISMISS - = "com.google.android.apps.santatracker.DISMISS"; -} diff --git a/app/common/src/main/java/com/google/android/apps/santatracker/util/AnalyticsManager.java b/app/common/src/main/java/com/google/android/apps/santatracker/util/AnalyticsManager.java deleted file mode 100644 index d095edef4..000000000 --- a/app/common/src/main/java/com/google/android/apps/santatracker/util/AnalyticsManager.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.util; - -import android.content.Context; -import android.util.Log; - -import com.google.android.gms.analytics.GoogleAnalytics; -import com.google.android.gms.analytics.HitBuilders; -import com.google.android.gms.analytics.Tracker; -import com.google.android.apps.santatracker.common.R; - -/** - * Handles communication with Google Analytics. - * Based on implementation in iosched: com.google.samples.apps.iosched.util.AnalyticsManager - */ -public class AnalyticsManager { - - private static Context sAppContext = null; - private static Tracker mTracker; - - private final static String TAG = "AnalyticsManager"; - - public static synchronized void setTracker(Tracker tracker) { - mTracker = tracker; - } - - private static boolean canSend() { - return mTracker != null; - } - - /** - * Sends a screen view with the string resource loaded as its label. - */ - public static void sendScreenView(int resourceId) { - sendScreenView(getString(resourceId)); - } - - private static String getString(int id){ - if(sAppContext != null) { - return sAppContext.getString(id); - } - return null; - } - /** - * Sends a screen vie for a screen label. - */ - public static void sendScreenView(String screenName) { - if (canSend()) { - mTracker.setScreenName(screenName); - mTracker.send(new HitBuilders.AppViewBuilder().build()); - Log.d(TAG, "Screen View recorded: " + screenName); - } else { - Log.d(TAG, "Screen View NOT recorded (analytics disabled or not ready)."); - } - } - - /** - * Sends an event to the tracker with string resources loaded as parameters. - */ - public static void sendEvent(int category, int action, int label, long value) { - sendEvent(getString(category), getString(action), - getString(label), value); - } - - /** - * Sends an event to the tracker with string resources loaded as parameters. - */ - public static void sendEvent(int category, int action) { - sendEvent(getString(category), getString(action)); - } - - /** - * Sends an event to the tracker with string resources loaded as parameters. - */ - public static void sendEvent(int category, int action, String label) { - sendEvent(getString(category), getString(action), label); - } - - public static void sendEvent(String category, String action) { - if (canSend()) { - mTracker.send(new HitBuilders.EventBuilder(category,action).build()); - - Log.d(TAG, "Event recorded:"); - Log.d(TAG, "\tCategory: " + category); - Log.d(TAG, "\tAction: " + action); - } else { - Log.d(TAG, "Analytics event ignored (analytics disabled or not ready)."); - } - } - - public static void sendEvent(String category, String action, String label, long value) { - if (canSend()) { - mTracker.send(new HitBuilders.EventBuilder() - .setCategory(category) - .setAction(action) - .setLabel(label) - .setValue(value) - .build()); - - Log.d(TAG, "Event recorded:"); - Log.d(TAG, "\tCategory: " + category); - Log.d(TAG, "\tAction: " + action); - Log.d(TAG, "\tLabel: " + label); - Log.d(TAG, "\tValue: " + value); - } else { - Log.d(TAG, "Analytics event ignored (analytics disabled or not ready)."); - } - } - - /** - * Sends an event to the tracker with string resources loaded as parameters. - */ - public static void sendEvent(int category, int action, int label) { - sendEvent(getString(category), getString(action), - getString(label)); - } - - public static void sendEvent(String category, String action, String label) { - sendEvent(category, action, label, 0); - } - - public Tracker getTracker() { - return mTracker; - } - - public static synchronized void initializeAnalyticsTracker(Context context) { - sAppContext = context; - if (mTracker == null) { - GoogleAnalytics analytics = GoogleAnalytics.getInstance(context); - mTracker = analytics.newTracker(R.xml.config_analytics_tracker); - Log.d(TAG, "Analytics tracker initialised."); - } - } -} \ No newline at end of file diff --git a/app/common/src/main/res/drawable-hdpi/signin.9.png b/app/common/src/main/res/drawable-hdpi/signin.9.png deleted file mode 100644 index 7936a5bda..000000000 Binary files a/app/common/src/main/res/drawable-hdpi/signin.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable-hdpi/signin_pressed.9.png b/app/common/src/main/res/drawable-hdpi/signin_pressed.9.png deleted file mode 100644 index 81f2f5d05..000000000 Binary files a/app/common/src/main/res/drawable-hdpi/signin_pressed.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable-mdpi/signin.9.png b/app/common/src/main/res/drawable-mdpi/signin.9.png deleted file mode 100644 index 8a9a94201..000000000 Binary files a/app/common/src/main/res/drawable-mdpi/signin.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable-mdpi/signin_pressed.9.png b/app/common/src/main/res/drawable-mdpi/signin_pressed.9.png deleted file mode 100644 index 38b705073..000000000 Binary files a/app/common/src/main/res/drawable-mdpi/signin_pressed.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable-xhdpi/signin.9.png b/app/common/src/main/res/drawable-xhdpi/signin.9.png deleted file mode 100644 index 82cd6cda5..000000000 Binary files a/app/common/src/main/res/drawable-xhdpi/signin.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable-xhdpi/signin_pressed.9.png b/app/common/src/main/res/drawable-xhdpi/signin_pressed.9.png deleted file mode 100644 index 9f5f470d8..000000000 Binary files a/app/common/src/main/res/drawable-xhdpi/signin_pressed.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable-xxhdpi/signin.9.png b/app/common/src/main/res/drawable-xxhdpi/signin.9.png deleted file mode 100644 index 5afea731c..000000000 Binary files a/app/common/src/main/res/drawable-xxhdpi/signin.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable-xxhdpi/signin_pressed.9.png b/app/common/src/main/res/drawable-xxhdpi/signin_pressed.9.png deleted file mode 100644 index dcd979921..000000000 Binary files a/app/common/src/main/res/drawable-xxhdpi/signin_pressed.9.png and /dev/null differ diff --git a/app/common/src/main/res/drawable/gplus_button.xml b/app/common/src/main/res/drawable/gplus_button.xml deleted file mode 100644 index f8feeb13a..000000000 --- a/app/common/src/main/res/drawable/gplus_button.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/app/common/src/main/res/drawable/score_background.xml b/app/common/src/main/res/drawable/score_background.xml deleted file mode 100644 index b1cfb6d7b..000000000 --- a/app/common/src/main/res/drawable/score_background.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/common/src/main/res/values-af/strings_jetpack.xml b/app/common/src/main/res/values-af/strings_jetpack.xml deleted file mode 100644 index 91ef58c35..000000000 --- a/app/common/src/main/res/values-af/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Meld aan om prestasies te ontsluit en jou telling te plaas! - Speel weer - Telling - diff --git a/app/common/src/main/res/values-ar-rXB/strings_jetpack.xml b/app/common/src/main/res/values-ar-rXB/strings_jetpack.xml deleted file mode 100644 index d934b2989..000000000 --- a/app/common/src/main/res/values-ar-rXB/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - ‏‮Sign‬‏ ‏‮in‬‏ ‏‮to‬‏ ‏‮unlock‬‏ ‏‮achievements‬‏ ‏‮and‬‏ ‏‮post‬‏ ‏‮your‬‏ ‏‮score‬‏! - ‏‮Play‬‏ ‏‮Again‬‏ - ‏‮Score‬‏ - diff --git a/app/common/src/main/res/values-bg/strings_jetpack.xml b/app/common/src/main/res/values-bg/strings_jetpack.xml deleted file mode 100644 index 3bbe5116d..000000000 --- a/app/common/src/main/res/values-bg/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Влезте в профила си, за да отключвате постижения и да публикувате резултата си! - Нова игра - Резултат - diff --git a/app/common/src/main/res/values-ca/strings_jetpack.xml b/app/common/src/main/res/values-ca/strings_jetpack.xml deleted file mode 100644 index 20f163751..000000000 --- a/app/common/src/main/res/values-ca/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Inicieu la sessió per desbloquejar assoliments i publicar la vostra puntuació! - Torna a jugar - Puntuació - diff --git a/app/common/src/main/res/values-da/strings_jetpack.xml b/app/common/src/main/res/values-da/strings_jetpack.xml deleted file mode 100644 index febe8ecd7..000000000 --- a/app/common/src/main/res/values-da/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Log ind for at låse op for resultater og indsende dine point. - Spil igen - Resultat - diff --git a/app/common/src/main/res/values-de-rAT/strings_jetpack.xml b/app/common/src/main/res/values-de-rAT/strings_jetpack.xml deleted file mode 100644 index 12d937c3f..000000000 --- a/app/common/src/main/res/values-de-rAT/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Melde dich an, um deine Erfolge zu speichern und deine Punktzahl zu posten! - Neues Spiel - Bewertung - diff --git a/app/common/src/main/res/values-de-rCH/strings_jetpack.xml b/app/common/src/main/res/values-de-rCH/strings_jetpack.xml deleted file mode 100644 index 12d937c3f..000000000 --- a/app/common/src/main/res/values-de-rCH/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Melde dich an, um deine Erfolge zu speichern und deine Punktzahl zu posten! - Neues Spiel - Bewertung - diff --git a/app/common/src/main/res/values-de/strings_jetpack.xml b/app/common/src/main/res/values-de/strings_jetpack.xml deleted file mode 100644 index 12d937c3f..000000000 --- a/app/common/src/main/res/values-de/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Melde dich an, um deine Erfolge zu speichern und deine Punktzahl zu posten! - Neues Spiel - Bewertung - diff --git a/app/common/src/main/res/values-en-rGB/strings_jetpack.xml b/app/common/src/main/res/values-en-rGB/strings_jetpack.xml deleted file mode 100644 index 398b26fa1..000000000 --- a/app/common/src/main/res/values-en-rGB/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Sign in to unlock achievements and post your score. - Play Again - Score - diff --git a/app/common/src/main/res/values-en-rIE/strings_jetpack.xml b/app/common/src/main/res/values-en-rIE/strings_jetpack.xml deleted file mode 100644 index 398b26fa1..000000000 --- a/app/common/src/main/res/values-en-rIE/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Sign in to unlock achievements and post your score. - Play Again - Score - diff --git a/app/common/src/main/res/values-en-rIN/strings_jetpack.xml b/app/common/src/main/res/values-en-rIN/strings_jetpack.xml deleted file mode 100644 index 398b26fa1..000000000 --- a/app/common/src/main/res/values-en-rIN/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Sign in to unlock achievements and post your score. - Play Again - Score - diff --git a/app/common/src/main/res/values-en-rSG/strings_jetpack.xml b/app/common/src/main/res/values-en-rSG/strings_jetpack.xml deleted file mode 100644 index 398b26fa1..000000000 --- a/app/common/src/main/res/values-en-rSG/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Sign in to unlock achievements and post your score. - Play Again - Score - diff --git a/app/common/src/main/res/values-en-rXA/strings_jetpack.xml b/app/common/src/main/res/values-en-rXA/strings_jetpack.xml deleted file mode 100644 index dc2652429..000000000 --- a/app/common/src/main/res/values-en-rXA/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - [Šîĝñ îñ ţö ûñļöçķ åçĥîévéméñţš åñð þöšţ ýöûŕ šçöŕé¡ one two three four five six seven eight nine ten eleven] - [Þļåý Åĝåîñ one two] - [Šçöŕé one] - diff --git a/app/common/src/main/res/values-en-rXC/strings_jetpack.xml b/app/common/src/main/res/values-en-rXC/strings_jetpack.xml deleted file mode 100644 index f8fae7f05..000000000 --- a/app/common/src/main/res/values-en-rXC/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - ‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‏‏‏‎‏‎‎‎‎‏‏‏‏‏‎‏‏‏‏‎‏‎‎‎‎‎‎‎‎‏‎‏‎‏‏‏‏‎‎‎‏‏‏‎‏‎‏‎‏‏‎‏‏‎‏‏‏‏‏‏‏‏‏‎‎‏‏‎‏‎‏‏‎‏‏‎‏‎Sign in to unlock achievements and post your score!‎‏‎‎‏‎ - ‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‏‏‏‎‏‎‎‎‎‏‏‏‏‏‏‎‏‏‏‏‎‏‎‏‏‎‏‎‎‎‏‎‎‎‏‎‎‎‎‎‏‏‎‎‏‎‏‎‏‏‏‏‏‎‏‎‏‎‏‏‏‎‏‏‎‏‎‎‏‎‏‏‎‎‏‎‏‎‎Play Again‎‏‎‎‏‎ - ‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‏‏‏‎‏‎‎‎‎‏‏‏‏‏‎‏‏‎‎‏‎‏‏‎‏‎‏‎‏‏‎‎‏‏‎‏‏‎‏‎‏‏‎‏‏‏‏‏‎‎‏‎‎‎‏‎‏‏‏‎‎‎‎‎‏‎‎‏‎‎‏‎‎‎‎‎‏‎Score‎‏‎‎‏‎ - diff --git a/app/common/src/main/res/values-en-rZA/strings_jetpack.xml b/app/common/src/main/res/values-en-rZA/strings_jetpack.xml deleted file mode 100644 index 398b26fa1..000000000 --- a/app/common/src/main/res/values-en-rZA/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Sign in to unlock achievements and post your score. - Play Again - Score - diff --git a/app/common/src/main/res/values-es-r419/strings_jetpack.xml b/app/common/src/main/res/values-es-r419/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-r419/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rAR/strings_jetpack.xml b/app/common/src/main/res/values-es-rAR/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rAR/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rBO/strings_jetpack.xml b/app/common/src/main/res/values-es-rBO/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rBO/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rCL/strings_jetpack.xml b/app/common/src/main/res/values-es-rCL/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rCL/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rCO/strings_jetpack.xml b/app/common/src/main/res/values-es-rCO/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rCO/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rCR/strings_jetpack.xml b/app/common/src/main/res/values-es-rCR/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rCR/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rDO/strings_jetpack.xml b/app/common/src/main/res/values-es-rDO/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rDO/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rEC/strings_jetpack.xml b/app/common/src/main/res/values-es-rEC/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rEC/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rGT/strings_jetpack.xml b/app/common/src/main/res/values-es-rGT/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rGT/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rHN/strings_jetpack.xml b/app/common/src/main/res/values-es-rHN/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rHN/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rMX/strings_jetpack.xml b/app/common/src/main/res/values-es-rMX/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rMX/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rNI/strings_jetpack.xml b/app/common/src/main/res/values-es-rNI/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rNI/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rPA/strings_jetpack.xml b/app/common/src/main/res/values-es-rPA/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rPA/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rPE/strings_jetpack.xml b/app/common/src/main/res/values-es-rPE/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rPE/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rPR/strings_jetpack.xml b/app/common/src/main/res/values-es-rPR/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rPR/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rPY/strings_jetpack.xml b/app/common/src/main/res/values-es-rPY/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rPY/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rSV/strings_jetpack.xml b/app/common/src/main/res/values-es-rSV/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rSV/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rUS/strings_jetpack.xml b/app/common/src/main/res/values-es-rUS/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rUS/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rUY/strings_jetpack.xml b/app/common/src/main/res/values-es-rUY/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rUY/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es-rVE/strings_jetpack.xml b/app/common/src/main/res/values-es-rVE/strings_jetpack.xml deleted file mode 100644 index d29a98a0d..000000000 --- a/app/common/src/main/res/values-es-rVE/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accede a tu cuenta para desbloquear logros y publicar tu puntuación - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-es/strings_jetpack.xml b/app/common/src/main/res/values-es/strings_jetpack.xml deleted file mode 100644 index 7ed4f62e3..000000000 --- a/app/common/src/main/res/values-es/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Inicia sesión para desbloquear logros y publicar tu puntuación. - Volver a jugar - Puntuación - diff --git a/app/common/src/main/res/values-et/strings_jetpack.xml b/app/common/src/main/res/values-et/strings_jetpack.xml deleted file mode 100644 index 30213a955..000000000 --- a/app/common/src/main/res/values-et/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Registreeruge, et püüda saavutusi, ja postitage oma tulemus! - Mängi uuesti - Tulemus - diff --git a/app/common/src/main/res/values-fi/strings_jetpack.xml b/app/common/src/main/res/values-fi/strings_jetpack.xml deleted file mode 100644 index f0182a540..000000000 --- a/app/common/src/main/res/values-fi/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Kirjaudu sisään, niin voit suorittaa saavutuksia ja julkaista tuloksesi. - Pelaa uudelleen - Tulos - diff --git a/app/common/src/main/res/values-fil/strings_jetpack.xml b/app/common/src/main/res/values-fil/strings_jetpack.xml deleted file mode 100644 index c5aecc8fc..000000000 --- a/app/common/src/main/res/values-fil/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Mag-sign in upang i-unlock ang mga achievement at i-post ang iyong score! - Maglaro Muli - Score - diff --git a/app/common/src/main/res/values-fr-rCA/strings_jetpack.xml b/app/common/src/main/res/values-fr-rCA/strings_jetpack.xml deleted file mode 100644 index 32249d4d9..000000000 --- a/app/common/src/main/res/values-fr-rCA/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Connectez-vous, pour débloquer vos exploits et afficher vos score! - Rejouer - Pointage - diff --git a/app/common/src/main/res/values-fr-rCH/strings_jetpack.xml b/app/common/src/main/res/values-fr-rCH/strings_jetpack.xml deleted file mode 100644 index 5221e429b..000000000 --- a/app/common/src/main/res/values-fr-rCH/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Connectez-vous pour débloquer vos exploits et publier vos scores ! - Rejouer - Score - diff --git a/app/common/src/main/res/values-fr/strings_jetpack.xml b/app/common/src/main/res/values-fr/strings_jetpack.xml deleted file mode 100644 index 5221e429b..000000000 --- a/app/common/src/main/res/values-fr/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Connectez-vous pour débloquer vos exploits et publier vos scores ! - Rejouer - Score - diff --git a/app/common/src/main/res/values-gsw/strings_jetpack.xml b/app/common/src/main/res/values-gsw/strings_jetpack.xml deleted file mode 100644 index 12d937c3f..000000000 --- a/app/common/src/main/res/values-gsw/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Melde dich an, um deine Erfolge zu speichern und deine Punktzahl zu posten! - Neues Spiel - Bewertung - diff --git a/app/common/src/main/res/values-hdpi/dimens.xml b/app/common/src/main/res/values-hdpi/dimens.xml deleted file mode 100644 index 62f52cb76..000000000 --- a/app/common/src/main/res/values-hdpi/dimens.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 8dp - 45dp - 16dp - - diff --git a/app/common/src/main/res/values-hr/strings_jetpack.xml b/app/common/src/main/res/values-hr/strings_jetpack.xml deleted file mode 100644 index 9cb3d1b4e..000000000 --- a/app/common/src/main/res/values-hr/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Prijavite se da biste otključali uspjehe i objavili rezultat! - Igraj ponovo - Rezultat - diff --git a/app/common/src/main/res/values-id/strings_jetpack.xml b/app/common/src/main/res/values-id/strings_jetpack.xml deleted file mode 100644 index 6560653ba..000000000 --- a/app/common/src/main/res/values-id/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Masuk untuk membuka pencapaian dan mengeposkan skor Anda! - Main Lagi - Skor - diff --git a/app/common/src/main/res/values-in/strings_jetpack.xml b/app/common/src/main/res/values-in/strings_jetpack.xml deleted file mode 100644 index 6560653ba..000000000 --- a/app/common/src/main/res/values-in/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Masuk untuk membuka pencapaian dan mengeposkan skor Anda! - Main Lagi - Skor - diff --git a/app/common/src/main/res/values-it/strings_jetpack.xml b/app/common/src/main/res/values-it/strings_jetpack.xml deleted file mode 100644 index 132c41706..000000000 --- a/app/common/src/main/res/values-it/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Accedi per sbloccare i risultati e pubblicare il tuo punteggio! - Gioca ancora - Punti - diff --git a/app/common/src/main/res/values-ja/strings_jetpack.xml b/app/common/src/main/res/values-ja/strings_jetpack.xml deleted file mode 100644 index 2b5f7f234..000000000 --- a/app/common/src/main/res/values-ja/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - ログインしたら、結果をロック解除してスコアを投稿しよう! - もう一度プレイ - スコア - diff --git a/app/common/src/main/res/values-ln/strings_jetpack.xml b/app/common/src/main/res/values-ln/strings_jetpack.xml deleted file mode 100644 index 5221e429b..000000000 --- a/app/common/src/main/res/values-ln/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Connectez-vous pour débloquer vos exploits et publier vos scores ! - Rejouer - Score - diff --git a/app/common/src/main/res/values-lt/strings_jetpack.xml b/app/common/src/main/res/values-lt/strings_jetpack.xml deleted file mode 100644 index 57d6103aa..000000000 --- a/app/common/src/main/res/values-lt/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Prisijunkite, jei norite atrakinti laimėjimus ir paskelbti savo rezultatą! - Žaisti dar kartą - Rezultatas - diff --git a/app/common/src/main/res/values-lv/strings_jetpack.xml b/app/common/src/main/res/values-lv/strings_jetpack.xml deleted file mode 100644 index 2e2837837..000000000 --- a/app/common/src/main/res/values-lv/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Pierakstieties, lai atbloķētu sasniegumus un izliktu savu rezultātu! - Spēlēt vēlreiz - Rezultāts - diff --git a/app/common/src/main/res/values-ml/strings_jetpack.xml b/app/common/src/main/res/values-ml/strings_jetpack.xml deleted file mode 100644 index f1b293af2..000000000 --- a/app/common/src/main/res/values-ml/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - നേട്ടങ്ങൾ അൺലോക്കുചെയ്യാനും നിങ്ങളുടെ സ്കോർ പോസ്റ്റ് ചെയ്യാനും സൈൻ ഇൻ ചെയ്യുക! - വീണ്ടും കളിക്കുക - സ്‌കോർ - diff --git a/app/common/src/main/res/values-mo/strings_jetpack.xml b/app/common/src/main/res/values-mo/strings_jetpack.xml deleted file mode 100644 index 63d833dc6..000000000 --- a/app/common/src/main/res/values-mo/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Conectează-te pentru a debloca realizările și pentru a posta scorul ! - Joacă din nou - Scor - diff --git a/app/common/src/main/res/values-nb/strings_jetpack.xml b/app/common/src/main/res/values-nb/strings_jetpack.xml deleted file mode 100644 index 424c74e94..000000000 --- a/app/common/src/main/res/values-nb/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Logg på for å låse opp prestasjoner og legge ut poengsummen din. - Spill igjen - Poeng - diff --git a/app/common/src/main/res/values-no/strings_jetpack.xml b/app/common/src/main/res/values-no/strings_jetpack.xml deleted file mode 100644 index 424c74e94..000000000 --- a/app/common/src/main/res/values-no/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Logg på for å låse opp prestasjoner og legge ut poengsummen din. - Spill igjen - Poeng - diff --git a/app/common/src/main/res/values-pl/strings_jetpack.xml b/app/common/src/main/res/values-pl/strings_jetpack.xml deleted file mode 100644 index dc2fb4273..000000000 --- a/app/common/src/main/res/values-pl/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Zaloguj się, aby odblokować osiągnięcia i opublikować swój wynik. - Zagraj ponownie - Wynik - diff --git a/app/common/src/main/res/values-pt-rBR/strings_jetpack.xml b/app/common/src/main/res/values-pt-rBR/strings_jetpack.xml deleted file mode 100644 index a4e239727..000000000 --- a/app/common/src/main/res/values-pt-rBR/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Faça login para desbloquear conquistas e postar sua pontuação! - Jogar novamente - Pontuação - diff --git a/app/common/src/main/res/values-pt-rPT/strings_jetpack.xml b/app/common/src/main/res/values-pt-rPT/strings_jetpack.xml deleted file mode 100644 index dedbf887d..000000000 --- a/app/common/src/main/res/values-pt-rPT/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Inicie sessão para desbloquear conquistas e publicar a sua pontuação! - Jogar novamente - Pontuação - diff --git a/app/common/src/main/res/values-pt/strings_jetpack.xml b/app/common/src/main/res/values-pt/strings_jetpack.xml deleted file mode 100644 index a4e239727..000000000 --- a/app/common/src/main/res/values-pt/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Faça login para desbloquear conquistas e postar sua pontuação! - Jogar novamente - Pontuação - diff --git a/app/common/src/main/res/values-ro/strings_jetpack.xml b/app/common/src/main/res/values-ro/strings_jetpack.xml deleted file mode 100644 index 63d833dc6..000000000 --- a/app/common/src/main/res/values-ro/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Conectează-te pentru a debloca realizările și pentru a posta scorul ! - Joacă din nou - Scor - diff --git a/app/common/src/main/res/values-sl/strings_jetpack.xml b/app/common/src/main/res/values-sl/strings_jetpack.xml deleted file mode 100644 index e223cbe15..000000000 --- a/app/common/src/main/res/values-sl/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Prijavite se, da odklenete dosežke in objavite svoj rezultat. - Igraj znova - Rezultat - diff --git a/app/common/src/main/res/values-sv/strings_jetpack.xml b/app/common/src/main/res/values-sv/strings_jetpack.xml deleted file mode 100644 index b8f30d9cc..000000000 --- a/app/common/src/main/res/values-sv/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Logga in för att låsa upp prestationer och skicka in dina poäng! - Spela igen - Poäng - diff --git a/app/common/src/main/res/values-sw600dp/dimens.xml b/app/common/src/main/res/values-sw600dp/dimens.xml deleted file mode 100644 index 5f4371d3b..000000000 --- a/app/common/src/main/res/values-sw600dp/dimens.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - 20dp - 75dp - - diff --git a/app/common/src/main/res/values-sw720dp/dimens.xml b/app/common/src/main/res/values-sw720dp/dimens.xml deleted file mode 100644 index 1152a0d39..000000000 --- a/app/common/src/main/res/values-sw720dp/dimens.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - 28sp - 120dp - - diff --git a/app/common/src/main/res/values-ta/strings_jetpack.xml b/app/common/src/main/res/values-ta/strings_jetpack.xml deleted file mode 100644 index 1abac4edc..000000000 --- a/app/common/src/main/res/values-ta/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - சாதனைகளை எட்டவும் உங்கள் ஸ்கோரை வெளியிடவும், உள்நுழையவும்! - மீண்டும் விளையாடு - ஸ்கோர் - diff --git a/app/common/src/main/res/values-th/strings_jetpack.xml b/app/common/src/main/res/values-th/strings_jetpack.xml deleted file mode 100644 index 096fc228d..000000000 --- a/app/common/src/main/res/values-th/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - ลงชื่อเข้าใช้เพื่อปลดล็อกรางวัลพิเศษและโพสต์คะแนนของคุณ - เล่นอีกครั้ง - คะแนน - diff --git a/app/common/src/main/res/values-tl/strings_jetpack.xml b/app/common/src/main/res/values-tl/strings_jetpack.xml deleted file mode 100644 index c5aecc8fc..000000000 --- a/app/common/src/main/res/values-tl/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Mag-sign in upang i-unlock ang mga achievement at i-post ang iyong score! - Maglaro Muli - Score - diff --git a/app/common/src/main/res/values-uk/strings_jetpack.xml b/app/common/src/main/res/values-uk/strings_jetpack.xml deleted file mode 100644 index 01c199e35..000000000 --- a/app/common/src/main/res/values-uk/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Увійдіть, щоб відкрити досягнення й похизуватися рахунком! - Грати ще раз - Рахунок - diff --git a/app/common/src/main/res/values-vi/strings_jetpack.xml b/app/common/src/main/res/values-vi/strings_jetpack.xml deleted file mode 100644 index 958aa33e9..000000000 --- a/app/common/src/main/res/values-vi/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - Đăng nhập để mở khóa thành tích và đăng điểm của bạn! - Chơi lại - Điểm số - diff --git a/app/common/src/main/res/values-xhdpi/dimens.xml b/app/common/src/main/res/values-xhdpi/dimens.xml deleted file mode 100644 index 2e5882027..000000000 --- a/app/common/src/main/res/values-xhdpi/dimens.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - 12sp - 50dp - - diff --git a/app/common/src/main/res/values-zh-rCN/strings_jetpack.xml b/app/common/src/main/res/values-zh-rCN/strings_jetpack.xml deleted file mode 100644 index 143f78853..000000000 --- a/app/common/src/main/res/values-zh-rCN/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 登录即可达成成就并发布您的得分! - 重玩 - 得分 - diff --git a/app/common/src/main/res/values-zh-rHK/strings_jetpack.xml b/app/common/src/main/res/values-zh-rHK/strings_jetpack.xml deleted file mode 100644 index 44deb3df1..000000000 --- a/app/common/src/main/res/values-zh-rHK/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 登入即可解鎖成就並發佈您的得分! - 再玩一次 - 得分 - diff --git a/app/common/src/main/res/values-zh-rTW/strings_jetpack.xml b/app/common/src/main/res/values-zh-rTW/strings_jetpack.xml deleted file mode 100644 index 107a5d0ea..000000000 --- a/app/common/src/main/res/values-zh-rTW/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 歡迎登入解開遊戲關卡並張貼得分! - 再玩一次 - 分數 - diff --git a/app/common/src/main/res/values-zh/strings_jetpack.xml b/app/common/src/main/res/values-zh/strings_jetpack.xml deleted file mode 100644 index 143f78853..000000000 --- a/app/common/src/main/res/values-zh/strings_jetpack.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - 登录即可达成成就并发布您的得分! - 重玩 - 得分 - diff --git a/app/common/src/main/res/values/game_colors.xml b/app/common/src/main/res/values/game_colors.xml deleted file mode 100644 index 7b1e84fd7..000000000 --- a/app/common/src/main/res/values/game_colors.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - #99ffffff - #ffdf4a32 - #FF17B223 - \ No newline at end of file diff --git a/app/common/src/main/res/values/strings.xml b/app/common/src/main/res/values/strings.xml deleted file mode 100644 index b5ed22122..000000000 --- a/app/common/src/main/res/values/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - Common - diff --git a/app/common/src/main/res/values/strings_jetpack.xml b/app/common/src/main/res/values/strings_jetpack.xml deleted file mode 100644 index 13bd3c8da..000000000 --- a/app/common/src/main/res/values/strings_jetpack.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Sign in to unlock achievements and post your score! - Play Again - Score - diff --git a/app/common/src/main/res/xml/config_analytics_tracker.xml b/app/common/src/main/res/xml/config_analytics_tracker.xml deleted file mode 100644 index 0b4b101d1..000000000 --- a/app/common/src/main/res/xml/config_analytics_tracker.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - 300 - - - false - - - true - - - TODO: add your analytics id - \ No newline at end of file diff --git a/app/gradle.properties b/app/gradle.properties deleted file mode 100644 index 53faa88c8..000000000 --- a/app/gradle.properties +++ /dev/null @@ -1,12 +0,0 @@ -org.gradle.daemon=true - -#dependencies and versions -androidToolsDependency=com.android.tools.build:gradle:1.0.1 -toolsVersion=21.1.2 - -appcompatV7=com.android.support:appcompat-v7:21.0.3 -playServices=com.google.android.gms:play-services:6.5.87 -playServicesWearable=com.google.android.gms:play-services-wearable:6.1.11 -recyclerView=com.android.support:recyclerview-v7:21.0.3 -supportV4=com.android.support:support-v4:21.0.3 -wearableSupport=com.google.android.support:wearable:1.1.0 \ No newline at end of file diff --git a/app/gradle/wrapper/gradle-wrapper.jar b/app/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a8..000000000 Binary files a/app/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/app/gradle/wrapper/gradle-wrapper.properties b/app/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index c629916e8..000000000 --- a/app/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (C) 2015 Google Inc. All Rights Reserved. -# -# 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. -# - -#Mon Jan 12 15:23:35 EST 2015 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/app/santa-tracker/build.gradle b/app/santa-tracker/build.gradle deleted file mode 100644 index 804a76938..000000000 --- a/app/santa-tracker/build.gradle +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -apply plugin: 'com.android.application' - -android { - compileSdkVersion 21 - buildToolsVersion toolsVersion - - defaultConfig { - applicationId "com.google.android.apps.santatracker" - minSdkVersion 15 - targetSdkVersion 21 - versionCode 32 - versionName "2.1.2" - } - signingConfigs { - debug { -// storeFile file("../santa-tracker-debug.keystore") -// keyAlias "androiddebugkey" - } - dogfood { -// storeFile file("../santa-tracker-dogfood.keystore") -// storePassword "" -// keyAlias "releasekey" -// keyPassword "" - } - } - buildTypes { - debug { - applicationIdSuffix ".debug" - versionNameSuffix "-debug" - signingConfig signingConfigs.debug - } - - dogfood { - minifyEnabled true - proguardFile 'proguard.txt' - // signingConfig signingConfigs.dogfood - } - - release { - minifyEnabled true - proguardFile 'proguard.txt' - } - } -} - -repositories { - jcenter() -} - -dependencies { - compile project(':village') - compile project(':common') - wearApp project(':wearable') - - compile supportV4 - compile appcompatV7 - compile recyclerView - compile playServices - - // Third party dependency: BaseGameUtils - compile project(':third_party:PlayGamesBasicSamples:BaseGameUtils') - // Third party dependency: Volley - compile files('../third_party/volley/volley.jar') - - // JBox2D - compile 'org.jbox2d:jbox2d-library:2.2.1.1' -} diff --git a/app/santa-tracker/lint.xml b/app/santa-tracker/lint.xml deleted file mode 100644 index 9da82c699..000000000 --- a/app/santa-tracker/lint.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/proguard.txt b/app/santa-tracker/proguard.txt deleted file mode 100644 index d1225acb1..000000000 --- a/app/santa-tracker/proguard.txt +++ /dev/null @@ -1,92 +0,0 @@ -# This is a configuration file for ProGuard. -# http://proguard.sourceforge.net/index.html#manual/usage.html - --dontusemixedcaseclassnames --dontskipnonpubliclibraryclasses --verbose - -# Optimization is turned off by default. Dex does not like code run -# through the ProGuard optimize and preverify steps (and performs some -# of these optimizations on its own). --dontoptimize --dontpreverify -# Note that if you want to enable optimization, you cannot just -# include optimization flags in your own project configuration file; -# instead you will need to point to the -# "proguard-android-optimize.txt" file instead of this one from your -# project.properties file. - -# SourceFile and LineNumberTable are required for useful stack traces --keepattributes *Annotation*,SourceFile,LineNumberTable - --keep public class com.google.vending.licensing.ILicensingService --keep public class com.android.vending.licensing.ILicensingService - -# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native --keepclasseswithmembernames class * { - native ; -} - -# keep setters in Views so that animations can still work. -# see http://proguard.sourceforge.net/manual/examples.html#beans --keepclassmembers public class * extends android.view.View { - void set*(***); - *** get*(); -} - -# We want to keep methods in Activity that could be used in the XML attribute onClick --keepclassmembers class * extends android.app.Activity { - public void *(android.view.View); -} - -# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations --keepclassmembers enum * { - public static **[] values(); - public static ** valueOf(java.lang.String); -} - --keep class * implements android.os.Parcelable { - public static final android.os.Parcelable$Creator *; -} - --keepclassmembers class **.R$* { - public static ; -} - -# The support library contains references to newer platform versions. -# Don't warn about those in case this app is linking against an older -# platform version. We know about them, and they are safe. --dontwarn android.support.** - -# Keep for Cast, TODO: be more explicit about exact classes to keep -#-keep class android.support.v7.** { *; } -#-keep interface android.support.v7.** { *; } - -# Allow obfuscation of android.support.v7.internal.view.menu.** -# to avoid problem on Samsung 4.2.2 devices with appcompat v21 -# see https://code.google.com/p/android/issues/detail?id=78377 --keep class !android.support.v7.internal.view.menu.**,android.support.** {*;} --keep interface !android.support.v7.internal.view.menu.**,android.support.** {*;} - --keep class android.support.v4.app.** { *; } --keep interface android.support.v4.app.** { *; } - -# Config for Google Play Services: http://developer.android.com/google/play-services/setup.html#Setup --keep class * extends java.util.ListResourceBundle { - protected Object[][] getContents(); -} - --keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { - public static final *** NULL; -} - --keepnames @com.google.android.gms.common.annotation.KeepName class * --keepclassmembernames class * { - @ccom.google.android.gms.common.annotation.KeepName *; -} - --keepnames class * implements android.os.Parcelable { - public static final ** CREATOR; -} - --keep public class com.google.android.apps.santatracker.village.** { public *;} diff --git a/app/santa-tracker/src/debug/res/drawable-hdpi/ic_launcher_santa.png b/app/santa-tracker/src/debug/res/drawable-hdpi/ic_launcher_santa.png deleted file mode 100755 index 2144e0ce3..000000000 Binary files a/app/santa-tracker/src/debug/res/drawable-hdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/debug/res/drawable-mdpi/ic_launcher_santa.png b/app/santa-tracker/src/debug/res/drawable-mdpi/ic_launcher_santa.png deleted file mode 100755 index 7cc9ddcfd..000000000 Binary files a/app/santa-tracker/src/debug/res/drawable-mdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/debug/res/drawable-xhdpi/ic_launcher_santa.png b/app/santa-tracker/src/debug/res/drawable-xhdpi/ic_launcher_santa.png deleted file mode 100755 index c079ecb79..000000000 Binary files a/app/santa-tracker/src/debug/res/drawable-xhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/debug/res/drawable-xxhdpi/ic_launcher_santa.png b/app/santa-tracker/src/debug/res/drawable-xxhdpi/ic_launcher_santa.png deleted file mode 100755 index 794b2b407..000000000 Binary files a/app/santa-tracker/src/debug/res/drawable-xxhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/debug/res/drawable-xxxhdpi/ic_launcher_santa.png b/app/santa-tracker/src/debug/res/drawable-xxxhdpi/ic_launcher_santa.png deleted file mode 100755 index 0b6599217..000000000 Binary files a/app/santa-tracker/src/debug/res/drawable-xxxhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/debug/res/menu/menu_startup.xml b/app/santa-tracker/src/debug/res/menu/menu_startup.xml deleted file mode 100644 index f36f32d6c..000000000 --- a/app/santa-tracker/src/debug/res/menu/menu_startup.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/santa-tracker/src/debug/res/values/debug_settings.xml b/app/santa-tracker/src/debug/res/values/debug_settings.xml deleted file mode 100644 index 00dd7c90c..000000000 --- a/app/santa-tracker/src/debug/res/values/debug_settings.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - false - - diff --git a/app/santa-tracker/src/debug/res/values/donottranslate.xml b/app/santa-tracker/src/debug/res/values/donottranslate.xml deleted file mode 100644 index f62fbf236..000000000 --- a/app/santa-tracker/src/debug/res/values/donottranslate.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - Santa Tracker Debug - - diff --git a/app/santa-tracker/src/debug/res/values/game_ids.xml b/app/santa-tracker/src/debug/res/values/game_ids.xml deleted file mode 100644 index 4758baaed..000000000 --- a/app/santa-tracker/src/debug/res/values/game_ids.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - 0 - - TODO: add gumball leaderboard id here - TODO: add memory leaderboard id here - diff --git a/app/santa-tracker/src/debug/res/values/game_ids_jetpack.xml b/app/santa-tracker/src/debug/res/values/game_ids_jetpack.xml deleted file mode 100644 index c9abd182e..000000000 --- a/app/santa-tracker/src/debug/res/values/game_ids_jetpack.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - diff --git a/app/santa-tracker/src/debug/res/xml/config_analytics_global.xml b/app/santa-tracker/src/debug/res/xml/config_analytics_global.xml deleted file mode 100644 index fb5f1e3e2..000000000 --- a/app/santa-tracker/src/debug/res/xml/config_analytics_global.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - verbose - true - \ No newline at end of file diff --git a/app/santa-tracker/src/dogfood/res/drawable-hdpi/ic_launcher_santa.png b/app/santa-tracker/src/dogfood/res/drawable-hdpi/ic_launcher_santa.png deleted file mode 100755 index 992e71a90..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-hdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-hdpi/santatracker_logo_startup.png b/app/santa-tracker/src/dogfood/res/drawable-hdpi/santatracker_logo_startup.png deleted file mode 100644 index b30702f89..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-hdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-mdpi/ic_launcher_santa.png b/app/santa-tracker/src/dogfood/res/drawable-mdpi/ic_launcher_santa.png deleted file mode 100755 index 2f883e12d..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-mdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-mdpi/santatracker_logo_startup.png b/app/santa-tracker/src/dogfood/res/drawable-mdpi/santatracker_logo_startup.png deleted file mode 100644 index 660d9f819..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-mdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-xhdpi/ic_launcher_santa.png b/app/santa-tracker/src/dogfood/res/drawable-xhdpi/ic_launcher_santa.png deleted file mode 100755 index 8b92e7406..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-xhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-xhdpi/santatracker_logo_startup.png b/app/santa-tracker/src/dogfood/res/drawable-xhdpi/santatracker_logo_startup.png deleted file mode 100644 index 8bcc1ab28..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-xhdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-xxhdpi/ic_launcher_santa.png b/app/santa-tracker/src/dogfood/res/drawable-xxhdpi/ic_launcher_santa.png deleted file mode 100755 index 7409533f1..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-xxhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-xxhdpi/santatracker_logo_startup.png b/app/santa-tracker/src/dogfood/res/drawable-xxhdpi/santatracker_logo_startup.png deleted file mode 100644 index 078d88399..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-xxhdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/drawable-xxxhdpi/ic_launcher_santa.png b/app/santa-tracker/src/dogfood/res/drawable-xxxhdpi/ic_launcher_santa.png deleted file mode 100755 index 6197a4333..000000000 Binary files a/app/santa-tracker/src/dogfood/res/drawable-xxxhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/dogfood/res/values/debug_settings.xml b/app/santa-tracker/src/dogfood/res/values/debug_settings.xml deleted file mode 100644 index 00dd7c90c..000000000 --- a/app/santa-tracker/src/dogfood/res/values/debug_settings.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - false - - diff --git a/app/santa-tracker/src/dogfood/res/values/donottranslate.xml b/app/santa-tracker/src/dogfood/res/values/donottranslate.xml deleted file mode 100644 index dc4b4d7f2..000000000 --- a/app/santa-tracker/src/dogfood/res/values/donottranslate.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - ":" - 00 - - diff --git a/app/santa-tracker/src/dogfood/res/values/game_ids.xml b/app/santa-tracker/src/dogfood/res/values/game_ids.xml deleted file mode 100644 index 4758baaed..000000000 --- a/app/santa-tracker/src/dogfood/res/values/game_ids.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - 0 - - TODO: add gumball leaderboard id here - TODO: add memory leaderboard id here - diff --git a/app/santa-tracker/src/dogfood/res/values/game_ids_jetpack.xml b/app/santa-tracker/src/dogfood/res/values/game_ids_jetpack.xml deleted file mode 100644 index c9abd182e..000000000 --- a/app/santa-tracker/src/dogfood/res/values/game_ids_jetpack.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - TODO: add achievement id - diff --git a/app/santa-tracker/src/dogfood/res/xml/config_analytics_global.xml b/app/santa-tracker/src/dogfood/res/xml/config_analytics_global.xml deleted file mode 100644 index 4d79b9c3a..000000000 --- a/app/santa-tracker/src/dogfood/res/xml/config_analytics_global.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - verbose - false - \ No newline at end of file diff --git a/app/santa-tracker/src/main/AndroidManifest.xml b/app/santa-tracker/src/main/AndroidManifest.xml deleted file mode 100644 index ebe0ad1b0..000000000 --- a/app/santa-tracker/src/main/AndroidManifest.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/santa-tracker/src/main/assets/RobotoCondensed-Regular.ttf b/app/santa-tracker/src/main/assets/RobotoCondensed-Regular.ttf deleted file mode 100644 index 713fd30c4..000000000 Binary files a/app/santa-tracker/src/main/assets/RobotoCondensed-Regular.ttf and /dev/null differ diff --git a/app/santa-tracker/src/main/assets/jetpack_music.mp3 b/app/santa-tracker/src/main/assets/jetpack_music.mp3 deleted file mode 100644 index bb2c2fb60..000000000 Binary files a/app/santa-tracker/src/main/assets/jetpack_music.mp3 and /dev/null differ diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/GumballActivity.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/GumballActivity.java deleted file mode 100644 index 314543d03..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/GumballActivity.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.common.PlayGamesActivity; -import com.google.android.apps.santatracker.games.gumball.TiltGameFragment; -import com.google.android.apps.santatracker.launch.StartupActivity; -import com.google.android.apps.santatracker.util.AnalyticsManager; - -import android.os.Bundle; - -public class GumballActivity extends PlayGamesActivity { - - private static final String TAG = GumballActivity.class - .getSimpleName(); - - private TiltGameFragment mGumballFragment; - - public GumballActivity() { - super(R.layout.activity_gumball, StartupActivity.class); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - mGumballFragment = TiltGameFragment.newInstance(); - this.getSupportFragmentManager().beginTransaction() - .replace(R.id.mainFragmentContainer, mGumballFragment).commit(); - - // [ANALYTICS SCREEN]: Gumball - AnalyticsManager.sendScreenView(R.string.analytics_screen_gumball); - } - - @Override - public void onBackPressed() { - if (mGumballFragment != null) { - mGumballFragment.onBackKeyPressed(); - } else { - super.onBackPressed(); - } - } - - @Override - public void onSignInSucceeded() { - super.onSignInSucceeded(); - mGumballFragment.onSignInSucceeded(); - } - - @Override - public String getGameId() { - return getResources().getString(R.string.gumball_game_id); - } - - @Override - public String getGameTitle() { - return getString(R.string.gumball); - } - - @Override - public void onSignInFailed() { - super.onSignInFailed(); - mGumballFragment.onSignInFailed(); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/MemoryActivity.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/MemoryActivity.java deleted file mode 100644 index 2dbcaa354..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/MemoryActivity.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.common.PlayGamesActivity; -import com.google.android.apps.santatracker.games.matching.MemoryMatchFragment; -import com.google.android.apps.santatracker.launch.StartupActivity; -import com.google.android.apps.santatracker.util.AnalyticsManager; - -import android.os.Bundle; - -public class MemoryActivity extends PlayGamesActivity { - - private MemoryMatchFragment mMemoryMatchFragment; - - public MemoryActivity() { - super(R.layout.activity_memory, StartupActivity.class); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - mMemoryMatchFragment = MemoryMatchFragment.newInstance(); - this.getSupportFragmentManager().beginTransaction() - .replace(R.id.mainFragmentContainer, mMemoryMatchFragment).commit(); - - // [ANALYTICS SCREEN]: Memory - AnalyticsManager.sendScreenView(R.string.analytics_screen_memory); - } - - @Override - public void onBackPressed() { - if (mMemoryMatchFragment != null) { - mMemoryMatchFragment.onBackKeyPressed(); - } else { - super.onBackPressed(); - } - } - - @Override - public void onSignInSucceeded() { - super.onSignInSucceeded(); - mMemoryMatchFragment.onSignInSucceeded(); - } - - @Override - public String getGameId() { - return getResources().getString(R.string.memory_game_id); - } - - @Override - public String getGameTitle() { - return getString(R.string.memory); - } - - @Override - public void onSignInFailed() { - super.onSignInFailed(); - mMemoryMatchFragment.onSignInFailed(); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/GameActivity.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/GameActivity.java deleted file mode 100644 index b5481ae5c..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/GameActivity.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.common; - -import com.google.android.apps.santatracker.R; -import com.google.android.gms.appindexing.AppIndex; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.ResultCallback; -import com.google.android.gms.common.api.Status; -import com.google.android.apps.santatracker.games.gumball.Utils; -import com.google.android.apps.santatracker.util.SantaLog; -import com.google.example.games.basegameutils.GameHelper; - -import android.annotation.SuppressLint; -import android.content.Intent; -import android.graphics.drawable.ColorDrawable; -import android.net.Uri; -import android.os.Bundle; -import android.support.v7.app.ActionBar; -import android.support.v7.app.ActionBarActivity; -import android.util.Log; -import android.view.Window; - -@SuppressLint("Registered") -public abstract class GameActivity extends ActionBarActivity implements GameHelper.GameHelperListener { - - public static final String TAG = "GameActivity"; - - GameHelper mHelper = null; - // we need a separate API client for App Indexing - // so that view and ViewEnd events can be recorded even - // when the user is not signed in - GoogleApiClient mApiClient = null; - boolean mSignedIn = false; - - // base URL for deep links required by App Indexing - // Deep link intent filter entries in AndroidManifest.xml must match - // the data part of this prefix - private static Uri BASE_APP_URI; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); - - ActionBar actionBar = getSupportActionBar(); - actionBar.setDisplayShowTitleEnabled(false); - actionBar.setHomeButtonEnabled(false); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setBackgroundDrawable(new ColorDrawable(android.R.color.transparent)); - - mHelper = new GameHelper(this, GameHelper.CLIENT_GAMES); - mApiClient = new GoogleApiClient.Builder(this).addApi(AppIndex.APP_INDEX_API).build(); - // add App Indexing API - BASE_APP_URI = Uri.parse( - "android-app://" + getApplicationContext().getPackageName() + - "/" + getResources().getString(R.string.santa_tracker_deep_link_prefix)); - // - if (getResources().getBoolean(R.bool.debug_logs_enabled)) { - Log.d("SantaTracker:GameHelper", "GameHelper debug logs are enabled."); - mHelper.enableDebugLog(true, "SantaTracker:GameHelper"); - } - // Max sign-in attempts of 0 forces BaseGameUtils into deferring sign-in until either a) the - // user signs in via a manual trigger or b) login, but only if the user has already signed - // in previously. - mHelper.setMaxAutoSignInAttempts(0); - mHelper.setup(this); - - if (Utils.hasKitKat()) { - ImmersiveModeHelper.setImmersiveSticky(getWindow()); - ImmersiveModeHelper.installSystemUiVisibilityChangeListener(getWindow()); - } - } - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - if (Utils.hasKitKat() && hasFocus) { - ImmersiveModeHelper.setImmersiveSticky(getWindow()); - } - } - - @Override - public void onStart() { - super.onStart(); - mHelper.onStart(this); - appIndexingRecordView(); - } - - @Override - public void onStop() { - super.onStop(); - appIndexingRecordViewEnd(); - mHelper.onStop(); - } - - @Override - public void onActivityResult(int req, int resp, Intent data) { - super.onActivityResult(req, resp, data); - mHelper.onActivityResult(req, resp, data); - } - - @Override - public void onSignInFailed() { - mSignedIn = false; - } - - @Override - public void onSignInSucceeded() { - mSignedIn = true; - } - - public GameHelper getGameHelper() { - return mHelper; - } - - public boolean isSignedIn() { - return mSignedIn; - } - - /** - * Connect the client, record the view using App Indexing API. - * We're not connecting the client in the activity lifecycle method - * to maintain symmetry with appIndexingRecordViewEnd which - * disconnects the client once the view is recorded - */ - private void appIndexingRecordView() { - // connect the client - mApiClient.connect(); - // Define a title for your current page, shown in autocompletion UI - final String title = getGameTitle(); - final Uri appUri = getGameDeepLinkUri(); - - // Call the App Indexing API view method - PendingResult result = AppIndex.AppIndexApi.view(mApiClient, this, - appUri, title, null, null); - - result.setResultCallback(new ResultCallback() { - @Override - public void onResult(Status status) { - if (status.isSuccess()) { - SantaLog.v(TAG, String.format("App Indexing API: Recorded [" - + title + "] view successfully.")); - } else { - Log.e(TAG, "App Indexing API: There was an error recording the view." - + status.toString()); - } - } - }); - } - - /** - * Record the view end using the App Indexing API, - * disconnect the client once the view is recorded. - */ - private void appIndexingRecordViewEnd() { - final Uri appUri = getGameDeepLinkUri(); - final String title = getGameTitle(); - PendingResult result = AppIndex.AppIndexApi.viewEnd(mApiClient, this, - appUri); - result.setResultCallback(new ResultCallback() { - @Override - public void onResult(Status status) { - mApiClient.disconnect(); // disconnecting here because of a potential race - if (status.isSuccess()) { - Log.v(TAG, "App Indexing API: Recorded [" - + title + "] view end successfully."); - } else { - Log.e(TAG, "App Indexing API: There was an error recording the view end." - + status.toString()); - } - } - }); - } - - /** - * See https://developers.google.com/app-indexing/webmasters/appindexingapi - * @return deep link representing this game - */ - public Uri getGameDeepLinkUri() { - return BASE_APP_URI.buildUpon().appendPath(String.valueOf(getGameId())).build(); - } - - /** - * This is the ID which becomes a part of the deep link. - * For example: - * android-app://com.google.android.apps.santatracker/http/google.com/santatracker/gumball - * This value need not be human-readable, it sent in the Intent back to the - * Santa Tracker by the Google App. - * When extending this class and providing new deep links, make sure - * to update the corresponding intent-filter in AndroidManifest.xml. - * @return deep link component to identify the game to app indexing API - */ - public abstract String getGameId(); - - /** - * This name will be shown to users in the Google app for autocompletion - * @return user-visible game title - */ - public abstract String getGameTitle(); - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/ImmersiveModeHelper.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/ImmersiveModeHelper.java deleted file mode 100644 index 550272a0d..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/ImmersiveModeHelper.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.common; - -import android.annotation.TargetApi; -import android.os.Build; -import android.util.Log; -import android.view.View; -import android.view.Window; - -public class ImmersiveModeHelper { - - private static final String TAG = ImmersiveModeHelper.class - .getSimpleName(); - - @TargetApi(Build.VERSION_CODES.KITKAT) - public static void installSystemUiVisibilityChangeListener(final Window w) { - View view = w.getDecorView(); - view.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { - @Override - public void onSystemUiVisibilityChange(int visibility) { - Log.d(TAG, "setOnSystemUiVisibilityChangeListener: visibility=" + visibility); - setImmersiveSticky(w); - } - }); - } - - @TargetApi(Build.VERSION_CODES.KITKAT) - public static void setImmersiveSticky(Window w) { - w.getDecorView().setSystemUiVisibility( - View.SYSTEM_UI_FLAG_LAYOUT_STABLE | - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | - View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | - View.SYSTEM_UI_FLAG_FULLSCREEN | - View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - - } - - @TargetApi(Build.VERSION_CODES.KITKAT) - public static void setImmersiveStickyWithActionBar(Window w) { - w.getDecorView().setSystemUiVisibility( - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | - View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | - View.SYSTEM_UI_FLAG_FULLSCREEN | - View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/PlayGamesActivity.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/PlayGamesActivity.java deleted file mode 100644 index 86d5763e9..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/common/PlayGamesActivity.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.common; - -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.games.Games; -import com.google.example.games.basegameutils.GameHelper; - -import android.os.Bundle; -import android.support.v7.app.ActionBar; - -import java.util.HashMap; - -public abstract class PlayGamesActivity extends GameActivity { - - // list of achievements we are pending to unlock or increment (waiting for sign in) - // Key is the achievement ID, value is the number of steps to increment. 0 means - // unlock rather than increment. - private HashMap mAchievementsToSend = new HashMap(); - - // score we are pending to send (waiting for sign in). Hash of leaderboard ID to score. - private HashMap mScoresToSend = new HashMap(); - - - // id of the layout to load during onCreate - private int mLayoutId; - protected Class mBackClass; - - public PlayGamesActivity(int layoutId, Class backClass) { - super(); - mLayoutId = layoutId; - mBackClass = backClass; - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(mLayoutId); - - ActionBar actionBar = getSupportActionBar(); - actionBar.setDisplayShowTitleEnabled(false); - actionBar.setDisplayHomeAsUpEnabled(false); - } - - @Override - public boolean onSupportNavigateUp() { - launchStartupActivity(); - return true; - } - - @Override - public void onBackPressed() { - launchStartupActivity(); - } - - protected void launchStartupActivity() { - finish(); - } - - @Override - public void onSignInSucceeded() { - super.onSignInSucceeded(); - tryToSendGameData(); - } - - // Call from any thread - public void postUnlockAchievement(final int achResId) { - final String achievementId = getString(achResId); - runOnUiThread(new Runnable() { - @Override - public void run() { - if (!mAchievementsToSend.containsKey(achievementId)) { - mAchievementsToSend.put(achievementId, 0); - } - tryToSendGameData(); - } - }); - } - - // Call from any thread - public void postIncrementAchievement(final int achResId, final int steps) { - final String achievementId = getString(achResId); - if (steps <= 0) { - return; - } - runOnUiThread(new Runnable() { - @Override - public void run() { - if (!mAchievementsToSend.containsKey(achievementId)) { - mAchievementsToSend.put(achievementId, steps); - } else { - mAchievementsToSend.put(achievementId, - mAchievementsToSend.get(achievementId) + steps); - } - tryToSendGameData(); - } - }); - } - - // Call from any thread - public void postSubmitScore(final int lbResId, final long score) { - final String leaderboardId = getString(lbResId); - runOnUiThread(new Runnable() { - @Override - public void run() { - if (mScoresToSend.containsKey(leaderboardId)) { - long existingScore = mScoresToSend.get(leaderboardId); - if (existingScore >= score) { - return; - } - } - mScoresToSend.put(leaderboardId, score); - tryToSendGameData(); - } - }); - } - - // Call from UI thread only. - private void tryToSendGameData() { - GameHelper helper = getGameHelper(); - if (helper != null && helper.isSignedIn() && - helper.getApiClient().isConnected()) { - GoogleApiClient apiClient = helper.getApiClient(); - for (String achId : mAchievementsToSend.keySet()) { - int arg = mAchievementsToSend.get(achId); - if (arg <= 0) { - Games.Achievements.unlock(apiClient, achId); - } else { - Games.Achievements.increment(apiClient, achId, arg); - } - } - mAchievementsToSend.clear(); - - for (String lbId : mScoresToSend.keySet()) { - Games.Leaderboards.submitScore(apiClient, lbId, - mScoresToSend.get(lbId)); - } - mScoresToSend.clear(); - } - } - - public void startSignIn() { - if (!isSignedIn()) { - getGameHelper().beginUserInitiatedSignIn(); - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/PhysicsWorld.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/PhysicsWorld.java deleted file mode 100644 index 6444b2729..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/PhysicsWorld.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.gumball; - -import org.jbox2d.collision.shapes.CircleShape; -import org.jbox2d.collision.shapes.EdgeShape; -import org.jbox2d.collision.shapes.PolygonShape; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.Vec2; -import org.jbox2d.dynamics.Body; -import org.jbox2d.dynamics.BodyDef; -import org.jbox2d.dynamics.BodyType; -import org.jbox2d.dynamics.FixtureDef; -import org.jbox2d.dynamics.World; - -import java.util.ArrayList; -import java.util.List; - -/** - * Wraps the game world and physics simulation for the gumball game. - */ -public class PhysicsWorld { - - /** - * All {@link org.jbox2d.dynamics.Body} objects in the world. - */ - private List mBodies = new ArrayList(); - /** - * The Physics world. - */ - private World mWorld; - /** - * Bodies that are to be removed from the scene. - */ - public List mBodiesToBeRemoved = new ArrayList(); - /** - * Render refresh rate. - */ - private static final float FRAME_RATE = 1.0f / 45.0f; - /** - * Create the physics world and draws the boundries - */ - public void create(Vec2 gravity) { - - // Create Physics World with Gravity - mWorld = new World(gravity); - mWorld.setAllowSleep(false); - mWorld.setSleepingAllowed(false); - mWorld.setAutoClearForces(true); - - BodyDef groundBodyDef = new BodyDef(); - - // Create Ground Box - groundBodyDef.position.set(new Vec2(5.0f, -2.0f)); - Body groundBody = mWorld.createBody(groundBodyDef); - PolygonShape polygonShape = new PolygonShape(); - - // Create top bound - groundBodyDef.position.set(new Vec2(5.0f, 32.0f)); - groundBody = mWorld.createBody(groundBodyDef); - groundBody.createFixture(polygonShape, 1.0f); - - polygonShape.setAsBox(2.0f, 18.0f); - - // Create left wall - groundBodyDef.position.set(new Vec2(-2.0f, 16.0f)); - groundBody = mWorld.createBody(groundBodyDef); - groundBody.createFixture(polygonShape, 1.0f); - - // Create right wall - groundBodyDef.position.set(new Vec2(12.0f, 16.0f)); - groundBody = mWorld.createBody(groundBodyDef); - groundBody.createFixture(polygonShape, 1.0f); - - } - - /** - * Adds a gumball to the scene. - */ - public void addGumball(float x, float y, Gumball gumball, float density, float radius, - float bounce, float friction, BodyType bodyType) { - // Create Shape with Properties - CircleShape circleShape = new CircleShape(); - circleShape.m_radius = radius; - addItem(x, y, circleShape, bounce, gumball, density, friction, bodyType); - } - - public void addPipeSides(float x, float y, int data, float density, float bounce, - float friction, BodyType bodyType) { - EdgeShape[] edgeShapes = new EdgeShape[2]; - edgeShapes[0] = new EdgeShape(); - edgeShapes[0].set(new Vec2(.23f, -1f), new Vec2(.01f, .48f)); - edgeShapes[1] = new EdgeShape(); - edgeShapes[1].set(new Vec2(1.4f, -1f), new Vec2(1.55f, .45f)); - addItem(x, y, edgeShapes, bounce, data, density, friction, bodyType); - } - - - public void addPipeBottom(float x, float y, int data, float density, float bounce, - float friction, BodyType bodyType) { - EdgeShape[] edgeShapes = new EdgeShape[1]; - edgeShapes[0] = new EdgeShape(); - edgeShapes[0].set(new Vec2(.83f, 0f), new Vec2(2.40f, 0f)); - addItem(x, y, edgeShapes, bounce, data, density, friction, bodyType); - } - - public void addFloor(float x, float y, int data, float density, float bounce, float friction, - BodyType bodyType) { - EdgeShape[] edgeShapes = new EdgeShape[1]; - edgeShapes[0] = new EdgeShape(); - edgeShapes[0].set(new Vec2(-9f, -.8f), new Vec2(9f, -.8f)); - addItem(x, y, edgeShapes, bounce, data, density, friction, bodyType); - } - - public void addItem(float x, float y, Shape[] shapes, float bounce, int data, float density, - float friction, BodyType bodyType) { - - // Create Dynamic Body - BodyDef bodyDef = new BodyDef(); - bodyDef.position.set(x, y); - bodyDef.userData = data; - bodyDef.type = bodyType; - Body body = mWorld.createBody(bodyDef); - mBodies.add(body); - - for (int i = 0; i < shapes.length; i++) { - // Assign shape to Body - FixtureDef fixtureDef = new FixtureDef(); - fixtureDef.shape = shapes[i]; - fixtureDef.density = density; - fixtureDef.friction = friction; - fixtureDef.restitution = bounce; - - body.createFixture(fixtureDef); - } - } - - public void addItem(float x, float y, Shape shape, float bounce, int data, float density, - float friction, BodyType bodyType) { - - // Create Dynamic Body - BodyDef bodyDef = new BodyDef(); - bodyDef.position.set(x, y); - bodyDef.userData = data; - bodyDef.type = bodyType; - Body body = mWorld.createBody(bodyDef); - mBodies.add(body); - - // Assign shape to Body - FixtureDef fixtureDef = new FixtureDef(); - fixtureDef.shape = shape; - fixtureDef.density = density; - fixtureDef.friction = friction; - fixtureDef.restitution = bounce; - body.createFixture(fixtureDef); - } - - public void addItem(float x, float y, Shape shape, float bounce, Gumball gumball, - float density, float friction, BodyType bodyType) { - - // Create Dynamic Body - BodyDef bodyDef = new BodyDef(); - bodyDef.position.set(x, y); - bodyDef.userData = gumball; - bodyDef.type = bodyType; - Body body = mWorld.createBody(bodyDef); - mBodies.add(body); - - // Assign shape to Body - FixtureDef fixtureDef = new FixtureDef(); - fixtureDef.shape = shape; - fixtureDef.density = density; - fixtureDef.friction = friction; - fixtureDef.restitution = bounce; - body.createFixture(fixtureDef); - } - - /** - * Updates the physics world by removing all pending bodies. - */ - public void update() { - // Update Physics World - for (int i = 0; i < mBodiesToBeRemoved.size(); i++) { - mWorld.destroyBody(mBodiesToBeRemoved.get(i)); - } - mBodiesToBeRemoved.clear(); - mWorld.step(FRAME_RATE, 10, 10); - mWorld.clearForces(); - } - - /** - * Gets a reference to the world. - */ - public World getWorld() { - return mWorld; - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/TiltGameFragment.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/TiltGameFragment.java deleted file mode 100644 index df11a6b25..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/TiltGameFragment.java +++ /dev/null @@ -1,1205 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.gumball; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.common.ImmersiveModeHelper; -import com.google.android.apps.santatracker.games.common.PlayGamesActivity; -import com.google.android.apps.santatracker.games.matching.CircleView; -import com.google.android.apps.santatracker.games.matching.MatchingGameConstants; -import com.google.android.apps.santatracker.games.matching.LevelTextView; - -import org.jbox2d.callbacks.ContactImpulse; -import org.jbox2d.callbacks.ContactListener; -import org.jbox2d.collision.Manifold; -import org.jbox2d.common.Vec2; -import org.jbox2d.dynamics.Body; -import org.jbox2d.dynamics.BodyType; -import org.jbox2d.dynamics.contacts.Contact; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import android.app.Activity; -import android.content.Context; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.graphics.Color; -import android.graphics.Typeface; -import android.graphics.drawable.AnimationDrawable; -import android.hardware.Sensor; -import android.hardware.SensorEvent; -import android.hardware.SensorEventListener; -import android.hardware.SensorManager; -import android.media.AudioManager; -import android.media.MediaPlayer; -import android.media.SoundPool; -import android.os.Build; -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.Surface; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; -import android.view.animation.Animation.AnimationListener; -import android.view.animation.AnimationUtils; -import android.view.animation.TranslateAnimation; -import android.widget.Button; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.TextView; - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Queue; -import java.util.UUID; -import java.util.concurrent.TimeUnit; - -/** - * Gumball game fragment. - */ -public class TiltGameFragment extends Fragment - implements SensorEventListener, ContactListener, AnimationListener, OnClickListener { - - /** - * Bounce rate of objects in the physics world. - */ - public static final float WORLD_OBJECT_BOUNCE = 0.2f; - /** - * Density of objects in the physics world. - */ - public static final float WORLD_OBJECT_DENSITY = 185.77f; - /** - * Friction of objects in the physics world. - */ - public static final float WORLD_OBJECT_FRICTION = 0.2f; - /** - * Friction of floor objects in the physics world. - */ - public static final float WORLD_FLOOR_FRICTION = 0.8f; - /** - * Initial X position of the floor and pipes in the physics world. - */ - public static final float WORLD_FLOOR_X = 3.37f; - /** - * Initial Y position of the floor and pipes in the physics world. - */ - public static final float WORLD_FLOOR_Y = 0f; - - /** View that contains the main game. */ - private TiltGameView mGameView; - - /** - * Box2D physics world for this game. - */ - private PhysicsWorld mWorld; - - /** - * Current rotation of the device. Used to adjust sensor readings if the screen is rotate in - * portrait or landscape. - * - * @see android.view.Display#getRotation() - */ - private int mRotation; - - /** - * Main game thread. - */ - private Runnable mGameThread; - - /** - * Previous value of the sensor's Y reading. Used to calculate the rotational offset between - * sensor events. - */ - private float mPreviousSensorY = 0f; - - /** - * MediaPlayer that plays the background music. - */ - private MediaPlayer mBackgroundMusic; - - /** - * Index of loaded sound effect in sound pool for small bounce. - */ - private int mSoundBounceSmall = -1; - - /** - * Index of loaded sound effect in sound pool for medium bounce. - */ - private int mSoundBounceMed = -1; - - /** - * Index of loaded sound effect in sound pool for large bounce. - */ - private int mSoundBounceLarge = -1; - - /** - * Index of loaded sound effect in sound pool for ball in machine. - */ - private int mSoundBallInMachine = -1; - - /** - * Index of loaded sound effect in sound pool for failed ball. - */ - private int mSoundBallFail = -1; - - /** - * Index of loaded sound effect in sound pool for dropped ball. - */ - private int mSoundBallDrop = -1; - - /** - * Index of loaded sound effect in sound pool for game over. - */ - private int mSoundGameOver = -1; - - /** - * Scale down animation for level. - */ - private Animation mAnimationScaleLevelDown; - - /** - * Fading out animation for level. - */ - private Animation mAnimationLevelFadeOut; - - /** - * Scaling up animation for level. - */ - private Animation mAnimationLevelScaleUp; - - /** - * Outlet animation for balls. - */ - private Animation mAnimationOutlet; - - /** - * Alpha animation for timer updates. - */ - private Animation mAnimationTimerAlpha; - - /** - * View for end of level circle overlay. - */ - private CircleView mEndLevelCircle; - - /** - * View that shows the current level number. - */ - private LevelTextView mLevelNumberText; - - /** - * Sound pool from which all sounds are played back. - */ - private SoundPool mSoundPool; - - /** - * Holder for sound pool id to handle playbacks, connects and disconnects. - */ - private final HashMap mSoundPoolId = new HashMap<>(); - - /** - * Number of balls left in the game. - */ - private int mGameBallsLeft = 2; - - /** - * Current play level. Zero indexed, first level is 0. - */ - private int mCurrentLevelNum = 0; - - /** - * View for the ball outlet at the top of the screen. - */ - private View mGameOutlet; - - /** - * Root view of the game layout. - */ - private View mRootView; - - /** - * Gumballs that are queued to be dropped through the outlet. - */ - private Queue mGumballQueue; - - /** - * The current, active gumball on screen. - */ - private Gumball mCurrentGumball; - - /** - * X position of outlet in the last animation. - */ - private float mOutletPreviousXPos = 0; - - /** - * Array of the ball indicator views at the bottom of the screen. - */ - private ImageView mViewIndicators[] = new ImageView[6]; - - /** - * Number of gumballs collected in the current game. - */ - private int mNumberCollected = 0; - - /** - * Refresh rate for the game countdown timer. - * - * @see com.google.android.apps.santatracker.games.gumball.TiltGameFragment.GameCountdown - */ - private int mFramesPerSecond = 60; - - /** - * Time left in the current game. Value in milliseconds. - */ - private long mTimeLeftInMillis = MatchingGameConstants.GUMBALL_INIT_TIME; - - /** - * Countdown timer for the current game. - */ - private GameCountdown mCountDownTimer = null; - - /** - * Countdown timer text. - */ - private TextView mViewCountdown; - - /** - * Score text. - */ - private TextView mViewScore; - - /** - * Total score of current game. - */ - private int mMatchScore = 0; - - /** - * Number of balls that have respawned in the current level. Used to calculate the total - * game score. - */ - private int mCountLevelBallRespawns = 0; - - /** - * Flag indicating if the game is paused. - */ - private boolean wasPaused = false; - - private ImageView mViewPlayButton; - - private ImageView mViewPauseButton; - - private ImageButton mViewBigPlayButton; - - private ImageView mViewCancelBar; - - private View mViewMatchPauseOverlay; - - private View mViewPlayAgainBackground; - - private View mViewPlayAgainMain; - - private Button mViewPlayAgainButton; - - private TextView mViewPlayAgainScore; - - private TextView mViewPlayAgainLevel; - - private Animation mAnimationPlayAgainBackground; - - private Animation mAnimationPlayAgainMain; - - /** - * Display offset on X axis for outlet in pixels. - */ - private int mOutletOffset; - - /** - * View that displays the instructions from {@link #mDrawableTransition} - */ - private ImageView mViewInstructions; - - /** - * Drawable that contains all images for the instructions. - */ - private AnimationDrawable mDrawableTransition; - - private SharedPreferences mSharedPreferences; - - private ImageView mViewGPlusSignIn; - - private View mViewGPlusLayout; - - private ImageButton mViewMainMenuButton; - - /** - * Gets an instance of this fragment - */ - public static TiltGameFragment newInstance() { - TiltGameFragment fragment = new TiltGameFragment(); - return fragment; - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - mRootView = inflater.inflate(R.layout.fragment_gumball, container, false); - mRootView.setKeepScreenOn(true); - - // Use a lower resolution background image to conserve memory below ICS - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - View matchScoreLayout = mRootView.findViewById(R.id.tilt_score_layout); - matchScoreLayout.setBackgroundResource(R.drawable.score_background_gingerbread); - } - - mViewPlayAgainScore = (TextView) mRootView.findViewById(R.id.play_again_score); - mViewPlayAgainScore.setText(String.valueOf(mMatchScore)); - mViewPlayAgainLevel = (TextView) mRootView.findViewById(R.id.play_again_level); - mViewPlayAgainLevel.setText(String.valueOf(mCurrentLevelNum)); - mViewPlayAgainBackground = mRootView.findViewById(R.id.play_again_bkgrd); - mViewPlayAgainMain = mRootView.findViewById(R.id.play_again_main); - mViewPlayAgainButton = (Button) mRootView.findViewById(R.id.play_again_btn); - mViewPlayAgainButton.setOnClickListener(this); - - mViewGPlusSignIn = (ImageView) mRootView.findViewById(R.id.gplus_button); - mViewGPlusSignIn.setOnClickListener(this); - mViewGPlusLayout = mRootView.findViewById(R.id.play_again_gplus); - mViewGPlusLayout.setVisibility(View.GONE); - - // Initialise all animations - // Construct an animation to blink the timer indefinitely - mAnimationTimerAlpha = new AlphaAnimation(0.0f, 1.0f); - mAnimationTimerAlpha.setDuration(1000); - mAnimationTimerAlpha.setRepeatMode(Animation.REVERSE); - mAnimationTimerAlpha.setRepeatCount(Animation.INFINITE); - - // Load all other animations - mAnimationPlayAgainBackground = AnimationUtils - .loadAnimation(getActivity(), R.anim.play_again_bkgrd_anim); - mAnimationPlayAgainBackground.setFillAfter(true); - mAnimationPlayAgainBackground.setAnimationListener(this); - mAnimationPlayAgainMain = AnimationUtils - .loadAnimation(getActivity(), R.anim.play_again_main_anim); - mAnimationPlayAgainMain.setFillAfter(true); - mAnimationPlayAgainMain.setAnimationListener(this); - mAnimationScaleLevelDown = AnimationUtils - .loadAnimation(getActivity(), R.anim.scale_level_anim_down); - mAnimationScaleLevelDown.setAnimationListener(this); - mAnimationLevelFadeOut = AnimationUtils - .loadAnimation(getActivity(), R.anim.level_fade_out_anim); - mAnimationLevelFadeOut.setAnimationListener(this); - mAnimationLevelScaleUp = AnimationUtils - .loadAnimation(getActivity(), R.anim.scale_up_level_anim); - mAnimationLevelScaleUp.setAnimationListener(this); - - mViewMainMenuButton = (ImageButton) mRootView.findViewById(R.id.main_menu_button); - mViewMainMenuButton.setVisibility(View.GONE); - mViewMainMenuButton.setOnClickListener(this); - - mGameOutlet = mRootView.findViewById(R.id.tiltGameOutlet); - mOutletOffset = getResources().getInteger(R.integer.outlet_offset); - - mViewIndicators[0] = (ImageView) mRootView.findViewById(R.id.indicator1); - mViewIndicators[1] = (ImageView) mRootView.findViewById(R.id.indicator2); - mViewIndicators[2] = (ImageView) mRootView.findViewById(R.id.indicator3); - mViewIndicators[3] = (ImageView) mRootView.findViewById(R.id.indicator4); - mViewIndicators[4] = (ImageView) mRootView.findViewById(R.id.indicator5); - mViewIndicators[5] = (ImageView) mRootView.findViewById(R.id.indicator6); - mViewCountdown = (TextView) mRootView.findViewById(R.id.tiltTimer); - - mLevelNumberText = (LevelTextView) mRootView.findViewById(R.id.tilt_end_level_number); - mLevelNumberText.setVisibility(View.GONE); - mEndLevelCircle = (CircleView) mRootView.findViewById(R.id.tilt_end_level_circle); - mEndLevelCircle.setVisibility(View.GONE); - - mViewPlayButton = (ImageView) mRootView.findViewById(R.id.tilt_play_button); - mViewPlayButton.setOnClickListener(this); - mViewPlayButton.setVisibility(View.GONE); - mViewPauseButton = (ImageView) mRootView.findViewById(R.id.tilt_pause_button); - mViewPauseButton.setOnClickListener(this); - mViewPauseButton.setVisibility(View.VISIBLE); - mViewMatchPauseOverlay = mRootView.findViewById(R.id.tilt_pause_overlay); - mViewMatchPauseOverlay.setVisibility(View.GONE); - mViewBigPlayButton = (ImageButton) mRootView.findViewById(R.id.tilt_big_play_button); - mViewBigPlayButton.setOnClickListener(this); - mViewCancelBar = (ImageView) mRootView.findViewById(R.id.tilt_cancel_bar); - mViewCancelBar.setOnClickListener(this); - mViewCancelBar.setVisibility(View.GONE); - - mViewScore = (TextView) mRootView.findViewById(R.id.tilt_score); - mViewScore.setText(String.valueOf(mMatchScore)); - - mGameView = (TiltGameView) mRootView.findViewById(R.id.tiltGameView); - - // Create the Box2D physics world. - mWorld = new PhysicsWorld(); - Vec2 gravity = new Vec2(0.0f, 0.0f); - mWorld.create(gravity); - mGameView.setModel(mWorld); - mWorld.getWorld().setContactListener(this); - - mGumballQueue = new LinkedList<>(); - - // Initialise the sound pool and audio playback - mSoundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); - mSoundBounceSmall = mSoundPool.load(getActivity(), R.raw.gbg_ball_bounce_1, 1); - mSoundBounceMed = mSoundPool.load(getActivity(), R.raw.gbg_ball_bounce_2, 1); - mSoundBounceLarge = mSoundPool.load(getActivity(), R.raw.gbg_ball_bounce_3, 1); - mSoundBallInMachine = mSoundPool.load(getActivity(), R.raw.gbg_ball_into_machine, 1); - mSoundBallFail = mSoundPool.load(getActivity(), R.raw.gbg_ball_fall_out, 1); - mSoundBallDrop = mSoundPool.load(getActivity(), R.raw.gbg_new_ball_bounce_drop, 1); - mSoundGameOver = mSoundPool.load(getActivity(), R.raw.gameover, 1); - - - // Display the instructions if they haven't been seen before - mSharedPreferences = getActivity().getSharedPreferences(MatchingGameConstants.PREFERENCES_FILENAME, Context.MODE_PRIVATE); - if (!mSharedPreferences.getBoolean(MatchingGameConstants.GUMBALL_INSTRUCTIONS_VIEWED, false)) { - mDrawableTransition = new AnimationDrawable(); - mDrawableTransition.addFrame(getResources().getDrawable(R.drawable.instructions_shake_1), 300); - mDrawableTransition.addFrame(getResources().getDrawable(R.drawable.instructions_shake_2), 300); - mDrawableTransition.addFrame(getResources().getDrawable(R.drawable.instructions_shake_3), 300); - mDrawableTransition.setOneShot(false); - mViewInstructions = (ImageView) mRootView.findViewById(R.id.instructions); - - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - mViewInstructions.setImageResource(R.drawable.instructions_shake_1); - } else { - mViewInstructions.setImageDrawable(mDrawableTransition); - mViewInstructions.post(new Runnable() { - public void run() { - mDrawableTransition.start(); - } - }); - } - - // Hide the instructions after 2 seconds - mViewInstructions.postDelayed(new HideInstructionsRunnable(), 2200); - } - - return mRootView; - } - - - @Override - public void onResume() { - super.onResume(); - - // Resume the game play if the game was not paused - if (!wasPaused) { - mRotation = getActivity().getWindowManager().getDefaultDisplay().getRotation(); - SensorManager sensorManager = (SensorManager) getActivity() - .getSystemService(Activity.SENSOR_SERVICE); - Sensor sensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); - if (sensor != null) { - sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_GAME); - } - mCountDownTimer = new GameCountdown(mFramesPerSecond, mTimeLeftInMillis); - mCountDownTimer.start(); - mGameView.setGameCountDown(mCountDownTimer); - } - - // Start the game loop if it is not initialised yet - if (mGameThread == null) { - mGameThread = new Runnable() { - public void run() { - synchronized (mWorld) { - if (!wasPaused) { - if (mCurrentLevelNum == 0) { - mCurrentLevelNum++; - loadLevel(mCurrentLevelNum); - } - mWorld.update(); - mGameView.invalidate(); - } - } - getActivity().getWindow().getDecorView().postDelayed(mGameThread, 10); - } - }; - } - getActivity().getWindow().getDecorView().postDelayed(mGameThread, 1000); - - loadBackgroundMusic(); - updateSignInButtonVisibility(); - } - - @Override - public void onPause() { - super.onPause(); - pauseGame(); - if (mBackgroundMusic != null) { - mBackgroundMusic.stop(); - mBackgroundMusic.release(); - } - getActivity().getWindow().getDecorView().removeCallbacks(mGameThread); - } - - private void loadBackgroundMusic() { - mBackgroundMusic = MediaPlayer.create(getActivity(), R.raw.santatracker_musicloop); - mBackgroundMusic.setLooping(true); - mBackgroundMusic.setVolume(.2f, .2f); - mBackgroundMusic.start(); - } - - /** - * Hide the sign in button if sign in was successful. - */ - public void onSignInSucceeded() { - setSignInButtonVisibility(false); - } - - public void onSignInFailed() { - } - - @Override - public void onClick(View view) { - if (view.equals(mViewPauseButton)) { - // Pause the game - pauseGame(); - } else if (view.equals(mViewPlayButton) || view.equals(mViewBigPlayButton)) { - // Continue the game - unPauseGame(); - } else if (view.equals(mViewPlayAgainButton)) { - // Reload the background music for a new game - if (mBackgroundMusic != null) { - mBackgroundMusic.stop(); - mBackgroundMusic.release(); - } - loadBackgroundMusic(); - - // Reset the game variables - mCurrentLevelNum = 0; - mTimeLeftInMillis = MatchingGameConstants.GUMBALL_INIT_TIME; - mMatchScore = 0; - mViewScore.setText(String.valueOf(mMatchScore)); - wasPaused = false; - - // Hide the pause screen - mViewPlayAgainBackground.clearAnimation(); - mViewPlayAgainMain.clearAnimation(); - mViewPlayAgainBackground.setVisibility(View.GONE); - mViewPlayAgainMain.setVisibility(View.GONE); - mViewGPlusLayout.setVisibility(View.GONE); - mViewMainMenuButton.setVisibility(View.GONE); - } else if (view.equals(mViewGPlusSignIn)) { - // Start sign-in flow. - PlayGamesActivity act = Utils.getPlayGamesActivity(this); - if (act != null) { - act.startSignIn(); - } - } else if (view.equals(mViewCancelBar) || (view.equals(mViewMainMenuButton))) { - // Exit and return to previous Activity. - returnToBackClass(); - } - - } - - private void returnToBackClass() { - getActivity().finish(); - } - - @Override - public void onAccuracyChanged(Sensor sensor, int accuracy) { - - } - - @Override - public void onSensorChanged(SensorEvent event) { - float x, y; - if (getActivity() != null) { - // Store the current screen rotation (used to offset the readings of the sensor). - mRotation = getActivity().getWindowManager().getDefaultDisplay().getRotation(); - } - - // Handle screen rotations by interpreting the sensor readings here - if (mRotation == Surface.ROTATION_0) { - x = -event.values[0]; - y = -event.values[1]; - } else if (mRotation == Surface.ROTATION_90) { - x = event.values[1]; - y = -event.values[0]; - } else if (mRotation == Surface.ROTATION_180) { - x = event.values[0]; - y = event.values[1]; - } else { - x = -event.values[1]; - y = event.values[0]; - } - // keep y low to simulate gravity - if (mPreviousSensorY == 0f) { - mPreviousSensorY = -9; - } else if (mPreviousSensorY > y) { - mPreviousSensorY = y; - } - // restrict x to ~+-45 degrees - if (x > 1.7) { - x = 2; - } else if (x < -1.7) { - x = -2; - } - mWorld.getWorld().setGravity(new Vec2(x, mPreviousSensorY)); - } - - @Override - public void beginContact(Contact contact) { - - } - - /** - * Handle contact with objects in the Box 2D world. - * Here the main game logic is implemented: When a ball hits the bottom pipe, it is removed - * and the next level or ball is started. - * When the ball goes over the edge, it is removed and a new ball is dropped from the pipe - * again. - */ - @Override - public void endContact(Contact contact) { - // If the gumball goes in the pipe, remove it from the scene (Case 1/2) - if (contact.getFixtureA().getBody().getUserData() != null && !(contact.getFixtureA() - .getBody().getUserData() instanceof Gumball) && ( - contact.getFixtureA().getBody().getUserData().equals(TiltGameView.PIPE_BOTTOM) - || contact.getFixtureA().getBody().getUserData() - .equals(TiltGameView.PIPE_SIDES))) { - mWorld.mBodiesToBeRemoved.add(contact.getFixtureB().getBody()); - mSoundPoolId - .remove(((Gumball) contact.getFixtureB().getBody().getUserData()).mSoundPoolId); - onBallInPipe(); - } else if (contact.getFixtureB().getBody().getUserData() != null && !(contact.getFixtureB() - .getBody().getUserData() instanceof Gumball) && ( - // If the gumball goes in the pipe, remove it from the scene (Case 2/2) - contact.getFixtureA().getBody().getUserData().equals(TiltGameView.PIPE_BOTTOM) - || contact.getFixtureA().getBody().getUserData() - .equals(TiltGameView.PIPE_SIDES))) { - mWorld.mBodiesToBeRemoved.add(contact.getFixtureA().getBody()); - mSoundPoolId - .remove(((Gumball) contact.getFixtureA().getBody().getUserData()).mSoundPoolId); - onBallInPipe(); - } else if (contact.getFixtureA().getBody().getUserData() != null && !(contact.getFixtureA() - .getBody().getUserData() instanceof Gumball) && contact.getFixtureA().getBody() - .getUserData().equals(TiltGameView.GAME_FLOOR)) { - // If the gumball goes over the edge, remove it and respawn (Case 1/2) - Gumball gumball = ((Gumball) contact.getFixtureB().getBody().getUserData()); - mWorld.mBodiesToBeRemoved.add(contact.getFixtureB().getBody()); - mSoundPoolId.remove(gumball.mSoundPoolId); - mSoundPool.play(mSoundBallFail, 1, 1, 0, 0, 1.0f); - mWorld.getWorld().step(1.0f / 60.0f, 10, 10); - moveOutlet((mCurrentGumball.mXInitPos)); - mCountLevelBallRespawns++; - } else if (contact.getFixtureB().getBody().getUserData() != null && !(contact.getFixtureB() - .getBody().getUserData() instanceof Gumball) && contact.getFixtureB().getBody() - .getUserData().equals(TiltGameView.GAME_FLOOR)) { - // If the gumball goes over the edge, remove it and respawn (Case 2/2) - Gumball gumball = ((Gumball) contact.getFixtureB().getBody().getUserData()); - mWorld.mBodiesToBeRemoved.add(contact.getFixtureA().getBody()); - mSoundPoolId.remove(gumball.mSoundPoolId); - mSoundPool.play(mSoundBallFail, 1, 1, 0, 0, 1.0f); - mWorld.getWorld().step(1.0f / 60.0f, 10, 10); - moveOutlet((mCurrentGumball.mXInitPos)); - mCountLevelBallRespawns++; - } - } - - /** - * Successfully dropped a ball in the pipe. - * Add the next ball and go to the next level if no balls are left in this level. - */ - private void onBallInPipe() { - mSoundPool.play(mSoundBallInMachine, 1, 1, 0, 0, 1.0f); - mGameBallsLeft--; - mNumberCollected++; - changeIndicator(); - mMatchScore += 50 * Math.max(1f, (mCurrentLevelNum - mCountLevelBallRespawns)); - mViewScore.setText(String.valueOf(mMatchScore)); - if (mGameBallsLeft == 0 && mViewPlayAgainBackground.getVisibility() != View.VISIBLE) { - // No balls are left in this level, go to the next one - mCurrentLevelNum++; - mLevelNumberText.setLevelNumber(mCurrentLevelNum); - mLevelNumberText.startAnimation(mAnimationLevelScaleUp); - mEndLevelCircle.startAnimation(mAnimationScaleLevelDown); - } - } - - /* - * (non-Javadoc) - * - * @see - * org.jbox2d.callbacks.ContactListener#postSolve(org.jbox2d.dynamics.contacts - * .Contact, org.jbox2d.callbacks.ContactImpulse) - */ - - /** - * Play a sound on impact (when a ball is dropped). - * The sound depends on the severity of the impact. - * - * @see #playBounceSound(float) - */ - @Override - public void postSolve(Contact contact, ContactImpulse impulse) { - // Get both collision objects - Object dataA = contact.getFixtureA().getBody().getUserData(); - Object dataB = contact.getFixtureB().getBody().getUserData(); - - // Check if one of the objects is NOT a gumball, but a candy cane. - boolean hitCane = false; - if (dataA != null && !(dataA instanceof Gumball) - && (Integer) dataA > TiltGameView.GUMBALL_PURPLE) { - hitCane = true; - } else if (dataB != null && !(dataB instanceof Gumball) - && (Integer) dataB > TiltGameView.GUMBALL_PURPLE) { - hitCane = true; - } - - if (hitCane && impulse.normalImpulses[0] > 80) { - playBounceSound(impulse.normalImpulses[0]); - } - } - - /** - * Plays a 'bounce' sound through the sound pool, depending on the impulse. - */ - private void playBounceSound(float impulse) { - if (impulse > 80) { - mSoundPool.play(mSoundBounceLarge, 1, 1, 0, 0, 1.0f); - } else if (impulse > 60) { - mSoundPool.play(mSoundBounceMed, 1, 1, 0, 0, 1.0f); - } else if (impulse > 30) { - mSoundPool.play(mSoundBounceSmall, 1, 1, 0, 0, 1.0f); - } - } - - - @Override - public void preSolve(Contact contact, Manifold arg1) { - - } - - /** - * Add a gumball to the game and play the ball drop sound. - */ - private void addGumball(float xPos, float yPos) { - Gumball gumball = new Gumball(); - gumball.mXInitPos = xPos; - gumball.mYInitPos = yPos; - gumball.mSoundPoolId = UUID.randomUUID(); - mSoundPoolId.put(gumball.mSoundPoolId, false); - mGameView.addGumball(gumball); - mSoundPool.play(mSoundBallDrop, 1, 1, 0, 0, 1); - } - - private JSONObject readLevelFile(int levelNumber) throws IOException, JSONException { - // load the appropriate levels file from a raw resource. - InputStream is = getResources() - .openRawResource(Utils.getLevelRawFile(mCurrentLevelNum)); - int size = is.available(); - byte[] buffer = new byte[size]; - is.read(buffer); - is.close(); - String json = new String(buffer, "UTF-8"); - JSONObject level = new JSONObject(json); - - return level; - } - /** - * Loads a level from the levels json file and sets up the game world. - */ - private void loadLevel(int levelNumber) { - - // Reset the current game state - if (mCountDownTimer != null) { - mCountDownTimer.cancel(); - } - mCountLevelBallRespawns = 0; - mNumberCollected = 0; - mViewPlayAgainLevel.setText(String.valueOf(levelNumber)); - Body body = mWorld.getWorld().getBodyList(); - while (body != null) { - if (body.m_userData == null) { - body = body.getNext(); - continue; - } - mWorld.mBodiesToBeRemoved.add(body); - body = body.getNext(); - } - mWorld.getWorld().step(1.0f / 60.0f, 10, 10); - - try { - // Read the level file and extract the candy cane positions - JSONObject level = readLevelFile(levelNumber); - JSONArray canes = level.getJSONArray("candycanes"); - - for (int i = 0; i < canes.length(); i++) { - JSONObject canePart = canes.getJSONObject(i); - int type = canePart.getInt("type"); - float xPos = (float) canePart.getDouble("xPos"); - float yPos = (float) canePart.getDouble("yPos"); - // Add the candy cane to the game world, the values represent the - mWorld.addItem(xPos, yPos, Edges.getEdges(type), WORLD_OBJECT_BOUNCE, type, - WORLD_OBJECT_DENSITY, WORLD_OBJECT_FRICTION, - BodyType.STATIC); - } - - // Add the sides and floor to the game world to catch dropped balls. - // Note that the WORLD_FRICTION is used as the bounce rate of the floors. - mWorld.addItem(WORLD_FLOOR_X, WORLD_FLOOR_Y, Edges.getPipeSideEdges(), - WORLD_OBJECT_BOUNCE, TiltGameView.PIPE_SIDES, - WORLD_OBJECT_DENSITY, WORLD_OBJECT_FRICTION, BodyType.STATIC); - mWorld.addFloor(WORLD_FLOOR_X, WORLD_FLOOR_Y, TiltGameView.GAME_FLOOR, - WORLD_OBJECT_DENSITY, WORLD_OBJECT_FRICTION, WORLD_FLOOR_FRICTION, - BodyType.STATIC); - mWorld.addPipeBottom(WORLD_FLOOR_X, WORLD_FLOOR_Y, TiltGameView.PIPE_BOTTOM, - WORLD_OBJECT_DENSITY, WORLD_OBJECT_FRICTION, WORLD_FLOOR_FRICTION, - BodyType.STATIC); - - // Add the gumballs - JSONArray gumballs = level.getJSONArray("gumballs"); - mGameBallsLeft = gumballs.length(); - setIndicators(mGameBallsLeft); - for (int j = 0; j < gumballs.length(); j++) { - JSONObject gumball = gumballs.getJSONObject(j); - float xPos = (float) gumball.getDouble("xPos"); - float yPos = (float) gumball.getDouble("yPos"); - Gumball gumballObject = new Gumball(); - gumballObject.mXInitPos = xPos; - gumballObject.mYInitPos = yPos; - mGumballQueue.add(gumballObject); - } - mCurrentGumball = mGumballQueue.poll(); - - // Start the timer - if (mCurrentGumball != null) { - if (mCurrentLevelNum > 1) { - // Do not include gumball dropping time in countdown calculation. - mTimeLeftInMillis += MatchingGameConstants.GUMBALL_ADDED_TIME; - } - mCountDownTimer = new GameCountdown(mFramesPerSecond, mTimeLeftInMillis); - mCountDownTimer.start(); - mGameView.setGameCountDown(mCountDownTimer); - - // Move the outlet to its initial position - moveOutlet((mCurrentGumball.mXInitPos)); - } - } catch (IOException e) { - } catch (JSONException e) { - } - - } - - /** - * Update the state of the indicators at the bottom of the screen to the number of balls - * collected. - */ - private void setIndicators(int numGumballs) { - for(int i=0; i < mViewIndicators.length ; i++){ - int stateResource = R.drawable.gbg_gumball_indicator_collected_disabled; - if(i+1 <= numGumballs){ - stateResource = R.drawable.gbg_gumball_indicator_pending; - } - mViewIndicators[i].setImageResource(stateResource); - } - } - - - /** - * Mark the last indicator for which a ball was collected in the 'collected' state. - */ - private void changeIndicator() { - mViewIndicators[mNumberCollected - 1].setImageResource( - R.drawable.gbg_gumball_indicator_collected); - } - - - @Override - public void onAnimationEnd(Animation animation) { - if (animation == mAnimationScaleLevelDown) { - // After the level scale down animation, fade out the level number and end circle - mLevelNumberText.startAnimation(mAnimationLevelFadeOut); - mEndLevelCircle.startAnimation(mAnimationLevelFadeOut); - } else if (animation == mAnimationLevelFadeOut) { - // After the level fade out animation reset and hide all other end level views - mEndLevelCircle.clearAnimation(); - mLevelNumberText.clearAnimation(); - mLevelNumberText.setVisibility(View.GONE); - mEndLevelCircle.setVisibility(View.GONE); - } else if (animation == mAnimationOutlet) { - // After the outlet has moved to the correct position, add gumball - addGumball(mCurrentGumball.mXInitPos, mCurrentGumball.mYInitPos); - if (mGumballQueue.peek() != null) { - // Move it to the next position if there is a gumball left in the queue - mCurrentGumball = mGumballQueue.poll(); - moveOutlet(mCurrentGumball.mXInitPos); - } - } - } - - @Override - public void onAnimationRepeat(Animation arg0) { - // do nothing - - } - - @Override - public void onAnimationStart(Animation animation) { - if (animation == mAnimationScaleLevelDown) { - // Show the circle level end and level text views when the animation starts - mEndLevelCircle.setVisibility(View.VISIBLE); - mLevelNumberText.setVisibility(View.VISIBLE); - } else if (animation == mAnimationLevelFadeOut) { - // Load the next level after the end level animation is over - loadLevel(mCurrentLevelNum); - } else if (animation == mAnimationPlayAgainBackground) { - // Show the 'play again' screen when the animation starts and cancel the timer - mViewPlayAgainBackground.setVisibility(View.VISIBLE); - if (mCountDownTimer != null) { - mCountDownTimer.cancel(); - } - } else if (animation == mAnimationPlayAgainMain) { - mViewPlayAgainMain.setVisibility(View.VISIBLE); - setSignInButtonVisibility(true); - } - } - - /** - * Set the visibility of the sign in button if the user is not already signed in. - */ - private void setSignInButtonVisibility(boolean show) { - mViewGPlusLayout.setVisibility(show && !Utils.isSignedIn(this) ? View.VISIBLE : View.GONE); - } - - /** - * Hide the sign in button when the user signs in and the button is still visible on screen. - */ - private void updateSignInButtonVisibility() { - if (mViewGPlusLayout.getVisibility() == View.VISIBLE && Utils.isSignedIn(this)) { - setSignInButtonVisibility(false); - } - } - - /** - * Start an animation to move the outlet to the x position in pixels. - */ - private void moveOutlet(float xPos) { - float scale = mRootView.getWidth() / 10.0f; - mAnimationOutlet = new TranslateAnimation(mOutletPreviousXPos, (scale * xPos) - mOutletOffset, 0, 0); - mAnimationOutlet.setDuration(700); - mAnimationOutlet.setFillAfter(true); - mAnimationOutlet.setStartOffset(400); - mAnimationOutlet.setAnimationListener(this); - mGameOutlet.startAnimation(mAnimationOutlet); - mOutletPreviousXPos = (scale * xPos) - mOutletOffset; - } - - /** - * Countdown for the main game. - * Updates the countdown on screen and stops the game when the timer runs out. - */ - public class GameCountdown { - - private Boolean animationStarted = false; - - private final long mMillisDuration; - - private final long mMillisTickDuration; - - private long mTicksLeft; - - private boolean mStarted = false; - - private long mSecondsTextValue = -1; - - /** - * @param framesPerSecond assumed frame rate - * @param millisInFuture duration of game at this frame rate - */ - public GameCountdown(int framesPerSecond, long millisInFuture) { - mMillisDuration = millisInFuture; - mMillisTickDuration = 1000 / framesPerSecond; - mTicksLeft = mMillisDuration / mMillisTickDuration; - } - - /** - * Stop the timer. - */ - public void cancel() { - mTicksLeft = 0; - mStarted = false; - } - - /** - * Starts the timer. - */ - public void start() { - mStarted = true; - mSecondsTextValue = -1; - long seconds = TimeUnit.MILLISECONDS.toSeconds(mTicksLeft * mMillisTickDuration); - if (seconds >= 6) { - animationStarted = false; - mViewCountdown.clearAnimation(); - mViewCountdown.setTextColor(Color.WHITE); - mViewCountdown.setTypeface(Typeface.DEFAULT); - } - } - - /** - * Update the displayed timer. - * When the timer is below 6s the text color changes to red. - */ - public void tick() { - if (mStarted) { - --mTicksLeft; - mTimeLeftInMillis = mTicksLeft * mMillisTickDuration; - if (mTimeLeftInMillis < 6000 && !animationStarted) { - animationStarted = true; - mViewCountdown.setTextColor(Color.RED); - mViewCountdown.setTypeface(Typeface.DEFAULT_BOLD); - mViewCountdown.clearAnimation(); - mViewCountdown.startAnimation(mAnimationTimerAlpha); - } - if (mSecondsTextValue != mTimeLeftInMillis / 1000) { - mViewCountdown.setText( - String.format("%d:%02d", - TimeUnit.MILLISECONDS.toMinutes(mTimeLeftInMillis), - TimeUnit.MILLISECONDS.toSeconds(mTimeLeftInMillis))); - mSecondsTextValue = mTimeLeftInMillis / 1000; - } - if (mTimeLeftInMillis == 0) { - finished(); - } - } - } - - /** - * Shut down the count down timer. - * Cancel all pending animations and display the 'play again' screen. - */ - private void finished() { - mViewCountdown.clearAnimation(); - animationStarted = false; - mViewCountdown.setTextColor(Color.WHITE); - mViewCountdown.setTypeface(Typeface.DEFAULT); - if (mViewPlayAgainBackground.getVisibility() != View.VISIBLE && !wasPaused) { - wasPaused = true; - submitScore(MatchingGameConstants.LEADERBOARDS_GUMBALL, mMatchScore); - if (mBackgroundMusic != null) { - mBackgroundMusic.stop(); - mBackgroundMusic.release(); - mBackgroundMusic = null; - } - mViewPlayAgainScore.setText(String.valueOf(mMatchScore)); - mViewPlayAgainBackground.startAnimation(mAnimationPlayAgainBackground); - mViewPlayAgainMain.startAnimation(mAnimationPlayAgainMain); - mViewPlayAgainBackground.setVisibility(View.VISIBLE); - mViewPlayAgainMain.setVisibility(View.VISIBLE); - mViewMainMenuButton.setVisibility(View.VISIBLE); - setSignInButtonVisibility(true); - mSoundPool.play(mSoundGameOver, .2f, .2f, 0, 0, 1.0f); - } - - cancel(); - } - } - - /** - * Pause the game when the back key is pressed. - */ - public void onBackKeyPressed() { - if (mViewPlayAgainMain.getVisibility() == View.VISIBLE) { - returnToBackClass(); - } else { - if (mViewPauseButton.getVisibility() != View.GONE) {// check if already handled - pauseGame(); - } else { - unPauseGame(); - } - } - } - - /** - * Pause the game and display the pause game screen. - */ - private void pauseGame() { - mViewPauseButton.setVisibility(View.GONE); - mViewPlayButton.setVisibility(View.VISIBLE); - if (mCountDownTimer != null) { - mCountDownTimer.cancel(); - wasPaused = true; - } - mViewMatchPauseOverlay.setVisibility(View.VISIBLE); - mViewCancelBar.setVisibility(View.VISIBLE); - SensorManager sensorManager = (SensorManager) getActivity() - .getSystemService(Activity.SENSOR_SERVICE); - sensorManager.unregisterListener(this); - if (Utils.hasKitKat()) { - ImmersiveModeHelper.setImmersiveStickyWithActionBar(getActivity().getWindow()); - } - } - - /** - * Continue the paused game. - * Restart the countdown timer and hide the pause game screen. - */ - private void unPauseGame() { - mViewPauseButton.setVisibility(View.VISIBLE); - mViewPlayButton.setVisibility(View.GONE); - mViewMatchPauseOverlay.setVisibility(View.GONE); - mViewCancelBar.setVisibility(View.GONE); - mCountDownTimer = new GameCountdown(mFramesPerSecond, mTimeLeftInMillis); - mCountDownTimer.start(); - mGameView.setGameCountDown(mCountDownTimer); - wasPaused = false; - SensorManager sensorManager = (SensorManager) getActivity() - .getSystemService(Activity.SENSOR_SERVICE); - Sensor sensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); - if (sensor != null) { - sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_GAME); - } - if (Utils.hasKitKat()) { - ImmersiveModeHelper.setImmersiveSticky(getActivity().getWindow()); - } - } - - /** - * Submit score to play games services - */ - private void submitScore(int resId, int score) { - PlayGamesActivity act = Utils.getPlayGamesActivity(this); - if (act != null) { - act.postSubmitScore(resId, score); - } - } - - /** - * Hide the instructions and mark them as viewed. - */ - private class HideInstructionsRunnable implements Runnable { - - @Override - public void run() { - mDrawableTransition.stop(); - wasPaused = false; - mViewInstructions.setVisibility(View.GONE); - Editor edit = mSharedPreferences.edit(); - edit.putBoolean(MatchingGameConstants.GUMBALL_INSTRUCTIONS_VIEWED, true); - edit.apply(); - } - - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/TiltGameView.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/TiltGameView.java deleted file mode 100644 index 77d893533..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/TiltGameView.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.gumball; - -import com.google.android.apps.santatracker.R; - -import org.jbox2d.collision.shapes.CircleShape; -import org.jbox2d.collision.shapes.EdgeShape; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.Vec2; -import org.jbox2d.dynamics.Body; -import org.jbox2d.dynamics.BodyType; -import org.jbox2d.dynamics.Fixture; - -import android.content.Context; -import android.content.res.Resources; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Matrix; -import android.graphics.Paint; -import android.util.AttributeSet; -import android.view.View; - -import java.util.Random; - - -/** - * Custom view which contains the elements used in the physics word. - * It handles the painting of all bitmaps for the game, including all levels (canes), - * the pipe and gumballs. - */ -public class TiltGameView extends View { - - public static final float GUMBALL_DENSITY = 185.77f; - public static final float GUMBALL_RADIUS = 0.258f; - public static final float GUMBALL_BOUNCE = 0.2f; - public static final float GUMBALL_FRICTION = 0.8f; - /** - * The physics world for the gumball game. - */ - private PhysicsWorld mWorld; - - /** - * Bitmaps for all elements on screen. - */ - private Bitmap mGumballBlue; - private Bitmap mGumballYellow; - private Bitmap mGumballRed; - private Bitmap mGumballGreen; - private Bitmap mGumballOrange; - private Bitmap mGumballPurple; - private Bitmap mCaneMainLong; - private Bitmap mCaneMainLongReverse; - private Bitmap mCaneMainMed; - private Bitmap mCaneMainMedReverse; - private Bitmap mCaneMainSmall; - private Bitmap mCaneMainSmallReverse; - private Bitmap mCaneMainTiny; - private Bitmap mCaneMainTinyReverse; - private Bitmap mCaneHook; - private Bitmap mCaneHookFlip; - private Bitmap mCaneHookReverse; - private Bitmap mCaneHookReverseFlip; - private Bitmap mCaneEnd; - private Bitmap mCaneEndFlip; - private Bitmap mCaneEndReverse; - private Bitmap mCaneEndReverseFlip; - - private Bitmap mCaneMainSmallAngleNine; - private Bitmap mCaneMainSmallAngleSix; - private Bitmap mCaneMainSmallAngleTwelve; - private Bitmap mCaneMainReverseTinyAngleTwelve; - private Bitmap mCaneMainLargeAngleSix; - private Bitmap mCaneMainMedAngleSix; - - /** - * Bitmap of a pipe where gumballs drop. - */ - private Bitmap mPipeSides; - - /** - * Default paint object that is used to draw all bitmaps to the screen. - */ - private Paint mPaint = new Paint(); - - /** - * Identifiers for objects in the world. - */ - public static final int GUMBALL_RED = 0; - public static final int GUMBALL_BLUE = 1; - public static final int GUMBALL_YELLOW = 2; - public static final int GUMBALL_GREEN = 3; - public static final int GUMBALL_ORANGE = 4; - public static final int GUMBALL_PURPLE = 5; - public static final int[] GUMBALLS = new int[]{GUMBALL_RED, GUMBALL_BLUE, GUMBALL_YELLOW, - GUMBALL_GREEN, GUMBALL_ORANGE, GUMBALL_PURPLE}; - - public static final int CANE_MAIN_LONG = 6; - public static final int CANE_MAIN_LONG_REVERSE = 7; - public static final int CANE_MAIN_MEDIUM = 8; - public static final int CANE_MAIN_MEDIUM_REVERSE = 9; - public static final int CANE_MAIN_SMALL = 10; - public static final int CANE_MAIN_SMALL_REVERSE = 11; - public static final int CANE_MAIN_TINY = 12; - public static final int CANE_MAIN_TINY_REVERSE = 13; - public static final int CANE_HOOK = 14; - public static final int CANE_HOOK_FLIP = 15; - public static final int CANE_HOOK_REVERSE = 16; - public static final int CANE_HOOK_REVERSE_FLIP = 17; - public static final int CANE_END = 18; - public static final int CANE_END_FLIP = 19; - public static final int CANE_END_REVERSE = 20; - public static final int CANE_END_REVERSE_FLIP = 21; - - public static final int CANE_MAIN_SMALL_ANGLE_NINE = 22; - public static final int CANE_MAIN_SMALL_ANGLE_SIX = 23; - public static final int CANE_MAIN_SMALL_ANGLE_TWELVE = 24; - public static final int CANE_MAIN_REVERSE_TINY_ANGLE_SIX = 25; - public static final int CANE_MAIN_LARGE_ANGLE_SIX = 26; - public static final int CANE_MAIN_MED_ANGLE_SIX = 27; - - public static final int PIPE_SIDES = -1; - /** - * Bottom of the pipe user data, this is separate from the side because the gumball is removed - * from the scene on collision with it. - */ - public static final int PIPE_BOTTOM = -2; - - public static final int GAME_FLOOR = -3; - - private static Random sRandomGenerator = new Random(); - - private TiltGameFragment.GameCountdown mGameCountDown; - - public TiltGameView(Context context) { - super(context); - init(); - } - - public TiltGameView(Context context, AttributeSet attrs) { - super(context, attrs); - init(); - } - - private void init() { - setClickable(true); - } - - @Override - protected void onSizeChanged(int w, int h, int oldw, int oldh) { - super.onSizeChanged(w, h, oldw, oldh); - // Load the bitmaps as soon as we have the size of the view to scale them appropriately. - if (mGumballBlue == null) { - loadBitmaps(); - } - } - - private void loadBitmaps() { - // set the bitmaps - Resources res = getResources(); - int[] gumballBlue = {R.drawable.gbg_gumball_blue_1920, R.drawable.gbg_gumball_blue_1280, - R.drawable.gbg_gumball_blue_800, R.drawable.gbg_gumball_blue_480}; - int[] gumballRed = {R.drawable.gbg_gumball_red_1920, R.drawable.gbg_gumball_red_1280, - R.drawable.gbg_gumball_red_800, R.drawable.gbg_gumball_red_480}; - int[] gumballYellow = {R.drawable.gbg_gumball_yellow_1920, - R.drawable.gbg_gumball_yellow_1280, R.drawable.gbg_gumball_yellow_800, - R.drawable.gbg_gumball_yellow_480}; - int[] gumballGreen = {R.drawable.gbg_gumball_green_1920, - R.drawable.gbg_gumball_green_1280, R.drawable.gbg_gumball_green_800, - R.drawable.gbg_gumball_green_480}; - int[] gumballOrange = {R.drawable.gbg_gumball_orange_1920, - R.drawable.gbg_gumball_orange_1280, R.drawable.gbg_gumball_orange_800, - R.drawable.gbg_gumball_orange_480}; - int[] gumballPurple = {R.drawable.gbg_gumball_purple_1920, - R.drawable.gbg_gumball_purple_1280, R.drawable.gbg_gumball_purple_800, - R.drawable.gbg_gumball_purple_480}; - int[] caneMain = {R.drawable.gbg_candycane_main_1920, - R.drawable.gbg_candycane_main_1280, R.drawable.gbg_candycane_main_800, - R.drawable.gbg_candycane_main_480}; - int[] caneMainReverse = {R.drawable.gbg_candycane_main_reverse_1920, - R.drawable.gbg_candycane_main_reverse_1280, - R.drawable.gbg_candycane_main_reverse_800, - R.drawable.gbg_candycane_main_reverse_480}; - int[] caneHook = {R.drawable.gbg_candycane_hook_1920, - R.drawable.gbg_candycane_hook_1280, R.drawable.gbg_candycane_hook_800, - R.drawable.gbg_candycane_hook_480}; - int[] caneHookReverse = {R.drawable.gbg_candycane_hook_reverse_1920, - R.drawable.gbg_candycane_hook_reverse_1280, - R.drawable.gbg_candycane_hook_reverse_800, - R.drawable.gbg_candycane_hook_reverse_480}; - int[] caneEnd = {R.drawable.gbg_candycane_end_1920, R.drawable.gbg_candycane_end_1280, - R.drawable.gbg_candycane_end_800, R.drawable.gbg_candycane_end_480}; - int[] caneEndReverse = {R.drawable.gbg_candycane_end_reverse_1920, - R.drawable.gbg_candycane_end_reverse_1280, - R.drawable.gbg_candycane_end_reverse_800, - R.drawable.gbg_candycane_end_reverse_480}; - int[] pipes = {R.drawable.gbg_gumball_funnel_1920, R.drawable.gbg_gumball_funnel_1280, - R.drawable.gbg_gumball_funnel_800, R.drawable.gbg_gumball_funnel_480}; - int[] caneMainAngleNine = {R.drawable.gbg_candycane_main_angle_nine, - R.drawable.gbg_candycane_main_angle_nine, - R.drawable.gbg_candycane_main_angle_nine, - R.drawable.gbg_candycane_main_angle_nine}; - int[] caneMainAngleSix = {R.drawable.gbg_candycane_small_angle_six, - R.drawable.gbg_candycane_small_angle_six, - R.drawable.gbg_candycane_small_angle_six, - R.drawable.gbg_candycane_small_angle_six}; - int[] caneMainAngleTwelve = {R.drawable.gbg_candycane_small_angle_twelve, - R.drawable.gbg_candycane_small_angle_twelve, - R.drawable.gbg_candycane_small_angle_twelve, - R.drawable.gbg_candycane_small_angle_twelve}; - int[] caneMainTinyReverseAngleSix = {R.drawable.gbg_candycane_tiny_reverse_angle_six, - R.drawable.gbg_candycane_tiny_reverse_angle_six, - R.drawable.gbg_candycane_tiny_reverse_angle_six, - R.drawable.gbg_candycane_tiny_reverse_angle_six}; - int[] caneMainLargeAngleSix = {R.drawable.gbg_candycane_large_angle_six, - R.drawable.gbg_candycane_large_angle_six, - R.drawable.gbg_candycane_large_angle_six, - R.drawable.gbg_candycane_large_angle_six}; - int[] caneMainMedAngleSix = {R.drawable.gbg_candycane_med_angle_six, - R.drawable.gbg_candycane_med_angle_six, R.drawable.gbg_candycane_med_angle_six, - R.drawable.gbg_candycane_med_angle_six}; - int[] sizes = {1920, 1280, 800, 480}; - - final int viewWidth = getWidth(); - final int size = sizes[0]; - - mGumballBlue = resizeImage(res, gumballBlue[0], size, viewWidth, -360f, true, 1); - mGumballRed = resizeImage(res, gumballRed[0], size, viewWidth, -360f, true, 1); - mGumballYellow = resizeImage(res, gumballYellow[0], size, viewWidth, -360f, true, 1); - mGumballGreen = resizeImage(res, gumballGreen[0], size, viewWidth, -360f, true, 1); - mGumballOrange = resizeImage(res, gumballOrange[0], size, viewWidth, -360f, true, 1); - mGumballPurple = resizeImage(res, gumballPurple[0], size, viewWidth, -360f, true, 1); - - mCaneMainLong = resizeImage(res, caneMain[0], size, viewWidth, 180f, false, 1); - mCaneMainLongReverse = resizeImage(res, caneMainReverse[0], size, viewWidth, 180f, false, - 1); - mCaneMainMed = resizeImage(res, caneMain[0], size, viewWidth, 180f, false, .75f); - mCaneMainMedReverse = resizeImage(res, caneMainReverse[0], size, viewWidth, 180f, false, - .75f); - - mCaneMainSmall = resizeImage(res, caneMain[0], size, viewWidth, 180f, false, .50f); - mCaneMainSmallReverse = resizeImage(res, caneMainReverse[0], size, viewWidth, 180f, - false, .50f); - mCaneMainTiny = resizeImage(res, caneMain[0], size, viewWidth, 180f, false, .25f); - mCaneMainTinyReverse = resizeImage(res, caneMainReverse[0], size, viewWidth, 180f, false, - .25f); - - mCaneMainSmallAngleNine = resizeImage(res, caneMainAngleNine[0], size, viewWidth, 180f, - true, 1f); - mCaneMainSmallAngleSix = resizeImage(res, caneMainAngleSix[0], size, viewWidth, 180f, - true, 1f); - mCaneMainSmallAngleTwelve = resizeImage(res, caneMainAngleTwelve[0], size, viewWidth, - 180f, true, 1f); - mCaneMainReverseTinyAngleTwelve = resizeImage(res, caneMainTinyReverseAngleSix[0], - size, viewWidth, 180f, true, 1f); - mCaneMainLargeAngleSix = resizeImage(res, caneMainLargeAngleSix[0], size, viewWidth, - 180f, true, 1f); - mCaneMainMedAngleSix = resizeImage(res, caneMainMedAngleSix[0], size, viewWidth, 180f, - true, 1f); - - mCaneHook = resizeImage(res, caneHook[0], size, viewWidth, 180f, false, 1); - mCaneHookFlip = resizeImage(res, caneHook[0], size, viewWidth, 180f, true, 1); - mCaneHookReverse = resizeImage(res, caneHookReverse[0], size, viewWidth, 180f, false, 1); - mCaneHookReverseFlip = resizeImage(res, caneHookReverse[0], size, viewWidth, 180f, true, - 1); - mCaneEnd = resizeImage(res, caneEnd[0], size, viewWidth, 180f, false, 1); - mCaneEndFlip = resizeImage(res, caneEnd[0], size, viewWidth, 180f, true, 1); - mCaneEndReverse = resizeImage(res, caneEndReverse[0], size, viewWidth, 180f, false, 1); - mCaneEndReverseFlip = resizeImage(res, caneEndReverse[0], size, viewWidth, 180f, true, - 1); - mPipeSides = resizeImage(res, pipes[0], size, viewWidth, 180f, true, 1); - - } - - @Override - protected void onDraw(Canvas canvas) { - super.onDraw(canvas); - - // Advance the countdown - if (mGameCountDown != null) { - mGameCountDown.tick(); - } - - // Load bitmaps if they haven't been initialised yet - if (mGumballBlue == null) { - loadBitmaps(); - } - // reset and initialise the canvas for a fresh draw - canvas.drawColor(Color.TRANSPARENT); - canvas.translate(0, getHeight()); - canvas.scale(1.0f, -1.0f); - float scale = getWidth() / 10.0f; - mPaint.setAntiAlias(true); - // Iterate through all of the bodies in the game world and draw the corresponding bitmaps - Body body = mWorld.getWorld().getBodyList(); - while (body != null) { - if (body.m_userData == null || body.m_userData.equals(PIPE_BOTTOM)) { - body = body.getNext(); - continue; - } - // Skip bodies with empty fixtures or shapes - Fixture fixture = body.getFixtureList(); - if (fixture == null) { - body = body.getNext(); - continue; - } - Shape shape = fixture.getShape(); - if (shape == null) { - body = body.getNext(); - continue; - } - - // Get the position. - Vec2 position = body.getPosition(); - - // Get the bitmap of this body. - Bitmap bitmap = null; - if (body.getUserData() instanceof Gumball) { - // For a gumball, load the correct color - Gumball gumball = (Gumball) body.getUserData(); - if (gumball.mGumballColorId == GUMBALL_BLUE) { - bitmap = mGumballBlue; - } else if (gumball.mGumballColorId == GUMBALL_YELLOW) { - bitmap = mGumballYellow; - } else if (gumball.mGumballColorId == GUMBALL_RED) { - bitmap = mGumballRed; - } else if (gumball.mGumballColorId == GUMBALL_GREEN) { - bitmap = mGumballGreen; - } else if (gumball.mGumballColorId == GUMBALL_ORANGE) { - bitmap = mGumballOrange; - } else if (gumball.mGumballColorId == GUMBALL_PURPLE) { - bitmap = mGumballPurple; - } - } else if (body.m_userData.equals(CANE_MAIN_LONG)) { - bitmap = mCaneMainLong; - } else if (body.m_userData.equals(CANE_MAIN_LONG_REVERSE)) { - bitmap = mCaneMainLongReverse; - } else if (body.m_userData.equals(CANE_MAIN_MEDIUM)) { - bitmap = mCaneMainMed; - } else if (body.m_userData.equals(CANE_MAIN_MEDIUM_REVERSE)) { - bitmap = mCaneMainMedReverse; - } else if (body.m_userData.equals(CANE_MAIN_SMALL)) { - bitmap = mCaneMainSmall; - } else if (body.m_userData.equals(CANE_MAIN_SMALL_REVERSE)) { - bitmap = mCaneMainSmallReverse; - } else if (body.m_userData.equals(CANE_MAIN_TINY)) { - bitmap = mCaneMainTiny; - } else if (body.m_userData.equals(CANE_MAIN_TINY_REVERSE)) { - bitmap = mCaneMainTinyReverse; - } else if (body.m_userData.equals(CANE_HOOK)) { - bitmap = mCaneHook; - } else if (body.m_userData.equals(CANE_HOOK_FLIP)) { - bitmap = mCaneHookFlip; - } else if (body.m_userData.equals(CANE_HOOK_REVERSE)) { - bitmap = mCaneHookReverse; - } else if (body.m_userData.equals(CANE_HOOK_REVERSE_FLIP)) { - bitmap = mCaneHookReverseFlip; - } else if (body.m_userData.equals(CANE_END)) { - bitmap = mCaneEnd; - } else if (body.m_userData.equals(CANE_END_FLIP)) { - bitmap = mCaneEndFlip; - } else if (body.m_userData.equals(CANE_END_REVERSE)) { - bitmap = mCaneEndReverse; - } else if (body.m_userData.equals(CANE_END_REVERSE_FLIP)) { - bitmap = mCaneEndReverseFlip; - } else if (body.m_userData.equals(PIPE_SIDES)) { - bitmap = mPipeSides; - } else if (body.m_userData.equals(CANE_MAIN_SMALL_ANGLE_NINE)) { - bitmap = mCaneMainSmallAngleNine; - } else if (body.m_userData.equals(CANE_MAIN_SMALL_ANGLE_SIX)) { - bitmap = mCaneMainSmallAngleSix; - } else if (body.m_userData.equals(CANE_MAIN_SMALL_ANGLE_TWELVE)) { - bitmap = mCaneMainSmallAngleTwelve; - } else if (body.m_userData.equals(CANE_MAIN_REVERSE_TINY_ANGLE_SIX)) { - bitmap = mCaneMainReverseTinyAngleTwelve; - } else if (body.m_userData.equals(CANE_MAIN_LARGE_ANGLE_SIX)) { - bitmap = mCaneMainLargeAngleSix; - } else if (body.m_userData.equals(CANE_MAIN_MED_ANGLE_SIX)) { - bitmap = mCaneMainMedAngleSix; - } - - if (shape instanceof CircleShape && bitmap != null) { - // Draw a gumball - CircleShape circleShape = (CircleShape) shape; - canvas.save(); - canvas.rotate((float) (180 * body.getAngle() / Math.PI), scale * position.x, - scale * position.y); - canvas.drawBitmap(bitmap, scale * (position.x - circleShape.m_radius), - scale * (position.y - circleShape.m_radius), mPaint); - canvas.restore(); - - } else if (shape instanceof EdgeShape && bitmap != null) { - // Draw all other objects - canvas.save(Canvas.MATRIX_SAVE_FLAG); - canvas.rotate((float) (180 * body.getAngle() / Math.PI), scale * position.x, - scale * position.y); - canvas.drawBitmap(bitmap, scale * (position.x), scale * (position.y), mPaint); - canvas.restore(); - - } - - // Continue drawing with the next body in the world - body = body.getNext(); - } - } - - public void setGameCountDown(TiltGameFragment.GameCountdown gameCountDown) { - mGameCountDown = gameCountDown; - } - - /** - * Returns the index of a randomly colored gumball. - */ - public static int getRandomGumballId() { - int index = sRandomGenerator.nextInt(GUMBALLS.length); - int id = GUMBALLS[index]; - return id; - } - - /** - * Gets the correct bitmap based on screen size and rotates and flips the image. - */ - private static Bitmap resizeImage(Resources res, int resourceId, int size, int viewWidth, - float rotationDegrees, boolean isFlipped, float caneScale) { - - Matrix matrix = new Matrix(); - Bitmap bmp = BitmapFactory.decodeResource(res, resourceId); - - if (rotationDegrees != 361f) { - matrix.setRotate(rotationDegrees, bmp.getWidth() / 2, bmp.getHeight() / 2); - } - if (isFlipped) { - matrix.preScale(-1, 1); - } - float scale = ((float) viewWidth) / size; - matrix.postScale(scale, scale); - - bmp = Bitmap - .createBitmap(bmp, 0, 0, (int) (bmp.getWidth() * caneScale), bmp.getHeight(), - matrix, true); - - return bmp; - } - - /** - * Sets the Box 2D physics world to draw. - */ - public void setModel(PhysicsWorld world) { - mWorld = world; - } - - /** - * Adds a gumball for drawing. - */ - public void addGumball(Gumball gumball) { - gumball.mGumballColorId = getRandomGumballId(); - mWorld.addGumball(gumball.mXInitPos, gumball.mYInitPos, gumball, GUMBALL_DENSITY, - GUMBALL_RADIUS, GUMBALL_BOUNCE, GUMBALL_FRICTION, BodyType.DYNAMIC); - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/Utils.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/Utils.java deleted file mode 100644 index 3c826376d..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/gumball/Utils.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.gumball; - - -import android.app.Activity; -import android.os.Build; -import android.support.v4.app.Fragment; -import android.util.Log; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.common.PlayGamesActivity; - -public class Utils { - - private static final String TAG = "SantaTracker"; - - /** - * Checks if the user has at least API level 9 - */ - public static boolean hasGingerbread() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD; - } - - /** - * Checks if the user has at least API level 11 - */ - public static boolean hasHoneycomb() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB; - } - - /** - * Checks if the user has at least API level 12 - */ - public static boolean hasHoneycombMR1() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1; - } - - /** - * Checks if the user has at least API level 16 - */ - public static boolean hasIceCreamSandwich() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH; - } - - /** - * Checks if the user has at least API level 16 - */ - public static boolean hasJellyBean() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; - } - - /** - * Checks if the user has at least API level 19 - */ - public static boolean hasKitKat() { - return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; - } - - public static int getLevelRawFile(int levelNumber) { - if (levelNumber > 13) { - levelNumber = (levelNumber % 13) + 1; - } - switch (levelNumber) { - case 1: - return R.raw.level1; - case 2: - return R.raw.level2; - case 3: - return R.raw.level3; - case 4: - return R.raw.level4; - case 5: - return R.raw.level5; - case 6: - return R.raw.level6; - case 7: - return R.raw.level7; - case 8: - return R.raw.level8; - case 9: - return R.raw.level9; - case 10: - return R.raw.level10; - case 11: - return R.raw.level11; - case 12: - return R.raw.level12; - case 13: - return R.raw.level13; - default: - return R.raw.level1; - } - } - - public static PlayGamesActivity getPlayGamesActivity(Fragment fragment) { - Activity act = fragment.getActivity(); - if (act == null || !(act instanceof PlayGamesActivity)) { - Log.w(TAG, "Fragment is not in a PlayGamesActivity!"); - return null; - } - return (PlayGamesActivity) act; - } - - public static boolean isSignedIn(Fragment fragment) { - PlayGamesActivity gamesActivity = getPlayGamesActivity(fragment); - return gamesActivity != null && gamesActivity.isSignedIn(); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackActivity.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackActivity.java deleted file mode 100644 index 001aff7a6..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackActivity.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.jetpack.gamebase.SceneActivity; -import com.google.android.apps.santatracker.games.simpleengine.Scene; -import com.google.android.apps.santatracker.games.simpleengine.SceneManager; -import com.google.android.apps.santatracker.launch.StartupActivity; -import com.google.android.apps.santatracker.util.AnalyticsManager; - -public class JetpackActivity extends SceneActivity { - - public JetpackActivity() { - super(R.layout.activity_jetpack, StartupActivity.class); - // [ANALYTICS SCREEN]: Jetpack - AnalyticsManager.sendScreenView(R.string.analytics_screen_jetpack); - } - - @Override - protected Scene getGameScene() { - return new JetpackScene(); - } - - @Override - public void onBackPressed() { - boolean handled = false; - Scene scene = SceneManager.getInstance().getCurrentScene(); - if (scene instanceof JetpackScene) { - handled = ((JetpackScene) scene).onBackKeyPressed(); - } - if (!handled) { - super.onBackPressed(); - } - } - - @Override - public String getGameId() { - return getResources().getString(R.string.jetpack_game_id); - } - - @Override - public String getGameTitle() { - return getString(R.string.elf_jetpack); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackConfig.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackConfig.java deleted file mode 100644 index b760da0e2..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackConfig.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.jetpack.gamebase.GameConfig; - -public class JetpackConfig { - - // player settings - public static class Player { - - public static final float WIDTH = 0.15f; - public static final float COLLIDER_WIDTH = 0.15f; - public static final float COLLIDER_HEIGHT = 0.20f; - public static final float MAX_SPEED = 20.0f; - - // how large is the "no fly zone" near the edges of the screen, where - // the player can't go - public static final float HORIZ_MOVEMENT_MARGIN = COLLIDER_WIDTH / 2; - public static final float VERT_MOVEMENT_MARGIN = COLLIDER_HEIGHT / 2 + 0.05f; - - public static class SpriteAngle { - - // the sprite angle is proportional to how far the player is from the target position - public static final float ANGLE_CONST = 5000.0f; - // per 1.0 units of distance from target - public static final float MAX_ANGLE = 22.0f; - public static final float MAX_CHANGE_RATE = 600.0f; - public static final int FILTER_SAMPLES = 2; - } - - // jetpack fire animation - public static class Fire { - - public static final float WIDTH = 0.4f * Player.WIDTH; - public static final float ANIM_PERIOD = 0.5f; - public static final float ANIM_AMPLITUDE = 0.05f; - } - } - - // input settings - public static class Input { - - public static final float TOUCH_SENSIVITY = 1.2f; - } - - // item settings - public static class Items { - - public static final float CANDY_WIDTH = 0.05f; - public static final float CANDY_COLLIDER_HEIGHT = CANDY_WIDTH * 2; - public static final float CANDY_COLLIDER_WIDTH = 0.1f; - public static final float PRESENT_WIDTH = 0.12f; - public static final float PRESENT_HEIGHT = PRESENT_WIDTH * 2; - public static final float PRESENT_COLLIDER_WIDTH = 0.10f; - public static final float PRESENT_COLLIDER_HEIGHT = PRESENT_COLLIDER_WIDTH * 2; - public static final float SMALL_WIDTH = 0.05f; - public static final float SMALL_HEIGHT = SMALL_WIDTH * 2; - public static final float SMALL_COLLIDER_WIDTH = 0.05f; - public static final float SMALL_COLLIDER_HEIGHT = SMALL_COLLIDER_WIDTH * 2; - - // item spawn settings - public static final float SPAWN_INTERVAL = 1.2f; - public static final float SPAWN_Y = 0.8f; - public static final float FALL_SPEED_MIN = 0.1f; - public static final float FALL_SPEED_MAX = 0.5f; - public static final float FALL_SPEED_LEVEL_MULT = 1.2f; - public static final float DELETE_Y = -0.8f; - - // what's the initial value for the small items? - public static final int BASE_VALUE = 50; - - // index of the "base value" variable of an item - public static final int IVAR_BASE_VALUE = 0; - - // index of the "item type" integer variable of an item - public static final int IVAR_TYPE = 1; - - // candy rotational speed - public static final float CANDY_ROTATE_SPEED = 180.0f; - - // maximum interval between two item collections for them to be - // considered a combo - public static final float COMBO_INTERVAL = 0.25f; - } - - public static class ComboPopup { - - public static final float SIZE = 0.1f; - public static final float VEL_Y = GameConfig.ScorePopup.POPUP_VEL_Y * 0.3f; - } - - public static final int SKY_COLOR = 0xff91d2f2; - - public static class Clouds { - - public static final int COUNT = 6; - public static final float WIDTH = 0.2f; - public static final float SPAWN_Y = 0.8f; - public static final float SPEED_MIN = 0.3f; - public static final float SPEED_MAX = 0.5f; - public static final float DELETE_Y = -0.8f; - } - - public static class Time { - - // how much time the player has at the beginning - public static final float INITIAL = 30.0f; - - // maximum remaining time player can have - public static final float MAX = INITIAL * 2; - - // how many seconds are recovered by picking up an item, at the beginning of the game - public static final float RECOVERED_BY_ITEM = 2.0f; - - // by how many seconds the time reward decreases per level gained - public static final float RECOVERED_DECREASE_PER_LEVEL = 0.5f; - - // the minimum # of seconds recovered by catching a present - public static final float RECOVERED_MIN = 1.0f; - } - - public static class Progression { - - // how many items must be collected to go up a level? - public static final int ITEMS_PER_LEVEL = 10; - // by how much the score multiplier increases when we go up a level? - public static final float SCORE_LEVEL_MULT = 1.5f; - } - - // background music asset file - public static final String BGM_ASSET_FILE = "jetpack_music.mp3"; - - // Achievements - public static class Achievements { - - // combo-based achievements - public static final int[] COMBO_ACHS = { - R.string.achievement_jetpack_2_combo, - R.string.achievement_jetpack_3_combo, - R.string.achievement_jetpack_4_combo - }; - - // score-based - public static final int[] SCORE_ACHS = { - R.string.achievement_jetpack_beginner_score_500, - R.string.achievement_jetpack_intermediate_score_1000, - R.string.achievement_jetpack_pro_score_5000, - R.string.achievement_jetpack_advanced_score_10000, - R.string.achievement_jetpack_expert_score_50000 - }; - - // score necessary for the corresponding SCORE_ACHS achievement - public static final int[] SCORE_FOR_ACH = {500, 1000, 5000, 10000, 50000}; - - // flight time achievements (one increment = one second) - public static final int[] TOTAL_TIME_ACHS = { - R.string.achievement_jetpack_flight_time_15, - R.string.achievement_jetpack_flight_time_30, - R.string.achievement_jetpack_flight_time_60 - }; - - // total presents achievements - public static final int[] TOTAL_PRESENTS_ACHS = { - R.string.achievement_jetpack_a_dozen_presents, - R.string.achievement_jetpack_a_dozen_dozen_presents - }; - - // total candy achievements - public static final int[] TOTAL_CANDY_ACHS = { - R.string.achievement_jetpack_candy_for_one_month_30, - R.string.achievement_jetpack_candy_for_one_year_365 - }; - - // interval between consecutive sending of incremental achievements - public static final float INC_ACH_SEND_INTERVAL = 15.0f; - } - - // leaderboard - public static final int LEADERBOARD = R.string.leaderboard_jetpack_high_scores; -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackObjectFactory.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackObjectFactory.java deleted file mode 100644 index 3fc045619..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackObjectFactory.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.jetpack.gamebase.GameConfig; -import com.google.android.apps.santatracker.games.simpleengine.Renderer; -import com.google.android.apps.santatracker.games.simpleengine.game.GameObject; -import com.google.android.apps.santatracker.games.simpleengine.game.World; - -import java.util.Random; - -public class JetpackObjectFactory { - - Renderer mRenderer; - World mWorld; - Random mRandom = new Random(); - - // item subtypes - public static final int ITEM_PRESENT = 0; - public static final int ITEM_CANDY = 1; - public static final int ITEM_SMALL = 2; - - // Textures - int mTexPlayer; - int[] mTexItemCandy; - int[] mTexItemSmall; - int[] mTexItemPresent; - int mTexCloud; - int[] mComboTex; - int mTexFire; - - JetpackObjectFactory(Renderer r, World w) { - mRenderer = r; - mWorld = w; - } - - GameObject makePlayer() { - GameObject p = mWorld - .newGameObjectWithImage(JetpackScene.TYPE_PLAYER, 0.0f, 0.0f, mTexPlayer, - JetpackConfig.Player.WIDTH, Float.NaN); - p.setBoxCollider(JetpackConfig.Player.COLLIDER_WIDTH, - JetpackConfig.Player.COLLIDER_HEIGHT); - - Renderer.Sprite fireSprite = p.getSprite(p.addSprite()); - fireSprite.texIndex = mTexFire; - fireSprite.width = JetpackConfig.Player.Fire.WIDTH; - fireSprite.height = Float.NaN; - fireSprite.tintFactor = 0.0f; - return p; - } - - GameObject makeRandomItem(float fallSpeedMultiplier) { - float minX = mRenderer.getLeft() + 2 * JetpackConfig.Items.PRESENT_WIDTH; - float maxX = mRenderer.getRight() - 2 * JetpackConfig.Items.PRESENT_WIDTH; - float x = minX + mRandom.nextFloat() * (maxX - minX); - - // 0 is candy, 1 is small item, 2 is present - int itemType = mRandom.nextInt(3); - int itemSubtype = mRandom.nextInt(4); // one of the 4 subtypes - - int tex; - float width; - float colliderWidth, colliderHeight; - boolean isLarge = false; - - switch (itemType) { - case ITEM_CANDY: - tex = mTexItemCandy[itemSubtype]; - width = JetpackConfig.Items.CANDY_WIDTH; - colliderWidth = JetpackConfig.Items.CANDY_COLLIDER_WIDTH; - colliderHeight = JetpackConfig.Items.CANDY_COLLIDER_HEIGHT; - break; - case ITEM_SMALL: - tex = mTexItemSmall[itemSubtype]; - width = JetpackConfig.Items.SMALL_WIDTH; - colliderWidth = JetpackConfig.Items.SMALL_COLLIDER_WIDTH; - colliderHeight = JetpackConfig.Items.SMALL_COLLIDER_HEIGHT; - break; - default: - tex = mTexItemPresent[itemSubtype]; - width = JetpackConfig.Items.PRESENT_WIDTH; - colliderWidth = JetpackConfig.Items.PRESENT_COLLIDER_WIDTH; - colliderHeight = JetpackConfig.Items.PRESENT_COLLIDER_HEIGHT; - isLarge = true; - break; - } - - GameObject p = mWorld - .newGameObjectWithImage(JetpackScene.TYPE_ITEM, x, JetpackConfig.Items.SPAWN_Y, - tex, width, Float.NaN); - - p.velY = -(JetpackConfig.Items.FALL_SPEED_MIN + mRandom.nextFloat() * - (JetpackConfig.Items.FALL_SPEED_MAX - JetpackConfig.Items.FALL_SPEED_MIN)); - p.velY *= fallSpeedMultiplier; - p.setBoxCollider(colliderWidth, colliderHeight); - p.ivar[JetpackConfig.Items.IVAR_BASE_VALUE] = isLarge ? JetpackConfig.Items.BASE_VALUE * 2 : - JetpackConfig.Items.BASE_VALUE; - p.ivar[JetpackConfig.Items.IVAR_TYPE] = itemType; - return p; - } - - GameObject makeCloud() { - return mWorld.newGameObjectWithImage(GameConfig.TYPE_DECOR, 0.0f, 0.0f, mTexCloud, - JetpackConfig.Clouds.WIDTH, Float.NaN); - } - - GameObject makeComboPopup(int comboItems, float x, float y) { - int i = comboItems - 2; - i = i < 0 ? 0 : i >= mComboTex.length ? mComboTex.length - 1 : i; - GameObject o = mWorld.newGameObjectWithImage(GameConfig.TYPE_DECOR, x, y, - mComboTex[i], JetpackConfig.ComboPopup.SIZE, Float.NaN); - o.velY = JetpackConfig.ComboPopup.VEL_Y; - o.timeToLive = GameConfig.ScorePopup.POPUP_EXPIRE; - return o; - } - - protected void requestTextures() { - // request player texture - mTexPlayer = mRenderer.requestImageTex(R.drawable.jetpack_player, "jetpack_player", - Renderer.DIM_WIDTH, JetpackConfig.Player.WIDTH); - - // request item textures - mTexItemCandy = new int[4]; - int i = 0; - for (int resId : new int[]{R.drawable.jetpack_candy1, R.drawable.jetpack_candy2, - R.drawable.jetpack_candy3, R.drawable.jetpack_candy4}) { - mTexItemCandy[i++] = mRenderer.requestImageTex(resId, "candy", Renderer.DIM_WIDTH, - JetpackConfig.Items.CANDY_WIDTH); - } - mTexItemPresent = new int[4]; - i = 0; - for (int resId : new int[]{R.drawable.jetpack_present1, R.drawable.jetpack_present2, - R.drawable.jetpack_present3, R.drawable.jetpack_present4}) { - mTexItemPresent[i++] = mRenderer.requestImageTex(resId, "present", Renderer.DIM_WIDTH, - JetpackConfig.Items.PRESENT_WIDTH); - } - mTexItemSmall = new int[4]; - i = 0; - for (int resId : new int[]{R.drawable.jetpack_small1, R.drawable.jetpack_small2, - R.drawable.jetpack_small3, R.drawable.jetpack_small4}) { - mTexItemSmall[i++] = mRenderer.requestImageTex(resId, "small", Renderer.DIM_WIDTH, - JetpackConfig.Items.SMALL_WIDTH); - } - - mTexCloud = mRenderer.requestImageTex(R.drawable.jetpack_cloud, "jetpack_cloud", - Renderer.DIM_WIDTH, JetpackConfig.Clouds.WIDTH); - - mComboTex = new int[3]; - mComboTex[0] = mRenderer.requestImageTex(R.drawable.jetpack_combo_2x, "jetpack_combo_2x", - Renderer.DIM_WIDTH, JetpackConfig.ComboPopup.SIZE); - mComboTex[1] = mRenderer.requestImageTex(R.drawable.jetpack_combo_3x, "jetpack_combo_3x", - Renderer.DIM_WIDTH, JetpackConfig.ComboPopup.SIZE); - mComboTex[2] = mRenderer.requestImageTex(R.drawable.jetpack_combo_4x, "jetpack_combo_4x", - Renderer.DIM_WIDTH, JetpackConfig.ComboPopup.SIZE); - mTexFire = mRenderer.requestImageTex(R.drawable.jetpack_fire, "jetpack_fire", - Renderer.DIM_WIDTH, JetpackConfig.Player.Fire.WIDTH); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackScene.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackScene.java deleted file mode 100644 index f7e510427..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/JetpackScene.java +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.jetpack.gamebase.BaseScene; -import com.google.android.apps.santatracker.games.jetpack.gamebase.SceneActivity; -import com.google.android.apps.santatracker.games.simpleengine.Logger; -import com.google.android.apps.santatracker.games.simpleengine.SceneManager; -import com.google.android.apps.santatracker.games.simpleengine.SmoothValue; -import com.google.android.apps.santatracker.games.simpleengine.SoundManager; -import com.google.android.apps.santatracker.games.simpleengine.game.GameObject; - -import java.util.ArrayList; -import java.util.HashSet; - -public final class JetpackScene extends BaseScene { - - // GameObject types: - static final int TYPE_PLAYER = 0; - static final int TYPE_ITEM = 1; - - // player - GameObject mPlayerObj; - - // our object factory - JetpackObjectFactory mFactory; - - // current difficulty level - int mLevel = 1; - - // total items collected - int mItemsCollected = 0; - - // item fall speed multipler (increases with level) - float mFallMult = 1.0f; - - // score multipler (increases with level) - float mScoreMult = 1.0f; - - SmoothValue mSpriteAngle = new SmoothValue(0.0f, - JetpackConfig.Player.SpriteAngle.MAX_CHANGE_RATE, - -JetpackConfig.Player.SpriteAngle.MAX_ANGLE, - JetpackConfig.Player.SpriteAngle.MAX_ANGLE, - JetpackConfig.Player.SpriteAngle.FILTER_SAMPLES); - - float mPlayerTargetX = 0.0f; - float mPlayerTargetY = 0.0f; - - // working array - ArrayList mTmpList = new ArrayList(); - - // how long til we spawn the next item? - float mSpawnCountdown = JetpackConfig.Items.SPAWN_INTERVAL; - - // cloud sprites - GameObject[] mCloudObj = new GameObject[JetpackConfig.Clouds.COUNT]; - - // time remaining - float mTimeRemaining = JetpackConfig.Time.INITIAL; - - // sfx IDs - int[] mItemSfx = null; - - // current combo - private class Combo { - - int items = 0; - float countdown = 0.0f; - float centroidX, centroidY; - float points; - float timeRecovery; - - void reset() { - items = 0; - countdown = centroidX = centroidY = points = timeRecovery = 0.0f; - } - } - - private Combo mCombo = new Combo(); - - // set of achievements we know we unlocked (to prevent repeated API calls) - private HashSet mUnlockedAchievements = new HashSet(); - - // achievement increments we are pending to send - private int mAchPendingPresents = 0; - private int mAchPendingCandy = 0; - private float mAchPendingSeconds = 0; - - // countdown to next sending of incremental achievements - private float mIncAchCountdown = JetpackConfig.Achievements.INC_ACH_SEND_INTERVAL; - - // what pointer Id is the one that's steering the elf - private int mActivePointerId = -1; - - // accumulated play time - private float mPlayTime = 0.0f; - - @Override - protected String getBgmAssetFile() { - return JetpackConfig.BGM_ASSET_FILE; - } - - @Override - protected float getDisplayedTime() { - return mTimeRemaining; - } - - @Override - protected BaseScene makeNewScene() { - return new JetpackScene(); - } - - @Override - public void onInstall() { - super.onInstall(); - mFactory = new JetpackObjectFactory(mRenderer, mWorld); - mFactory.requestTextures(); - - mPlayerObj = mFactory.makePlayer(); - - SoundManager soundManager = SceneManager.getInstance().getSoundManager(); - mItemSfx = new int[3]; - mItemSfx[0] = soundManager.requestSfx(R.raw.jetpack_score1); - mItemSfx[1] = soundManager.requestSfx(R.raw.jetpack_score2); - mItemSfx[2] = soundManager.requestSfx(R.raw.jetpack_score3); - - // start paused - pauseGame(); - } - - @Override - public void onUninstall() { - super.onUninstall(); - } - - @Override - public void doStandbyFrame(float deltaT) { - super.doStandbyFrame(deltaT); - mRenderer.setClearColor(JetpackConfig.SKY_COLOR); - } - - @Override - public void doFrame(float deltaT) { - if (mPaused) { - deltaT = 0; - } - - if (!mGameEnded) { - mPlayTime += deltaT; - updatePlayer(deltaT); - detectCollectedPresents(); - updateTimeRemaining(deltaT); - updateCombo(deltaT); - checkLevelUp(); - mAchPendingSeconds += deltaT; - } - - updateClouds(); - updateCandy(deltaT); - killMissedPresents(); - - mIncAchCountdown -= deltaT; - sendIncrementalAchievements(false); - - if (!mGameEnded && (mSpawnCountdown -= deltaT) < 0.0f) { - mSpawnCountdown = JetpackConfig.Items.SPAWN_INTERVAL; - mFactory.makeRandomItem(mFallMult); - } - - mRenderer.setClearColor(JetpackConfig.SKY_COLOR); - super.doFrame(deltaT); - } - - protected void endGame() { - super.endGame(); - - // hide the player - mPlayerObj.hide(); - - // delete all remaining items - killAllPresents(); - - // force send all incremental achievements - sendIncrementalAchievements(true); - - // submit our score - submitScore(JetpackConfig.LEADERBOARD, mScore); - } - - private void updateTimeRemaining(float deltaT) { - mTimeRemaining -= deltaT; - if (mTimeRemaining < 0.0f) { - endGame(); - } - } - - private float sineWave(float period, float amplitude, float t) { - return (float) Math.sin(2 * Math.PI * t / period) * amplitude; - } - - private void updatePlayer(float deltaT) { - mSpriteAngle.setTarget( - (mPlayerObj.x - mPlayerTargetX) * JetpackConfig.Player.SpriteAngle.ANGLE_CONST); - mSpriteAngle.update(deltaT); - mPlayerObj.getSprite(0).rotation = mSpriteAngle.getValue(); - mPlayerObj.getSprite(1).rotation = mSpriteAngle.getValue(); - mPlayerObj.getSprite(1).width = JetpackConfig.Player.Fire.WIDTH * - (1.0f + sineWave(JetpackConfig.Player.Fire.ANIM_PERIOD, - JetpackConfig.Player.Fire.ANIM_AMPLITUDE, mPlayTime)); - mPlayerObj.getSprite(1).height = Float.NaN; // proportional to width - mPlayerObj.displaceTowards(mPlayerTargetX, mPlayerTargetY, deltaT * - JetpackConfig.Player.MAX_SPEED); - } - - private void updateClouds() { - int i; - for (i = 0; i < mCloudObj.length; i++) { - GameObject o = mCloudObj[i]; - if (o == null) { - o = mFactory.makeCloud(); - mCloudObj[i] = o; - setupNewCloud(o); - } else if (o.y < JetpackConfig.Clouds.DELETE_Y) { - setupNewCloud(o); - } - } - } - - private void updateCombo(float deltaT) { - if (mCombo.items > 0 && (mCombo.countdown -= deltaT) <= 0.0f) { - endCombo(); - } - } - - private boolean isCandy(GameObject o) { - return o.type == TYPE_ITEM && - o.ivar[JetpackConfig.Items.IVAR_TYPE] == JetpackObjectFactory.ITEM_CANDY; - } - - private boolean isPresent(GameObject o) { - return o.type == TYPE_ITEM && - o.ivar[JetpackConfig.Items.IVAR_TYPE] == JetpackObjectFactory.ITEM_PRESENT; - } - - private void updateCandy(float deltaT) { - int i; - for (i = 0; i < mWorld.gameObjects.size(); i++) { - GameObject o = mWorld.gameObjects.get(i); - if (isCandy(o)) { - o.getSprite(0).rotation += deltaT * JetpackConfig.Items.CANDY_ROTATE_SPEED; - } - } - } - - private void setupNewCloud(GameObject o) { - o.displaceTo(mRenderer.getLeft() + mRandom.nextFloat() * (mRenderer.getRight() - - mRenderer.getLeft()), JetpackConfig.Clouds.SPAWN_Y); - o.velY = -(JetpackConfig.Clouds.SPEED_MIN + mRandom.nextFloat() * - (JetpackConfig.Clouds.SPEED_MAX - JetpackConfig.Clouds.SPEED_MIN)); - } - - private void killMissedPresents() { - int i; - for (i = 0; i < mWorld.gameObjects.size(); i++) { - GameObject o = mWorld.gameObjects.get(i); - if (o.type == TYPE_ITEM && o.y < JetpackConfig.Items.DELETE_Y) { - o.dead = true; - } - } - } - - private void killAllPresents() { - int i; - for (i = 0; i < mWorld.gameObjects.size(); i++) { - GameObject o = mWorld.gameObjects.get(i); - if (o.type == TYPE_ITEM) { - o.dead = true; - } - } - } - - private int roundScore(int score) { - score = (score / 50) * 50; - return score < 50 ? 50 : score; - } - - private void addScore(float score) { - mScore += score; - unlockScoreBasedAchievements(); - } - - private void addTime(float time) { - mTimeRemaining += time; - if (mTimeRemaining > JetpackConfig.Time.MAX) { - mTimeRemaining = JetpackConfig.Time.MAX; - } - } - - private void pickUpItem(GameObject item) { - int baseValue = item.ivar[JetpackConfig.Items.IVAR_BASE_VALUE]; - int value = roundScore((int) (baseValue * mScoreMult)); - - if (isCandy(item)) { - mAchPendingCandy++; - } else if (isPresent(item)) { - mAchPendingPresents++; - } - - mObjectFactory.makeScorePopup(item.x, item.y, value, mDigitFactory); - float thisX = item.x; - float thisY = item.y; - item.dead = true; - mItemsCollected++; - - float timeRecovery = JetpackConfig.Time.RECOVERED_BY_ITEM - - mLevel * JetpackConfig.Time.RECOVERED_DECREASE_PER_LEVEL; - if (timeRecovery < JetpackConfig.Time.RECOVERED_MIN) { - timeRecovery = JetpackConfig.Time.RECOVERED_MIN; - } - - // rewards: score and time - addScore(value); - addTime(timeRecovery); - - // play sfx - SceneManager.getInstance().getSoundManager().playSfx( - mItemSfx[mRandom.nextInt(mItemSfx.length)]); - - // increment combo - mCombo.centroidX = (mCombo.centroidX * mCombo.items + thisX) / (mCombo.items + 1); - mCombo.centroidY = (mCombo.centroidY * mCombo.items + thisY) / (mCombo.items + 1); - mCombo.items++; - mCombo.countdown = JetpackConfig.Items.COMBO_INTERVAL; - mCombo.points += value; - mCombo.timeRecovery += timeRecovery; - } - - private void detectCollectedPresents() { - mWorld.detectCollisions(mPlayerObj, mTmpList, true); - int i; - for (i = 0; i < mTmpList.size(); i++) { - GameObject o = mTmpList.get(i); - if (o.type == TYPE_ITEM) { - pickUpItem(o); - } - } - } - - private void endCombo() { - if (mCombo.items > 1) { - mFactory.makeComboPopup(mCombo.items, mCombo.centroidX, mCombo.centroidY); - - // give bonus - addScore(mCombo.points * mCombo.items); - addTime(mCombo.timeRecovery * mCombo.items); - - // unlock combo-based achievements - unlockComboBasedAchievements(mCombo.items); - } - mCombo.reset(); - } - - @Override - public void onPointerDown(int pointerId, float x, float y) { - super.onPointerDown(pointerId, x, y); - if (mActivePointerId < 0) { - mActivePointerId = pointerId; - } - } - - @Override - public void onPointerUp(int pointerId, float x, float y) { - super.onPointerUp(pointerId, x, y); - if (mActivePointerId == pointerId) { - mActivePointerId = -1; - } - } - - @Override - public void onPointerMove(int pointerId, float x, float y, float deltaX, float deltaY) { - super.onPointerMove(pointerId, x, y, deltaX, deltaY); - - // if paused, do nothing. - if (mPaused) { - return; - } - - // if no finger owns the steering of the elf, adopt this one. - if (mActivePointerId < 0) { - mActivePointerId = pointerId; - } - - // if this finger is the owner of the steering, steer! - if (mActivePointerId == pointerId) { - mPlayerTargetX += deltaX * JetpackConfig.Input.TOUCH_SENSIVITY; - mPlayerTargetY += deltaY * JetpackConfig.Input.TOUCH_SENSIVITY; - - // don't let the player wander off screen - limitPlayerMovement(); - } - } - - private void limitPlayerMovement() { - float minX = mRenderer.getLeft() + JetpackConfig.Player.HORIZ_MOVEMENT_MARGIN; - float maxX = mRenderer.getRight() - JetpackConfig.Player.HORIZ_MOVEMENT_MARGIN; - float minY = mRenderer.getBottom() + JetpackConfig.Player.VERT_MOVEMENT_MARGIN; - float maxY = mRenderer.getTop() - JetpackConfig.Player.VERT_MOVEMENT_MARGIN; - mPlayerTargetX = mPlayerTargetX < minX ? minX : - mPlayerTargetX > maxX ? maxX : mPlayerTargetX; - mPlayerTargetY = mPlayerTargetY < minY ? minY : - mPlayerTargetY > maxY ? maxY : mPlayerTargetY; - } - - - private void checkLevelUp() { - int dueLevel = mItemsCollected / JetpackConfig.Progression.ITEMS_PER_LEVEL; - while (mLevel < dueLevel) { - mLevel++; - Logger.d("Level up! Now at level " + mLevel); - mFallMult *= JetpackConfig.Items.FALL_SPEED_LEVEL_MULT; - mScoreMult *= JetpackConfig.Progression.SCORE_LEVEL_MULT; - } - } - - private void unlockScoreBasedAchievements() { - int i; - for (i = 0; i < JetpackConfig.Achievements.SCORE_ACHS.length; i++) { - if (mScore >= JetpackConfig.Achievements.SCORE_FOR_ACH[i]) { - unlockAchievement(JetpackConfig.Achievements.SCORE_ACHS[i]); - } - } - } - - private void unlockComboBasedAchievements(int comboSize) { - int i; - for (i = 0; i < JetpackConfig.Achievements.COMBO_ACHS.length; i++) { - // COMBO_ACHS[n] is the achievement to unlock for a combo of size n + 2 - if (comboSize >= i + 2) { - unlockAchievement(JetpackConfig.Achievements.COMBO_ACHS[i]); - } - } - } - - private void sendIncrementalAchievements(boolean force) { - if (!force && mIncAchCountdown > 0.0f) { - // it's not time to send yet - return; - } - if (SceneManager.getInstance().getActivity() == null) { - // no Activity (maybe we're in the background), so can't send yet - return; - } - - if (mAchPendingCandy > 0) { - incrementAchievements(JetpackConfig.Achievements.TOTAL_CANDY_ACHS, mAchPendingCandy); - mAchPendingCandy = 0; - } - if (mAchPendingPresents > 0) { - incrementAchievements(JetpackConfig.Achievements.TOTAL_PRESENTS_ACHS, - mAchPendingPresents); - mAchPendingPresents = 0; - } - if (mAchPendingSeconds >= 1.0f) { - int seconds = (int) Math.floor(mAchPendingSeconds); - incrementAchievements(JetpackConfig.Achievements.TOTAL_TIME_ACHS, seconds); - mAchPendingSeconds -= seconds; - } - - // submit score as well, since we're at it. - submitScore(JetpackConfig.LEADERBOARD, mScore); - - // reset countdown - mIncAchCountdown = JetpackConfig.Achievements.INC_ACH_SEND_INTERVAL; - } - - private void unlockAchievement(int resId) { - SceneActivity act = (SceneActivity) SceneManager.getInstance().getActivity(); - if (!mUnlockedAchievements.contains(resId) && act != null) { - act.postUnlockAchievement(resId); - mUnlockedAchievements.add(resId); - } - } - - private void incrementAchievements(int[] resId, int steps) { - for (int i : resId) { - incrementAchievement(i, steps); - } - } - - private void incrementAchievement(int resId, int steps) { - SceneActivity act = (SceneActivity) SceneManager.getInstance().getActivity(); - if (steps > 0 && act != null) { - act.postIncrementAchievement(resId, steps); - } - } - - private void submitScore(int resId, int score) { - SceneActivity act = (SceneActivity) SceneManager.getInstance().getActivity(); - if (act != null) { - act.postSubmitScore(resId, score); - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/BaseScene.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/BaseScene.java deleted file mode 100644 index dcf70a515..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/BaseScene.java +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack.gamebase; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.common.ImmersiveModeHelper; -import com.google.android.apps.santatracker.games.gumball.Utils; -import com.google.android.apps.santatracker.games.simpleengine.Renderer; -import com.google.android.apps.santatracker.games.simpleengine.Scene; -import com.google.android.apps.santatracker.games.simpleengine.SceneManager; -import com.google.android.apps.santatracker.games.simpleengine.SmoothValue; -import com.google.android.apps.santatracker.games.simpleengine.SoundManager; -import com.google.android.apps.santatracker.games.simpleengine.game.GameObject; -import com.google.android.apps.santatracker.games.simpleengine.game.World; -import com.google.android.apps.santatracker.games.simpleengine.ui.Button; -import com.google.android.apps.santatracker.games.simpleengine.ui.SimpleUI; -import com.google.android.apps.santatracker.games.simpleengine.ui.Widget; -import com.google.example.games.basegameutils.GameHelper; - -import android.app.Activity; - -import java.util.Random; - -public abstract class BaseScene extends Scene implements Widget.WidgetTriggerListener { - - // digit object factory (to display score, etc) - protected DigitObjectFactory mDigitFactory; - protected GameObjectFactory mObjectFactory; - - protected World mWorld; - protected Renderer mRenderer; - protected Random mRandom = new Random(); - - // score bar object - protected GameObject mScoreBarObj; - - // score digit objects - protected GameObject[] mScoreDigitObj = new GameObject[GameConfig.ScoreDisplay.DIGIT_COUNT]; - - // timer digit objects - protected GameObject mClockIconObj = null; - protected GameObject[] mTimeDigitObj = new GameObject[GameConfig.TimeDisplay.DIGIT_COUNT]; - - // player's current score - protected int mScore = 0; - protected SmoothValue mDisplayedScore = new SmoothValue(0.0f, - GameConfig.ScoreDisplay.UPDATE_SPEED); - - // game ended? - protected boolean mGameEnded = false; - - // our UI (buttons, etc) - protected SimpleUI mUI = null; - - // widget trigger messages - private static final int MSG_REPLAY = 1001; - private static final int MSG_SIGN_IN = 1002; - private static final int MSG_PAUSE = 1003; - private static final int MSG_RESUME = 1004; - private static final int MSG_QUIT = 1005; - - // sfx IDs - protected int mGameOverSfx; - - // paused? - protected boolean mPaused = false; - - // back key pressed? - private boolean mBackKeyPending = false; - - // pause and resume buttons - Button mPauseButton, mResumeButton; - - // pause curtain, that is, the full screen object we display as a translucent - // screen over the whole display when the game is paused - GameObject mPauseCurtain = null; - - // the big play button - Button mBigPlayButton = null; - - // quit button - Button mQuitButton = null; - - // game objects that compose the Sign In ui - GameObject mSignInBarObj = null; - Button mSignInButton = null; - GameObject mSignInTextObj = null; - - // to be implemented by subclasses - protected abstract String getBgmAssetFile(); - - protected abstract float getDisplayedTime(); - - protected abstract BaseScene makeNewScene(); - - // are we signed in - private boolean mSignedIn = false; - - @Override - public void onInstall() { - mRenderer = SceneManager.getInstance().getRenderer(); - mWorld = new World(mRenderer); - mDigitFactory = new DigitObjectFactory(mRenderer, mWorld); - mDigitFactory.requestTextures(GameConfig.ScoreDisplay.DIGIT_SIZE); - mObjectFactory = new GameObjectFactory(mRenderer, mWorld); - mObjectFactory.requestTextures(); - - mDigitFactory.makeDigitObjects(GameConfig.ScoreDisplay.DIGIT_COUNT, GameConfig.TYPE_DECOR, - mRenderer.getRelativePos(GameConfig.ScoreDisplay.POS_X_REL, - GameConfig.ScoreDisplay.POS_X_DELTA), - mRenderer.getRelativePos(GameConfig.ScoreDisplay.POS_Y_REL, - GameConfig.ScoreDisplay.POS_Y_DELTA), - GameConfig.ScoreDisplay.DIGIT_SIZE, - GameConfig.ScoreDisplay.DIGIT_SPACING, mScoreDigitObj); - - mClockIconObj = mObjectFactory.makeClockIcon(); - mScoreBarObj = mObjectFactory.makeScoreBar(); - - mUI = new SimpleUI(mRenderer); - - mPauseButton = mObjectFactory.makePauseButton(this, MSG_PAUSE); - mResumeButton = mObjectFactory.makeResumeButton(this, MSG_RESUME); - mResumeButton.hide(); - - mUI.add(mPauseButton); - mUI.add(mResumeButton); - - mPauseCurtain = mObjectFactory.makePauseCurtain(); - mPauseCurtain.hide(); - - mBigPlayButton = mObjectFactory.makeBigPlayButton(this, MSG_RESUME); - mBigPlayButton.hide(); - mUI.add(mBigPlayButton); - - mQuitButton = mObjectFactory.makeQuitButton(this, MSG_QUIT); - mQuitButton.hide(); - mUI.add(mQuitButton); - - float x = GameConfig.TimeDisplay.POS_X_DELTA + GameConfig.TimeDisplay.ICON_SIZE; - mDigitFactory.makeDigitObjects(GameConfig.TimeDisplay.DIGIT_COUNT, GameConfig.TYPE_DECOR, - mRenderer.getRelativePos(GameConfig.TimeDisplay.POS_X_REL, x), - mRenderer.getRelativePos(GameConfig.TimeDisplay.POS_Y_REL, - GameConfig.TimeDisplay.POS_Y_DELTA), - GameConfig.TimeDisplay.DIGIT_SIZE, - GameConfig.TimeDisplay.DIGIT_SPACING, mTimeDigitObj); - - SoundManager soundManager = SceneManager.getInstance().getSoundManager(); - soundManager.requestBackgroundMusic(getBgmAssetFile()); - mGameOverSfx = soundManager.requestSfx(R.raw.jetpack_gameover); - - mRenderer.setClearColor(0xffffffff); - - // are we signed in? - SceneActivity act = (SceneActivity) SceneManager.getInstance().getActivity(); - if (act != null && act.getGameHelper() != null) { - mSignedIn = act.getGameHelper().isSignedIn(); - } - - } - - @Override - public void onUninstall() { - } - - @Override - public void doStandbyFrame(float deltaT) { - } - - @Override - public void doFrame(float deltaT) { - if (mPaused) { - deltaT = 0.0f; - } - - if (mBackKeyPending) { - processBackKey(); - } - - // If Activity lost focus and we're playing the game, pause - if (!SceneManager.getInstance().shouldBePlaying() && !mGameEnded && !mPaused) { - pauseGame(); - } - - if (!mGameEnded) { - updateScore(deltaT); - updateTime(deltaT); - } else { - updateScore(deltaT); - checkSignInWidgetsNeeded(); - } - - mWorld.doFrame(deltaT); - } - - private void processBackKey() { - mBackKeyPending = false; - if (mGameEnded) { - quitGame(); - } else if (mPaused) { - unpauseGame(); - } else { - pauseGame(); - } - } - - private void updateScore(float deltaT) { - if (mGameEnded) { - mDisplayedScore.setValue(mScore); - } else { - mDisplayedScore.setTarget(mScore); - mDisplayedScore.update(deltaT); - } - mDigitFactory.setDigits((int) Math.round(mDisplayedScore.getValue()), mScoreDigitObj); - mScoreBarObj.bringToFront(); - bringObjectsToFront(mScoreDigitObj); - mPauseButton.bringToFront(); - mResumeButton.bringToFront(); - } - - protected void endGame() { - mGameEnded = true; - - // hide the score bar - mScoreBarObj.hide(); - - // show the podium object - mObjectFactory.makePodium(); - - // move score to final position - float x = mRenderer.getRelativePos(GameConfig.Podium.ScoreDisplay.X_REL, - GameConfig.Podium.ScoreDisplay.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.Podium.ScoreDisplay.Y_REL, - GameConfig.Podium.ScoreDisplay.Y_DELTA); - displaceObjectsTo(mScoreDigitObj, x, y); - bringObjectsToFront(mScoreDigitObj); - - // hide time counter - mClockIconObj.hide(); - hideObjects(mTimeDigitObj); - - // make the "your score is" label - mObjectFactory.makeScoreLabel(); - - // create the end of game UI and add the "play again" button to it - mUI.add(mObjectFactory.makePlayAgainButton(this, MSG_REPLAY)); - mResumeButton.hide(); - mPauseButton.hide(); - - Button quitButton = mObjectFactory.makePodiumQuitButton(this, MSG_QUIT); - mUI.add(quitButton); - quitButton.bringToFront(); - quitButton.show(); - - // create the sign in bar and sign in button - if (!mSignedIn) { - mSignInBarObj = mObjectFactory.makeSignInBar(); - mSignInTextObj = mObjectFactory.makeSignInText(); - mUI.add(mSignInButton = mObjectFactory.makeSignInButton(this, MSG_SIGN_IN)); - } - - // disable the background music - SceneManager.getInstance().getSoundManager().enableBgm(false); - - // play the game over sfx - SceneManager.getInstance().getSoundManager().playSfx(mGameOverSfx); - } - - protected void displaceObjectsTo(GameObject[] objs, float x, float y) { - float deltaX = x - objs[0].x; - float deltaY = y - objs[0].y; - int i; - for (i = 0; i < objs.length; i++) { - objs[i].displaceBy(deltaX, deltaY); - } - } - - protected void bringObjectsToFront(GameObject[] objs) { - int i; - for (i = 0; i < objs.length; i++) { - objs[i].bringToFront(); - } - } - - protected void hideObjects(GameObject[] objs) { - int i; - for (i = 0; i < objs.length; i++) { - objs[i].hide(); - } - } - - private void updateTime(float deltaT) { - int seconds = (int) Math.ceil(getDisplayedTime()); - seconds = seconds < 0 ? 0 : seconds > 99 ? 99 : seconds; - mDigitFactory.setDigits(seconds, mTimeDigitObj); - bringObjectsToFront(mTimeDigitObj); - mClockIconObj.bringToFront(); - } - - @Override - public void onScreenResized(int width, int height) { - - } - - @Override - public void onPointerDown(int pointerId, float x, float y) { - super.onPointerDown(pointerId, x, y); - if (mUI != null) { - mUI.onPointerDown(pointerId, x, y); - } - } - - @Override - public void onPointerUp(int pointerId, float x, float y) { - super.onPointerUp(pointerId, x, y); - if (mUI != null) { - mUI.onPointerUp(pointerId, x, y); - } - } - - protected void pauseGame() { - if (!mPaused) { - mPaused = true; - SceneManager.getInstance().getSoundManager().enableBgm(false); - mPauseButton.hide(); - mResumeButton.show(); - mPauseCurtain.show(); - mPauseCurtain.bringToFront(); - mBigPlayButton.show(); - mBigPlayButton.bringToFront(); - mQuitButton.show(); - mQuitButton.bringToFront(); - if (Utils.hasKitKat() && SceneManager.getInstance().getActivity() !=null) { - SceneManager.getInstance().getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - ImmersiveModeHelper.setImmersiveStickyWithActionBar( - SceneManager.getInstance().getActivity().getWindow()); - } - }); - } - } - } - - protected void unpauseGame() { - if (mPaused) { - mPaused = false; - SceneManager.getInstance().getSoundManager().enableBgm(true); - mResumeButton.hide(); - mPauseButton.show(); - mPauseCurtain.hide(); - mQuitButton.hide(); - mBigPlayButton.hide(); - if (Utils.hasKitKat() && SceneManager.getInstance().getActivity() !=null) { - SceneManager.getInstance().getActivity().runOnUiThread(new Runnable() { - @Override - public void run() { - ImmersiveModeHelper.setImmersiveSticky( - SceneManager.getInstance().getActivity().getWindow()); - } - }); - } - } - } - - private int roundScore(int score) { - score = (score / 50) * 50; - return score <= 0 ? 50 : score; - } - - @Override - public void onPointerMove(int pointerId, float x, float y, float deltaX, float deltaY) { - if (mUI != null) { - mUI.onPointerMove(pointerId, x, y, deltaX, deltaY); - } - } - - @Override - public void onWidgetTriggered(int message) { - SceneActivity act; - GameHelper helper; - - switch (message) { - case MSG_REPLAY: - SceneManager.getInstance().requestNewScene(makeNewScene()); - break; - case MSG_SIGN_IN: - act = (SceneActivity) SceneManager.getInstance().getActivity(); - if (act != null && null != (helper = act.getGameHelper())) { - // start sign in flow - helper.beginUserInitiatedSignIn(); - } - break; - case MSG_PAUSE: - pauseGame(); - break; - case MSG_RESUME: - unpauseGame(); - break; - case MSG_QUIT: - quitGame(); - break; - } - } - - private void quitGame() { - Activity act = SceneManager.getInstance().getActivity(); - if (act != null && act instanceof SceneActivity) { - ((SceneActivity) act).postQuitGame(); - } - } - - private void checkSignInWidgetsNeeded() { - if (mSignedIn) { - if (mSignInBarObj != null) { - mSignInBarObj.hide(); - } - if (mSignInTextObj != null) { - mSignInTextObj.hide(); - } - if (mSignInButton != null) { - mSignInButton.hide(); - } - } - } - - // Caution: Called from the UI thread! - public void setSignedIn(boolean signedIn) { - mSignedIn = signedIn; - } - - // Caution: Called from the UI thread! - public boolean onBackKeyPressed() { - // raise a flag and process later (on the game thread) - mBackKeyPending = true; - return true; - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/DigitObjectFactory.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/DigitObjectFactory.java deleted file mode 100644 index 06fbdcf35..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/DigitObjectFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack.gamebase; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.simpleengine.Renderer; -import com.google.android.apps.santatracker.games.simpleengine.game.GameObject; -import com.google.android.apps.santatracker.games.simpleengine.game.World; - -public class DigitObjectFactory { - - int mDigitTex[] = new int[10]; - Renderer mRenderer; - World mWorld; - - public DigitObjectFactory(Renderer renderer, World world) { - mRenderer = renderer; - mWorld = world; - } - - public void requestTextures(float maxDigitWidth) { - int[] res = new int[]{ - R.drawable.games_digit_0, R.drawable.games_digit_1, R.drawable.games_digit_2, - R.drawable.games_digit_3, R.drawable.games_digit_4, R.drawable.games_digit_5, - R.drawable.games_digit_6, R.drawable.games_digit_7, R.drawable.games_digit_8, - R.drawable.games_digit_9 - }; - for (int i = 0; i < 10; i++) { - mDigitTex[i] = mRenderer.requestImageTex(res[i], "digit_" + i, - Renderer.DIM_WIDTH, maxDigitWidth); - } - } - - public GameObject makeDigitObject(int type, float x, float y, float size) { - return mWorld.newGameObjectWithImage(type, x, y, mDigitTex[0], size, size); - } - - public void setDigit(GameObject digitObject, int digit) { - digit = digit > 9 ? 9 : digit < 0 ? 0 : digit; - digitObject.getSprite(0).texIndex = mDigitTex[digit]; - } - - public void makeDigitObjects(int count, int type, float x, float y, float size, - float stride, GameObject[] result) { - int i; - for (i = 0; i < count; i++) { - result[i] = makeDigitObject(type, x, y, size); - x += stride; - } - } - - public void setDigits(int valueToShow, GameObject[] digitObjects) { - setDigits(valueToShow, digitObjects, 0, digitObjects.length); - } - - public void setDigits(int valueToShow, GameObject[] digitObjects, int start, int length) { - int i; - for (i = start + length - 1; i >= start; --i) { - setDigit(digitObjects[i], valueToShow % 10); - valueToShow /= 10; - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameConfig.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameConfig.java deleted file mode 100644 index 3deee08ca..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameConfig.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack.gamebase; - -import com.google.android.apps.santatracker.games.simpleengine.Renderer; - -public class GameConfig { - - // type code for decorative objects (HUD, etc) - public static final int TYPE_DECOR = 9999; - - // score popup settings - public class ScorePopup { - - public static final float DIGIT_SIZE = 0.04f; - public static final float DIGIT_SPACING = 0.022f; - public static final float POPUP_VEL_Y = 0.1f; - public static final float POPUP_EXPIRE = 0.8f; - } - - // score bar settings - public class ScoreBar { - - public static final float WIDTH = 0.7f; - public static final int X_REL = Renderer.REL_RIGHT; - public static final float X_DELTA = -WIDTH / 2; - public static final int Y_REL = Renderer.REL_BOTTOM; - public static final float Y_DELTA = 0.06f; - - public class PauseButton { - - public static final int X_REL = Renderer.REL_RIGHT; - public static final float X_DELTA = -0.1f; - public static final int Y_REL = Renderer.REL_BOTTOM; - public static final float Y_DELTA = 0.06f; - public static final float WIDTH = 0.2f; - public static final float HEIGHT = 0.2f; - public static final float SPRITE_WIDTH = 0.1f; - public static final float SPRITE_HEIGHT = 0.1f; - } - } - - // score display settings - public class ScoreDisplay { - - public static final float DIGIT_SIZE = 0.06f; - public static final float DIGIT_SPACING = DIGIT_SIZE * 0.5f; - public static final int DIGIT_COUNT = 6; - public static final int POS_X_REL = Renderer.REL_RIGHT; - public static final float POS_X_DELTA = -0.62f; - public static final int POS_Y_REL = Renderer.REL_BOTTOM; - public static final float POS_Y_DELTA = 0.062f; - public static final float UPDATE_SPEED = 1000.0f; - } - - // time display settings - public class TimeDisplay { - - public static final float ICON_SIZE = 0.06f; - public static final float DIGIT_SIZE = ScoreDisplay.DIGIT_SIZE; - public static final float DIGIT_SPACING = ScoreDisplay.DIGIT_SPACING; - public static final int DIGIT_COUNT = 2; - public static final int POS_X_REL = Renderer.REL_RIGHT; - public static final float POS_X_DELTA = -0.33f; - public static final int POS_Y_REL = Renderer.REL_BOTTOM; - public static final float POS_Y_DELTA = ScoreDisplay.POS_Y_DELTA; - } - - // podium (level end) screen settings - public class Podium { - - public static final float WIDTH = 0.8f; - public static final int X_REL = Renderer.REL_CENTER; - public static final float X_DELTA = 0.0f; - public static final int Y_REL = Renderer.REL_CENTER; - public static final float Y_DELTA = 0.1f; - - // score label (the static text that says "Score") - public class ScoreLabel { - - public static final int X_REL = Renderer.REL_CENTER; - public static final float X_DELTA = 0.15f; - public static final int Y_REL = Renderer.REL_CENTER; - public static final float Y_DELTA = 0.2f; - public static final float FONT_SIZE = 25.0f; - } - - // where do we display the score in the podium screen - public class ScoreDisplay { - - public static final int X_REL = Renderer.REL_CENTER; - public static final float X_DELTA = 0.07f; - public static final int Y_REL = Renderer.REL_CENTER; - public static final float Y_DELTA = 0.1f; - } - - // "play again" button - public class ReplayButton { - - public static final float FONT_SIZE = 25.0f; - public static final int X_REL = Renderer.REL_CENTER; - public static final float X_DELTA = 0.0f; - public static final int Y_REL = Renderer.REL_CENTER; - public static final float Y_DELTA = -0.13f; - public static final float WIDTH = 0.6f; - public static final float HEIGHT = 0.12f; - public static final int NORMAL_COLOR = 0xff269e43; - public static final int HIGHLIGHT_COLOR = 0xff2db04b; - } - } - - // Sign in bar - public class SignInBar { - - public static final int COLOR = 0x80ffffff; - public static final int X_REL = Renderer.REL_CENTER; - public static final float X_DELTA = 0.0f; - public static final int Y_REL = Renderer.REL_BOTTOM; - public static final float HEIGHT = 0.2f; - public static final float WIDTH = 10.0f; - public static final float Y_DELTA = 0.5f * HEIGHT; - } - - // Sign in button - public class SignInButton { - - public static final float WIDTH = 0.4f; - // (120/402 is the height/width of the image asset) - public static final float HEIGHT = WIDTH * (120.0f / 402.0f); - public static final int X_REL = Renderer.REL_LEFT; - public static final float X_DELTA = WIDTH * 0.5f + 0.05f; - public static final int Y_REL = Renderer.REL_BOTTOM; - public static final float Y_DELTA = 0.1f; - - public static final float TEXT_DELTA_X = 0.05f; - - public static final float FONT_SIZE = 20.0f; - } - - // Sign in encouragement text - public class SignInText { - - public static final int COLOR = 0xffdf4a32; - public static final int X_REL = Renderer.REL_LEFT; - public static final float X_DELTA = SignInButton.X_DELTA + SignInButton.WIDTH * 0.5f - + 0.05f; - public static final int Y_REL = Renderer.REL_BOTTOM; - public static final float Y_DELTA = 0.1f; - public static final int ANCHOR = Renderer.TEXT_ANCHOR_MIDDLE | Renderer.TEXT_ANCHOR_LEFT; - public static final float FONT_SIZE = 20.0f; - } - - // pause screen settings - public class PauseScreen { - - public static final int CURTAIN_COLOR = 0x80ffffff; - - public class BigPlayButton { - - public static final int X_REL = Renderer.REL_CENTER; - public static final float X_DELTA = 0.0f; - public static final int Y_REL = Renderer.REL_CENTER; - public static final float Y_DELTA = 0.0f; - public static final float WIDTH = 0.4f; - public static final float HEIGHT = 0.4f; - public static final float SPRITE_WIDTH = 0.4f; - } - - public class QuitBar { - - public static final int X_REL = Renderer.REL_LEFT; - public static final float X_DELTA = 0.05f; - public static final int Y_REL = Renderer.REL_BOTTOM; - public static final float Y_DELTA = 0.058f; - public static final float WIDTH = 0.25f; - public static final float HEIGHT = WIDTH * 0.5f; - public static final float SPRITE_WIDTH = WIDTH; - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameFragment.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameFragment.java deleted file mode 100644 index d5668d338..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameFragment.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack.gamebase; - -import com.google.android.apps.santatracker.games.simpleengine.GameView; - -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -public class GameFragment extends Fragment { - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - return new GameView(getActivity()); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameObjectFactory.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameObjectFactory.java deleted file mode 100644 index 0ff7a50d9..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/GameObjectFactory.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack.gamebase; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.simpleengine.Renderer; -import com.google.android.apps.santatracker.games.simpleengine.game.GameObject; -import com.google.android.apps.santatracker.games.simpleengine.game.World; -import com.google.android.apps.santatracker.games.simpleengine.ui.Button; -import com.google.android.apps.santatracker.games.simpleengine.ui.Widget; - -import java.util.Arrays; -import java.util.Random; - -public class GameObjectFactory { - - protected Renderer mRenderer; - protected World mWorld; - protected Random mRandom = new Random(); - - // Textures - int mTexClock; - int mTexPodium; - int mPlayAgainTex; - int mScoreLabelTex; - int mSignInLabelTex; - int mSignInNormalTex; - int mSignInHighlightTex; - int mSignInTextTex; - int mScoreBarTex; - int mPauseIconTex; - int mResumeIconTex; - int mBigPlayButtonNormalTex; - int mBigPlayButtonHighlightTex; - int mQuitBarTex; - - public GameObjectFactory(Renderer r, World w) { - mRenderer = r; - mWorld = w; - } - - GameObject[] mTmpDigits = new GameObject[5]; - - public void makeScorePopup(float x, float y, int score, DigitObjectFactory df) { - int digits = (score >= 10000) ? 5 : (score >= 1000) ? 4 : (score >= 100) ? 3 : 2; - - Arrays.fill(mTmpDigits, null); - df.makeDigitObjects(digits, GameConfig.TYPE_DECOR, x, y, - GameConfig.ScorePopup.DIGIT_SIZE, GameConfig.ScorePopup.DIGIT_SPACING, - mTmpDigits); - df.setDigits(score, mTmpDigits, 0, digits); - - int i; - for (i = 0; i < digits; i++) { - GameObject o = mTmpDigits[i]; - o.velY = GameConfig.ScorePopup.POPUP_VEL_Y; - o.timeToLive = GameConfig.ScorePopup.POPUP_EXPIRE; - } - } - - protected void requestTextures() { - mTexClock = mRenderer.requestImageTex(R.drawable.jetpack_clock, "jetpack_clock", - Renderer.DIM_WIDTH, GameConfig.TimeDisplay.ICON_SIZE); - mTexPodium = mRenderer.requestImageTex(R.drawable.jetpack_podium, "jetpack_podium", - Renderer.DIM_WIDTH, GameConfig.Podium.WIDTH); - - mPlayAgainTex = mRenderer.requestTextTex(R.string.play_again, "play_again", - GameConfig.Podium.ReplayButton.FONT_SIZE); - mScoreLabelTex = mRenderer.requestTextTex(R.string.score, "score", - GameConfig.Podium.ScoreLabel.FONT_SIZE); - - mSignInLabelTex = mRenderer.requestTextTex(R.string.common_signin_button_text, - "jetpack_sign_in", - GameConfig.SignInButton.FONT_SIZE); - mSignInNormalTex = mRenderer.requestImageTex(R.drawable.jetpack_signin, "jetpack_siginin", - Renderer.DIM_WIDTH, GameConfig.SignInButton.WIDTH); - mSignInHighlightTex = mRenderer.requestImageTex(R.drawable.jetpack_signin_pressed, - "jetpack_signin_pressed", Renderer.DIM_WIDTH, - GameConfig.SignInButton.WIDTH); - mSignInTextTex = mRenderer.requestTextTex(R.string.why_sign_in, - "jetpack_why_sign_in", GameConfig.SignInText.FONT_SIZE, - GameConfig.SignInText.ANCHOR, GameConfig.SignInText.COLOR); - mScoreBarTex = mRenderer.requestImageTex(R.drawable.games_scorebar, "games_scorebar", - Renderer.DIM_WIDTH, GameConfig.ScoreBar.WIDTH); - mResumeIconTex = mRenderer.requestImageTex(R.drawable.games_play, "games_play", - Renderer.DIM_WIDTH, GameConfig.ScoreBar.PauseButton.SPRITE_WIDTH); - mPauseIconTex = mRenderer.requestImageTex(R.drawable.games_pause, "games_pause", - Renderer.DIM_WIDTH, GameConfig.ScoreBar.PauseButton.SPRITE_WIDTH); - mBigPlayButtonNormalTex = mRenderer.requestImageTex(R.drawable.games_bigplay, - "games_bigplay", Renderer.DIM_WIDTH, - GameConfig.PauseScreen.BigPlayButton.SPRITE_WIDTH); - mBigPlayButtonHighlightTex = mRenderer.requestImageTex(R.drawable.games_bigplay_pressed, - "games_bigplay_pressed", Renderer.DIM_WIDTH, - GameConfig.PauseScreen.BigPlayButton.SPRITE_WIDTH); - mQuitBarTex = mRenderer.requestImageTex(R.drawable.games_cancelbar, - "games_cancelbar", Renderer.DIM_WIDTH, - GameConfig.PauseScreen.QuitBar.SPRITE_WIDTH); - } - - public GameObject makeClockIcon() { - float x = mRenderer.getRelativePos(GameConfig.TimeDisplay.POS_X_REL, - GameConfig.TimeDisplay.POS_X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.TimeDisplay.POS_Y_REL, - GameConfig.TimeDisplay.POS_Y_DELTA); - return mWorld.newGameObjectWithImage(GameConfig.TYPE_DECOR, x, y, mTexClock, - GameConfig.TimeDisplay.ICON_SIZE, GameConfig.TimeDisplay.ICON_SIZE); - } - - public GameObject makePodium() { - float x = mRenderer.getRelativePos(GameConfig.Podium.X_REL, GameConfig.Podium.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.Podium.Y_REL, GameConfig.Podium.Y_DELTA); - return mWorld.newGameObjectWithImage(GameConfig.TYPE_DECOR, x, y, mTexPodium, - GameConfig.Podium.WIDTH, Float.NaN); - } - - public GameObject makeScoreBar() { - float x = mRenderer.getRelativePos(GameConfig.ScoreBar.X_REL, GameConfig.ScoreBar.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.ScoreBar.Y_REL, GameConfig.ScoreBar.Y_DELTA); - return mWorld.newGameObjectWithImage(GameConfig.TYPE_DECOR, x, y, mScoreBarTex, - GameConfig.ScoreBar.WIDTH, Float.NaN); - } - - public GameObject makeScoreLabel() { - // create the "score" static label - float x = mRenderer.getRelativePos(GameConfig.Podium.ScoreLabel.X_REL, - GameConfig.Podium.ScoreLabel.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.Podium.ScoreLabel.Y_REL, - GameConfig.Podium.ScoreLabel.Y_DELTA); - return mWorld.newGameObjectWithImage(GameConfig.TYPE_DECOR, x, y, mScoreLabelTex, - Float.NaN, Float.NaN); - } - - public Button makePlayAgainButton(Widget.WidgetTriggerListener listener, int message) { - float x = mRenderer.getRelativePos(GameConfig.Podium.ReplayButton.X_REL, - GameConfig.Podium.ReplayButton.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.Podium.ReplayButton.Y_REL, - GameConfig.Podium.ReplayButton.Y_DELTA); - Button replayButton = new Button(mRenderer, x, y, GameConfig.Podium.ReplayButton.WIDTH, - GameConfig.Podium.ReplayButton.HEIGHT); - replayButton.addFlatBackground(GameConfig.Podium.ReplayButton.NORMAL_COLOR, - GameConfig.Podium.ReplayButton.HIGHLIGHT_COLOR); - replayButton.addTex(mPlayAgainTex); - replayButton.setClickListener(listener, message); - return replayButton; - } - - public GameObject makeSignInBar() { - float x = mRenderer.getRelativePos(GameConfig.SignInBar.X_REL, - GameConfig.SignInBar.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.SignInBar.Y_REL, - GameConfig.SignInBar.Y_DELTA); - return mWorld - .newGameObjectWithColor(GameConfig.TYPE_DECOR, x, y, GameConfig.SignInBar.COLOR, - GameConfig.SignInBar.WIDTH, GameConfig.SignInBar.HEIGHT); - } - - public GameObject makeSignInText() { - float x = mRenderer.getRelativePos(GameConfig.SignInText.X_REL, - GameConfig.SignInText.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.SignInText.Y_REL, - GameConfig.SignInText.Y_DELTA); - return mWorld.newGameObjectWithImage(GameConfig.TYPE_DECOR, x, y, - mSignInTextTex, Float.NaN, Float.NaN); - } - - public Button makeSignInButton(Widget.WidgetTriggerListener listener, int message) { - float x = mRenderer.getRelativePos(GameConfig.SignInButton.X_REL, - GameConfig.SignInButton.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.SignInButton.Y_REL, - GameConfig.SignInButton.Y_DELTA); - Button signInButton = new Button(mRenderer, x, y, GameConfig.SignInButton.WIDTH, - GameConfig.SignInButton.HEIGHT); - signInButton.addNormalTex(mSignInNormalTex); - signInButton.addHighlightTex(mSignInHighlightTex); - signInButton.addTex(mSignInLabelTex, GameConfig.SignInButton.TEXT_DELTA_X, 0.0f, - Float.NaN, Float.NaN); - signInButton.setClickListener(listener, message); - return signInButton; - } - - private Button makePauseOrResumeButton(boolean isPause, Widget.WidgetTriggerListener listener, - int message) { - float x = mRenderer.getRelativePos(GameConfig.ScoreBar.PauseButton.X_REL, - GameConfig.ScoreBar.PauseButton.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.ScoreBar.PauseButton.Y_REL, - GameConfig.ScoreBar.PauseButton.Y_DELTA); - Button button = new Button(mRenderer, x, y, GameConfig.ScoreBar.PauseButton.WIDTH, - GameConfig.ScoreBar.PauseButton.HEIGHT); - button.addTex(isPause ? mPauseIconTex : mResumeIconTex, 0.0f, 0.0f, - GameConfig.ScoreBar.PauseButton.SPRITE_WIDTH, - GameConfig.ScoreBar.PauseButton.SPRITE_HEIGHT); - button.setClickListener(listener, message); - return button; - } - - public Button makePauseButton(Widget.WidgetTriggerListener listener, int message) { - return makePauseOrResumeButton(true, listener, message); - } - - public Button makeResumeButton(Widget.WidgetTriggerListener listener, int message) { - return makePauseOrResumeButton(false, listener, message); - } - - public GameObject makePauseCurtain() { - GameObject o = mWorld.newGameObject(GameConfig.TYPE_DECOR, 0.0f, 0.0f); - Renderer.Sprite sp = o.getSprite(o.addSprite()); - sp.width = mRenderer.getWidth() + 0.1f; // safety margin - sp.height = mRenderer.getHeight() + 0.1f; // safety margin - sp.color = GameConfig.PauseScreen.CURTAIN_COLOR; - sp.tintFactor = 0.0f; - return o; - } - - public Button makeBigPlayButton(Widget.WidgetTriggerListener listener, int message) { - float x = mRenderer.getRelativePos(GameConfig.PauseScreen.BigPlayButton.X_REL, - GameConfig.PauseScreen.BigPlayButton.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.PauseScreen.BigPlayButton.Y_REL, - GameConfig.PauseScreen.BigPlayButton.Y_DELTA); - Button button = new Button(mRenderer, x, y, GameConfig.PauseScreen.BigPlayButton.WIDTH, - GameConfig.PauseScreen.BigPlayButton.HEIGHT); - button.addNormalTex(mBigPlayButtonNormalTex, 0.0f, 0.0f, - GameConfig.PauseScreen.BigPlayButton.SPRITE_WIDTH, Float.NaN); - button.addHighlightTex(mBigPlayButtonHighlightTex, 0.0f, 0.0f, - GameConfig.PauseScreen.BigPlayButton.SPRITE_WIDTH, Float.NaN); - button.setClickListener(listener, message); - return button; - } - - public Button makeQuitButton(Widget.WidgetTriggerListener listener, int message) { - float x = mRenderer.getRelativePos(GameConfig.PauseScreen.QuitBar.X_REL, - GameConfig.PauseScreen.QuitBar.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.PauseScreen.QuitBar.Y_REL, - GameConfig.PauseScreen.QuitBar.Y_DELTA); - Button button = new Button(mRenderer, x, y, GameConfig.PauseScreen.QuitBar.WIDTH, - GameConfig.PauseScreen.QuitBar.HEIGHT); - button.addTex(mQuitBarTex, 0.0f, 0.0f, - GameConfig.PauseScreen.QuitBar.SPRITE_WIDTH, Float.NaN); - button.setClickListener(listener, message); - return button; - } - - // As above, but anchored at the top of screen (hence -y) - public Button makePodiumQuitButton(Widget.WidgetTriggerListener listener, int message) { - float x = mRenderer.getRelativePos(GameConfig.PauseScreen.QuitBar.X_REL, - GameConfig.PauseScreen.QuitBar.X_DELTA); - float y = mRenderer.getRelativePos(GameConfig.PauseScreen.QuitBar.Y_REL, - GameConfig.PauseScreen.QuitBar.Y_DELTA); - Button button = new Button(mRenderer, x, -y, GameConfig.PauseScreen.QuitBar.WIDTH, - GameConfig.PauseScreen.QuitBar.HEIGHT); - button.addTex(mQuitBarTex, 0.0f, 0.0f, - GameConfig.PauseScreen.QuitBar.SPRITE_WIDTH, Float.NaN); - button.setClickListener(listener, message); - return button; - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/SceneActivity.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/SceneActivity.java deleted file mode 100644 index 6ebbd7d7c..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/jetpack/gamebase/SceneActivity.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.jetpack.gamebase; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.common.PlayGamesActivity; -import com.google.android.apps.santatracker.games.simpleengine.Scene; -import com.google.android.apps.santatracker.games.simpleengine.SceneManager; - -import android.os.Bundle; - -public abstract class SceneActivity extends PlayGamesActivity { - - protected abstract Scene getGameScene(); - - public SceneActivity(int layoutId, Class backClass) { - super(layoutId, backClass); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - if (savedInstanceState == null) { - SceneManager.getInstance().enableDebugLog(getResources().getBoolean( - R.bool.debug_logs_enabled)); - SceneManager.getInstance().requestNewScene(getGameScene()); - } - } - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - SceneManager.getInstance().onFocusChanged(hasFocus); - } - - @Override - public void onPause() { - super.onPause(); - SceneManager.getInstance().onPause(); - } - - @Override - public void onResume() { - super.onResume(); - SceneManager.getInstance().onResume(this); - } - - @Override - public void onSignInFailed() { - super.onSignInFailed(); - - // communicate to the BaseScene that we are no longer signed in - Scene s = SceneManager.getInstance().getCurrentScene(); - if (s instanceof BaseScene) { - ((BaseScene) s).setSignedIn(false); - } - } - - @Override - public void onSignInSucceeded() { - super.onSignInSucceeded(); - - // communicate to the BaseScene that we are no longer signed in - Scene s = SceneManager.getInstance().getCurrentScene(); - if (s instanceof BaseScene) { - ((BaseScene) s).setSignedIn(true); - } - } - - public void postQuitGame() { - runOnUiThread(new Runnable() { - @Override - public void run() { - launchStartupActivity(); - } - }); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MatchingGameConstants.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MatchingGameConstants.java deleted file mode 100644 index 85b11665b..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MatchingGameConstants.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.matching; - -import com.google.android.apps.santatracker.R; - -/** - * Constants for the memory match and gumball games. - */ -public class MatchingGameConstants { - - /** - * Name of the preferences file for the gumball and memory match games. - */ - public static final String PREFERENCES_FILENAME = "match_gumball_games"; - /** - * Key of the preference indicating that the memory match instructions have been viewed. - */ - public static final String MATCH_INSTRUCTIONS_VIEWED = "MATCH_INSTRUCTIONS_VIEWED"; - /** - * Key of the preference indicating that the gumball instructions have been viewed. - */ - public static final String GUMBALL_INSTRUCTIONS_VIEWED = "GUMBALL_INSTRUCTIONS_VIEWED"; - - /** - * ID of the string resource pointing to the Play Games leaderboard game ID for the memory match - * game. - */ - public static final int LEADERBOARDS_MATCH = R.string.leaderboard_memory; - /** - * ID of the string resource pointing to the Play Games leaderboard game ID for the gumball - * game. - */ - public static final int LEADERBOARDS_GUMBALL = R.string.leaderboard_gumball; - - /** - * Initial time for the gumball game. - */ - public static final long GUMBALL_INIT_TIME = 60000; - /** - * Time to add to the countdown when a gumball is dropped. - */ - public static final long GUMBALL_ADDED_TIME = 5000; - /** - * Initial time for the memory match game. - */ - public static final long MATCH_INIT_TIME = 60000; - /** - * Time to add to the countdown for each successful match in the memory match game. - */ - public static final long MATCH_ADD_TIME_NEXT_LEVEL = 5000; -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MemoryCard.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MemoryCard.java deleted file mode 100644 index e22d4a6aa..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MemoryCard.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.matching; - -import android.view.View; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Card in the memory game. - * Contains the front of the card (the card image) and its back (its cloak). - */ -public class MemoryCard { - - public int mCardImageId; - public int mCardCloakId; - public View mView; - - public MemoryCard(int cardImageId, int cardCloakId) { - mCardImageId = cardImageId; - mCardCloakId = cardCloakId; - } - - /** - * Generate a randomised list of {@link com.google.android.apps.santatracker.games.matching.MemoryCard}s. - * - * @param numCards Number of cards to generate - * @param cardImages List of card image references - * @param cardCloaks List of card cloak image references - */ - public static ArrayList getGameCards(int numCards, List cardImages, - List cardCloaks) { - Collections.shuffle(cardImages); - Collections.shuffle(cardCloaks); - ArrayList cards = new ArrayList(); - for (int i = 0; i < (numCards / 2); i++) { - cards.add(new MemoryCard(cardImages.get(i), cardCloaks.get(i))); - cards.add(new MemoryCard(cardImages.get(i), cardCloaks.get(i))); - } - Collections.shuffle(cards); - return cards; - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MemoryMatchFragment.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MemoryMatchFragment.java deleted file mode 100644 index db3f91ba4..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/matching/MemoryMatchFragment.java +++ /dev/null @@ -1,965 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.matching; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.common.ImmersiveModeHelper; -import com.google.android.apps.santatracker.games.common.PlayGamesActivity; -import com.google.android.apps.santatracker.games.gumball.Utils; - -import android.content.Context; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.graphics.Color; -import android.graphics.Typeface; -import android.graphics.drawable.AnimationDrawable; -import android.graphics.drawable.Drawable; -import android.graphics.drawable.Drawable.Callback; -import android.media.AudioManager; -import android.media.MediaPlayer; -import android.media.SoundPool; -import android.os.Build; -import android.os.Bundle; -import android.os.CountDownTimer; -import android.os.Handler; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; -import android.view.animation.Animation.AnimationListener; -import android.view.animation.AnimationSet; -import android.view.animation.AnimationUtils; -import android.view.animation.TranslateAnimation; -import android.widget.Button; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.TextView; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * Fragment that contains the memory match game. - */ -public class MemoryMatchFragment extends Fragment - implements OnClickListener, AnimationListener, Callback { - - /** - * Drawables for all card faces. - */ - private static final Integer[] CARD_FACE_DRAWABLES = new Integer[]{ - R.drawable.mmg_card_ball, R.drawable.mmg_card_balloon, R.drawable.mmg_card_beachball, - R.drawable.mmg_card_candle, R.drawable.mmg_card_globe, R.drawable.mmg_card_gumball, - R.drawable.mmg_card_penguin, R.drawable.mmg_card_rabbit, R.drawable.mmg_card_reindeer, - R.drawable.mmg_card_snowman, R.drawable.mmg_card_tree, R.drawable.mmg_card_trophy}; - /** - * Drawables for all card face cloaks (background color). - */ - private static final Integer[] CARD_CLOAK_DRAWABLES = new Integer[]{ - R.drawable.mmg_card_cloak_blue_dark, R.drawable.mmg_card_cloak_blue_light, - R.drawable.mmg_card_cloak_orange, R.drawable.mmg_card_cloak_purple, - R.drawable.mmg_card_cloak_red, R.drawable.mmg_card_cloak_orange}; - - /** - * Current game level. - */ - private int mLevelNumber = 1; - - /** - * Number of correct moves required for this level. - */ - private int mCorrectMovesRequired = 0; - - /** - * Count of correct moves in this level so far. - */ - private int mCurrentCorrectMoves = 0; - - /** - * Total score of the game so far. - */ - private int mMatchScore = 0; - - /** - * Count of the number of wrong selections in the level so far. - */ - private int mWrongAnswers = 0; - - /** - * First card that has been selected and is visible. - */ - private View mVisibleCard1 = null; - - /** - * Second card that has been selected and is visible. - */ - private View mVisibleCard2 = null; - - /** - * First card that was visible and is being animated to become hidden again. - */ - private View mHiddenCard1; - - /** - * Second card that was visible and is being animated to become hidden again. - */ - private View mHiddenCard2; - - /** - * Views that represent the cards (doors) on screen. - */ - private View[] mViewCard = new View[12]; - - /** - * List of card faces. - * This list is shuffled before each level. - */ - private List mCardFaceIds = Arrays.asList(CARD_FACE_DRAWABLES); - - /** - * List of card cloaks (backgrounds). - * This list is shuffled before each level. - */ - private List mCardCloakIds = Arrays.asList(CARD_CLOAK_DRAWABLES); - - /** - * Time left in the game in milliseconds. - */ - private long mTimeLeftInMillis = MatchingGameConstants.MATCH_INIT_TIME; - /** - * Countdown timer refresh interval in milliseconds. - */ - private long mCountDownInterval = 1000; - /** - * Countdown timer that drives the game logic. - */ - private GameCountdown mCountDownTimer = null; - /** - * Flag to indicate the state of this Fragment and stop the game correctly when the countdown - * expires. - */ - private boolean wasPaused = false; - - private Animation mAnimationRightPaneSlideOut; - private Animation mAnimationLeftPaneSlideOut; - private Animation mAnimationLeftPaneSlideIn; - private Animation mAnimationRightPaneSlideIn; - private Animation mAnimationScaleLevelDown; - private Animation mAnimationLevelFadeOut; - private Animation mAnimationLevelScaleUp; - private Animation mAnimationPlayAgainBackground; - private Animation mAnimationPlayAgainMain; - private Animation mAnimationCardCover; - private TranslateAnimation mAnimationSnowman; - private Animation mAnimationTimerAlpha; - private TranslateAnimation mAnimationSnowmanBack; - private AnimationSet mAnimationSetSnowman; - - private CircleView mEndLevelCircle; - private TextView mScoreText; - private LevelTextView mLevelNumberText; - - private int mSoundDoorOpen = -1; - private int mSoundDoorClose = -1; - private int mSoundMatchWrong = -1; - private int mSoundMatchRight = -1; - private int mSoundBeep = -1; - private int mSoundGameOver = -1; - private MediaPlayer mBackgroundMusic; - private SoundPool mSoundPool; - - private TextView mTimerTextView; - private View mViewPlayAgainBackground; - private View mViewPlayAgainMain; - private TextView mTextPlayAgainScore; - private TextView mTextPlayAgainLevel; - private ImageView mButtonPlay; - private ImageView mButtonPause; - private ImageButton mButtonBigPlay; - private Button mPlayAgainBtn; - private ImageButton mButtonCancelBar; - private ImageButton mButtonMenu; - private ImageView mViewInstructions; - private View mViewPauseOverlay; - private View mViewBonusSnowman; - private AnimationDrawable mInstructionDrawable; - private ImageView mViewGPlusSignIn; - private View mLayoutGPlus; - - /** - * Handler that dismisses the game instructions when the game is started for the first time. - */ - private Handler mDelayHandler = new Handler(); - - /** - * Preferences that store whether the game instructions have been viewed. - */ - private SharedPreferences mPreferences; - - /** - * Indicates whether the screen is clickable. - * It is disabled when a full screen animation is in progress at the end of the level or at the - * end of the game. - */ - private boolean isClickable = true; - - /** - * Create a new instance of this fragment. - */ - public static MemoryMatchFragment newInstance() { - return new MemoryMatchFragment(); - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_memory_match, container, false); - rootView.setKeepScreenOn(true); - - // Below ICS, display a special, simplified background for the entire fragment - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - rootView.findViewById(R.id.match_score_layout).setBackgroundResource( - R.drawable.score_background_gingerbread); - } - - // Initialise the sound pool and all sound effects - mSoundPool = new SoundPool(5, AudioManager.STREAM_MUSIC, 0); - mSoundDoorOpen = mSoundPool.load(getActivity(), R.raw.mmg_open_door_3, 1); - mSoundDoorClose = mSoundPool.load(getActivity(), R.raw.mmg_close_door, 1); - mSoundMatchWrong = mSoundPool.load(getActivity(), R.raw.mmg_wrong, 1); - mSoundMatchRight = mSoundPool.load(getActivity(), R.raw.mmg_right, 1); - mSoundGameOver = mSoundPool.load(getActivity(), R.raw.gameover, 1); - mSoundBeep = mSoundPool.load(getActivity(), R.raw.mmg_open_door_2, 1); - - // Set up all animations. - loadAnimations(); - - // G+ sign-in views - mViewGPlusSignIn = (ImageView) rootView.findViewById(R.id.gplus_button); - mViewGPlusSignIn.setOnClickListener(this); - mLayoutGPlus = rootView.findViewById(R.id.play_again_gplus); - mLayoutGPlus.setVisibility(View.GONE); - - // 'Play again' screen views - mTextPlayAgainScore = (TextView) rootView.findViewById(R.id.play_again_score); - mTextPlayAgainScore.setText(String.valueOf(mMatchScore)); - mTextPlayAgainLevel = (TextView) rootView.findViewById(R.id.play_again_level); - mTextPlayAgainLevel.setText(String.valueOf(mLevelNumber)); - mViewPlayAgainBackground = rootView.findViewById(R.id.play_again_bkgrd); - mViewPlayAgainMain = rootView.findViewById(R.id.play_again_main); - mPlayAgainBtn = (Button) rootView.findViewById(R.id.play_again_btn); - mPlayAgainBtn.setOnClickListener(this); - - // Level, countdown and score views at the bottom of the screen - mTimerTextView = (TextView) rootView.findViewById(R.id.match_timer); - mLevelNumberText = (LevelTextView) rootView.findViewById(R.id.card_end_level_number); - mLevelNumberText.setVisibility(View.GONE); - mScoreText = (TextView) rootView.findViewById(R.id.match_score); - mScoreText.setText(String.valueOf(mMatchScore)); - - // End of level animated circle - mEndLevelCircle = (CircleView) rootView.findViewById(R.id.card_end_level_circle); - mEndLevelCircle.setVisibility(View.GONE); - - // The snowman that is animated as a bonus when the player is particularly awesome - mViewBonusSnowman = rootView.findViewById(R.id.match_snowman); - - // 'Pause' screen views - mButtonMenu = (ImageButton) rootView.findViewById(R.id.main_menu_button); - mButtonMenu.setOnClickListener(this); - mButtonMenu.setVisibility(View.GONE); - mButtonPlay = (ImageView) rootView.findViewById(R.id.match_play_button); - mButtonPlay.setOnClickListener(this); - mButtonPlay.setVisibility(View.GONE); - mButtonPause = (ImageView) rootView.findViewById(R.id.match_pause_button); - mButtonPause.setOnClickListener(this); - mButtonPause.setVisibility(View.VISIBLE); - mViewPauseOverlay = rootView.findViewById(R.id.match_pause_overlay); - mViewPauseOverlay.setVisibility(View.GONE); - mButtonBigPlay = (ImageButton) rootView.findViewById(R.id.match_big_play_button); - mButtonBigPlay.setOnClickListener(this); - mButtonCancelBar = (ImageButton) rootView.findViewById(R.id.match_cancel_bar); - mButtonCancelBar.setOnClickListener(this); - mButtonCancelBar.setVisibility(View.GONE); - - // Playing cards (doors) - mViewCard[0] = rootView.findViewById(R.id.card_position_1); - mViewCard[1] = rootView.findViewById(R.id.card_position_2); - mViewCard[2] = rootView.findViewById(R.id.card_position_3); - mViewCard[3] = rootView.findViewById(R.id.card_position_4); - mViewCard[4] = rootView.findViewById(R.id.card_position_5); - mViewCard[5] = rootView.findViewById(R.id.card_position_6); - mViewCard[6] = rootView.findViewById(R.id.card_position_7); - mViewCard[7] = rootView.findViewById(R.id.card_position_8); - mViewCard[8] = rootView.findViewById(R.id.card_position_9); - mViewCard[9] = rootView.findViewById(R.id.card_position_10); - mViewCard[10] = rootView.findViewById(R.id.card_position_11); - mViewCard[11] = rootView.findViewById(R.id.card_position_12); - - - - // Display the instructions if they haven't been seen by the player yet. - mPreferences = getActivity() - .getSharedPreferences(MatchingGameConstants.PREFERENCES_FILENAME, - Context.MODE_PRIVATE); - if (!mPreferences.getBoolean(MatchingGameConstants.MATCH_INSTRUCTIONS_VIEWED, false)) { - // Instructions haven't been viewed yet. Construct an AnimationDrawable with instructions. - mInstructionDrawable = new AnimationDrawable(); - mInstructionDrawable - .addFrame(getResources().getDrawable(R.drawable.instructions_touch_1), 300); - mInstructionDrawable - .addFrame(getResources().getDrawable(R.drawable.instructions_touch_2), 300); - mInstructionDrawable.setOneShot(false); - mViewInstructions = (ImageView) rootView.findViewById(R.id.instructions); - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - mViewInstructions.setImageResource(R.drawable.instructions_touch_1); - } else { - mViewInstructions.setImageDrawable(mInstructionDrawable); - mInstructionDrawable.start(); - } - // Set a timer to hide the instructions after 2 seconds - mViewInstructions.postDelayed(new StartGameDelay(), 2000); - } else { - //Instructions have already been viewed. Start the first level. - setUpLevel(); - } - - return rootView; - } - - /** - * Load and initialise all animations required for the game. - */ - private void loadAnimations(){ - mAnimationTimerAlpha = new AlphaAnimation(0.0f, 1.0f); - mAnimationTimerAlpha.setDuration(1000); - mAnimationTimerAlpha.setRepeatMode(Animation.REVERSE); - mAnimationTimerAlpha.setRepeatCount(Animation.INFINITE); - - mAnimationPlayAgainBackground = AnimationUtils - .loadAnimation(getActivity(), R.anim.play_again_bkgrd_anim); - mAnimationPlayAgainBackground.setFillAfter(true); - mAnimationPlayAgainBackground.setAnimationListener(this); - mAnimationCardCover = AnimationUtils.loadAnimation(getActivity(), R.anim.card_answer_flash); - mAnimationCardCover.setFillAfter(true); - mAnimationPlayAgainMain = AnimationUtils - .loadAnimation(getActivity(), R.anim.play_again_main_anim); - mAnimationPlayAgainMain.setFillAfter(true); - mAnimationPlayAgainMain.setAnimationListener(this); - // Special bonus animation to play if the player is particularly awesome. - mAnimationSetSnowman = new AnimationSet(true); - mAnimationSnowman = new TranslateAnimation(150, 0, 150, 0); - mAnimationSnowman.setDuration(1000); - mAnimationSetSnowman.addAnimation(mAnimationSnowman); - mAnimationSnowmanBack = new TranslateAnimation(0, 150, 0, 150); - mAnimationSnowmanBack.setDuration(1000); - mAnimationSnowmanBack.setStartOffset(1500); - mAnimationSnowmanBack.setAnimationListener(this); - mAnimationSetSnowman.addAnimation(mAnimationSnowmanBack); - mAnimationSetSnowman.setAnimationListener(this); - - mAnimationRightPaneSlideOut = AnimationUtils - .loadAnimation(getActivity(), android.R.anim.slide_out_right); - mAnimationRightPaneSlideOut.setFillAfter(true); - mAnimationLeftPaneSlideOut = AnimationUtils - .loadAnimation(getActivity(), R.anim.left_pane_slide_out); - mAnimationLeftPaneSlideOut.setFillAfter(true); - mAnimationLeftPaneSlideIn = AnimationUtils - .loadAnimation(getActivity(), android.R.anim.slide_in_left); - mAnimationLeftPaneSlideIn.setFillAfter(true); - mAnimationRightPaneSlideIn = AnimationUtils - .loadAnimation(getActivity(), R.anim.right_pane_slide_in); - mAnimationRightPaneSlideIn.setFillAfter(true); - mAnimationScaleLevelDown = AnimationUtils - .loadAnimation(getActivity(), R.anim.scale_level_anim_down); - mAnimationScaleLevelDown.setAnimationListener(this); - mAnimationLevelFadeOut = AnimationUtils - .loadAnimation(getActivity(), R.anim.level_fade_out_anim); - mAnimationLevelFadeOut.setAnimationListener(this); - mAnimationLevelScaleUp = AnimationUtils - .loadAnimation(getActivity(), R.anim.scale_up_level_anim); - mAnimationLevelScaleUp.setAnimationListener(this); - mAnimationRightPaneSlideOut.setAnimationListener(this); - mAnimationLeftPaneSlideOut.setAnimationListener(this); - } - - /** - * Runnable that stars the game after the instructions have been viewed. - * It hides the instructions, marks them as viewed and starts the game. - */ - private class StartGameDelay implements Runnable { - - @Override - public void run() { - // Start the first level. - setUpLevel(); - - // Hide the instructions. - mInstructionDrawable.stop(); - mViewInstructions.setVisibility(View.GONE); - // Mark the instructions as 'viewed'. - Editor edit = mPreferences.edit(); - edit.putBoolean(MatchingGameConstants.MATCH_INSTRUCTIONS_VIEWED, true); - edit.commit(); - } - - } - - public void onSignInSucceeded() { - setSignInButtonVisibility(false); - } - - public void onSignInFailed() { - - } - - - @Override - public void onResume() { - super.onResume(); - isClickable = true; - if (wasPaused && mViewPauseOverlay.getVisibility() != View.VISIBLE) { - mCountDownTimer = new GameCountdown(mTimeLeftInMillis, mCountDownInterval); - mCountDownTimer.start(); - wasPaused = false; - } - loadBackgroundMusic(); - updateSignInButtonVisibility(); - } - - /** - * Toggles visibility of the G+ sign in layout if the user is not already signed in. - */ - private void setSignInButtonVisibility(boolean show) { - mLayoutGPlus.setVisibility(show && !Utils.isSignedIn(this) ? View.VISIBLE : View.GONE); - } - - private void updateSignInButtonVisibility() { - if (mLayoutGPlus.getVisibility() == View.VISIBLE && Utils.isSignedIn(this)) { - setSignInButtonVisibility(false); - } - } - - @Override - public void onPause() { - super.onPause(); - pauseGame(); - stopBackgroundMusic(); - if (mCountDownTimer != null && mViewPauseOverlay.getVisibility() != View.VISIBLE) { - mCountDownTimer.cancel(); - wasPaused = true; - } - } - - private void stopBackgroundMusic() { - if (mBackgroundMusic != null) { - mBackgroundMusic.stop(); - mBackgroundMusic.release(); - mBackgroundMusic = null; - } - } - - - private void loadBackgroundMusic() { - mBackgroundMusic = MediaPlayer.create(getActivity(), R.raw.santatracker_musicloop); - mBackgroundMusic.setLooping(true); - mBackgroundMusic.setVolume(.1f, .1f); - mBackgroundMusic.start(); - } - - /** - * Starts the next level. - * Shuffles the cards, sets up the views and starts the countdown for the next level. - */ - private void setUpLevel() { - mCurrentCorrectMoves = 0; - mWrongAnswers = 0; - if (mCountDownTimer != null) { - mCountDownTimer.cancel(); - } - - // Display the level number - mTextPlayAgainLevel.setText(String.valueOf(mLevelNumber)); - - // Lock all doors, unlock them individually per level later - for (View card : mViewCard) { - setUpLockedCard(card); - } - - if(mLevelNumber > 1){ - // Add the 'next level' bonus time - mTimeLeftInMillis += MatchingGameConstants.MATCH_ADD_TIME_NEXT_LEVEL; - } - - int pairsRequired = Math.min(mLevelNumber, 5) + 1; - mCorrectMovesRequired = pairsRequired; - ArrayList memoryCards = - MemoryCard.getGameCards(pairsRequired * 2, mCardFaceIds, mCardCloakIds); - int[] cardSlots; - - if (mLevelNumber == 1) { - cardSlots = new int[] {2, 3, 8, 9}; - } else if (mLevelNumber == 2) { - cardSlots = new int[] {0, 1, 2, 3, 4, 5}; - } else if (mLevelNumber == 3) { - cardSlots = new int[] {1, 2, 3, 4, 7, 8, 9, 10}; - } else if (mLevelNumber == 4) { - cardSlots = new int[] {0, 1, 2, 3, 4, 5, 7, 8, 9, 10}; - } else { - cardSlots = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; - } - for (int i = 0; i < cardSlots.length; i++) { - setUpMemoryCard(mViewCard[cardSlots[i]], memoryCards.get(i)); - } - - // Start the countdown for the new level - mCountDownTimer = new GameCountdown(mTimeLeftInMillis, mCountDownInterval); - mCountDownTimer.start(); - } - - /** - * Sets the card displayed by this view to the 'locked' state. - */ - private void setUpLockedCard(View view) { - view.setOnClickListener(null); - view.findViewById(R.id.card_locked).setVisibility(View.VISIBLE); - view.findViewById(R.id.card_cloak).setVisibility(View.GONE); - view.findViewById(R.id.card_frame).setVisibility(View.GONE); - view.findViewById(R.id.card_image).setVisibility(View.GONE); - view.findViewById(R.id.card_pane_right).clearAnimation(); - view.findViewById(R.id.card_pane_left).clearAnimation(); - view.findViewById(R.id.card_pane_left).setVisibility(View.GONE); - view.findViewById(R.id.card_pane_right).setVisibility(View.GONE); - view.findViewById(R.id.card_cover).setVisibility(View.GONE); - } - - /** - * Sets the viewCard that displays a card to show the face and cloaking indicated by the - * {@link com.google.android.apps.santatracker.games.matching.MemoryCard}. - */ - private void setUpMemoryCard(View viewCard, MemoryCard card) { - viewCard.setOnClickListener(this); - card.mView = viewCard; - viewCard.setTag(card); - viewCard.findViewById(R.id.card_locked).setVisibility(View.GONE); - viewCard.findViewById(R.id.card_frame).setVisibility(View.VISIBLE); - ((ImageView) viewCard.findViewById(R.id.card_cloak)).setImageResource(card.mCardCloakId); - viewCard.findViewById(R.id.card_cloak).setVisibility(View.VISIBLE); - ((ImageView) viewCard.findViewById(R.id.card_image)).setImageResource(card.mCardImageId); - viewCard.findViewById(R.id.card_image).setVisibility(View.VISIBLE); - viewCard.findViewById(R.id.card_pane_right).clearAnimation(); - viewCard.findViewById(R.id.card_pane_left).clearAnimation(); - viewCard.findViewById(R.id.card_pane_left).setVisibility(View.VISIBLE); - viewCard.findViewById(R.id.card_pane_right).setVisibility(View.VISIBLE); - viewCard.findViewById(R.id.card_cover).setVisibility(View.INVISIBLE); - } - - /** - * Plays a sound unveils the given card. - */ - private void showCard(View view) { - mSoundPool.play(mSoundDoorOpen, 1, 1, 0, 0, 1.0f); - view.findViewById(R.id.card_pane_right).startAnimation(mAnimationRightPaneSlideOut); - - view.findViewById(R.id.card_pane_left).startAnimation(mAnimationLeftPaneSlideOut); - } - - /** - * Plays a sound and hides the given card. - */ - private void hideCard(View view) { - mSoundPool.play(mSoundDoorClose, 1, 1, 0, 0, 1.0f); - view.findViewById(R.id.card_pane_left).startAnimation(mAnimationLeftPaneSlideIn); - view.findViewById(R.id.card_pane_right).startAnimation(mAnimationRightPaneSlideIn); - } - - @Override - public void onClick(View view) { - // Check if the cards are not currently clickable and skip if necessary. - if (view.getTag() != null && isClickable) { - // A card has been clicked. - onCardClick(view); - } else if (view.equals(mPlayAgainBtn)) { - // The 'play again' button has been clicked. Stop the music and restart. - stopBackgroundMusic(); - loadBackgroundMusic(); - - // Reset the game state. - resetGameState(); - - // Reset the UI and clear all animations. - mScoreText.setText(String.valueOf(mMatchScore)); - mTextPlayAgainScore.setText(String.valueOf(mMatchScore)); - mViewPlayAgainBackground.clearAnimation(); - mViewPlayAgainMain.clearAnimation(); - mViewPlayAgainBackground.setVisibility(View.GONE); - mViewPlayAgainMain.setVisibility(View.GONE); - mButtonMenu.setVisibility(View.GONE); - setSignInButtonVisibility(false); - } else if (view.equals(mButtonPause)) { - // Pause button. - pauseGame(); - } else if (view.equals(mButtonPlay) || view.equals(mButtonBigPlay)) { - // Play button, resume the game. - resumeGame(); - } else if (view.equals(mButtonCancelBar) || view.equals(mButtonMenu)) { - // Exit the game. - exit(); - } else if (view.equals(mViewGPlusSignIn)) { - // Start sign-in flow. - PlayGamesActivity activity = Utils.getPlayGamesActivity(this); - if (activity != null) { - activity.startSignIn(); - } - } - } - - private void resetGameState() { - mLevelNumber = 1; - mTimeLeftInMillis = MatchingGameConstants.MATCH_INIT_TIME; - setUpLevel(); - mMatchScore = 0; - } - - /** - * Handles onClick events for views that represent cards. - * Unveils the card and checks for a match if another card has already been unveiled. - */ - private void onCardClick(View view) { - MemoryCard card1 = (MemoryCard) view.getTag(); - if (mVisibleCard1 != null && mVisibleCard2 != null) { - // Two cards are already unveiled, hide them both - hideCard(mVisibleCard1); - hideCard(mVisibleCard2); - mVisibleCard2.setOnClickListener(this); - mVisibleCard1.setOnClickListener(this); - mVisibleCard1 = view; - mVisibleCard2 = null; - mVisibleCard1.setOnClickListener(null); - showCard(mVisibleCard1); - } else if (mVisibleCard1 != null && mVisibleCard2 == null) { - // One card is already unveiled and a second one has been selected - MemoryCard card2 = (MemoryCard) mVisibleCard1.getTag(); - - if (card1.mCardImageId == card2.mCardImageId) { - // The second card matches the face of the first one - we have a winner! - mVisibleCard2 = view; - mVisibleCard2.setOnClickListener(null); - mVisibleCard1.setOnClickListener(null); - showCard(view); - if (mVisibleCard1.findViewById(R.id.card_cover).getVisibility() != View.GONE) { - // Play an animation to flash the background of both cards in green - mVisibleCard1.findViewById(R.id.card_cover).setBackgroundColor(Color.GREEN); - mVisibleCard2.findViewById(R.id.card_cover).setBackgroundColor(Color.GREEN); - mVisibleCard1.findViewById(R.id.card_cover).clearAnimation(); - mVisibleCard2.findViewById(R.id.card_cover).clearAnimation(); - mVisibleCard1.findViewById(R.id.card_cover).setVisibility(View.VISIBLE); - mVisibleCard2.findViewById(R.id.card_cover).setVisibility(View.VISIBLE); - mAnimationCardCover.setAnimationListener(this); - mHiddenCard1 = mVisibleCard1; - mHiddenCard2 = mVisibleCard2; - mVisibleCard1.findViewById(R.id.card_cover).startAnimation( - mAnimationCardCover); - mVisibleCard2.findViewById(R.id.card_cover).startAnimation( - mAnimationCardCover); - - mVisibleCard2 = null; - mVisibleCard1 = null; - - // Add the cards to the tally of correct cards - mCurrentCorrectMoves++; - increaseScoreMatch(); - - // Check if this level is finished - checkNextLevel(); - } - } else { - // The second card does not match the first one - this is not a match. - mSoundPool.play(mSoundMatchWrong, 1, 1, 0, 0, 1.0f); - mWrongAnswers++; - mVisibleCard2 = view; - mVisibleCard2.setOnClickListener(null); - showCard(mVisibleCard2); - // Play an animation to flash the background of both cards in red - mVisibleCard1.findViewById(R.id.card_cover).setBackgroundColor(Color.RED); - mVisibleCard2.findViewById(R.id.card_cover).setBackgroundColor(Color.RED); - mVisibleCard1.findViewById(R.id.card_cover).clearAnimation(); - mVisibleCard2.findViewById(R.id.card_cover).clearAnimation(); - mVisibleCard1.findViewById(R.id.card_cover).setVisibility(View.VISIBLE); - mVisibleCard2.findViewById(R.id.card_cover).setVisibility(View.VISIBLE); - mAnimationCardCover.setAnimationListener(null); - mVisibleCard1.findViewById(R.id.card_cover).startAnimation(mAnimationCardCover); - mVisibleCard2.findViewById(R.id.card_cover).startAnimation(mAnimationCardCover); - } - } else { - // This is the first card that has been unveiled. - mVisibleCard1 = view; - mVisibleCard1.setOnClickListener(null); - showCard(mVisibleCard1); - } - } - - /** - * Advances the game to the next level if all matching pairs have been unveiled. - */ - private void checkNextLevel() { - if (mCurrentCorrectMoves >= mCorrectMovesRequired) { - // Increment the level count - increaseScoreLevel(); - mLevelNumber++; - mLevelNumberText.setLevelNumber(mLevelNumber); - // Start the 'next level' animation after a short delay. - mDelayHandler.postDelayed(new Runnable() { - @Override - public void run() { - mLevelNumberText.startAnimation(mAnimationLevelScaleUp); - mEndLevelCircle.startAnimation(mAnimationScaleLevelDown); - setUpLevel(); - } - }, 750); - } - } - - private void exit() { - getActivity().finish(); - } - - private void resumeGame() { - mButtonPause.setVisibility(View.VISIBLE); - mButtonPlay.setVisibility(View.GONE); - mCountDownTimer = new GameCountdown(mTimeLeftInMillis, mCountDownInterval); - mCountDownTimer.start(); - mViewPauseOverlay.setVisibility(View.GONE); - mButtonCancelBar.setVisibility(View.GONE); - if (Utils.hasKitKat()) { - ImmersiveModeHelper.setImmersiveSticky(getActivity().getWindow()); - } - } - - /** - * CountDownTimer that handles the game timing logic of the memory match game. - */ - public class GameCountdown extends CountDownTimer { - - private Boolean animationStarted = false; - - public GameCountdown(long millisInFuture, long countDownInterval) { - super(millisInFuture, countDownInterval); - } - - @Override - public void onFinish() { - // When the countdown is over, end the game. - mTimerTextView.clearAnimation(); - animationStarted = false; - mTimerTextView.setTextColor(Color.WHITE); - mTimerTextView.setTypeface(Typeface.DEFAULT); - if (mViewPlayAgainBackground.getVisibility() != View.VISIBLE && !wasPaused) { - submitScore(MatchingGameConstants.LEADERBOARDS_MATCH, mMatchScore); - stopBackgroundMusic(); - - // Show the 'play again' screen. - mTextPlayAgainScore.setText(String.valueOf(mMatchScore)); - mViewPlayAgainBackground.startAnimation(mAnimationPlayAgainBackground); - mViewPlayAgainMain.startAnimation(mAnimationPlayAgainMain); - mViewPlayAgainBackground.setVisibility(View.VISIBLE); - mViewPlayAgainMain.setVisibility(View.VISIBLE); - mButtonMenu.setVisibility(View.VISIBLE); - setSignInButtonVisibility(true); - - mSoundPool.play(mSoundGameOver, .2f, .2f, 0, 0, 1.0f); - } - } - - @Override - public void onTick(long millisUntilFinished) { - - long seconds = TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished); - if (seconds >= 6) { - animationStarted = false; - mTimerTextView.clearAnimation(); - mTimerTextView.setTypeface(Typeface.DEFAULT); - mTimerTextView.setTextColor(Color.WHITE); - } else if (!animationStarted) { - // Start flashing the countdown time - animationStarted = true; - mTimerTextView.setTypeface(Typeface.DEFAULT_BOLD); - mTimerTextView.setTextColor(Color.RED); - mTimerTextView.clearAnimation(); - mTimerTextView.startAnimation(mAnimationTimerAlpha); - } - - // Update the displayed countdown time - mTimeLeftInMillis = millisUntilFinished; - mTimerTextView.setText( - String.format("%d:%02d", TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished), - seconds - TimeUnit.MINUTES.toSeconds( - TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished)))); - - } - - } - - /** - * Increases the current score when a match is found. - * The score is based on the current level. - */ - private void increaseScoreMatch() { - mSoundPool.play(mSoundMatchRight, 1, 1, 0, 0, 1.0f); - mMatchScore += (50 * (Math.pow(1.1, mLevelNumber - 1))); - mScoreText.setText(String.valueOf(mMatchScore)); - mTextPlayAgainScore.setText(String.valueOf(mMatchScore)); - } - - /** - * Increases the current score when advancing to the next level. - */ - private void increaseScoreLevel() { - mMatchScore += (500 * (Math.pow(1.1, mLevelNumber - 1))); - if (mLevelNumber > 2 && mWrongAnswers == 0) { - // Show an amazing bonus animation if this the player is particularly skillful ;) - mViewBonusSnowman.startAnimation(mAnimationSnowman); - } - mScoreText.setText(String.valueOf(mMatchScore)); - mTextPlayAgainScore.setText(String.valueOf(mMatchScore)); - } - - @Override - public void onAnimationEnd(Animation animation) { - // The game is clickable again now that the animation has ended - isClickable = true; - - if (animation == mAnimationScaleLevelDown) { - // After the scale level down animation, fade out the end level circle - mLevelNumberText.startAnimation(mAnimationLevelFadeOut); - mEndLevelCircle.startAnimation(mAnimationLevelFadeOut); - } else if (animation == mAnimationLevelFadeOut) { - // Hide the end level circle after the animation has finished - mEndLevelCircle.clearAnimation(); - mLevelNumberText.clearAnimation(); - mLevelNumberText.setVisibility(View.GONE); - mEndLevelCircle.setVisibility(View.GONE); - } else if (animation == mAnimationSetSnowman) { - mViewBonusSnowman.clearAnimation(); - mViewBonusSnowman.setVisibility(View.GONE); - } else if (animation == mAnimationCardCover) { - // Reset the state and animations of both cards after they have been hidden again - mHiddenCard1.clearAnimation(); - mHiddenCard2.clearAnimation(); - - mHiddenCard1.findViewById(R.id.card_pane_right).clearAnimation(); - mHiddenCard1.findViewById(R.id.card_pane_left).clearAnimation(); - mHiddenCard2.findViewById(R.id.card_pane_right).clearAnimation(); - mHiddenCard2.findViewById(R.id.card_pane_left).clearAnimation(); - mHiddenCard1.findViewById(R.id.card_pane_right).setVisibility(View.GONE); - mHiddenCard1.findViewById(R.id.card_pane_left).setVisibility(View.GONE); - mHiddenCard2.findViewById(R.id.card_pane_right).setVisibility(View.GONE); - mHiddenCard2.findViewById(R.id.card_pane_left).setVisibility(View.GONE); - mHiddenCard1.findViewById(R.id.card_cover).setBackgroundColor(Color.TRANSPARENT); - mHiddenCard2.findViewById(R.id.card_cover).setBackgroundColor(Color.TRANSPARENT); - mHiddenCard1.findViewById(R.id.card_cover).setVisibility(View.GONE); - mHiddenCard2.findViewById(R.id.card_cover).setVisibility(View.GONE); - } - } - - - @Override - public void onAnimationRepeat(Animation animation) { - } - - @Override - public void onAnimationStart(Animation animation) { - // Mark the game as not clickable when an animation is in progress - isClickable = false; - - // Mark the correct views as visible before the start of an animation. - if (animation == mAnimationScaleLevelDown) { - mEndLevelCircle.setVisibility(View.VISIBLE); - mLevelNumberText.setVisibility(View.VISIBLE); - } else if (animation == mAnimationPlayAgainBackground) { - mViewPlayAgainBackground.setVisibility(View.VISIBLE); - } else if (animation == mAnimationPlayAgainMain) { - mViewPlayAgainMain.setVisibility(View.VISIBLE); - setSignInButtonVisibility(true); - } else if (animation == mAnimationSetSnowman) { - mViewBonusSnowman.setVisibility(View.VISIBLE); - mViewBonusSnowman.postDelayed(new Runnable() { - - @Override - public void run() { - mSoundPool.play(mSoundBeep, .5f, .5f, 0, 0, 1.0f); - } - }, 800); - } - } - - - @Override - public void invalidateDrawable(Drawable who) { - } - - @Override - public void scheduleDrawable(Drawable who, Runnable what, long when) { - } - - @Override - public void unscheduleDrawable(Drawable who, Runnable what) { - } - - /** - * Pauses the game when the back key is pressed. - */ - public void onBackKeyPressed() { - if (mViewPlayAgainMain.getVisibility() == View.VISIBLE) { - exit(); - } else { - if (mButtonPause.getVisibility() != View.GONE) {// check if already handled - pauseGame(); - } else { - resumeGame(); - } - } - } - - private void pauseGame() { - mButtonPause.setVisibility(View.GONE); - mButtonPlay.setVisibility(View.VISIBLE); - if (mCountDownTimer != null) { - mCountDownTimer.cancel(); - } - mViewPauseOverlay.setVisibility(View.VISIBLE); - mButtonCancelBar.setVisibility(View.VISIBLE); - if (Utils.hasKitKat()) { - ImmersiveModeHelper.setImmersiveStickyWithActionBar(getActivity().getWindow()); - } - } - - /** - * Submit score to Play Games services and the leader board. - */ - private void submitScore(int resId, int score) { - PlayGamesActivity act = Utils.getPlayGamesActivity(this); - if (act != null) { - act.postSubmitScore(resId, score); - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/Logger.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/Logger.java deleted file mode 100644 index 60248d1e0..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/Logger.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.simpleengine; - -import android.util.Log; - -public class Logger { - - private static final String TAG = "seng"; - private static boolean debugEnabled = false; - - public static void enableDebugLog(boolean enable) { - debugEnabled = enable; - if (debugEnabled) { - d("Debug logs enabled."); - } - } - - public static void d(String msg) { - if (debugEnabled) { - Log.d(TAG, msg); - } - } - - public static void w(String msg) { - Log.w(TAG, "!!! WARNING: " + msg); - } - - public static void e(String msg) { - Log.e(TAG, "*** ERROR: " + msg); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/Scene.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/Scene.java deleted file mode 100644 index 6c00e5670..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/Scene.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.simpleengine; - -public class Scene { - - public void onScreenResized(int width, int height) { - } - - public void doStandbyFrame(float deltaT) { - } - - public void doFrame(float deltaT) { - } - - public void onInstall() { - } - - public void onUninstall() { - } - - public void onPointerDown(int pointerId, float x, float y) { - } - - public void onPointerMove(int pointerId, float x, float y, float deltaX, float deltaY) { - } - - public void onPointerUp(int pointerId, float x, float y) { - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/SceneManager.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/SceneManager.java deleted file mode 100644 index e4bf6ea2f..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/SceneManager.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.simpleengine; - -import android.app.Activity; -import android.content.Context; -import android.graphics.PointF; -import android.util.SparseArray; -import android.view.MotionEvent; - -import java.lang.ref.WeakReference; -import java.util.ArrayList; - -public class SceneManager { - - private static SceneManager instance = new SceneManager(); - private Renderer mRenderer = new Renderer(); - private SoundManager mSoundManager = null; - private Scene mCurScene = null; - private Scene mNewScene = null; - private long mLastFrameTime = -1; - private boolean mHasGL = false; - private Context mAppContext = null; - - // reference to Activity, if it's in the resumed state -- otherwise null - private WeakReference mActivity = new WeakReference(null); - private boolean mActivityResumed = false; - private boolean mActivityHasFocus = false; - - // queue of MotionEvents to process from the game thread - private ArrayList mMotionEventQueue = new ArrayList(32); - private ArrayList mMotionEventRecycle = new ArrayList(32); - - // this flag is raised by the UI thread when it adds something to mMotionEventQueue - // and lowered by the game thread when it processes the motion event queue. This flag - // should only be modified when mMotionEventQueue is locked; it can be read without - // locking. - private volatile boolean mCheckMotionEvents = false; - - // last x, y of pointer, keyed by pointer ID - private SparseArray mLastTouchCoords = new SparseArray(); - - // recycle bin of PointF objects - private ArrayList mPointRecycleBin = new ArrayList(); - - private SceneManager() { - } - - public static SceneManager getInstance() { - return instance; - } - - void onGLSurfaceCreated(Context ctx) { - mHasGL = true; - mAppContext = ctx.getApplicationContext(); - mRenderer.onGLSurfaceCreated(mAppContext); - if (mSoundManager == null) { - mSoundManager = new SoundManager(ctx); - } - } - - void onGLSurfaceChanged(int width, int height) { - mRenderer.onGLSurfaceChanged(width, height); - if (mCurScene != null) { - mCurScene.onScreenResized(width, height); - } - } - - private void installNewScene() { - if (mCurScene != null) { - mCurScene.onUninstall(); - mRenderer.reset(); - mSoundManager.reset(); - } - mCurScene = mNewScene; - mNewScene = null; - if (mCurScene != null) { - mCurScene.onInstall(); - mRenderer.startLoadingTexs(mAppContext); - } - } - - public void onPause() { - mActivityResumed = false; - if (mSoundManager != null) { - mSoundManager.pause(); - } - mActivity.clear(); - } - - public void onResume(Activity activity) { - mActivityResumed = true; - mActivity = new WeakReference(activity); - if (mSoundManager != null && mActivityHasFocus) { - mSoundManager.resume(); - } - } - - public Activity getActivity() { - return mActivity.get(); - } - - public void onFocusChanged(boolean focus) { - mActivityHasFocus = focus; - if (!focus) { - mSoundManager.pause(); - } else if (mActivityResumed && mSoundManager != null) { - mSoundManager.resume(); - } - } - - public boolean shouldBePlaying() { - return mActivityResumed && mActivityHasFocus; - } - - public Scene getCurrentScene() { - return mCurScene; - } - - void onDrawFrame() { - if (!mHasGL) { - Logger.w("Ignoring request to do frame without a GL surface."); - return; - } - if (mNewScene != null) { - installNewScene(); - } - if (mCurScene != null) { - if (mLastFrameTime < 0) { - mLastFrameTime = System.currentTimeMillis(); - } - float deltaT = (System.currentTimeMillis() - mLastFrameTime) * 0.001f; - mLastFrameTime = System.currentTimeMillis(); - if (mRenderer.prepareFrame() && mSoundManager.isReady()) { - mCurScene.doFrame(deltaT); - } else { - mCurScene.doStandbyFrame(deltaT); - } - } - mRenderer.doFrame(); - - // process touch events - if (mCheckMotionEvents) { - processMotionEvents(); - } - } - - public void enableDebugLog(boolean enable) { - Logger.enableDebugLog(enable); - } - - public void requestNewScene(Scene c) { - mNewScene = c; - } - - public boolean onTouchEvent(MotionEvent event) { - // we are running on the UI thread, so deliver the event to the queue, - // where the game thread will pick it up to process - synchronized (mMotionEventQueue) { - int action = event.getActionMasked(); - - // get updates about each pointer in the gesture - int i; - for (i = 0; i < event.getPointerCount(); i++) { - int pointerId = event.getPointerId(i); - float x = event.getX(i); - float y = event.getY(i); - - // figure out delta from last touch event - float deltaX = x - getLastTouchX(pointerId, x); - float deltaY = y - getLastTouchY(pointerId, y); - - // queue the motion event - queueMotionEvent(MotionEvent.ACTION_MOVE, pointerId, x, y, deltaX, deltaY); - - // update last touch coordinates - setLastTouchCoords(pointerId, x, y); - } - - // figure out if a pointer went up or down - int id; - PointF point; - switch (action) { - case MotionEvent.ACTION_UP: - case MotionEvent.ACTION_POINTER_UP: - id = event.getPointerId(event.getActionIndex()); - forgetLastTouchCoords(id); - queueMotionEvent(MotionEvent.ACTION_UP, id, event.getX(), event.getY(), - 0.0f, 0.0f); - break; - case MotionEvent.ACTION_DOWN: - case MotionEvent.ACTION_POINTER_DOWN: - id = event.getPointerId(event.getActionIndex()); - setLastTouchCoords(id, event.getX(), event.getY()); - queueMotionEvent(MotionEvent.ACTION_DOWN, id, event.getX(), event.getY(), - 0.0f, 0.0f); - break; - } - } - return true; - } - - private float getLastTouchX(int pointerId, float defaultX) { - PointF pt = mLastTouchCoords.get(pointerId, null); - return pt != null ? pt.x : defaultX; - } - - private float getLastTouchY(int pointerId, float defaultY) { - PointF pt = mLastTouchCoords.get(pointerId, null); - return pt != null ? pt.y : defaultY; - } - - private void setLastTouchCoords(int pointerId, float x, float y) { - PointF pt = mLastTouchCoords.get(pointerId, null); - if (pt == null) { - pt = allocPointF(); - } - pt.x = x; - pt.y = y; - mLastTouchCoords.put(pointerId, pt); - } - - private void forgetLastTouchCoords(int pointerId) { - PointF pt = mLastTouchCoords.get(pointerId, null); - if (pt != null) { - mLastTouchCoords.remove(pointerId); - recyclePointF(pt); - } - } - - private PointF allocPointF() { - if (mPointRecycleBin.size() > 0) { - PointF p = mPointRecycleBin.remove(mPointRecycleBin.size() - 1); - p.x = p.y = 0.0f; - return p; - } - return new PointF(); - } - - private void recyclePointF(PointF p) { - mPointRecycleBin.add(p); - } - - private void queueMotionEvent(int action, int pointerId, float screenX, float screenY, - float deltaX, float deltaY) { - OurMotionEvent e = mMotionEventRecycle.size() > 0 ? - mMotionEventRecycle.remove(mMotionEventRecycle.size() - 1) : - new OurMotionEvent(); - e.action = action; - e.pointerId = pointerId; - e.screenX = screenX; - e.screenY = screenY; - e.deltaX = deltaX; - e.deltaY = deltaY; - mMotionEventQueue.add(e); - mCheckMotionEvents = true; - } - - public Renderer getRenderer() { - return mRenderer; - } - - public SoundManager getSoundManager() { - return mSoundManager; - } - - ArrayList mTmpMotionEvent = new ArrayList(32); - - private void processMotionEvents() { - int i; - - // move array items to our temporary array so we can unlock the original - synchronized (mMotionEventQueue) { - for (i = 0; i < mMotionEventQueue.size(); i++) { - mTmpMotionEvent.add(mMotionEventQueue.get(i)); - } - mMotionEventQueue.clear(); - mCheckMotionEvents = false; - } - - // process the motion events - for (i = 0; i < mTmpMotionEvent.size(); i++) { - processMotionEvent(mTmpMotionEvent.get(i)); - } - - // recycle the objects - synchronized (mMotionEventQueue) { - for (i = 0; i < mTmpMotionEvent.size(); i++) { - mMotionEventRecycle.add(mTmpMotionEvent.get(i)); - } - mTmpMotionEvent.clear(); - } - } - - private void processMotionEvent(OurMotionEvent event) { - if (mCurScene == null) { - return; - } - - // convert the screen coordinates to our standard coordinate system - float x = mRenderer.convertScreenX(event.screenX); - float y = mRenderer.convertScreenY(event.screenY); - float deltaX = mRenderer.convertScreenDeltaX(event.deltaX); - float deltaY = mRenderer.convertScreenDeltaY(event.deltaY); - - switch (event.action) { - case MotionEvent.ACTION_DOWN: - mCurScene.onPointerDown(event.pointerId, x, y); - break; - case MotionEvent.ACTION_MOVE: - mCurScene.onPointerMove(event.pointerId, x, y, deltaX, deltaY); - break; - case MotionEvent.ACTION_UP: - mCurScene.onPointerUp(event.pointerId, x, y); - break; - } - } - - private class OurMotionEvent { - - int action; - int pointerId; - float screenX, screenY; - float deltaX, deltaY; - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/ShaderSource.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/ShaderSource.java deleted file mode 100644 index 3164753ce..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/ShaderSource.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.simpleengine; - -public class ShaderSource { - - private static final String COMMON_DECLS = - "precision mediump float; \n" + - "uniform mat4 u_Matrix; \n" + - "uniform vec4 u_Color; \n" + - "uniform float u_TintFactor; \n" + - "uniform sampler2D u_Sampler; \n " + - "varying vec4 v_Color; \n" + - "varying vec2 v_TexCoord; \n"; - - public static final String VERTEX_SHADER = COMMON_DECLS + - "attribute vec4 a_Position; \n" + - "attribute vec2 a_TexCoord; \n" + - "void main() \n" + - "{ \n" + - " v_Color = u_Color; \n" + - " v_TexCoord = a_TexCoord; \n" + - " gl_Position = u_Matrix * a_Position; \n" + - "} \n"; - - public static final String FRAG_SHADER = - COMMON_DECLS + - "void main() \n" + - "{ \n" + - " vec4 c = mix(texture2D(u_Sampler, v_TexCoord), u_Color, u_TintFactor);\n" + - " gl_FragColor = c;\n" + - "}\n"; -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/SoundManager.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/SoundManager.java deleted file mode 100644 index 39690ff85..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/SoundManager.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.simpleengine; - -import android.content.Context; -import android.content.res.AssetFileDescriptor; -import android.media.AudioManager; -import android.media.MediaPlayer; -import android.media.SoundPool; - -import java.io.IOException; - -public class SoundManager implements MediaPlayer.OnPreparedListener, - SoundPool.OnLoadCompleteListener { - - MediaPlayer mBgmMediaPlayer = null; - AssetFileDescriptor mBgmFileDescriptor = null; - boolean mBgmLoading = false; - Context mAppContext; - boolean mPaused = false; - boolean mWantBgm = true; - - SoundPool mSoundPool = null; - int mSoundsLoading = 0; // how many sounds are loading in the SoundPool - - static final int MAX_STREAMS = 4; - static final int STREAM_TYPE = AudioManager.STREAM_MUSIC; - static final int SRC_QUALITY = 0; - static final int DEFAULT_PRIORITY = 1; - static final float DEFAULT_VOLUME = 0.6f; - static final float DEFAULT_BGM_VOLUME = 0.5f; - - public SoundManager(Context ctx) { - mAppContext = ctx.getApplicationContext(); - mSoundPool = new SoundPool(MAX_STREAMS, STREAM_TYPE, SRC_QUALITY); - mSoundPool.setOnLoadCompleteListener(this); - } - - public void requestBackgroundMusic(String assetsFileName) { - try { - mBgmFileDescriptor = mAppContext.getAssets().openFd(assetsFileName); - mBgmMediaPlayer = new MediaPlayer(); - mBgmMediaPlayer.setDataSource(mBgmFileDescriptor.getFileDescriptor(), - mBgmFileDescriptor.getStartOffset(), - mBgmFileDescriptor.getDeclaredLength()); - mBgmMediaPlayer.setOnPreparedListener(this); - mBgmLoading = true; - mBgmMediaPlayer.prepareAsync(); - } catch (IOException ex) { - Logger.e("Error loading background music from asset file: " + assetsFileName); - ex.printStackTrace(); - return; - } - } - - public int requestSfx(int resId) { - mSoundsLoading++; - return mSoundPool.load(mAppContext, resId, DEFAULT_PRIORITY); - } - - public void playSfx(int soundId) { - mSoundPool.play(soundId, DEFAULT_VOLUME, DEFAULT_VOLUME, DEFAULT_PRIORITY, 0, 1.0f); - } - - @Override - public void onPrepared(MediaPlayer mp) { - if (mBgmFileDescriptor != null) { - try { - mBgmFileDescriptor.close(); - } catch (IOException ex) { - Logger.e("Error closing bgm file descriptor:"); - ex.printStackTrace(); - } - mBgmFileDescriptor = null; - } - mBgmLoading = false; - mBgmMediaPlayer.setVolume(DEFAULT_BGM_VOLUME, DEFAULT_BGM_VOLUME); - mBgmMediaPlayer.setLooping(true); - updateBgm(); - } - - public boolean isReady() { - return !mBgmLoading && mSoundsLoading <= 0; - } - - private void updateBgm() { - boolean shouldPlay = !mPaused && mWantBgm; - if (mBgmMediaPlayer != null) { - if (shouldPlay && !mBgmMediaPlayer.isPlaying()) { - mBgmMediaPlayer.start(); - } else if (!shouldPlay && mBgmMediaPlayer.isPlaying()) { - mBgmMediaPlayer.pause(); - } - } - } - - public void pause() { - mPaused = true; - updateBgm(); - } - - public void resume() { - mPaused = false; - updateBgm(); - } - - public void enableBgm(boolean enable) { - mWantBgm = enable; - updateBgm(); - } - - public void reset() { - if (mBgmMediaPlayer != null) { - if (mBgmMediaPlayer.isPlaying()) { - mBgmMediaPlayer.stop(); - } - mBgmMediaPlayer = null; - } - mBgmLoading = false; - mWantBgm = true; - } - - public void dispose() { - if (mBgmMediaPlayer != null && mBgmMediaPlayer.isPlaying()) { - mBgmMediaPlayer.stop(); - } - } - - @Override - public void onLoadComplete(SoundPool soundPool, int sampleId, int status) { - mSoundsLoading--; - if (status != 0) { - Logger.e("Error loading SFX into SoundPool, sample " + sampleId + - ", status " + status); - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/ui/Widget.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/ui/Widget.java deleted file mode 100644 index fdaa19ed4..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/games/simpleengine/ui/Widget.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.games.simpleengine.ui; - -public class Widget { - - public interface WidgetTriggerListener { - - public void onWidgetTriggered(int message); - } - - public void doFrame(float deltaT) { - } - - public void onPointerDown(int pointerId, float x, float y) { - } - - public void onPointerMove(int pointerId, float x, float y, float deltaX, float deltaY) { - } - - public void onPointerUp(int pointerId, float x, float y) { - } - - public void dispose() { - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/AbstractLaunch.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/AbstractLaunch.java deleted file mode 100644 index ed61974c4..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/AbstractLaunch.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import android.content.Context; -import android.content.Intent; -import android.content.res.Resources; -import android.view.View; -import android.widget.Toast; - -/** - * Partial implementation of a launch from the main village into a specific game or activity. All - * launches are visually illustrated with a marker and must be defined with color, a badge and some - * state that defines whether the marker is locked or available. - */ -public abstract class AbstractLaunch implements View.OnClickListener, - View.OnLongClickListener, VoiceAction.VoiceActionHandler { - - public static final int STATE_LOCKED = 0; - public static final int STATE_READY = 1; - public static final int STATE_DISABLED = 2; - public static final int STATE_FINISHED = 3; - public static final int STATE_HIDDEN = 4; - - private static final String TAG = "AbstractLaunch"; - - protected int mState = STATE_DISABLED; - protected StartupActivity.SantaContext mContext; - protected String mContentDescription; - protected MarkerView mMarker; - - // Marker-specific style properties - protected int mBadgeDrawable; - protected int mMarkerColor; - protected int mBadgePaddingLeft; - protected int mBadgePaddingTop; - protected int mBadgePaddingRight; - - /** - * Constructs a new launch (marker). - * - * @param context The application (Santa) context - * @param contentDescriptionId The name of the marker, used for accessibility - * @param badgeDrawable The resource ID of the badge to draw on the marker - * @param markerColor The resource ID of the color in which to fill the marker - * @param badgePaddingLeft The left-side padding of the marker badge from the edge of the - * marker - * @param badgePaddingTop The top-side padding of the marker badge from the edge of the - * marker - * @param badgePaddingRight The right-side padding of the marker badge from the edge of the - * marker - * @see com.google.android.apps.santatracker.launch.MarkerView#setBadgePadding(int, int, int) - */ - public AbstractLaunch(StartupActivity.SantaContext context, int contentDescriptionId, - int badgeDrawable, int markerColor, int badgePaddingLeft, - int badgePaddingTop, int badgePaddingRight) { - initialise(context, contentDescriptionId, badgeDrawable, markerColor, badgePaddingLeft, - badgePaddingTop, badgePaddingRight); - } - - protected void initialise(StartupActivity.SantaContext context, int contentDescriptionId, - int badgeDrawable, int markerColor, int badgePaddingLeft, - int badgePaddingTop, int badgePaddingRight) { - setContext(context); - mState = STATE_DISABLED; - mContentDescription = mContext.getResources().getString(contentDescriptionId); - mBadgeDrawable = badgeDrawable; - mMarkerColor = markerColor; - mBadgePaddingLeft = badgePaddingLeft; - mBadgePaddingTop = badgePaddingTop; - mBadgePaddingRight = badgePaddingRight; - } - - /** Sets the SantaContext. */ - public void setContext(StartupActivity.SantaContext context) { - mContext = context; - mState = STATE_DISABLED; - } - - /** Retrieves the underlying image of the marker. */ - public MarkerView getImage() { - return mMarker; - } - - /** - * Binds the image to the marker and sets up the visual properties. Used when the RecyclerView - * wishes to draw the marker. - */ - public void attachToView(MarkerView image) { - mMarker = image; - - Resources r = mContext.getContext().getResources(); - image.setDrawable(r.getDrawable(mBadgeDrawable)); - image.setColor(r.getColor(mMarkerColor)); - image.setBadgePadding(r.getDimensionPixelOffset(mBadgePaddingLeft), - r.getDimensionPixelOffset(mBadgePaddingTop), - r.getDimensionPixelOffset(mBadgePaddingRight)); - } - - /** Recycles the image when not on screen. */ - public void detachFromView() { - mMarker = null; - } - - /** Attaches events to the marker, updating the image based on the current state. */ - public void applyState() { - if (mMarker != null) { - mMarker.setOnClickListener(this); - mMarker.setOnLongClickListener(this); - mMarker.setContentDescription(mContentDescription); - setImage(mState); - } - } - - /** - * Updates the state of the image (e.g. locked). - * - * @param state One of {@code STATE_LOCKED, STATE_READY, STATE_DISABLED, STATE_FINISHED, - * STATE_HIDDEN} - */ - public void setState(int state) { - if (mState != state) { - mState = state; - applyState(); - } - } - - private void setImage(int state) { - mMarker.setVisibility(View.VISIBLE); - if (state == STATE_HIDDEN) { - // special case, only hide the image - mMarker.setVisibility(View.GONE); - } else { - mMarker.setLocked(false); - mMarker.setDisabled(false); - if (state == STATE_FINISHED || state == STATE_DISABLED) { - mMarker.setDisabled(true); - } else if (state == STATE_LOCKED) { - mMarker.setLocked(true); - } - mMarker.setVisibility(View.VISIBLE); - mMarker.invalidate(); - } - } - - /** - * Display a {@link android.widget.Toast} with a given string resource message. - */ - protected void notify(Context context, int stringId) { - Toast.makeText(context, context.getResources().getText(stringId), Toast.LENGTH_SHORT) - .show(); - } - - /** - * Display a {@link android.widget.Toast} with a given string resource message with additional - * string parameters. - * - * @see android.content.res.Resources#getString(int, Object...) - */ - protected void notify(Context context, int stringId, Object... args) { - Toast.makeText(context, context.getResources().getString(stringId, args), - Toast.LENGTH_SHORT) - .show(); - } - - /** Retrieves the current marker state. */ - public int getState() { - return mState; - } - - - /** - * Handles a voice action. Override if the implementation wishes to handle voice actions and - * return true if it has been or will be handled. - * - * @param intent Google Voice Actions intent. - * @return true if the action was handled or will be handled - */ - @Override - public boolean handleVoiceAction(Intent intent) { - return false; - } - - /** - * Determines if this marker is a game. Default is true, so override is only necessary if - * implementation is not a game. - * - * @return true if this launcher will launch a game, false otherwise. - */ - public boolean isGame() { - return true; - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchGumball.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchGumball.java deleted file mode 100644 index 94e1499fb..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchGumball.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.GumballActivity; - -import android.view.View; - -/** - * Launch the Gumball Tilt game. - */ -public class LaunchGumball extends AbstractLaunch { - - public LaunchGumball(StartupActivity.SantaContext context) { - super(context, R.string.gumball, R.drawable.marker_badge_gumball, R.color.SantaPurple, - R.dimen.markerGumballPadding, R.dimen.markerGumballPadding, - R.dimen.markerGumballPadding); - } - - static public int getId() { - return R.string.gumball; - } - - @Override - public void onClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - mContext.launchActivity(GumballActivity.class); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.gumball_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.gumball_locked); - break; - } - } - - @Override - public boolean onLongClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - notify(mContext.getContext(), R.string.gumball); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.gumball_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.gumball_locked); - break; - } - return true; - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchJetpack.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchJetpack.java deleted file mode 100644 index 1458e9e4f..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchJetpack.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.jetpack.JetpackActivity; - -import android.view.View; - -/** - * Launch the Elf Jetpack game. - */ -public class LaunchJetpack extends AbstractLaunch { - - public LaunchJetpack(StartupActivity.SantaContext context) { - super(context, R.string.elf_jetpack, R.drawable.marker_badge_jetpack, R.color.SantaOrange, - R.dimen.markerJetpackPaddingSides, R.dimen.markerJetpackPaddingTop, - R.dimen.markerJetpackPaddingSides); - } - - static public int getId() { - return R.string.elf_jetpack; - } - - @Override - public void onClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - mContext.launchActivity(JetpackActivity.class); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.elf_jetpack_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.elf_jetpack_locked); - break; - } - } - - @Override - public boolean onLongClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - notify(mContext.getContext(), R.string.elf_jetpack); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.elf_jetpack_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.elf_jetpack_locked); - break; - } - return true; - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchMemory.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchMemory.java deleted file mode 100644 index 9b473ed55..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchMemory.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.games.MemoryActivity; - -import android.view.View; - -/** - * Launch the Memory Match game. - */ -public class LaunchMemory extends AbstractLaunch { - - public LaunchMemory(StartupActivity.SantaContext context) { - super(context, R.string.memory, R.drawable.marker_badge_memory, R.color.SantaGreen, - R.dimen.markerMemoryPaddingSides, R.dimen.markerMemoryPaddingTop, - R.dimen.markerMemoryPaddingSides); - } - - static public int getId() { - return R.string.memory; - } - - @Override - public void onClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - mContext.launchActivity(MemoryActivity.class); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.memory_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.memory_locked); - break; - } - } - - @Override - public boolean onLongClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - notify(mContext.getContext(), R.string.memory); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.memory_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.memory_locked); - break; - } - return true; - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchSanta.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchSanta.java deleted file mode 100644 index b7e628d71..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchSanta.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.util.SantaLog; -import com.google.android.gms.actions.SearchIntents; - -import android.app.SearchManager; -import android.content.Intent; -import android.content.res.Resources; -import android.util.Log; -import android.view.View; -import android.widget.Toast; - -import java.util.Arrays; -import java.util.concurrent.Executor; - -/** - * Launch the Santa Tracker screen. - * This is only a place holder implementation that only displays a message when the tracker - * should be launched. - */ -public class LaunchSanta extends AbstractLaunch { - - protected static final String TAG = "LaunchSanta"; - - private SimpleCommandExecutor mExecutor = new SimpleCommandExecutor(); - - public LaunchSanta(StartupActivity.SantaContext context) { - super(context, R.string.track_santa, R.drawable.marker_badge_santa, R.color.SantaGreen, - R.dimen.markerBadgeDefaultPadding, R.dimen.markerBadgeDefaultPadding, - R.dimen.markerBadgeDefaultPadding); - } - - static public int getId() { - return R.string.track_santa; - } - - @Override - public void onClick(View v) { - mExecutor.cancelAll(); // touchscreen action cancels all pending voice commands - switch (mState) { - case STATE_READY: - // Launch Santa Tracker - Toast.makeText(mContext.getContext(), "Tracker would be launched here.", - Toast.LENGTH_SHORT).show(); - break; - case STATE_LOCKED: - // Tracker is still locked, waiting for 24th December - notify(mContext.getContext(), R.string.santa_locked); - break; - case STATE_FINISHED: - // Tracking is over, waiting for next year - notify(mContext.getContext(), R.string.santa_is_busy_preparing_for_next_year); - break; - case STATE_DISABLED: - default: - // Tracker is unavailable (insufficient data to launch tracker) - notify(mContext.getContext(), R.string.still_trying_to_reach_santa); - break; - } - } - - @Override - public boolean onLongClick(View v) { - switch (mState) { - case STATE_READY: - notify(mContext.getContext(), R.string.track_santa); - break; - case STATE_LOCKED: - notify(mContext.getContext(), R.string.santa_locked); - break; - case STATE_FINISHED: - notify(mContext.getContext(), R.string.santa_is_busy_preparing_for_next_year); - break; - case STATE_DISABLED: - default: - notify(mContext.getContext(), R.string.still_trying_to_reach_santa); - break; - } - return true; - } - - @Override - public boolean handleVoiceAction(Intent intent) { - String action = intent.getAction(); - if (SearchIntents.ACTION_SEARCH.equals(action)) { - String query = intent.getStringExtra(SearchManager.QUERY); - Log.d(TAG, String.format("Voice command: search for [%s] on Santa Tracker", query)); - if (isSupportedQuery(query)) { - handleVoiceSearchForSanta(); - // if we got here, the voice command syntax was OK - // so even though we may not actually pop the Santa map view, we'll - // report back that we handled (or at least tried to) the voice command - return true; - } - } - return false; - } - - - private void handleVoiceSearchForSanta() { - switch (mState) { - case STATE_READY: // highly unlikely to be ready upon the first invocation - SantaLog.d(TAG, "Got lucky. Launching SantaMapActivity."); - Toast.makeText(mContext.getContext(), "Hello, Santa!", Toast.LENGTH_SHORT).show(); - break; - case STATE_FINISHED: // FINISHED -> READY transition does happen with local API - case STATE_DISABLED: - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.contacting_santa); - scheduleVoiceCommand(); - break; - } - } - - private void scheduleVoiceCommand() { - Log.d(TAG, "Not ready. Scheduling for later."); - Runnable launchSantaMap = new Runnable() { - @Override - public void run() { - Log.d(TAG, "Launching SantaMapActivity."); - Toast.makeText(mContext.getContext(), "Hello, Santa!", Toast.LENGTH_SHORT).show(); - } - }; - mExecutor.execute(launchSantaMap); - } - - private boolean isSupportedQuery(String query) { - Resources res = mContext.getResources(); - String[] supportedQueries = res.getStringArray(R.array.voice_command_search_for); - return Arrays.asList(supportedQueries).contains(query.toLowerCase()); - } - - - @Override - public void setState(int state) { - super.setState(state); - SantaLog.v(TAG, String.format("setState to [%d]", state)); - // if the transition was into READY state, execute all pending commands - if (mState == STATE_READY) { - mExecutor.executeAll(); - } - } - - /** - * Queues up commands until explicit executeAll invocation. - * Currently max queue length is 1. - */ - static class SimpleCommandExecutor implements Executor { - - public static final int TIMEOUT_MS = 30 * 1000; // give up after 30 seconds - - private Runnable mPendingCommand; - - private long mTimeStamp; - - @Override - public void execute(Runnable command) { - synchronized (this) { - cancelAll(); - mPendingCommand = command; - mTimeStamp = System.currentTimeMillis(); - } - } - - public synchronized void cancelAll() { - mPendingCommand = null; - mTimeStamp = 0L; - } - - public synchronized void executeAll() { - if (mPendingCommand != null) { - if (System.currentTimeMillis() - mTimeStamp <= TIMEOUT_MS) { - mPendingCommand.run(); - } else { - Log.d(TAG, "Pending command timed out, ignoring."); - } - mPendingCommand = null; - mTimeStamp = 0L; - } - } - } - - @Override - public boolean isGame() { - return false; - } -} - diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchVideo.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchVideo.java deleted file mode 100644 index d7a83daef..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/LaunchVideo.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.util.Intents; - -import android.content.Intent; -import android.content.res.Resources; -import android.view.View; - -/** - * Launch a YouTube video. - */ -public class LaunchVideo extends AbstractLaunch { - - public static final String HIDDEN_VIDEO = "_disabled"; - - private final int mLockedDrawableId; - private final int mUnlockDate; - private String mVideoId; - - /** - * Constructs a video-launching marker. - * - * @param context The SantaContext - * @param lockedDrawableId The badge icon to use if this marker is locked (e.g. unlock date) - * @param colorId The resource ID of the color to fill the marker - * @param unlockDate The day in December to unlock this video (e.g. 05 for December 5) - */ - public LaunchVideo(StartupActivity.SantaContext context, int lockedDrawableId, int colorId, - int unlockDate) { - super(context, R.string.video, R.drawable.marker_badge_video, colorId, - R.dimen.markerVideoPaddingLeft, R.dimen.markerBadgeDefaultPadding, - R.dimen.markerVideoPaddingRight); - mLockedDrawableId = lockedDrawableId; - mUnlockDate = unlockDate; - } - - @Override - public void attachToView(MarkerView image) { - super.attachToView(image); - Resources r = mContext.getContext().getResources(); - if (mLockedDrawableId > 0) { - image.setLockedDrawable(r.getDrawable(mLockedDrawableId)); - } else { - image.setLockedDrawable(null); - } - } - - @Override - public void onClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - Intent intent = Intents.getYoutubeIntent(mContext.getContext(), mVideoId); - mContext.getContext().startActivity(intent); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.video_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.video_disabled, mUnlockDate); - break; - } - } - - @Override - public boolean onLongClick(View v) { - switch (mState) { - case STATE_READY: - case STATE_FINISHED: - notify(mContext.getContext(), R.string.video); - break; - case STATE_DISABLED: - notify(mContext.getContext(), R.string.video_disabled); - break; - case STATE_LOCKED: - default: - notify(mContext.getContext(), R.string.video_locked, mUnlockDate); - break; - } - return true; - } - - public void setVideo(String videoId, long unlockTime) { - if (HIDDEN_VIDEO.equals(videoId)) { - // video explicitly disabled - mVideoId = null; - setState(STATE_HIDDEN); - } else if (videoId != null && !videoId.isEmpty() && !videoId.equals("null")) { - // JSONObject.getString will coerce a null value into "null" - // valid-looking video ID - unlock regardless of time - mVideoId = videoId; - setState(STATE_READY); - } else if (System.currentTimeMillis() < unlockTime) { - // video not-yet unlocked - mVideoId = null; - setState(STATE_LOCKED); - } else { - // video ID null or not present and video should be unlocked - mVideoId = null; - setState(STATE_DISABLED); - } - } - - @Override - public boolean isGame() { - return false; - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/MarkerManager.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/MarkerManager.java deleted file mode 100644 index dfa9ca78f..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/MarkerManager.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.R; - -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -/** - * TODO(macd,jfschmakeit): add javadoc here. - */ -public class MarkerManager extends RecyclerView.Adapter { - - public static final int SANTA = 0; - public static final int VIDEO01 = 1; - public static final int GUMBALL = 2; - public static final int MEMORY = 3; - public static final int JETPACK = 4; - public static final int VIDEO15 = 5; - public static final int VIDEO23 = 6; - public static final int NUM_PINS = 7; - - private AbstractLaunch[] mLaunchers = new AbstractLaunch[NUM_PINS]; - private RecyclerView mRecyclerView; - private LinearLayoutManager mLayoutManager; - - public MarkerManager() { - } - - public void initialise(StartupActivity.SantaContext santaContext, - final RecyclerView recyclerView) { - // launcher pins - if (mLaunchers[SANTA] == null) { - mLaunchers[SANTA] = new LaunchSanta(santaContext); - mLaunchers[VIDEO01] = new LaunchVideo(santaContext, 0, R.color.SantaYellow, 1); - mLaunchers[GUMBALL] = new LaunchGumball(santaContext); - mLaunchers[MEMORY] = new LaunchMemory(santaContext); - mLaunchers[JETPACK] = new LaunchJetpack(santaContext); - mLaunchers[VIDEO15] = new LaunchVideo(santaContext, R.drawable.marker_badge_locked_15, - R.color.SantaGreen, 15); - mLaunchers[VIDEO23] = new LaunchVideo(santaContext, R.drawable.marker_badge_locked_23, - R.color.SantaOrange, 23); - } else { - // reset states only upon restart - for (int i = 0; i < mLaunchers.length; i++) { - mLaunchers[i].setContext(santaContext); - } - } - - mLayoutManager = new LinearLayoutManager(santaContext.getContext()); - mLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); - mRecyclerView = recyclerView; - mRecyclerView.setLayoutManager(mLayoutManager); - mRecyclerView.setAdapter(this); - mRecyclerView.setHasFixedSize(true); - mRecyclerView.setItemViewCacheSize(mLaunchers.length); - - mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() { - boolean mForward = true; - - @Override - public void onScrollStateChanged(RecyclerView recyclerView, int newState) { - if (newState == RecyclerView.SCROLL_STATE_IDLE) { - // Snap to show partial markers if two or more fit on screen - if (recyclerView.getWidth() >= recyclerView.getChildAt(0).getWidth() * 2) { - if (mForward) { - if (mLayoutManager.findLastVisibleItemPosition() != - mLayoutManager.findLastCompletelyVisibleItemPosition()) { - recyclerView.smoothScrollToPosition( - mLayoutManager.findLastVisibleItemPosition()); - } - } else { - if (mLayoutManager.findFirstVisibleItemPosition() != - mLayoutManager.findFirstCompletelyVisibleItemPosition()) { - recyclerView.smoothScrollToPosition( - mLayoutManager.findFirstVisibleItemPosition()); - } - } - } - } - } - - @Override - public void onScrolled(RecyclerView recyclerView, int dx, int dy) { - if (dx >= 0) { - mForward = true; - } else { - mForward = false; - } - } - }); - - // Start the scrollview one screen to the right and scroll back to show that the - // view is scrollable - mRecyclerView.post(new Runnable() { - @Override - public void run() { - // RecyclerView might be null if the screen is off (launch via Android Studio) - // and we need to check child count to ensure the LayoutManager doesnhas an internal - // OrientationHelper, otherwise we NPE here. - if (mRecyclerView != null && mRecyclerView.getChildCount() > 0) { - mRecyclerView - .scrollToPosition(mLayoutManager.findLastVisibleItemPosition() + 2); - mRecyclerView.postDelayed(new Runnable() { - @Override - public void run() { - mRecyclerView.smoothScrollToPosition(0); - } - }, 250); - } - } - }); - } - - public AbstractLaunch[] getLaunchers() { - return mLaunchers; - } - - public AbstractLaunch getLauncher(int markerId) { - return mLaunchers[markerId]; - } - - // Return the number of pins (invoked by the layout manager) - @Override - public int getItemCount() { - return mLaunchers.length; - } - - // Create new views (invoked by the layout manager) - @Override - public ViewHolder onCreateViewHolder(ViewGroup parent, - int viewType) { - // create a new view - View v = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.layout_village_markers, parent, false); - return new ViewHolder(v); - } - - // Replace the contents of a view (invoked by the layout manager) - @Override - public void onBindViewHolder(ViewHolder holder, int position) { - holder.mLauncher = mLaunchers[position]; - holder.mLauncher.attachToView(holder.mImage); - holder.mLauncher.applyState(); - } - - @Override - public void onViewRecycled(ViewHolder holder) { - super.onViewRecycled(holder); - holder.mLauncher.detachFromView(); - holder.mLauncher = null; - } - - // Provide a reference to the views for each data item - // Complex data items may need more than one view per item, and - // you provide access to all the views for a data item in a view holder - public static class ViewHolder extends RecyclerView.ViewHolder { - - // each data item is just a string in this case - public AbstractLaunch mLauncher; - public MarkerView mImage; - - public ViewHolder(View v) { - super(v); - mImage = (MarkerView) v.findViewById(R.id.marker); - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/MarkerView.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/MarkerView.java deleted file mode 100644 index 15dc88a2a..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/MarkerView.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.R; - -import android.content.Context; -import android.content.res.TypedArray; -import android.graphics.Bitmap; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.ColorFilter; -import android.graphics.ColorMatrix; -import android.graphics.ColorMatrixColorFilter; -import android.graphics.LightingColorFilter; -import android.graphics.Matrix; -import android.graphics.Paint; -import android.graphics.Path; -import android.graphics.Rect; -import android.graphics.RectF; -import android.graphics.drawable.BitmapDrawable; -import android.graphics.drawable.Drawable; -import android.os.Build; -import android.util.AttributeSet; -import android.widget.ImageView; - -import java.util.Random; - -/** - * Pin for the launcher. - * The outline of a pin is drawn programmatically based on the available size of this view. - */ -public class MarkerView extends ImageView { - - /** - * Lock icon. - */ - private static final Path LOCK = new Path(); - /** - * Marker pin outline. - */ - private static final Path MARKER = new Path(); - /** - * Fraction of marker width to use as lock diameter - */ - private static final float LOCK_FRACTION = 0.4f; - /** - * Colors available for markers. - */ - private static final int[] PALETTE = new int[]{R.color.SantaBlue, R.color.SantaBlueGreen, - R.color.SantaGreen, R.color.SantaOrange, R.color.SantaPink, R.color.SantaPurple, - R.color.SantaRed, R.color.SantaYellow}; - - /** - * Computed width/height ratio of a mrker, based on the available height and width. - */ - private static final float MARKER_RATIO; - /** - * Saturation level for the disabled state. - * - * @see #setDisabled(boolean) - * @see android.graphics.ColorMatrix#setSaturation(float) - */ - private static final float DISABLED_SATURATION = 0.1f; - - private static Paint sTouchedPaint = new Paint(); - private static Paint sLockPaint = new Paint(); - - private static RectF sBounds = new RectF(); - private static RectF sLockBounds = new RectF(); - - static { - MARKER.moveTo(46.700001f, 164.699997f); - MARKER.cubicTo(44.700001f, 164.699997f, 43.000000f, 163.099991f, 42.799999f, 161.199997f); - MARKER.cubicTo(36.900002f, 97.599998f, 0.000000f, 81.000000f, 0.000000f, 46.700001f); - MARKER.cubicTo(0.000000f, 20.900000f, 20.900000f, 0.000000f, 46.700001f, 0.000000f); - MARKER.cubicTo(72.500000f, 0.000000f, 93.400002f, 20.900000f, 93.400002f, 46.700001f); - MARKER.cubicTo(93.400002f, 81.000000f, 56.500000f, 97.699997f, 50.600002f, 161.199997f); - MARKER.cubicTo(50.400002f, 163.100006f, 48.700001f, 164.699997f, 46.700001f, 164.699997f); - MARKER.close(); - MARKER.computeBounds(sBounds, true); - - LOCK.moveTo(24.000000f, 13.200000f); - LOCK.rLineTo(0.000000f, -1.400000f); - LOCK.cubicTo(24.000000f, 7.900000f, 20.799999f, 4.700000f, 16.900000f, 4.700000f); - LOCK.cubicTo(13.000000f, 4.700000f, 9.799999f, 7.900001f, 9.799999f, 11.800000f); - LOCK.rLineTo(0.000000f, 1.400000f); - LOCK.lineTo(8.400000f, 13.200000f); - LOCK.rLineTo(0.000000f, 13.300000f); - LOCK.rLineTo(17.200001f, 0.000000f); - LOCK.lineTo(25.600000f, 13.200000f); - LOCK.lineTo(24.000000f, 13.200000f); - LOCK.close(); - LOCK.moveTo(24.000000f, 13.200000f); - LOCK.moveTo(12.100000f, 11.800000f); - LOCK.cubicTo(12.100000f, 9.200001f, 14.200001f, 7.000000f, 16.900002f, 7.000000f); - LOCK.cubicTo(19.500002f, 7.000000f, 21.700001f, 9.100000f, 21.700001f, 11.800000f); - LOCK.rLineTo(0.000000f, 1.400000f); - LOCK.rLineTo(-9.500000f, 0.000000f); - LOCK.lineTo(12.200001f, 11.800000f); - LOCK.close(); - LOCK.moveTo(12.100000f, 11.800000f); - LOCK.moveTo(18.500000f, 23.200001f); - LOCK.rLineTo(-3.000000f, 0.000000f); - LOCK.rLineTo(0.900000f, -3.700000f); - LOCK.cubicTo(15.700000f, 19.200001f, 15.099999f, 18.500000f, 15.099999f, 17.700001f); - LOCK.cubicTo(15.099999f, 16.700001f, 15.900000f, 15.800001f, 17.000000f, 15.800001f); - LOCK.cubicTo(18.000000f, 15.800001f, 18.900000f, 16.600000f, 18.900000f, 17.700001f); - LOCK.cubicTo(18.900000f, 18.500000f, 18.400000f, 19.200001f, 17.699999f, 19.400002f); - LOCK.lineTo(18.500000f, 23.200001f); - LOCK.close(); - LOCK.computeBounds(sLockBounds, true); - - MARKER_RATIO = sBounds.height() / sBounds.width(); - - sLockPaint.setColor(Color.WHITE); - sTouchedPaint.setColorFilter(new LightingColorFilter(Color.LTGRAY, 1)); - } - - /** - * Transformation matrix for drawing this marker. - */ - private Matrix mMatrix = new Matrix(); - - private Path mMarkerPath; - private Path mLockPath; - private Bitmap mBadgeBitmap; - private Bitmap mLockedBitmap; - private Paint mPaint = new Paint(); - private ColorFilter mPaintColorFilter; - private Paint mLockCirclePaint = new Paint(); - private Rect mBadgePadding; - private int mColor; - private boolean mLocked = false; - - public MarkerView(Context context) { - super(context); - } - - public MarkerView(Context context, AttributeSet attrs) { - super(context, attrs); - init(attrs); - } - - public MarkerView(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - init(attrs); - } - - public MarkerView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - init(attrs); - } - - public void setDrawable(Drawable drawable) { - mBadgeBitmap = drawableToBitmap(drawable); - } - - public void setLockedDrawable(Drawable lockedDrawable) { - mLockedBitmap = drawableToBitmap(lockedDrawable); - } - - public void setColor(int color) { - mColor = color; - mPaint.setColor(color); - mLockCirclePaint.setColor(color); - mLockCirclePaint.setColorFilter(new LightingColorFilter(Color.LTGRAY, 1)); - } - - public void setLocked(boolean locked) { - mLocked = locked; - } - - public void setDisabled(boolean disabled) { - if (disabled) { - mPaint.setColor(getResources().getColor(R.color.disabledMarker)); - ColorMatrix desatMatrix = new ColorMatrix(); - desatMatrix.setSaturation(DISABLED_SATURATION); - mPaintColorFilter = new ColorMatrixColorFilter(desatMatrix); - } else { - mPaint.setColor(mColor); - mPaintColorFilter = null; - } - } - - /** - * Sets the amount of padding to apply around the border of the badge. As the marker is an - * uneven shape, this value applies to the 'circular' (top) part of the marker, where the image - * is scaled to fit in the marker (sans left and right padding) and drawn offset from the top. - */ - public void setBadgePadding(int left, int top, int right) { - mBadgePadding = new Rect(left, top, right, 0); - } - - private void init(AttributeSet attrs) { - // Fix for invisible markers on ICS and JB devices - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) { - setLayerType(LAYER_TYPE_SOFTWARE, null); - } - - // set up the local artwork - mMarkerPath = new Path(MARKER); - mLockPath = new Path(LOCK); - - // process the XML attributes - TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.MarkerView); - - setDrawable(a.getDrawable(R.styleable.MarkerView_badge)); - setLockedDrawable(a.getDrawable(R.styleable.MarkerView_lockedBadge)); - - int defaultColor = getContext().getResources().getColor( - PALETTE[new Random().nextInt(PALETTE.length)]); - setColor(a.getColor(R.styleable.MarkerView_markerColor, defaultColor)); - - setBadgePadding(a.getDimensionPixelOffset(R.styleable.MarkerView_badgePaddingLeft, 0), - a.getDimensionPixelOffset(R.styleable.MarkerView_badgePaddingTop, 0), - a.getDimensionPixelOffset(R.styleable.MarkerView_badgePaddingRight, 0)); - } - - private static Bitmap drawableToBitmap(Drawable drawable) { - if (drawable == null) { - return null; - } - if (drawable instanceof BitmapDrawable) { - return ((BitmapDrawable) drawable).getBitmap(); - } - - Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), - drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); - Canvas canvas = new Canvas(bitmap); - drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); - drawable.draw(canvas); - - return bitmap; - } - - private float ratio; - private float lockRatio; - private float badgeRatio; - private int markerWidth; - private int markerCanvasDiff; - private Bitmap badge; - private Rect badgeRect = new Rect(); - private int badgeW; - private int badgeH; - private int radius; - private int cx; - private int cy; - private int lockX; - private int lockY; - - @Override - protected void onDraw(Canvas canvas) { - if (mBadgeBitmap == null) { - return; - } - - // scale the marker to fit the view - mMarkerPath.computeBounds(sBounds, true); - ratio = getHeight() / sBounds.height(); - mMatrix.setScale(ratio, ratio); - mMarkerPath.transform(mMatrix); - - // center the marker - mMarkerPath.computeBounds(sBounds, true); - markerWidth = (int) sBounds.width(); - markerCanvasDiff = 0; - if (getWidth() > markerWidth) { - markerCanvasDiff = getWidth() - markerWidth; - mMatrix.setTranslate(markerCanvasDiff / 2 - sBounds.left, 0); - mMarkerPath.transform(mMatrix); - } - - // draw the marker - if (this.isPressed() || this.isFocused()) { - mPaint.setColorFilter(sTouchedPaint.getColorFilter()); - } else { - mPaint.setColorFilter(mPaintColorFilter); - } - canvas.drawPath(mMarkerPath, mPaint); - - // calculate badge position relative to the marker - badge = (mLocked && mLockedBitmap != null) ? mLockedBitmap : mBadgeBitmap; - badgeRatio = (float) badge.getHeight() / badge.getWidth(); - badgeW = markerWidth - (mBadgePadding.left + mBadgePadding.right); - badgeH = (int) (badgeW * badgeRatio); - - badgeRect.left = (markerCanvasDiff / 2) + mBadgePadding.left; - badgeRect.top = mBadgePadding.top; - badgeRect.right = badgeRect.left + badgeW; - badgeRect.bottom = badgeRect.top + badgeH; - - // draw the badge - but only shade the badge if it's pressed and not disabled - if (mPaintColorFilter == null && (this.isPressed() || this.isFocused())) { - mPaint.setColorFilter(sTouchedPaint.getColorFilter()); - } else { - mPaint.setColorFilter(mPaintColorFilter); - } - canvas.drawBitmap(badge, null, badgeRect, mPaint); - - // draw the locked icon in the upper-right corner - if (mLocked) { - // draw the circle - radius = (int) (LOCK_FRACTION * markerWidth / 2); - cx = (markerCanvasDiff / 2) + markerWidth - (2 * radius); // top-left of circle - cy = 0; - canvas.drawCircle(cx + radius, cy + radius, radius, mLockCirclePaint); - - // size the lock - mLockPath.computeBounds(sLockBounds, true); - lockRatio = radius / sLockBounds.width(); - mMatrix.setScale(lockRatio, lockRatio); - mLockPath.transform(mMatrix); - - // position the lock - mLockPath.computeBounds(sLockBounds, true); - lockX = (int) (cx + radius - (sLockBounds.width() / 2)); - lockY = (int) (cy + radius - (sLockBounds.height() / 2)); - mMatrix.setTranslate(lockX - sLockBounds.left, lockY - sLockBounds.top); - mLockPath.transform(mMatrix); - - // draw the lock - canvas.drawPath(mLockPath, sLockPaint); - } - } - - // TODO - expand logic to support view too narrow for marker (i.e. top/bottom padded) - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - // Adjust the width to ensure a correct ratio - int height = getMeasuredHeight(); - int width = (int) (height / MARKER_RATIO); - setMeasuredDimension(width + getPaddingLeft() + getPaddingRight(), - height + getPaddingTop() + getPaddingBottom()); - - // Reset artwork - mMarkerPath = new Path(MARKER); - mLockPath = new Path(LOCK); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/StartupActivity.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/StartupActivity.java deleted file mode 100644 index 7be6a3e7b..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/StartupActivity.java +++ /dev/null @@ -1,689 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import com.google.android.apps.santatracker.util.AudioPlayer; -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.common.NotificationConstants; -import com.google.android.apps.santatracker.notification.SantaNotificationBuilder; -import com.google.android.apps.santatracker.util.AccessibilityUtil; -import com.google.android.apps.santatracker.util.AnalyticsManager; -import com.google.android.apps.santatracker.util.SantaLog; -import com.google.android.apps.santatracker.village.Village; -import com.google.android.apps.santatracker.village.VillageView; -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.GooglePlayServicesUtil; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.games.Games; -import com.google.example.games.basegameutils.GameHelper; - -import android.app.AlertDialog; -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.res.Resources; -import android.graphics.drawable.ColorDrawable; -import android.net.Uri; -import android.os.Bundle; -import android.os.Handler; -import android.support.v7.app.ActionBar; -import android.support.v7.app.ActionBarActivity; -import android.support.v7.widget.RecyclerView; -import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.Window; -import android.widget.Toast; - -/** - * Launch activity for the app. Handles loading of the village, the state of the markers (based on - * the date/time) and incoming voice intents. - */ -public class StartupActivity extends ActionBarActivity - implements GameHelper.GameHelperListener, View.OnClickListener, Village.VillageListener { - - protected static final String TAG = "SantaStart"; - private static final String VILLAGE_TAG = "VillageFragment"; - private static final String INTENT_HANDLED = "intent_handled"; - - private GameHelper mGameHelper; - private AudioPlayer mAudioPlayer; - - private boolean mResumed = false; - private boolean mSignedIn = false; - - private Village mVillage; - private VillageView mVillageView; - private SantaContext mSantaContext; - - private MarkerManager mMarkerManager; - private RecyclerView mMarkers; - - // Load these values from resources when an instance of this activity is initialised. - private static long OFFLINE_SANTA_DEPARTURE; - private static long OFFLINE_SANTA_FINALARRIVAL; - private static long UNLOCK_GUMBALL; - private static long UNLOCK_JETPACK; - private static long UNLOCK_MEMORY; - private static long UNLOCK_VIDEO_1; - private static long UNLOCK_VIDEO_15; - private static long UNLOCK_VIDEO_23; - - // Server controlled flags - private boolean mFlagDisableGumball = false; - private boolean mFlagDisableJetpack = false; - private boolean mFlagDisableMemory = false; - - private String[] mVideoList = new String[]{null, null, null}; - - - private boolean mHaveGooglePlayServices = false; - private long mFirstDeparture; - private long mFinalArrival; - - private MenuItem mMenuItemLegal; - - // Handler for scheduled UI updates - private Handler mHandler = new Handler(); - - // request code for games Activities - private final int RC_STARTUP = 1111; - private final int RC_GAMES = 9999; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); - setContentView(R.layout.activity_startup); - - loadResourceFields(getResources()); - - mAudioPlayer = new AudioPlayer(getApplicationContext()); - - ActionBar actionBar = getSupportActionBar(); - actionBar.setDisplayShowTitleEnabled(false); - actionBar.setHomeButtonEnabled(false); - actionBar.setDisplayHomeAsUpEnabled(false); - actionBar.setBackgroundDrawable(new ColorDrawable(android.R.color.transparent)); - - mSantaContext = new SantaContext(); - - mVillageView = (VillageView) findViewById(R.id.villageView); - mVillage = (Village) getSupportFragmentManager().findFragmentByTag(VILLAGE_TAG); - if (mVillage == null) { - mVillage = new Village(); - getSupportFragmentManager().beginTransaction().add(mVillage, VILLAGE_TAG).commit(); - } - - mMarkers = (RecyclerView) findViewById(R.id.markers); - mMarkerManager = new MarkerManager(); - - initialiseViews(); - - mHaveGooglePlayServices = checkGooglePlayServicesAvailable(); - - // initialize our connection to Google Play Games - mGameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES); - if (getResources().getBoolean(R.bool.debug_logs_enabled)) { - SantaLog.d("SantaTracker:GameHelper", "GameHelper debug logs are enabled."); - mGameHelper.enableDebugLog(true, "SantaTracker:GameHelper"); - } - // Max sign-in attempts of 0 forces BaseGameUtils into deferring sign-in until either a) the - // user signs in via a manual trigger or b) login, but only if the user has already signed - // in previously. - mGameHelper.setMaxAutoSignInAttempts(0); - mGameHelper.setup(this); - - // set up click listeners for our buttons - findViewById(R.id.button_show_achievements).setOnClickListener(this); - findViewById(R.id.button_show_leaderboards).setOnClickListener(this); - - // [ANALYTICS SCREEN]: Village - AnalyticsManager.sendScreenView(R.string.analytics_screen_village); - // set the initial states - resetLauncherStates(); - // See if it was a voice action which triggered this activity and handle it - onNewIntent(getIntent()); - } - - private void loadResourceFields(Resources res) { - final long ms = 1000L; - OFFLINE_SANTA_DEPARTURE = res.getInteger(R.integer.santa_takeoff) * ms; - OFFLINE_SANTA_FINALARRIVAL = res.getInteger(R.integer.santa_arrival) * ms; - mFinalArrival = OFFLINE_SANTA_FINALARRIVAL; - mFirstDeparture = OFFLINE_SANTA_DEPARTURE; - - // Game unlock - UNLOCK_GUMBALL = res.getInteger(R.integer.unlock_gumball) * ms; - UNLOCK_JETPACK = res.getInteger(R.integer.unlock_jetpack) * ms; - UNLOCK_MEMORY = res.getInteger(R.integer.unlock_memory) * ms; - - // Video unlock - UNLOCK_VIDEO_1 = res.getInteger(R.integer.unlock_video1) * ms; - UNLOCK_VIDEO_15 = res.getInteger(R.integer.unlock_video15) * ms; - UNLOCK_VIDEO_23 = res.getInteger(R.integer.unlock_video23) * ms; - } - - void initialiseViews() { - mVillageView.setVillage(mVillage); - mMarkerManager.initialise(mSantaContext, mMarkers); - } - - // see http://stackoverflow.com/questions/25884954/deep-linking-and-multiple-app-instances/ - @Override - protected void onNewIntent(Intent intent) { - setIntent(intent); - handleVoiceActions(); - - Bundle extras = intent.getExtras(); - if (extras != null - && extras.getString(NotificationConstants.KEY_NOTIFICATION_TYPE) != null) { - // [ANALYTICS EVENT]: Launch Notification - AnalyticsManager.sendEvent(R.string.analytics_event_category_launch, - R.string.analytics_launch_action_notification, - extras.getString(NotificationConstants.KEY_NOTIFICATION_TYPE)); - SantaLog.d(TAG, "launched from notification"); - } - } - - private void handleVoiceActions() { - Intent intent = getIntent(); - if (VoiceAction.isVoiceAction(intent)) { - if (isAlreadyHandled(intent)) { - Log.d(TAG, String.format("Ignoring an already handled intent [%s]", - intent.getAction())); - return; // already processed - } - boolean handled = false; - // check all the pins - AbstractLaunch[] pins = mMarkerManager.getLaunchers(); - // try sending the voice command to all launchers, the first one that handles it wins - for (AbstractLaunch l : pins) { - if (handled = l.handleVoiceAction(intent)) { - // [ANALYTICS EVENT]: Launch Voice - AnalyticsManager.sendEvent(R.string.analytics_event_category_launch, - R.string.analytics_launch_action_voice, - l.mContentDescription); - break; - } - } - if (!handled) { - Toast.makeText(this, getResources().getText(R.string.voice_command_unhandled), - Toast.LENGTH_SHORT) - .show(); - // [ANALYTICS EVENT]: Launch Voice Unhandled - AnalyticsManager.sendEvent(R.string.analytics_event_category_launch, - R.string.analytics_launch_action_voice, - R.string.analytics_launch_voice_unhandled); - } else { - setAlreadyHandled(intent); - } - } - } - - /** - * This method is responsible for handling a corner case. - * Upon orientation change, the Activity is re-created (onCreate is called) - * and the same intent is (re)delivered to the app. - * Fortunately the Intent is Parcelable so we can mark it and check for this condition. - * Without this, if the phone is in portrait mode, and the user issues voice command to - * start a game (or other forcing orientation change), the following happens: - * - * 1. com.google.android.apps.santatracker.PLAY_GAME is delivered to the app. - * 2. Game is started and phone switches to landscape. - * 3. User ends the game, rotates the phone back to portrait. - * 4. onCreate is called again since StartupActivity is re-created. - * 5. The voice action is re-executed - * (since getIntent returns com.google.android.apps.santatracker.PLAY_GAME). - * - * We don't want #5 to take place. - * - * @param intent current intent - */ - private void setAlreadyHandled(Intent intent) { - intent.putExtra(INTENT_HANDLED, true); - } - - /** - * Checks to see if the intent (voice command) has already been processed - * - * @param intent current intent (voice command) - * @return true if the intent (voice command) has already been processed - */ - private boolean isAlreadyHandled(Intent intent) { - return intent.getBooleanExtra(INTENT_HANDLED, false); - } - - @Override - protected void onResume() { - super.onResume(); - - mResumed = true; - } - - @Override - protected void onPause() { - super.onPause(); - mResumed = false; - mAudioPlayer.stopAll(); - - cancelUIUpdate(); - } - - @Override - protected void onStart() { - super.onStart(); - - mGameHelper.onStart(this); - initialiseViews(); - resetLauncherStates(); - } - - private void resetLauncherStates() { - // Start only if play services are available - if (mHaveGooglePlayServices) { - updateVillage(); - } else { - //TODO - } - } - - @Override - protected void onStop() { - super.onStop(); - mGameHelper.onStop(); - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - mGameHelper.onActivityResult(requestCode, resultCode, data); - } - - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - if (mResumed && hasFocus && !AccessibilityUtil.isTouchAccessiblityEnabled(this)) { - mAudioPlayer.playTrackExclusive(R.raw.village_music, true); - } - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu - getMenuInflater().inflate(R.menu.menu_startup, menu); - - mMenuItemLegal = menu.findItem(R.id.legal); - mMenuItemLegal.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem item) { - final Resources resources = getResources(); - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(StartupActivity.this); - dialogBuilder.setItems(resources.getStringArray(R.array.legal_privacy), - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int which) { - String url; - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder( - StartupActivity.this); - switch (which) { - case 1: - // Privacy - url = resources.getString(R.string.url_privacy); - break; - case 2: - // TOS - url = resources.getString(R.string.url_tos); - break; - case 3: - //Box 2D - dialog.dismiss(); - dialogBuilder.setMessage(R.string.jbox2d_license).create() - .show(); - dialogBuilder.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - dialog.dismiss(); - } - }); - return; - case 4: - // Show play services license text - dialog.dismiss(); - dialogBuilder.setMessage(GooglePlayServicesUtil - .getOpenSourceSoftwareLicenseInfo( - getApplicationContext())).create().show(); - dialogBuilder.setPositiveButton(android.R.string.ok, - new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, - int which) { - dialog.dismiss(); - } - }); - return; - case 0: - default: - url = resources.getString(R.string.url_legal); - break; - } - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); - } - }); - dialogBuilder.create().show(); - return true; - } - }); - - menu.findItem(R.id.open_help) - .setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - startActivity(new Intent(Intent.ACTION_VIEW, - Uri.parse(getString(R.string.url_help)))); - return true; - } - }); - - menu.findItem(R.id.sign_out) - .setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - mGameHelper.signOut(); - updateSignInState(false); - return true; - } - }); - - // For debugging and testing purposes, display notifications just as if they were scheduled - // to be displayed. - - // The take-off notification with a fixed message text. - menu.findItem(R.id.notification_takeoff) - .setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - SantaNotificationBuilder - .CreateSantaNotification(StartupActivity.this, - R.string.notification_takeoff); - return true; - } - }); - - // Info notification that contains a title, text and hardcoded image URL. - menu.findItem(R.id.notification_info) - .setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { - @Override - public boolean onMenuItemClick(MenuItem menuItem) { - SantaNotificationBuilder - .CreateInfoNotification(StartupActivity.this, "Title", "text", - "https://www.google.com/images/srpr/logo11w.png"); - return true; - } - }); - - return super.onCreateOptionsMenu(menu); - } - - @Override - protected boolean onPrepareOptionsPanel(View view, Menu menu) { - menu.findItem(R.id.sign_out).setVisible(mSignedIn); - return super.onPrepareOptionsPanel(view, menu); - } - - /** - * Update the UI elements on the village. - * This resets the navigation elements (pins), schedules another update once additional - * pins (un)lock and schedules the take-off notification. - */ - private void updateVillage() { - Log.d(TAG, "Santa is offline."); - - // Enable/disable pins - updateNavigation(); - - // Schedule UI Updates - scheduleUIUpdate(); - - // TODO: Set only one state here and remove references to timing - // Note that in the "no data" state, this may or may not include the TIME_OFFSET, depending - // on whether we've had a successful API call and still have the data. We can't use - // System.currentTimeMillis() as it *will* ignore TIME_OFFSET. - final long time = System.currentTimeMillis(); - - AbstractLaunch launchSanta = mMarkerManager.getLauncher(MarkerManager.SANTA); - - if (time < OFFLINE_SANTA_DEPARTURE) { - // Santa hasn't departed yet, show countdown - launchSanta.setState(AbstractLaunch.STATE_LOCKED); - final long notificationTime = OFFLINE_SANTA_DEPARTURE; - SantaNotificationBuilder - .ScheduleSantaNotification(getApplicationContext(), notificationTime, - NotificationConstants.NOTIFICATION_TAKEOFF); - - } else if (time >= OFFLINE_SANTA_DEPARTURE && time < OFFLINE_SANTA_FINALARRIVAL) { - // Santa should have already left, but no data yet, hide countdown and show message - launchSanta.setState(AbstractLaunch.STATE_DISABLED); - - } else { - // Post Christmas - launchSanta.setState(AbstractLaunch.STATE_FINISHED); - } - } - - /* - * Village Markers - */ - private void updateNavigation() { - // Games - mMarkerManager.getLauncher(MarkerManager.GUMBALL).setState( - getGamePinState(mFlagDisableGumball, UNLOCK_GUMBALL)); - mMarkerManager.getLauncher(MarkerManager.MEMORY).setState( - getGamePinState(mFlagDisableMemory, UNLOCK_MEMORY)); - mMarkerManager.getLauncher(MarkerManager.JETPACK) - .setState(getGamePinState(mFlagDisableJetpack, UNLOCK_JETPACK)); - - ((LaunchVideo) mMarkerManager.getLauncher(MarkerManager.VIDEO01)).setVideo( - mVideoList[0], UNLOCK_VIDEO_1); - ((LaunchVideo) mMarkerManager.getLauncher(MarkerManager.VIDEO15)).setVideo( - mVideoList[1], UNLOCK_VIDEO_15); - ((LaunchVideo) mMarkerManager.getLauncher(MarkerManager.VIDEO23)).setVideo( - mVideoList[2], UNLOCK_VIDEO_23); - - // reinitialise action bar - supportInvalidateOptionsMenu(); - } - - private int getGamePinState(boolean disabledFlag, long unlockTime) { - // TODO: update logic - if (disabledFlag) { - return AbstractLaunch.STATE_HIDDEN; - } else if (!disabledFlag && System.currentTimeMillis() < unlockTime) { - return AbstractLaunch.STATE_LOCKED; - } else { - return AbstractLaunch.STATE_READY; - } - } - - /* - * Scheduled UI update - */ - - /** - * Schedule a call to {@link #updateVillage()} at the next time at which - * the UI should be updated (games become available, Santa takes off, Santa is finished). - */ - private void scheduleUIUpdate() { - // cancel scheduled update - cancelUIUpdate(); - - final long delay = calculateNextUiUpdateDelay(); - if (delay > 0 && delay < Long.MAX_VALUE) { - // schedule if delay is in the future - mHandler.postDelayed(mUpdateUiRunnable, delay); - } - } - - private long calculateNextUiUpdateDelay() { - - final long time = System.currentTimeMillis(); - - final long departureDelay = mFirstDeparture - time; - final long arrivalDelay = mFinalArrival - time; - - // if disable flag is toggled, exclude from calculation - final long[] delays = new long[]{ - mFlagDisableGumball ? Long.MAX_VALUE : UNLOCK_GUMBALL - time, - mFlagDisableJetpack ? Long.MAX_VALUE : UNLOCK_JETPACK - time, - mFlagDisableMemory ? Long.MAX_VALUE : UNLOCK_MEMORY - time, - departureDelay, arrivalDelay}; - - // find lowest delay, but only count positive values or zero (ie. that are in the future) - long delay = Long.MAX_VALUE; - for (final long x : delays) { - if (x >= 0) { - delay = Math.min(delay, x); - } - } - - return delay; - } - - private void cancelUIUpdate() { - mHandler.removeCallbacksAndMessages(null); - } - - private Runnable mUpdateUiRunnable = new Runnable() { - @Override - public void run() { - updateVillage(); - } - }; - - - /* - * Google Play Services - from - * http://code.google.com/p/google-api-java-client/source/browse/tasks-android-sample/src/main/ - * java/com/google/api/services/samples/tasks/android/TasksSample.java?repo=samples - */ - - /** - * Check that Google Play services APK is installed and up to date. - */ - private boolean checkGooglePlayServicesAvailable() { - final int connectionStatusCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); - if (GooglePlayServicesUtil.isUserRecoverableError(connectionStatusCode)) { - showGooglePlayServicesAvailabilityErrorDialog(connectionStatusCode); - return false; - } - return (connectionStatusCode == ConnectionResult.SUCCESS); - } - - private void showGooglePlayServicesAvailabilityErrorDialog(final int connectionStatusCode) { - - Dialog dialog = GooglePlayServicesUtil.getErrorDialog(connectionStatusCode, this, 0); - dialog.show(); - dialog.setOnDismissListener(new Dialog.OnDismissListener() { - - public void onDismiss(DialogInterface dialog) { - finish(); - } - }); - - } - - private void updateSignInState(boolean signedIn) { - mSignedIn = signedIn; - findViewById(R.id.games_buttons).setVisibility(signedIn ? View.VISIBLE : View.INVISIBLE); - supportInvalidateOptionsMenu(); - } - - @Override - public void onSignInFailed() { - updateSignInState(false); - } - - @Override - public void onSignInSucceeded() { - updateSignInState(true); - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.button_show_achievements: - showAchievements(); - break; - case R.id.button_show_leaderboards: - showLeaderboards(); - break; - } - } - - private void showAchievements() { - GoogleApiClient apiClient = mGameHelper.getApiClient(); - if (apiClient != null && apiClient.isConnected()) { - startActivityForResult( - Games.Achievements.getAchievementsIntent(apiClient), - RC_GAMES); - } - } - - private void showLeaderboards() { - GoogleApiClient apiClient = mGameHelper.getApiClient(); - if (apiClient != null && apiClient.isConnected()) { - startActivityForResult( - Games.Leaderboards.getAllLeaderboardsIntent(apiClient), - RC_GAMES); - } - } - - @Override - public void playSoundOnce(int resSoundId) { - mAudioPlayer.playTrack(resSoundId, false); - } - - /** - * Context holder and convenience methods for AbstractLaunch objects. - */ - public class SantaContext { - - public Context getContext() { - return StartupActivity.this.getApplicationContext(); - } - - public Resources getResources() { - return StartupActivity.this.getResources(); - } - - // Launch the activity but do cleanup first. - public void launchActivity(Class clss) { - SantaNotificationBuilder.DismissNotifications(getApplicationContext()); - startActivityForResult(new Intent(getApplicationContext(), clss), RC_STARTUP); - } - - } - - protected void enableAnimation(boolean animate) { - mVillageView.enableAnimation(animate); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/VoiceAction.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/VoiceAction.java deleted file mode 100644 index efedaed1a..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/launch/VoiceAction.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.launch; - -import android.content.Intent; - -import com.google.android.gms.actions.SearchIntents; - -import java.util.Arrays; - -/** - * Support for Google Voice Actions - * See http://android-developers.blogspot.com/2014/10/the-fastest-route-between-voice-search.html - */ - -public class VoiceAction { - - private static final String[] SUPPORTED_ACTIONS = {SearchIntents.ACTION_SEARCH}; - - - public static boolean isVoiceAction(Intent intent) { - return Arrays.asList(SUPPORTED_ACTIONS).contains(intent.getAction()); - } - - public interface VoiceActionHandler { - - /** - * Callback method for handling voice actions - * - * @param intent Google Voice Action intent. - * @return true if the action was handled or will be handled - */ - boolean handleVoiceAction(Intent intent); - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/notification/NotificationBroadcastReceiver.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/notification/NotificationBroadcastReceiver.java deleted file mode 100644 index a0bccf0a2..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/notification/NotificationBroadcastReceiver.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.notification; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.common.NotificationConstants; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -/** - * Receiver that displays a notification. - * Notifications are defined from constants in - * {@link com.google.android.apps.santatracker.common.NotificationConstants}. - */ -public class NotificationBroadcastReceiver extends BroadcastReceiver { - - private static final String TAG = "NotificationBroadcastReceiver"; - - /** - * Display the notification encoded within the {@link Intent}. - */ - @Override - public void onReceive(Context context, Intent intent) { - int type = intent.getIntExtra(NotificationConstants.KEY_NOTIFICATION_TYPE, -1); - - switch (type) { - case NotificationConstants.NOTIFICATION_TAKEOFF: - SantaNotificationBuilder - .CreateSantaNotification(context, R.string.notification_takeoff); - break; - case NotificationConstants.NOTIFICATION_INFO: - processFactNotification(context, intent); - break; - } - } - - /** - * Displays a 'fact' notification (fact or status with an optional image) encoded within the - * Intent. - * - * @see com.google.android.apps.santatracker.common.NotificationConstants - */ - private void processFactNotification(Context context, Intent intent) { - final long finalArrival = intent.getLongExtra(NotificationConstants.KEY_FINAL_ARRIVAL, 0); - final long timestamp = intent.getLongExtra(NotificationConstants.KEY_TIMESTAMP, 0); - - // Sanity check to make sure Santa is still travelling - if (timestamp > finalArrival) { - return; - } - - final String didyouknow = intent.getStringExtra(NotificationConstants.KEY_FACT); - final String imageUrl = intent.getStringExtra(NotificationConstants.KEY_IMAGEURL); - final String status = intent.getStringExtra(NotificationConstants.KEY_STATUS); - - String title; - String text; - if (didyouknow != null) { - title = context.getString(R.string.did_you_know); - text = didyouknow; - } else { - title = context.getString(R.string.update_from_santa); - text = status; - } - // Schedule the next notification - SantaNotificationBuilder.CreateInfoNotification(context, title, text, imageUrl); - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/notification/SantaNotificationBuilder.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/notification/SantaNotificationBuilder.java deleted file mode 100644 index 5c2da1cdd..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/notification/SantaNotificationBuilder.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.notification; - -import com.google.android.apps.santatracker.R; -import com.google.android.apps.santatracker.common.NotificationConstants; -import com.google.android.apps.santatracker.launch.StartupActivity; -import com.google.android.apps.santatracker.util.LruImageCache; - -import com.android.volley.RequestQueue; -import com.android.volley.VolleyError; -import com.android.volley.toolbox.ImageLoader; -import com.android.volley.toolbox.Volley; - -import android.app.AlarmManager; -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.content.res.Resources; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; -import android.support.v4.app.TaskStackBuilder; - -/** - * Helper methods to create notifications. - */ -public abstract class SantaNotificationBuilder { - - // private static final String TAG = "SantaNotificationBuilder"; - - /** - * Construct a generic Santa notification with a headline title. - */ - private static Notification GetNotification(Context c, int headline) { - Resources r = c.getResources(); - - // Add the wearable extender with a different notification background - Bitmap largeIcon = BitmapFactory.decodeResource(r, - R.drawable.santa_notification_background); - NotificationCompat.WearableExtender wearableExtender = - new NotificationCompat.WearableExtender() - .setHintHideIcon(false) - .setBackground(largeIcon); - - NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(c) - .setSmallIcon(R.drawable.notification_small) - .setColor(c.getResources().getColor(R.color.brandSantaTracker)) - .setAutoCancel(true) - .setContentTitle(r.getString(headline)) - .setContentText(r.getString(R.string.track_santa)) - .extend(wearableExtender); - - // Add the type of notification for wearable to app tracking of clicks - Intent i = new Intent(c, StartupActivity.class); - i.putExtra(NotificationConstants.KEY_NOTIFICATION_TYPE, NotificationConstants.TAKEOFF_PATH); - - // Add the intent to open the main startup activity when clicked - TaskStackBuilder stackBuilder = TaskStackBuilder.create(c); - stackBuilder.addParentStack(StartupActivity.class); - stackBuilder.addNextIntent(i); - PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, - PendingIntent.FLAG_UPDATE_CURRENT); - mBuilder.setContentIntent(resultPendingIntent); - - return mBuilder.build(); - } - - /** - * Display a generic Santa notification with content loaded from a string resource. - */ - public static void CreateSantaNotification(Context c, int content) { - Notification n = GetNotification(c, content); - - //Post the notification. - NotificationManagerCompat.from(c) - .notify(NotificationConstants.NOTIFICATION_ID, n); - } - - - /** - * Display an info notification with an optional photo loaded from a URL. - */ - public static void CreateInfoNotification(final Context c, final String title, - final String text, - final String photoUrl) { - - if (photoUrl != null) { - // Load the photo through the Volley library - RequestQueue requestQueue = Volley.newRequestQueue(c); - requestQueue.start(); - ImageLoader imageLoader = new ImageLoader(requestQueue, new LruImageCache()); - // Wait until the photo has been loaded to display the notification - imageLoader.get(photoUrl, new ImageLoader.ImageListener() { - @Override - public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) { - CreateInfoNotificationWithBitmap(c, title, text, response.getBitmap()); - } - - @Override - public void onErrorResponse(VolleyError error) { - CreateInfoNotificationWithBitmap(c, title, text, null); - } - }); - } else { - CreateInfoNotificationWithBitmap(c, title, text, null); - } - } - - /** - * Display a notification with a bitmap as the background for Wear. - * If no bitmap is set, the default Santa notification background is shown instead. - */ - private static void CreateInfoNotificationWithBitmap(Context c, String title, String text, - Bitmap photo) { - - Resources r = c.getResources(); - Bitmap largeIcon = BitmapFactory.decodeResource(r, - R.drawable.santa_info_notification_background); - NotificationCompat.WearableExtender wearableExtender = - new NotificationCompat.WearableExtender() - .setHintHideIcon(false) - .setBackground(largeIcon); - - if (photo != null) { - // Set the bitmap as a background for Wear - NotificationCompat.Builder page = new NotificationCompat.Builder(c) - .setSmallIcon(R.drawable.notification_small) - .setContentText(text) - .extend(new NotificationCompat.WearableExtender().setBackground(photo)); - wearableExtender.addPage(page.build()); - } - - // Make main notification - NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(c) - .setSmallIcon(R.drawable.notification_small) - .setColor(c.getResources().getColor(R.color.brandSantaTrackerDark)) - .setLargeIcon(largeIcon) - .setAutoCancel(true) - .setContentTitle(title) - .extend(wearableExtender); - - if (photo == null) { - mBuilder.setContentText(text); - } - - Intent i = new Intent(c, StartupActivity.class); - i.putExtra(NotificationConstants.KEY_NOTIFICATION_TYPE, NotificationConstants.KEY_LOCATION); - - // Add Intent to open main startup activity (or return to it if the app is already open.) - TaskStackBuilder stackBuilder = TaskStackBuilder.create(c); - stackBuilder.addParentStack(StartupActivity.class); - stackBuilder.addNextIntent(i); - PendingIntent resultPendingIntent = stackBuilder.getPendingIntent(0, - PendingIntent.FLAG_UPDATE_CURRENT); - mBuilder.setContentIntent(resultPendingIntent); - - Notification n = mBuilder.build(); - - // Fire off the notification - NotificationManager mNotificationManager = (NotificationManager) c - .getSystemService(Context.NOTIFICATION_SERVICE); - mNotificationManager.notify(NotificationConstants.NOTIFICATION_ID, n); - } - - /** - * Dismiss all notifications. - */ - public static void DismissNotifications(Context c) { - NotificationManager mNotificationManager = (NotificationManager) c - .getSystemService(Context.NOTIFICATION_SERVICE); - mNotificationManager.cancelAll(); - } - - /** - * Schedule a basic notification at an approximate time. - */ - public static void ScheduleSantaNotification(Context c, long timestamp, int notificationType) { - - // Only schedule a notification if the time is in the future - if (timestamp < System.currentTimeMillis()) { - return; - } - - AlarmManager alarm = (AlarmManager) c - .getSystemService(Context.ALARM_SERVICE); - - Intent i = new Intent(c, NotificationBroadcastReceiver.class); - i.putExtra(NotificationConstants.KEY_NOTIFICATION_ID, - NotificationConstants.NOTIFICATION_ID); - - // Type is "takeoff", "location", etc. - i.putExtra(NotificationConstants.KEY_NOTIFICATION_TYPE, notificationType); - - // Generate unique pending intent - PendingIntent pi = PendingIntent.getBroadcast(c, notificationType, i, 0); - - // Deliver next time the device is woken up - alarm.set(AlarmManager.RTC, timestamp, pi); - - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/AccessibilityUtil.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/AccessibilityUtil.java deleted file mode 100644 index e86793414..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/AccessibilityUtil.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.util; - - -import android.content.Context; -import android.support.v4.view.accessibility.AccessibilityEventCompat; -import android.view.View; -import android.view.accessibility.AccessibilityEvent; -import android.view.accessibility.AccessibilityManager; - -/** - * Utility methods for accessibility support. - */ -public abstract class AccessibilityUtil { - - /** - * Return true if the accessibility service or touch exploration are enabled. - */ - public static boolean isTouchAccessiblityEnabled(Context context) { - AccessibilityManager am = (AccessibilityManager) context - .getSystemService(Context.ACCESSIBILITY_SERVICE); - boolean isAccessibilityEnabled = am.isEnabled(); - boolean isTouchExplorationEnabled = am.isTouchExplorationEnabled(); - return isAccessibilityEnabled || isTouchExplorationEnabled; - } - - /** - * Announce text through the AccessibilityManager for a view. - * - * @param text - * @param view - * @param manager - */ - public static void announceText(String text, View view, AccessibilityManager manager) { - // Only announce text if the accessibility service is enabled - if (!manager.isEnabled()) { - return; - } - AccessibilityEvent event = AccessibilityEvent - .obtain(AccessibilityEventCompat.TYPE_ANNOUNCEMENT); - event.getText().add(text); - event.setEnabled(true); - // Tie the event to the view - event.setClassName(view.getClass().getName()); - event.setPackageName(view.getContext().getPackageName()); - AccessibilityEventCompat.asRecord(event).setSource(view); - - // Send the announcement - manager.sendAccessibilityEvent(event); - - } - -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/AudioPlayer.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/AudioPlayer.java deleted file mode 100644 index edc4a361b..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/AudioPlayer.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.util; - -import android.content.Context; -import android.media.MediaPlayer; -import android.media.MediaPlayer.OnCompletionListener; -import android.media.MediaPlayer.OnPreparedListener; -import android.util.SparseArray; - -/** - * Handle audio playback, including repeats, stopping and muting of multiple streams. - */ -public class AudioPlayer { - - private Context mContext; - - private SparseArray mStreams; - - private boolean mMuted = false; - - /** - * Volume for all media playback. - */ - private static float VOLUME_MULTIPLIER = 0.25f; - - public AudioPlayer(Context context) { - mContext = context; - mStreams = new SparseArray<>(); - this.mMuted = false; - } - - /** - * Play a sound identified by a resource ID. - * - * @param resId Resource ID of sound to play - * @param loop If set, the track is repeated indefinitely. - */ - public void playTrack(final int resId, final boolean loop) { - MediaPlayer mediaPlayer = MediaPlayer.create(mContext, resId); - mStreams.put(resId, mediaPlayer); - mediaPlayer.setLooping(loop); - mediaPlayer.setOnPreparedListener(new OnPreparedListener() { - public void onPrepared(MediaPlayer mp) { - startMedia(mp); - } - }); - mediaPlayer.setOnCompletionListener(new OnCompletionListener() { - public void onCompletion(MediaPlayer mp) { - if (!mp.isLooping()) { - mStreams.remove(resId); - } - } - }); - } - - /** - * Mute all audio streams and only play this sound. - * - * @see #playTrack(int, boolean) - */ - public void playTrackExclusive(final int resId, final boolean loop) { - boolean restart = false; - MediaPlayer mp = mStreams.get(resId); - try { - if (mp == null || !mp.isPlaying()) { - restart = true; - } - } catch (IllegalStateException e) { - // Media player was not initialised or was released - restart = true; - } - - if (restart) { - stopAll(); - playTrack(resId, loop); - } - } - - /** - * Initialise the volume and start the MediaPlayer. - */ - private void startMedia(MediaPlayer mp) { - if (mMuted) { - mp.setVolume(0f, 0f); - } else { - mp.setVolume(VOLUME_MULTIPLIER, VOLUME_MULTIPLIER); - } - mp.start(); - } - - public void stop(int resId) { - MediaPlayer mp = mStreams.get(resId); - if (mp != null) { - mp.stop(); - mp.release(); - mStreams.remove(resId); - } - } - - public void muteAll() { - mMuted = true; - for (int i = 0; i < mStreams.size(); i++) { - mStreams.valueAt(i).setVolume(0f, 0f); - } - } - - public void unMuteAll() { - mMuted = false; - for (int i = 0; i < mStreams.size(); i++) { - mStreams.valueAt(i).setVolume(VOLUME_MULTIPLIER, VOLUME_MULTIPLIER); - } - } - - public void pauseAll() { - for (int i = 0; i < mStreams.size(); i++) { - mStreams.valueAt(i).pause(); - } - } - - public void resumeAll() { - for (int i = 0; i < mStreams.size(); i++) { - startMedia(mStreams.valueAt(i)); - } - } - - public void stopAll() { - // Stop all audio - for (int i = 0; i < mStreams.size(); i++) { - MediaPlayer mp = mStreams.valueAt(i); - mp.release(); - mStreams.removeAt(i); - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/Intents.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/Intents.java deleted file mode 100644 index 9444182ea..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/Intents.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.util; - -import android.content.Context; -import android.content.Intent; -import android.content.pm.ResolveInfo; -import android.net.Uri; - -import java.util.List; - -/** - * Utility methods for Intents. - */ -public class Intents { - - /** - * URL for YouTube video IDs. - */ - private static final String VIDEO_URL = "https://www.youtube.com/watch?v=%s"; - - /** - * Constructs an Intent that plays back a YouTube video. - * If the YouTube app is installed, the video will be played back directly in full screen - * mode. - * if the YouTube app is not available (e.g. not installed or disabled), the video is launched - * in a browser instead. - * - * @param context - * @param videoId YouTube Video id. - * @return - */ - public static Intent getYoutubeIntent(Context context, String videoId) { - Intent intent = new Intent(Intent.ACTION_VIEW, - Uri.parse("vnd.youtube://" + videoId)); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra("force_fullscreen", true); - - List resolvers = context.getPackageManager().queryIntentActivities(intent, 0); - if (resolvers != null && resolvers.size() > 0) { - // Devices with YouTube installed will get the native full-screen player - return intent; - } else { - // If YouTube is not available, load open the video in the browser - intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(VIDEO_URL, videoId))); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - return intent; - } - } -} diff --git a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/LruImageCache.java b/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/LruImageCache.java deleted file mode 100644 index 638f1c47b..000000000 --- a/app/santa-tracker/src/main/java/com/google/android/apps/santatracker/util/LruImageCache.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2015 Google Inc. All Rights Reserved. - * - * 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. - */ - -package com.google.android.apps.santatracker.util; - -import android.graphics.Bitmap; -import android.support.v4.util.LruCache; - -import com.android.volley.toolbox.ImageLoader; - -/** - * LRU cache implementation of a Volley library image cache. - */ -public class LruImageCache implements ImageLoader.ImageCache { - - private LruCache mMemoryCache; - - public LruImageCache() { - // Naive calculation of available memory: Use 1/8th of memory for cache - int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024); - int cacheSize = maxMemory / 8; - mMemoryCache = new LruCache(cacheSize) { - @Override - protected int sizeOf(String key, Bitmap bitmap) { - return bitmap.getByteCount() / 1024; - } - }; - } - - @Override - public Bitmap getBitmap(String url) { - return mMemoryCache.get(url); - } - - @Override - public void putBitmap(String url, Bitmap bitmap) { - mMemoryCache.put(url, bitmap); - } - -} diff --git a/app/santa-tracker/src/main/lint.xml b/app/santa-tracker/src/main/lint.xml deleted file mode 100644 index 48dc66d01..000000000 --- a/app/santa-tracker/src/main/lint.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/proguard-project.txt b/app/santa-tracker/src/main/proguard-project.txt deleted file mode 100644 index f2fe1559a..000000000 --- a/app/santa-tracker/src/main/proguard-project.txt +++ /dev/null @@ -1,20 +0,0 @@ -# To enable ProGuard in your project, edit project.properties -# to define the proguard.config property as described in that file. -# -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in ${sdk.dir}/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the ProGuard -# include property in project.properties. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/app/santa-tracker/src/main/res/anim/card_answer_flash.xml b/app/santa-tracker/src/main/res/anim/card_answer_flash.xml deleted file mode 100644 index 27b46f7aa..000000000 --- a/app/santa-tracker/src/main/res/anim/card_answer_flash.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/fade_in_dash.xml b/app/santa-tracker/src/main/res/anim/fade_in_dash.xml deleted file mode 100644 index a9fb83e4b..000000000 --- a/app/santa-tracker/src/main/res/anim/fade_in_dash.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/fade_out_dash.xml b/app/santa-tracker/src/main/res/anim/fade_out_dash.xml deleted file mode 100644 index abdf64b42..000000000 --- a/app/santa-tracker/src/main/res/anim/fade_out_dash.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/left_pane_slide_out.xml b/app/santa-tracker/src/main/res/anim/left_pane_slide_out.xml deleted file mode 100644 index fa61384a0..000000000 --- a/app/santa-tracker/src/main/res/anim/left_pane_slide_out.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/level_fade_out_anim.xml b/app/santa-tracker/src/main/res/anim/level_fade_out_anim.xml deleted file mode 100644 index 9a043fd16..000000000 --- a/app/santa-tracker/src/main/res/anim/level_fade_out_anim.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/play_again_bkgrd_anim.xml b/app/santa-tracker/src/main/res/anim/play_again_bkgrd_anim.xml deleted file mode 100644 index 42af9e146..000000000 --- a/app/santa-tracker/src/main/res/anim/play_again_bkgrd_anim.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/app/santa-tracker/src/main/res/anim/play_again_main_anim.xml b/app/santa-tracker/src/main/res/anim/play_again_main_anim.xml deleted file mode 100644 index 07ddcb75c..000000000 --- a/app/santa-tracker/src/main/res/anim/play_again_main_anim.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/app/santa-tracker/src/main/res/anim/right_pane_slide_in.xml b/app/santa-tracker/src/main/res/anim/right_pane_slide_in.xml deleted file mode 100644 index 2d05c8ae2..000000000 --- a/app/santa-tracker/src/main/res/anim/right_pane_slide_in.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/scale_level_anim_down.xml b/app/santa-tracker/src/main/res/anim/scale_level_anim_down.xml deleted file mode 100644 index af28635d3..000000000 --- a/app/santa-tracker/src/main/res/anim/scale_level_anim_down.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/scale_up_level_anim.xml b/app/santa-tracker/src/main/res/anim/scale_up_level_anim.xml deleted file mode 100644 index 1b6b1d2d7..000000000 --- a/app/santa-tracker/src/main/res/anim/scale_up_level_anim.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/slide_in_bottom.xml b/app/santa-tracker/src/main/res/anim/slide_in_bottom.xml deleted file mode 100644 index cf607e93b..000000000 --- a/app/santa-tracker/src/main/res/anim/slide_in_bottom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - diff --git a/app/santa-tracker/src/main/res/anim/slide_in_left.xml b/app/santa-tracker/src/main/res/anim/slide_in_left.xml deleted file mode 100644 index 953afa024..000000000 --- a/app/santa-tracker/src/main/res/anim/slide_in_left.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/slide_out_right.xml b/app/santa-tracker/src/main/res/anim/slide_out_right.xml deleted file mode 100644 index fad42b2a7..000000000 --- a/app/santa-tracker/src/main/res/anim/slide_out_right.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/anim/slide_out_top.xml b/app/santa-tracker/src/main/res/anim/slide_out_top.xml deleted file mode 100644 index 53e7cf9a9..000000000 --- a/app/santa-tracker/src/main/res/anim/slide_out_top.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/games_cancelbar.png b/app/santa-tracker/src/main/res/drawable-hdpi/games_cancelbar.png deleted file mode 100644 index bcc5f51a7..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/games_cancelbar.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_achievements.png b/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_achievements.png deleted file mode 100644 index 6db433a13..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_achievements.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_achievements_pressed.png b/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_achievements_pressed.png deleted file mode 100644 index ea97b5ed6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_achievements_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_leaderboards.png b/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_leaderboards.png deleted file mode 100644 index c3e8d521c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_leaderboards.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_leaderboards_pressed.png b/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_leaderboards_pressed.png deleted file mode 100644 index 9c6f82abd..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/games_ic_leaderboards_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_inner.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_inner.png deleted file mode 100644 index 3978ced4a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_inner.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_outer_bottom.9.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_outer_bottom.9.png deleted file mode 100644 index 14bce07c4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_outer_bottom.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_outer_top.9.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_outer_top.9.png deleted file mode 100644 index a30e1bee3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_bg_main_outer_top.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_collected.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_collected.png deleted file mode 100644 index 880ba55fb..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_collected.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_collected_disabled.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_collected_disabled.png deleted file mode 100644 index 3b1e133cb..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_collected_disabled.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_pending.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_pending.png deleted file mode 100644 index d4a9dc8ff..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_indicator_pending.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_outlet.9.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_outlet.9.png deleted file mode 100644 index 3192c57a2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_gumball_outlet.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_score_summary_dialog.9.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_score_summary_dialog.9.png deleted file mode 100644 index 35e865e31..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_score_summary_dialog.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_score_summary_elf.png b/app/santa-tracker/src/main/res/drawable-hdpi/gbg_score_summary_elf.png deleted file mode 100644 index 99fa7a5c8..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/gbg_score_summary_elf.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/ic_launcher_santa.png b/app/santa-tracker/src/main/res/drawable-hdpi/ic_launcher_santa.png deleted file mode 100755 index 9ffed676e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_1.png b/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_1.png deleted file mode 100644 index 8218c95dd..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_2.png b/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_2.png deleted file mode 100644 index 82a01139c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_3.png b/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_3.png deleted file mode 100644 index c55ef79ed..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_shake_3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_touch_1.png b/app/santa-tracker/src/main/res/drawable-hdpi/instructions_touch_1.png deleted file mode 100644 index 402e59246..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_touch_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_touch_2.png b/app/santa-tracker/src/main/res/drawable-hdpi/instructions_touch_2.png deleted file mode 100644 index 131f9f20b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/instructions_touch_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_gumball.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_gumball.png deleted file mode 100644 index f62ee172e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_jetpack.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_jetpack.png deleted file mode 100644 index 7cab02b60..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_jetpack.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_locked_15.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_locked_15.png deleted file mode 100644 index 573363e20..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_locked_15.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_locked_23.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_locked_23.png deleted file mode 100644 index 5bed8accc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_locked_23.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_memory.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_memory.png deleted file mode 100644 index 4b760f373..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_memory.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_santa.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_santa.png deleted file mode 100644 index 682038775..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_video.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_video.png deleted file mode 100644 index 27c58a7a5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_badge_video.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_selector.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_selector.png deleted file mode 100644 index 44157c8f1..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_selector.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/marker_selector_locked.png b/app/santa-tracker/src/main/res/drawable-hdpi/marker_selector_locked.png deleted file mode 100644 index 2a0cc1faf..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/marker_selector_locked.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/misc_pause.png b/app/santa-tracker/src/main/res/drawable-hdpi/misc_pause.png deleted file mode 100644 index ee3450e1f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/misc_pause.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/misc_play.png b/app/santa-tracker/src/main/res/drawable-hdpi/misc_play.png deleted file mode 100644 index 4fcdccb48..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/misc_play.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_left.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_left.png deleted file mode 100644 index 7d59550dc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_right.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_right.png deleted file mode 100644 index 07a5834ba..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_top.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_top.png deleted file mode 100644 index 6e073790e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_background_top.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_ball.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_ball.png deleted file mode 100644 index 7f9a37c1e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_ball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_balloon.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_balloon.png deleted file mode 100644 index 355466665..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_balloon.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_beachball.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_beachball.png deleted file mode 100644 index ddc237bc3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_beachball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_candle.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_candle.png deleted file mode 100644 index 859d9fbe4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_candle.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_blue_dark.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_blue_dark.png deleted file mode 100644 index 6b7635b88..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_blue_dark.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_blue_light.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_blue_light.png deleted file mode 100644 index 4755435f8..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_blue_light.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_orange.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_orange.png deleted file mode 100644 index 974a230e5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_orange.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_purple.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_purple.png deleted file mode 100644 index facc52cfe..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_purple.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_red.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_red.png deleted file mode 100644 index 553d06011..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_cloak_red.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_frame.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_frame.png deleted file mode 100644 index c499c970e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_frame.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_globe.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_globe.png deleted file mode 100644 index 220ae6ee3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_globe.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_gumball.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_gumball.png deleted file mode 100644 index 9defaae36..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_penguin.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_penguin.png deleted file mode 100644 index 082b98c62..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_penguin.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_rabbit.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_rabbit.png deleted file mode 100644 index 99d374bae..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_rabbit.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_reindeer.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_reindeer.png deleted file mode 100644 index 9b1a53578..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_reindeer.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_snowman.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_snowman.png deleted file mode 100644 index e4a3b8722..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_snowman.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_tree.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_tree.png deleted file mode 100644 index b0175c160..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_tree.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_trophy.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_trophy.png deleted file mode 100644 index d4d509c77..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_card_trophy.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_pane_left.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_pane_left.png deleted file mode 100644 index 97ec56629..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_pane_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_pane_right.png b/app/santa-tracker/src/main/res/drawable-hdpi/mmg_pane_right.png deleted file mode 100644 index ea9a75f1a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/mmg_pane_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/notification_small.png b/app/santa-tracker/src/main/res/drawable-hdpi/notification_small.png deleted file mode 100755 index 402de7caf..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/notification_small.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-hdpi/santatracker_logo_startup.png b/app/santa-tracker/src/main/res/drawable-hdpi/santatracker_logo_startup.png deleted file mode 100644 index c33ed2c2e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-hdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/games_cancelbar.png b/app/santa-tracker/src/main/res/drawable-mdpi/games_cancelbar.png deleted file mode 100644 index 765fd14cc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/games_cancelbar.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_achievements.png b/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_achievements.png deleted file mode 100644 index 570cd236d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_achievements.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_achievements_pressed.png b/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_achievements_pressed.png deleted file mode 100644 index 38f1fe52c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_achievements_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_leaderboards.png b/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_leaderboards.png deleted file mode 100644 index 2091e79db..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_leaderboards.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_leaderboards_pressed.png b/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_leaderboards_pressed.png deleted file mode 100644 index 9dae1aecc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/games_ic_leaderboards_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_inner.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_inner.png deleted file mode 100644 index 6af35da5e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_inner.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_outer_bottom.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_outer_bottom.png deleted file mode 100644 index df30bfe15..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_outer_bottom.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_outer_top.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_outer_top.png deleted file mode 100644 index c1b064d44..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_bg_main_outer_top.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_collected.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_collected.png deleted file mode 100644 index 881c59a89..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_collected.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_collected_disabled.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_collected_disabled.png deleted file mode 100644 index 9ad49e258..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_collected_disabled.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_pending.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_pending.png deleted file mode 100644 index 98cac3b53..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_indicator_pending.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_outlet.9.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_outlet.9.png deleted file mode 100644 index 8d1da1eae..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_gumball_outlet.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_score_summary_dialog.9.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_score_summary_dialog.9.png deleted file mode 100644 index 7a5c8cc07..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_score_summary_dialog.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_score_summary_elf.png b/app/santa-tracker/src/main/res/drawable-mdpi/gbg_score_summary_elf.png deleted file mode 100644 index 03a824aae..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/gbg_score_summary_elf.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/ic_launcher_santa.png b/app/santa-tracker/src/main/res/drawable-mdpi/ic_launcher_santa.png deleted file mode 100755 index 1d507a3c0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_1.png b/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_1.png deleted file mode 100644 index 0614b5e3c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_2.png b/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_2.png deleted file mode 100644 index 5a0f161a4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_3.png b/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_3.png deleted file mode 100644 index 9851aef26..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_shake_3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_touch_1.png b/app/santa-tracker/src/main/res/drawable-mdpi/instructions_touch_1.png deleted file mode 100644 index dde6dce5e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_touch_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_touch_2.png b/app/santa-tracker/src/main/res/drawable-mdpi/instructions_touch_2.png deleted file mode 100644 index 535e60752..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/instructions_touch_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_gumball.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_gumball.png deleted file mode 100644 index 7bb73d8a2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_jetpack.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_jetpack.png deleted file mode 100644 index decb98d7a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_jetpack.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_locked_15.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_locked_15.png deleted file mode 100644 index d7cfa2f04..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_locked_15.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_locked_23.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_locked_23.png deleted file mode 100644 index d42ab92f6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_locked_23.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_memory.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_memory.png deleted file mode 100644 index d75118f2a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_memory.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_santa.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_santa.png deleted file mode 100644 index f65594284..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_video.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_video.png deleted file mode 100644 index 1de8abda6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_badge_video.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_selector.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_selector.png deleted file mode 100644 index 209fd65c9..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_selector.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/marker_selector_locked.png b/app/santa-tracker/src/main/res/drawable-mdpi/marker_selector_locked.png deleted file mode 100644 index b98b562e4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/marker_selector_locked.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/misc_pause.png b/app/santa-tracker/src/main/res/drawable-mdpi/misc_pause.png deleted file mode 100644 index d3e1f56ed..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/misc_pause.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/misc_play.png b/app/santa-tracker/src/main/res/drawable-mdpi/misc_play.png deleted file mode 100644 index 7bf303124..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/misc_play.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_left.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_left.png deleted file mode 100644 index cb7a40328..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_right.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_right.png deleted file mode 100644 index b89190568..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_top.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_top.png deleted file mode 100644 index ce021f6d8..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_background_top.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_ball.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_ball.png deleted file mode 100644 index d76347e24..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_ball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_balloon.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_balloon.png deleted file mode 100644 index 1799a9cb4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_balloon.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_beachball.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_beachball.png deleted file mode 100644 index 6ac741291..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_beachball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_candle.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_candle.png deleted file mode 100644 index eef2f2705..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_candle.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_blue_dark.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_blue_dark.png deleted file mode 100644 index 970fcbfa9..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_blue_dark.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_blue_light.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_blue_light.png deleted file mode 100644 index 033fd36d0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_blue_light.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_orange.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_orange.png deleted file mode 100644 index 17a7bb875..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_orange.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_purple.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_purple.png deleted file mode 100644 index c015b104a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_purple.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_red.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_red.png deleted file mode 100644 index dd913a79c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_cloak_red.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_frame.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_frame.png deleted file mode 100644 index 10527b06b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_frame.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_globe.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_globe.png deleted file mode 100644 index a502f2f74..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_globe.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_gumball.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_gumball.png deleted file mode 100644 index 833817195..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_penguin.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_penguin.png deleted file mode 100644 index f9d382f73..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_penguin.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_rabbit.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_rabbit.png deleted file mode 100644 index 529b11205..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_rabbit.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_reindeer.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_reindeer.png deleted file mode 100644 index f52842707..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_reindeer.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_snowman.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_snowman.png deleted file mode 100644 index b21ef666d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_snowman.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_tree.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_tree.png deleted file mode 100644 index 9fb02d210..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_tree.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_trophy.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_trophy.png deleted file mode 100644 index 0cf02f1b1..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_card_trophy.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_pane_left.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_pane_left.png deleted file mode 100644 index 4ab6e7470..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_pane_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_pane_right.png b/app/santa-tracker/src/main/res/drawable-mdpi/mmg_pane_right.png deleted file mode 100644 index 988564d07..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/mmg_pane_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/notification_small.png b/app/santa-tracker/src/main/res/drawable-mdpi/notification_small.png deleted file mode 100755 index 76bf243c9..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/notification_small.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-mdpi/santatracker_logo_startup.png b/app/santa-tracker/src/main/res/drawable-mdpi/santatracker_logo_startup.png deleted file mode 100644 index 557d1d0db..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-mdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_bigplay.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_bigplay.png deleted file mode 100644 index 8b1837e72..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_bigplay.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_bigplay_pressed.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_bigplay_pressed.png deleted file mode 100644 index 40fad1371..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_bigplay_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_cancelbar.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_cancelbar.png deleted file mode 100644 index 7388b978f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_cancelbar.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_0.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_0.png deleted file mode 100644 index c7d733cf3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_0.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_1.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_1.png deleted file mode 100644 index 74d6aad23..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_2.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_2.png deleted file mode 100644 index cc8cc8812..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_3.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_3.png deleted file mode 100644 index cab843aea..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_4.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_4.png deleted file mode 100644 index ce96dacee..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_4.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_5.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_5.png deleted file mode 100644 index 3cd6d4995..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_5.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_6.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_6.png deleted file mode 100644 index 36fe120d1..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_6.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_7.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_7.png deleted file mode 100644 index a114131d3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_7.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_8.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_8.png deleted file mode 100644 index 808014990..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_8.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_9.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_9.png deleted file mode 100644 index 8d0906f1c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_digit_9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_pause.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_pause.png deleted file mode 100644 index daa9e934c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_pause.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_play.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_play.png deleted file mode 100644 index 589501077..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_play.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/games_scorebar.png b/app/santa-tracker/src/main/res/drawable-nodpi/games_scorebar.png deleted file mode 100644 index 501a865ee..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/games_scorebar.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_bg_gumball_indicatorp.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_bg_gumball_indicatorp.9.png deleted file mode 100644 index c21aca11c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_bg_gumball_indicatorp.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_1280.9.png deleted file mode 100644 index 45acce325..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_1920.9.png deleted file mode 100644 index 5b78456d2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_480.9.png deleted file mode 100644 index 521a95a10..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_800.9.png deleted file mode 100644 index 7a3a34ca5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_1280.9.png deleted file mode 100644 index 94571d34d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_1920.9.png deleted file mode 100644 index 47c5d806f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_480.9.png deleted file mode 100644 index 7ea241be5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_800.9.png deleted file mode 100644 index c336a6044..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_end_reverse_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_1280.9.png deleted file mode 100644 index 8cc55a34d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_1920.9.png deleted file mode 100644 index 1f81e8379..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_480.9.png deleted file mode 100644 index 6dc0eaede..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_800.9.png deleted file mode 100644 index 52c2b0951..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_1280.9.png deleted file mode 100644 index 6beff47bd..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_1920.9.png deleted file mode 100644 index 7ac298993..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_480.9.png deleted file mode 100644 index 351a38364..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_800.9.png deleted file mode 100644 index 8313ef24c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_hook_reverse_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_large_angle_six.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_large_angle_six.png deleted file mode 100644 index e5f207758..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_large_angle_six.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_1280.9.png deleted file mode 100644 index d7a557fab..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_1920.9.png deleted file mode 100644 index 2da631978..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_480.9.png deleted file mode 100644 index f71e33910..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_800.9.png deleted file mode 100644 index 5872369e7..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_angle_nine.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_angle_nine.png deleted file mode 100644 index 2cf1e176f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_angle_nine.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_1280.9.png deleted file mode 100644 index 4477dc04c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_1920.9.png deleted file mode 100644 index 7c7d7e543..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_480.9.png deleted file mode 100644 index 3d3279d1d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_800.9.png deleted file mode 100644 index 7718a7de5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_main_reverse_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_med_angle_six.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_med_angle_six.png deleted file mode 100644 index 78e256c93..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_med_angle_six.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_small_angle_six.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_small_angle_six.png deleted file mode 100644 index f95f5fd1c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_small_angle_six.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_small_angle_twelve.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_small_angle_twelve.png deleted file mode 100644 index 185208049..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_small_angle_twelve.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_tiny_reverse_angle_six.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_tiny_reverse_angle_six.png deleted file mode 100644 index 91f6058a8..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_candycane_tiny_reverse_angle_six.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_1280.9.png deleted file mode 100644 index d20593a6b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_1920.9.png deleted file mode 100644 index abbf05b04..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_480.9.png deleted file mode 100644 index 937daf378..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_800.9.png deleted file mode 100644 index 2f558b897..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_blue_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_1280.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_1280.png deleted file mode 100644 index d1231a1d2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_1280.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_1920.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_1920.png deleted file mode 100644 index ef1917040..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_1920.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_480.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_480.png deleted file mode 100644 index bda5b5d4b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_480.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_800.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_800.png deleted file mode 100644 index 350171917..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_funnel_800.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_1280.9.png deleted file mode 100644 index e5b652698..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_1920.9.png deleted file mode 100644 index 93db61f47..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_480.9.png deleted file mode 100644 index de71c50d0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_800.9.png deleted file mode 100644 index c339fb6e3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_green_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_1280.9.png deleted file mode 100644 index 1c8be0754..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_1920.9.png deleted file mode 100644 index 92424a24d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_480.9.png deleted file mode 100644 index 9c7aa6257..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_800.9.png deleted file mode 100644 index db95bf193..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_orange_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_1280.9.png deleted file mode 100644 index 3611291c2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_1920.9.png deleted file mode 100644 index 1bcc20032..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_480.9.png deleted file mode 100644 index bad809490..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_800.9.png deleted file mode 100644 index debd3b0c3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_purple_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_1280.9.png deleted file mode 100644 index 798730dab..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_1920.9.png deleted file mode 100644 index 478463caf..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_480.9.png deleted file mode 100644 index 120ef93d1..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_800.9.png deleted file mode 100644 index ce2a871bc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_red_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_1280.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_1280.9.png deleted file mode 100644 index ce129cbb7..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_1280.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_1920.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_1920.9.png deleted file mode 100644 index ed7a21afc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_1920.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_480.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_480.9.png deleted file mode 100644 index d627a8496..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_480.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_800.9.png b/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_800.9.png deleted file mode 100644 index 71f91da81..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/gbg_gumball_yellow_800.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/google_logo.png b/app/santa-tracker/src/main/res/drawable-nodpi/google_logo.png deleted file mode 100755 index c9c8e8a9a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/google_logo.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy1.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy1.png deleted file mode 100644 index 2285fcd44..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy2.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy2.png deleted file mode 100644 index ed4e7b34f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy3.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy3.png deleted file mode 100644 index 3b41bdb4b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy4.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy4.png deleted file mode 100644 index 303bc6062..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_candy4.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_clock.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_clock.png deleted file mode 100644 index 87e330147..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_clock.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_cloud.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_cloud.png deleted file mode 100644 index 0e7cf9e66..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_cloud.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_2x.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_2x.png deleted file mode 100644 index 5ed77a540..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_2x.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_3x.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_3x.png deleted file mode 100644 index b7a86de56..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_3x.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_4x.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_4x.png deleted file mode 100644 index bd039c13a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_combo_4x.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_fire.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_fire.png deleted file mode 100644 index e19046535..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_fire.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_player.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_player.png deleted file mode 100644 index 9b62338b0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_player.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_podium.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_podium.png deleted file mode 100644 index 319fe25c4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_podium.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present1.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present1.png deleted file mode 100644 index 066f4d1c0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present2.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present2.png deleted file mode 100644 index a9227c3f2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present3.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present3.png deleted file mode 100644 index 1653149a3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present4.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present4.png deleted file mode 100644 index 42c230ea0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_present4.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_signin.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_signin.png deleted file mode 100644 index a7fb71c92..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_signin.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_signin_pressed.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_signin_pressed.png deleted file mode 100644 index 1c84966de..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_signin_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small1.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small1.png deleted file mode 100644 index 6d5e1109b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small2.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small2.png deleted file mode 100644 index 458b491ed..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small3.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small3.png deleted file mode 100644 index d9e65bb73..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small4.png b/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small4.png deleted file mode 100644 index 8caa8b6dc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/jetpack_small4.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/santa_info_notification_background.png b/app/santa-tracker/src/main/res/drawable-nodpi/santa_info_notification_background.png deleted file mode 100644 index f7d20b842..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/santa_info_notification_background.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/santa_notification_background.png b/app/santa-tracker/src/main/res/drawable-nodpi/santa_notification_background.png deleted file mode 100644 index 6bdfb0e88..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/santa_notification_background.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/snowman.png b/app/santa-tracker/src/main/res/drawable-nodpi/snowman.png deleted file mode 100644 index c12f7a830..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/snowman.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-nodpi/transparent.png b/app/santa-tracker/src/main/res/drawable-nodpi/transparent.png deleted file mode 100644 index cc4b8d91a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-nodpi/transparent.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/games_cancelbar.png b/app/santa-tracker/src/main/res/drawable-xhdpi/games_cancelbar.png deleted file mode 100644 index c071816e2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/games_cancelbar.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_achievements.png b/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_achievements.png deleted file mode 100644 index 484306fe6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_achievements.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_achievements_pressed.png b/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_achievements_pressed.png deleted file mode 100644 index 414819779..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_achievements_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_leaderboards.png b/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_leaderboards.png deleted file mode 100644 index 7b302e34e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_leaderboards.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_leaderboards_pressed.png b/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_leaderboards_pressed.png deleted file mode 100644 index ef2191bd5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/games_ic_leaderboards_pressed.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_inner.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_inner.png deleted file mode 100644 index a5fc7e4f0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_inner.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_outer_bottom.9.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_outer_bottom.9.png deleted file mode 100644 index d31b5d12f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_outer_bottom.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_outer_top.9.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_outer_top.9.png deleted file mode 100644 index 78984f6d7..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_bg_main_outer_top.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_collected.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_collected.png deleted file mode 100644 index 472cc97da..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_collected.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_collected_disabled.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_collected_disabled.png deleted file mode 100644 index 21119e71d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_collected_disabled.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_pending.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_pending.png deleted file mode 100644 index eec026769..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_indicator_pending.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_outlet.9.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_outlet.9.png deleted file mode 100644 index f1d7de12a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_gumball_outlet.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_score_summary_dialog.9.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_score_summary_dialog.9.png deleted file mode 100644 index 136d3da4a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_score_summary_dialog.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_score_summary_elf.png b/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_score_summary_elf.png deleted file mode 100644 index 2c3f66dbd..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/gbg_score_summary_elf.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/ic_launcher_santa.png b/app/santa-tracker/src/main/res/drawable-xhdpi/ic_launcher_santa.png deleted file mode 100755 index 7fff7ded1..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_1.png b/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_1.png deleted file mode 100644 index efe3fddc4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_2.png b/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_2.png deleted file mode 100644 index 73712e4b1..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_3.png b/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_3.png deleted file mode 100644 index 08d6bc493..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_shake_3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_touch_1.png b/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_touch_1.png deleted file mode 100644 index 72dff85e6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_touch_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_touch_2.png b/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_touch_2.png deleted file mode 100644 index 713d92f48..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/instructions_touch_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_gumball.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_gumball.png deleted file mode 100644 index 9f25fdfc6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_jetpack.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_jetpack.png deleted file mode 100644 index d11b5c7af..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_jetpack.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_locked_15.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_locked_15.png deleted file mode 100644 index 4bc41d6b2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_locked_15.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_locked_23.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_locked_23.png deleted file mode 100644 index 994fcc1d8..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_locked_23.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_memory.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_memory.png deleted file mode 100644 index e577bfb5d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_memory.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_santa.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_santa.png deleted file mode 100644 index 9af5cb8d6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_video.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_video.png deleted file mode 100644 index 255c10175..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_badge_video.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_selector.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_selector.png deleted file mode 100644 index 4974a712b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_selector.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_selector_locked.png b/app/santa-tracker/src/main/res/drawable-xhdpi/marker_selector_locked.png deleted file mode 100644 index f80c89637..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/marker_selector_locked.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/misc_pause.png b/app/santa-tracker/src/main/res/drawable-xhdpi/misc_pause.png deleted file mode 100644 index 2dcc57994..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/misc_pause.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/misc_play.png b/app/santa-tracker/src/main/res/drawable-xhdpi/misc_play.png deleted file mode 100644 index ca243ab29..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/misc_play.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_left.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_left.png deleted file mode 100644 index 4cb4244fc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_right.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_right.png deleted file mode 100644 index f26fa1bef..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_top.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_top.png deleted file mode 100644 index 7824a66b9..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_background_top.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_ball.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_ball.png deleted file mode 100644 index f11c9286b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_ball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_balloon.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_balloon.png deleted file mode 100644 index b529ce0d3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_balloon.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_beachball.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_beachball.png deleted file mode 100644 index dea80dc1f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_beachball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_candle.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_candle.png deleted file mode 100644 index d8f700fec..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_candle.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_blue_dark.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_blue_dark.png deleted file mode 100644 index be5d1d85b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_blue_dark.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_blue_light.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_blue_light.png deleted file mode 100644 index c91898e4e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_blue_light.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_orange.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_orange.png deleted file mode 100644 index 2447ecd89..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_orange.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_purple.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_purple.png deleted file mode 100644 index 1cd48dc4d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_purple.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_red.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_red.png deleted file mode 100644 index 3d4ae05a0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_cloak_red.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_frame.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_frame.png deleted file mode 100644 index fbbf14627..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_frame.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_globe.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_globe.png deleted file mode 100644 index b065ce334..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_globe.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_gumball.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_gumball.png deleted file mode 100644 index 8a555961a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_penguin.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_penguin.png deleted file mode 100644 index 1a9596ad3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_penguin.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_rabbit.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_rabbit.png deleted file mode 100644 index 15e52e2fa..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_rabbit.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_reindeer.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_reindeer.png deleted file mode 100644 index 8287fc77b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_reindeer.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_snowman.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_snowman.png deleted file mode 100644 index 7ca05522e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_snowman.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_tree.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_tree.png deleted file mode 100644 index b16942e02..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_tree.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_trophy.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_trophy.png deleted file mode 100644 index 5111d94d4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_card_trophy.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_pane_left.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_pane_left.png deleted file mode 100644 index 98d47bc07..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_pane_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_pane_right.png b/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_pane_right.png deleted file mode 100644 index 3229ac8bb..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/mmg_pane_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/notification_small.png b/app/santa-tracker/src/main/res/drawable-xhdpi/notification_small.png deleted file mode 100755 index a2bcfd91e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/notification_small.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xhdpi/santatracker_logo_startup.png b/app/santa-tracker/src/main/res/drawable-xhdpi/santatracker_logo_startup.png deleted file mode 100644 index c9adbddff..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xhdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/games_cancelbar.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/games_cancelbar.png deleted file mode 100644 index 06123258c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/games_cancelbar.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_bg_main_inner.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_bg_main_inner.png deleted file mode 100644 index f4e575cd8..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_bg_main_inner.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_bg_main_outer_top.9.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_bg_main_outer_top.9.png deleted file mode 100644 index f544146c4..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_bg_main_outer_top.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_collected.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_collected.png deleted file mode 100644 index e704d0a22..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_collected.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_collected_disabled.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_collected_disabled.png deleted file mode 100644 index 7231b90d0..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_collected_disabled.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_pending.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_pending.png deleted file mode 100644 index 06f40dc45..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_indicator_pending.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_outlet.9.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_outlet.9.png deleted file mode 100644 index 73d0101b2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_gumball_outlet.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_score_summary_dialog.9.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_score_summary_dialog.9.png deleted file mode 100644 index 473bb2bb5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_score_summary_dialog.9.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_score_summary_elf.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_score_summary_elf.png deleted file mode 100644 index dbf1c6b5d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/gbg_score_summary_elf.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/ic_launcher_santa.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/ic_launcher_santa.png deleted file mode 100755 index 204839dd2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_1.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_1.png deleted file mode 100644 index 829b5823c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_2.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_2.png deleted file mode 100644 index 055c12827..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_3.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_3.png deleted file mode 100644 index 694d58834..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_shake_3.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_touch_1.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_touch_1.png deleted file mode 100644 index 7858e3378..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_touch_1.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_touch_2.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_touch_2.png deleted file mode 100644 index f19c67b10..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/instructions_touch_2.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_gumball.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_gumball.png deleted file mode 100644 index 4f0b0c02d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_jetpack.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_jetpack.png deleted file mode 100644 index 410afe128..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_jetpack.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_locked_15.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_locked_15.png deleted file mode 100644 index 6b211727e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_locked_15.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_locked_23.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_locked_23.png deleted file mode 100644 index a03318498..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_locked_23.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_memory.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_memory.png deleted file mode 100644 index d2281d226..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_memory.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_santa.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_santa.png deleted file mode 100644 index 88b6a4c29..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_video.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_video.png deleted file mode 100644 index 77cb1dec3..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_badge_video.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_selector.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_selector.png deleted file mode 100644 index d3ba8c9b5..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_selector.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_selector_locked.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_selector_locked.png deleted file mode 100644 index 65bdc53bb..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/marker_selector_locked.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/misc_pause.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/misc_pause.png deleted file mode 100644 index 00d9c6d44..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/misc_pause.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/misc_play.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/misc_play.png deleted file mode 100644 index 2fcd4d08d..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/misc_play.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_left.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_left.png deleted file mode 100644 index 4028a1384..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_right.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_right.png deleted file mode 100644 index f278b232e..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_top.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_top.png deleted file mode 100644 index 43513abca..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_background_top.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_ball.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_ball.png deleted file mode 100644 index 9f60b37af..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_ball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_balloon.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_balloon.png deleted file mode 100644 index 53b630ce2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_balloon.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_beachball.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_beachball.png deleted file mode 100644 index 7f59865f9..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_beachball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_candle.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_candle.png deleted file mode 100644 index bab74b985..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_candle.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_blue_dark.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_blue_dark.png deleted file mode 100644 index 4bc046ecd..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_blue_dark.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_blue_light.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_blue_light.png deleted file mode 100644 index edf2f84d8..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_blue_light.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_orange.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_orange.png deleted file mode 100644 index bec25e48c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_orange.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_purple.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_purple.png deleted file mode 100644 index 2c693eab2..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_purple.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_red.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_red.png deleted file mode 100644 index b5adfb063..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_cloak_red.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_frame.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_frame.png deleted file mode 100644 index 4ea5c95bc..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_frame.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_globe.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_globe.png deleted file mode 100644 index 7d4633a2a..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_globe.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_gumball.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_gumball.png deleted file mode 100644 index 0ab6970f6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_gumball.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_penguin.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_penguin.png deleted file mode 100644 index 78df00ccf..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_penguin.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_rabbit.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_rabbit.png deleted file mode 100644 index 4af522d9b..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_rabbit.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_reindeer.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_reindeer.png deleted file mode 100644 index ab3341bd6..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_reindeer.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_snowman.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_snowman.png deleted file mode 100644 index 957d05b3c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_snowman.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_tree.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_tree.png deleted file mode 100644 index 555c4093f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_tree.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_trophy.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_trophy.png deleted file mode 100644 index b8ff6383c..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_card_trophy.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_pane_left.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_pane_left.png deleted file mode 100644 index a232d020f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_pane_left.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_pane_right.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_pane_right.png deleted file mode 100644 index 14e3f2b02..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/mmg_pane_right.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/notification_small.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/notification_small.png deleted file mode 100755 index 2cf86d8ef..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/notification_small.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxhdpi/santatracker_logo_startup.png b/app/santa-tracker/src/main/res/drawable-xxhdpi/santatracker_logo_startup.png deleted file mode 100644 index 3e6f76795..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxhdpi/santatracker_logo_startup.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable-xxxhdpi/ic_launcher_santa.png b/app/santa-tracker/src/main/res/drawable-xxxhdpi/ic_launcher_santa.png deleted file mode 100755 index 9364e085f..000000000 Binary files a/app/santa-tracker/src/main/res/drawable-xxxhdpi/ic_launcher_santa.png and /dev/null differ diff --git a/app/santa-tracker/src/main/res/drawable/big_play_button.xml b/app/santa-tracker/src/main/res/drawable/big_play_button.xml deleted file mode 100644 index 1b69f58f5..000000000 --- a/app/santa-tracker/src/main/res/drawable/big_play_button.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/app/santa-tracker/src/main/res/drawable/button_achievements.xml b/app/santa-tracker/src/main/res/drawable/button_achievements.xml deleted file mode 100644 index 95018f78b..000000000 --- a/app/santa-tracker/src/main/res/drawable/button_achievements.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/app/santa-tracker/src/main/res/drawable/button_leaderboards.xml b/app/santa-tracker/src/main/res/drawable/button_leaderboards.xml deleted file mode 100644 index 60849ec53..000000000 --- a/app/santa-tracker/src/main/res/drawable/button_leaderboards.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/app/santa-tracker/src/main/res/drawable/marker_selector_locked_states.xml b/app/santa-tracker/src/main/res/drawable/marker_selector_locked_states.xml deleted file mode 100644 index f763092ca..000000000 --- a/app/santa-tracker/src/main/res/drawable/marker_selector_locked_states.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/drawable/marker_selector_states.xml b/app/santa-tracker/src/main/res/drawable/marker_selector_states.xml deleted file mode 100644 index d83119602..000000000 --- a/app/santa-tracker/src/main/res/drawable/marker_selector_states.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/drawable/play_again_button.xml b/app/santa-tracker/src/main/res/drawable/play_again_button.xml deleted file mode 100644 index bea0c07cd..000000000 --- a/app/santa-tracker/src/main/res/drawable/play_again_button.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/drawable/score_background_gingerbread.xml b/app/santa-tracker/src/main/res/drawable/score_background_gingerbread.xml deleted file mode 100644 index d9fb40fdf..000000000 --- a/app/santa-tracker/src/main/res/drawable/score_background_gingerbread.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - diff --git a/app/santa-tracker/src/main/res/layout-sw600dp/activity_memory.xml b/app/santa-tracker/src/main/res/layout-sw600dp/activity_memory.xml deleted file mode 100644 index 28cd755e0..000000000 --- a/app/santa-tracker/src/main/res/layout-sw600dp/activity_memory.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/layout-sw600dp/fragment_gumball.xml b/app/santa-tracker/src/main/res/layout-sw600dp/fragment_gumball.xml deleted file mode 100644 index f15a6c3e1..000000000 --- a/app/santa-tracker/src/main/res/layout-sw600dp/fragment_gumball.xml +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/santa-tracker/src/main/res/layout-sw720dp/include_score_summary.xml b/app/santa-tracker/src/main/res/layout-sw720dp/include_score_summary.xml deleted file mode 100644 index e0b9c0f86..000000000 --- a/app/santa-tracker/src/main/res/layout-sw720dp/include_score_summary.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -