[
  {
    "path": ".gitignore",
    "content": "# Built application files\n*.apk\n*.ap_\n\n# Files for the Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nbin/\ngen/\n\n# Gradle files\n.gradle/\nbuild/\n/*/build/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n*.DS_Store\n\n# Proguard folder generated by Eclipse\nproguard/\n\n# Log Files\n*.log\n\n#IDE\n.idea/\n*.iml\n\n#Private Keys\napp/src/main/res/values/keys.xml\napp/fabric.properties\nmirror-keystore.jks\nsigning.properties"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "README.md",
    "content": "# HomeMirror\nAndroid application powering the mirror in my house\n\n<img src=\"https://raw.githubusercontent.com/HannahMitt/HomeMirror/master/design/IMG_20151121_183522%20(1).jpg\" width=\"400\"/>\n\n### Note: code unmaintained\nThis was a fun project, and I may pick it back up again one day.\nYou can still follow the instructions for putting a mirror together, but may need to bring your own light-text-on-dark-background app.\n\nSoftware\n====\n* Day, time, and weather display\n* Birthday messages\n* Chore reminders\n* Biking weather recommendation\n* Stock price swings\n* Today's new XKCD\n* Next calendar event\n* Top news headline\n* Face detection with mood detection\n\nAPIs provided by Yahoo Finance, Forecast.io, the BBC, and XKCD\n\n<img src=\"https://raw.githubusercontent.com/HannahMitt/HomeMirror/master/design/HomeMirror.png\" width=\"400\"/>\n\nHow to Run\n----\n1. Clone project\n2. Get a [forecast.io api key](https://developer.forecast.io/)\n3. Add a keys.xml file under res/values with \\<string name=\"dark_sky_api_key\">your_key\\</string>\n4. Import project to Android Studio and run\n\nWhen its mirror time, I also recommend turning on the device Developer Option: \"Stay Awake - Screen will never sleep while charging\"\n\nMaking a Mirror\n====\n\n[Video walk-through on adafruit (Thank you Becky!)](https://learn.adafruit.com/android-smart-home-mirror)\n\n1. Obtain Android device\n----\nWe had too many. Sad old devices are ideal.\nI used a [2012 Nexus 7](http://www.amazon.com/gp/offer-listing/B009X3UW2G/ref=olp_tab_refurbished?ie=UTF8&condition=refurbished&qid=1441327955&sr=8-1).\n\n2. Obtain two-way mirror\n---\nWe did this the old-fashioned way, and quested to [Canal Plastic Center](http://canalplastic.com/). A beautiful and highly recommended establishment. \n\n[Wiki of places to buy two-way mirrors](https://github.com/HannahMitt/HomeMirror/wiki/Places-to-buy-a-two-way-mirror)\n\nGet a mirror at least as large as your Android device. My mirror is 6\"x12\" with 1/8 thickness. \n\n3. Sticky stuff for mounting\n---\nOur trickiest problem was figuring out how to mount everything with minimal damage and error.\nWe eventually discovered [reusable double-sided adhesive](http://www.amazon.com/Command-Assorted-8-Small-4-Medium-4-Large/dp/B0084M68IO/ref=pd_sim_sbs_229_6?ie=UTF8&refRID=1TX12CR5RF0RTP6CKJR7&dpSrc=sims&dpST=_AC_UL320_SR202%2C320_), which is amazing. \n\nWe're using it both to mount the mirror to the device, and the device to the wall.\n\n4. Attach black backing\n---\nWe used black construction paper. If your device and mirror are awesomely identical in size, you can skip this.\n\nNote: You want to glue it well, so the backing doesn't tear when the adhesive is holding it.\n\n* Cut a piece of black backing the same size as your mirror\n* Decide where you want your device to show through. We did upper right. Leave a border all the way around for adhesive.\n* At that location, carefully cut a hole in the backing the same size as your device\n* CAREFULLY glue the backing to the mirror. We used spray adhesive, and practiced how we would pick it up and lay it on the mirror a couple times before going for it. We also wore black surgical gloves.\n \n<img src=\"https://raw.githubusercontent.com/HannahMitt/HomeMirror/master/design/IMG_20150911_110449-2.jpg\" height=\"400\"/>\n\n5. Adhesion\n---\nFire up the app on the device.\n\nPut the adhesive along the bezel or edges of the device. Line up the mirror and stick it on there.\n\n6. Wall spot\n---\nYou probably want a long usb cable. Find a wall spot where you can keep the device plugged in.\n\nPut a bunch of adhesive on the back of the device, and stick it on there.\n\n<img src=\"https://raw.githubusercontent.com/HannahMitt/HomeMirror/faed8d927b93ec2c38159d8e3968f8133511ee67/design/thumbs_up_mirror.jpg\" width=\"400\"/>\n\nLinks\n===\nAt the heart of this project, is 'put a mirror on it'. [Check out alternative mirror projects and feel free to add your own reflections](https://github.com/HannahMitt/HomeMirror/wiki/Other-mirror-projects-with-alternate-technologies)\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "buildscript {\n    repositories {\n        maven { url 'https://maven.fabric.io/public' }\n    }\n\n    dependencies {\n        classpath 'io.fabric.tools:gradle:1.+'\n    }\n}\napply plugin: 'com.android.application'\napply plugin: 'io.fabric'\n\nandroid {\n    signingConfigs {\n        mirror {\n        }\n    }\n    compileSdkVersion 22\n    buildToolsVersion \"23.0.1\"\n    defaultConfig {\n        applicationId \"com.morristaedt.mirror\"\n        minSdkVersion 14\n        targetSdkVersion 22\n        versionCode 4\n        versionName \"1.3\"\n    }\n    buildTypes {\n        debug {\n            ext.enableCrashlytics = false\n            applicationIdSuffix '.debug'\n        }\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n            signingConfig signingConfigs.mirror\n        }\n    }\n}\n\nrepositories {\n    maven { url \"https://jitpack.io\" }\n    maven { url 'https://maven.fabric.io/public' }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile 'com.android.support:appcompat-v7:22.0.0'\n    compile 'com.squareup.retrofit:retrofit:1.9.0'\n    compile 'com.squareup.picasso:picasso:2.5.2'\n    compile 'com.github.ahorn:android-rss:cf40b89'\n    compile 'com.google.android.gms:play-services-vision:8.1.0'\n    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {\n        transitive = true;\n    }\n}\n\ndef signingFile = rootProject.file('signing.properties')\nif (signingFile.exists()) {\n    def props = new Properties()\n    props.load(new FileInputStream(signingFile))\n    android.signingConfigs.mirror.storeFile rootProject.file(props.keyStore)\n    android.signingConfigs.mirror.storePassword props.keyStorePassword\n    android.signingConfigs.mirror.keyAlias props.keyAlias\n    android.signingConfigs.mirror.keyPassword props.keyAliasPassword\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/HannahMitt/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/androidTest/java/com/morristaedt/mirror/ApplicationTest.java",
    "content": "package com.morristaedt.mirror;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n    public ApplicationTest() {\n        super(Application.class);\n    }\n}"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.morristaedt.mirror\">\n\n    <uses-permission android:name=\"android.permission.WAKE_LOCK\" />\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <uses-permission android:name=\"android.permission.CAMERA\" />\n    <uses-permission android:name=\"android.permission.READ_CALENDAR\" />\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" />\n    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n\n    <uses-feature\n        android:name=\"android.hardware.camera\"\n        android:required=\"false\" />\n    <uses-feature\n        android:name=\"android.hardware.location\"\n        android:required=\"false\" />\n    <uses-feature\n        android:name=\"android.hardware.location.gps\"\n        android:required=\"false\" />\n    <uses-feature\n        android:name=\"android.hardware.location.network\"\n        android:required=\"false\" />\n\n    <application\n        android:name=\".MirrorApplication\"\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/icon\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\">\n\n        <meta-data\n            android:name=\"com.google.android.gms.version\"\n            android:value=\"@integer/google_play_services_version\" />\n\n        <activity\n            android:name=\".SetUpActivity\"\n            android:label=\"@string/app_name\"\n            android:launchMode=\"singleInstance\"\n            android:windowSoftInputMode=\"stateHidden\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n\n        <activity\n            android:name=\".MirrorActivity\"\n            android:launchMode=\"singleInstance\" />\n\n        <receiver android:name=\".receiver.AlarmReceiver\" />\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/MirrorActivity.java",
    "content": "package com.morristaedt.mirror;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics.ColorFilter;\nimport android.graphics.ColorMatrixColorFilter;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.support.annotation.NonNull;\nimport android.support.v7.app.ActionBar;\nimport android.support.v7.app.ActionBarActivity;\nimport android.text.TextUtils;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.view.WindowManager;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\nimport com.morristaedt.mirror.modules.BirthdayModule;\nimport com.morristaedt.mirror.modules.CalendarModule;\nimport com.morristaedt.mirror.modules.ChoresModule;\nimport com.morristaedt.mirror.modules.CountdownModule;\nimport com.morristaedt.mirror.modules.DayModule;\nimport com.morristaedt.mirror.modules.ForecastModule;\nimport com.morristaedt.mirror.modules.MoodModule;\nimport com.morristaedt.mirror.modules.NewsModule;\nimport com.morristaedt.mirror.modules.XKCDModule;\nimport com.morristaedt.mirror.modules.YahooFinanceModule;\nimport com.morristaedt.mirror.receiver.AlarmReceiver;\nimport com.morristaedt.mirror.requests.YahooStockResponse;\nimport com.morristaedt.mirror.utils.WeekUtil;\nimport com.squareup.picasso.Picasso;\n\nimport java.lang.ref.WeakReference;\n\npublic class MirrorActivity extends ActionBarActivity {\n\n    @NonNull\n    private ConfigurationSettings mConfigSettings;\n\n    private TextView mBirthdayText;\n    private TextView mDayText;\n    private TextView mWeatherSummary;\n    private TextView mHelloText;\n    private TextView mBikeTodayText;\n    private TextView mStockText;\n    private TextView mMoodText;\n    private View mWaterPlants;\n    private View mGroceryList;\n    private ImageView mXKCDImage;\n    private MoodModule mMoodModule;\n    private TextView mNewsHeadline;\n    private TextView mCalendarTitleText;\n    private TextView mCalendarDetailsText;\n    private TextView mCountdownText;\n\n    private XKCDModule.XKCDListener mXKCDListener = new XKCDModule.XKCDListener() {\n        @Override\n        public void onNewXKCDToday(String url) {\n            if (TextUtils.isEmpty(url)) {\n                mXKCDImage.setVisibility(View.GONE);\n            } else {\n                Picasso.with(MirrorActivity.this).load(url).into(mXKCDImage);\n                mXKCDImage.setVisibility(View.VISIBLE);\n            }\n        }\n    };\n\n    private YahooFinanceModule.StockListener mStockListener = new YahooFinanceModule.StockListener() {\n        @Override\n        public void onNewStockPrice(YahooStockResponse.YahooQuoteResponse quoteResponse) {\n            if (quoteResponse == null) {\n                mStockText.setVisibility(View.GONE);\n            } else {\n                mStockText.setVisibility(View.VISIBLE);\n                mStockText.setText(\"$\" + quoteResponse.symbol + \" $\" + quoteResponse.LastTradePriceOnly);\n            }\n        }\n    };\n\n    private ForecastModule.ForecastListener mForecastListener = new ForecastModule.ForecastListener() {\n        @Override\n        public void onWeatherToday(String weatherToday) {\n            if (!TextUtils.isEmpty(weatherToday)) {\n                mWeatherSummary.setVisibility(View.VISIBLE);\n                mWeatherSummary.setText(weatherToday);\n            }\n        }\n\n        @Override\n        public void onShouldBike(boolean showToday, boolean shouldBike) {\n            if (mConfigSettings.showBikingHint()) {\n                mBikeTodayText.setVisibility(showToday ? View.VISIBLE : View.GONE);\n                mBikeTodayText.setText(shouldBike ? R.string.bike_today : R.string.no_bike_today);\n            } else {\n                mBikeTodayText.setVisibility(View.GONE);\n            }\n        }\n    };\n\n    private NewsModule.NewsListener mNewsListener = new NewsModule.NewsListener() {\n        @Override\n        public void onNewNews(String headline) {\n            if (TextUtils.isEmpty(headline)) {\n                mNewsHeadline.setVisibility(View.GONE);\n            } else {\n                mNewsHeadline.setVisibility(View.VISIBLE);\n                mNewsHeadline.setText(headline);\n                mNewsHeadline.setSelected(true);\n            }\n        }\n    };\n\n    private MoodModule.MoodListener mMoodListener = new MoodModule.MoodListener() {\n        @Override\n        public void onShouldGivePositiveAffirmation(final String affirmation) {\n            runOnUiThread(new Runnable() {\n                @Override\n                public void run() {\n                    mMoodText.setVisibility(affirmation == null ? View.GONE : View.VISIBLE);\n                    mMoodText.setText(affirmation);\n                }\n            });\n        }\n    };\n\n    private CalendarModule.CalendarListener mCalendarListener = new CalendarModule.CalendarListener() {\n        @Override\n        public void onCalendarUpdate(String title, String details) {\n            mCalendarTitleText.setVisibility(title != null ? View.VISIBLE : View.GONE);\n            mCalendarTitleText.setText(title);\n            mCalendarDetailsText.setVisibility(details != null ? View.VISIBLE : View.GONE);\n            mCalendarDetailsText.setText(details);\n\n            //Make marquee effect work for long text\n            mCalendarTitleText.setSelected(true);\n            mCalendarDetailsText.setSelected(true);\n        }\n    };\n\n    private CountdownModule.CountdownListener mCountdownListener = new CountdownModule.CountdownListener() {\n        @Override\n        public void onCountdownUpdate(final String timeLeft) {\n            runOnUiThread(new Runnable() {\n                @Override\n                public void run() {\n                    mCountdownText.setVisibility(View.VISIBLE);\n                    mCountdownText.setText(timeLeft);\n                }\n            });\n        }\n    };\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_mirror);\n        mConfigSettings = new ConfigurationSettings(this);\n        AlarmReceiver.startMirrorUpdates(this);\n\n        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n                    WindowManager.LayoutParams.FLAG_FULLSCREEN);\n        } else {\n            View decorView = getWindow().getDecorView();\n            int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n                    | View.SYSTEM_UI_FLAG_FULLSCREEN\n                    | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n                    | View.SYSTEM_UI_FLAG_IMMERSIVE;\n            decorView.setSystemUiVisibility(uiOptions);\n            ActionBar actionBar = getSupportActionBar();\n            actionBar.hide();\n        }\n\n        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n\n        mBirthdayText = (TextView) findViewById(R.id.birthday_text);\n        mDayText = (TextView) findViewById(R.id.day_text);\n        mWeatherSummary = (TextView) findViewById(R.id.weather_summary);\n        mHelloText = (TextView) findViewById(R.id.hello_text);\n        mWaterPlants = findViewById(R.id.water_plants);\n        mGroceryList = findViewById(R.id.grocery_list);\n        mBikeTodayText = (TextView) findViewById(R.id.can_bike);\n        mStockText = (TextView) findViewById(R.id.stock_text);\n        mMoodText = (TextView) findViewById(R.id.mood_text);\n        mXKCDImage = (ImageView) findViewById(R.id.xkcd_image);\n        mNewsHeadline = (TextView) findViewById(R.id.news_headline);\n        mCalendarTitleText = (TextView) findViewById(R.id.calendar_title);\n        mCalendarDetailsText = (TextView) findViewById(R.id.calendar_details);\n        mCountdownText = (TextView) findViewById(R.id.countdown_text);\n\n        if (mConfigSettings.invertXKCD()) {\n            //Negative of XKCD image\n            float[] colorMatrixNegative = {\n                    -1.0f, 0, 0, 0, 255, //red\n                    0, -1.0f, 0, 0, 255, //green\n                    0, 0, -1.0f, 0, 255, //blue\n                    0, 0, 0, 1.0f, 0 //alpha\n            };\n            ColorFilter colorFilterNegative = new ColorMatrixColorFilter(colorMatrixNegative);\n            mXKCDImage.setColorFilter(colorFilterNegative); // not inverting for now\n        }\n\n        setViewState();\n    }\n\n    @Override\n    protected void onPause() {\n        super.onPause();\n\n        if (mMoodModule != null) {\n            mMoodModule.release();\n        }\n    }\n\n    @Override\n    protected void onNewIntent(Intent intent) {\n        super.onNewIntent(intent);\n        setViewState();\n    }\n\n    private void colorTextViews(ViewGroup mview){\n        for (int i = 0; i < mview.getChildCount(); i++) {\n            View view = mview.getChildAt(i);\n            if (view instanceof ViewGroup)\n                colorTextViews((ViewGroup) view);\n            else if (view instanceof TextView) {\n                ((TextView) view).setTextColor(mConfigSettings.getTextColor());\n            }\n        }\n    }\n\n    private void setViewState() {\n        colorTextViews((ViewGroup) findViewById(R.id.main_layout));\n\n        String birthday = BirthdayModule.getBirthday();\n        if (TextUtils.isEmpty(birthday)) {\n            mBirthdayText.setVisibility(View.GONE);\n        } else {\n            mBirthdayText.setVisibility(View.VISIBLE);\n            mBirthdayText.setText(getString(R.string.happy_birthday, birthday));\n        }\n\n        mDayText.setText(DayModule.getDay());\n//        mHelloText.setText(TimeModule.getTimeOfDayWelcome(getResources())); // not in current design\n\n        mWaterPlants.setVisibility(ChoresModule.waterPlantsToday() ? View.VISIBLE : View.GONE);\n        mGroceryList.setVisibility(ChoresModule.makeGroceryListToday() ? View.VISIBLE : View.GONE);\n\n        // Get the API key for whichever weather service API key is available\n        // These should be declared as a string in xml\n        int forecastApiKeyRes = getResources().getIdentifier(\"dark_sky_api_key\", \"string\", getPackageName());\n        int openWeatherApiKeyRes = getResources().getIdentifier(\"open_weather_api_key\", \"string\", getPackageName());\n\n        if (forecastApiKeyRes != 0) {\n            ForecastModule.getForecastIOHourlyForecast(getString(forecastApiKeyRes), mConfigSettings.getForecastUnits(), mConfigSettings.getLatitude(), mConfigSettings.getLongitude(), mForecastListener);\n        } else if (openWeatherApiKeyRes != 0) {\n            ForecastModule.getOpenWeatherForecast(getString(openWeatherApiKeyRes), mConfigSettings.getForecastUnits(), mConfigSettings.getLatitude(), mConfigSettings.getLongitude(), mForecastListener);\n        }\n\n        if (mConfigSettings.showNewsHeadline()) {\n            NewsModule.getNewsHeadline(mNewsListener);\n        } else {\n            mNewsHeadline.setVisibility(View.GONE);\n        }\n\n        if (mConfigSettings.showXKCD()) {\n            XKCDModule.getXKCDForToday(mXKCDListener);\n        } else {\n            mXKCDImage.setVisibility(View.GONE);\n        }\n\n        if (mConfigSettings.showNextCalendarEvent()) {\n            CalendarModule.getCalendarEvents(this, mCalendarListener);\n        } else {\n            mCalendarTitleText.setVisibility(View.GONE);\n            mCalendarDetailsText.setVisibility(View.GONE);\n        }\n\n        if (mConfigSettings.showStock() && (ConfigurationSettings.isDemoMode() || WeekUtil.isWeekdayAfterFive())) {\n            YahooFinanceModule.getStockForToday(mConfigSettings.getStockTickerSymbol(), mStockListener);\n        } else {\n            mStockText.setVisibility(View.GONE);\n        }\n\n        if (mConfigSettings.showMoodDetection()) {\n            mMoodModule = new MoodModule(new WeakReference<Context>(this));\n            mMoodModule.getCurrentMood(mMoodListener);\n        } else {\n            mMoodText.setVisibility(View.GONE);\n        }\n\n        if (mConfigSettings.showCountdown()){\n            CountdownModule.getTimeRemaining(mConfigSettings.getCountdownEnd(), mCountdownListener);\n        } else {\n            mCountdownText.setVisibility(View.GONE);\n        }\n    }\n\n    @Override\n    public void onBackPressed() {\n        super.onBackPressed();\n        AlarmReceiver.stopMirrorUpdates(this);\n        Intent intent = new Intent(this, SetUpActivity.class);\n        startActivity(intent);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/MirrorApplication.java",
    "content": "package com.morristaedt.mirror;\n\nimport android.app.Application;\n\nimport com.crashlytics.android.Crashlytics;\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\n\nimport io.fabric.sdk.android.Fabric;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic class MirrorApplication extends Application {\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        if (!ConfigurationSettings.isDebugBuild()) {\n            Fabric.with(this, new Crashlytics());\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/SetUpActivity.java",
    "content": "package com.morristaedt.mirror;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics.Color;\nimport android.location.Criteria;\nimport android.location.Location;\nimport android.location.LocationListener;\nimport android.location.LocationManager;\nimport android.os.Bundle;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\nimport android.util.Log;\nimport android.view.View;\nimport android.view.inputmethod.InputMethodManager;\nimport android.widget.CheckBox;\nimport android.widget.CompoundButton;\nimport android.widget.EditText;\nimport android.widget.RadioGroup;\nimport android.widget.SeekBar;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\n\npublic class SetUpActivity extends Activity {\n\n    private static final long HOUR_MILLIS = 60 * 60 * 1000;\n    private static final int METERS_MIN = 500;\n\n    @NonNull\n    private ConfigurationSettings mConfigSettings;\n\n    private LocationManager mLocationManager;\n\n    @Nullable\n    private LocationListener mLocationListener;\n\n    @Nullable\n    private Location mLocation;\n\n    private RadioGroup mTemperatureChoice;\n    private CheckBox mBikingCheckbox;\n    private CheckBox mMoodDetectionCheckbox;\n    private CheckBox mShowNextCaledarEventCheckbox;\n    private CheckBox mShowNewsHeadlineCheckbox;\n    private CheckBox mXKCDCheckbox;\n    private CheckBox mXKCDInvertCheckbox;\n    private CheckBox mCountdownCheckbox;\n    private CheckBox mNewCountdownCheckbox;\n    private View mNewCountdownView;\n    private View mLocationView;\n    private View mColorShowView;\n    private EditText mLatitude;\n    private EditText mLongitude;\n    private EditText mStockTickerSymbol;\n    private EditText mCountdownDays;\n    private EditText mCountdownHours;\n    private EditText mCountdownMins;\n    private EditText mCountdownSecs;\n    private SeekBar mColorPickerRed;\n    private SeekBar mColorPickerGreen;\n    private SeekBar mColorPickerBlue;\n    private TextView mColorShowerRed;\n    private TextView mColorShowerGreen;\n    private TextView mColorShowerBlue;\n    \n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_configuration);\n\n        mConfigSettings = new ConfigurationSettings(this);\n\n        mTemperatureChoice = (RadioGroup) findViewById(R.id.temperature_group);\n        mTemperatureChoice.check(mConfigSettings.getIsCelsius() ? R.id.celsius : R.id.farenheit);\n\n        mColorPickerRed = (SeekBar) findViewById(R.id.ColorPickerRed);\n        mColorPickerRed.setProgress(Color.red(mConfigSettings.getTextColor()));\n\n        mColorPickerGreen = (SeekBar) findViewById(R.id.ColorPickerGreen);\n        mColorPickerGreen.setProgress(Color.green(mConfigSettings.getTextColor()));\n\n        mColorPickerBlue = (SeekBar) findViewById(R.id.ColorPickerBlue);\n        mColorPickerBlue.setProgress(Color.blue(mConfigSettings.getTextColor()));\n\n        mColorShowerRed = (TextView) findViewById(R.id.ColorShowerRed);\n        mColorShowerRed.setText(String.format(\"%d\", Color.red(mConfigSettings.getTextColor())));\n\n        mColorShowerGreen = (TextView) findViewById(R.id.ColorShowerGreen);\n        mColorShowerGreen.setText(String.format(\"%d\", Color.green(mConfigSettings.getTextColor())));\n\n        mColorShowerBlue = (TextView) findViewById(R.id.ColorShowerBlue);\n        mColorShowerBlue.setText(String.format(\"%d\", Color.blue(mConfigSettings.getTextColor())));\n\n        mColorShowView = findViewById(R.id.colored_bar);\n        mColorShowView.setBackgroundColor(mConfigSettings.getTextColor());\n\n        mColorPickerRed.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n            @Override\n            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n                mConfigSettings.setTextColorRed(progress);\n                mColorShowerRed.setText(String.format(\"%d\", progress));\n                mColorShowView.setBackgroundColor(mConfigSettings.getTextColor());\n            }\n\n            @Override\n            public void onStartTrackingTouch(SeekBar seekBar) {\n            }\n\n            @Override\n            public void onStopTrackingTouch(SeekBar seekBar) {\n            }\n        });\n\n        mColorPickerGreen.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n            @Override\n            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n                mConfigSettings.setTextColorGreen(progress);\n                mColorShowerGreen.setText(String.format(\"%d\", progress));\n                mColorShowView.setBackgroundColor(mConfigSettings.getTextColor());\n            }\n\n            @Override\n            public void onStartTrackingTouch(SeekBar seekBar) {}\n\n            @Override\n            public void onStopTrackingTouch(SeekBar seekBar) {}\n        });\n\n        mColorPickerBlue.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n            @Override\n            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n                mConfigSettings.setTextColorBlue(progress);\n                mColorShowerBlue.setText(String.format(\"%d\", progress));\n                mColorShowView.setBackgroundColor(mConfigSettings.getTextColor());\n            }\n\n            @Override\n            public void onStartTrackingTouch(SeekBar seekBar) {}\n\n            @Override\n            public void onStopTrackingTouch(SeekBar seekBar) {}\n        });\n\n        mBikingCheckbox = (CheckBox) findViewById(R.id.biking_checkbox);\n        mBikingCheckbox.setChecked(mConfigSettings.showBikingHint());\n\n        mMoodDetectionCheckbox = (CheckBox) findViewById(R.id.mood_detection_checkbox);\n        mMoodDetectionCheckbox.setChecked(mConfigSettings.showMoodDetection());\n\n        mShowNextCaledarEventCheckbox = (CheckBox) findViewById(R.id.calendar_checkbox);\n        mShowNextCaledarEventCheckbox.setChecked(mConfigSettings.showNextCalendarEvent());\n\n        mShowNewsHeadlineCheckbox = (CheckBox) findViewById(R.id.headline_checkbox);\n        mShowNewsHeadlineCheckbox.setChecked(mConfigSettings.showNewsHeadline());\n\n        mXKCDCheckbox = (CheckBox) findViewById(R.id.xkcd_checkbox);\n        mXKCDCheckbox.setChecked(mConfigSettings.showXKCD());\n\n        mXKCDInvertCheckbox = (CheckBox) findViewById(R.id.xkcd_invert_checkbox);\n        mXKCDInvertCheckbox.setChecked(mConfigSettings.invertXKCD());\n\n        mLatitude = (EditText) findViewById(R.id.latitude);\n        mLongitude = (EditText) findViewById(R.id.longitude);\n\n        mLatitude.setText(String.valueOf(mConfigSettings.getLatitude()));\n        mLongitude.setText(String.valueOf(mConfigSettings.getLongitude()));\n\n        mLocationView = findViewById(R.id.location_view);\n        setUpLocationMonitoring();\n\n        mStockTickerSymbol = (EditText) findViewById(R.id.stock_name);\n        mStockTickerSymbol.setText(mConfigSettings.getStockTickerSymbol());\n\n        mCountdownCheckbox = (CheckBox) findViewById(R.id.countdown_checkbox);\n        mCountdownCheckbox.setChecked(mConfigSettings.showCountdown());\n\n        mNewCountdownCheckbox = (CheckBox) findViewById(R.id.countdown_new_checkbox);\n        mNewCountdownCheckbox.setChecked(false);\n        if (!mConfigSettings.showCountdown()) {\n            mNewCountdownCheckbox.setVisibility(View.GONE);\n        }\n\n        mNewCountdownView = findViewById(R.id.new_countdown_view);\n        mNewCountdownView.setVisibility(View.GONE);\n\n        mCountdownDays = (EditText) findViewById(R.id.countdown_days);\n        mCountdownHours = (EditText) findViewById(R.id.countdown_hours);\n        mCountdownMins = (EditText) findViewById(R.id.countdown_mins);\n        mCountdownSecs = (EditText) findViewById(R.id.countdown_secs);\n\n        mCountdownCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){\n            @Override\n            public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {\n                if (isChecked){\n                    mNewCountdownCheckbox.setVisibility(View.VISIBLE);\n                } else {\n                    mNewCountdownCheckbox.setChecked(false);\n                    mNewCountdownCheckbox.setVisibility(View.GONE);\n                    mNewCountdownView.setVisibility(View.GONE);\n                }\n            }\n        });\n\n        mNewCountdownCheckbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){\n            @Override\n            public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {\n                if (isChecked){\n                    mNewCountdownView.setVisibility(View.VISIBLE);\n                } else {\n                    mNewCountdownView.setVisibility(View.GONE);\n                }\n            }\n        });\n\n\n        findViewById(R.id.launch_button).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                saveFields();\n\n                InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n                imm.hideSoftInputFromWindow(mStockTickerSymbol.getWindowToken(), 0);\n\n                Intent intent = new Intent(SetUpActivity.this, MirrorActivity.class);\n                startActivity(intent);\n            }\n        });\n    }\n\n    @Override\n    protected void onDestroy() {\n        super.onDestroy();\n        if (mLocationManager != null && mLocationListener != null) {\n            mLocationManager.removeUpdates(mLocationListener);\n        }\n    }\n\n    private void setUpLocationMonitoring() {\n        mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n        Criteria criteria = new Criteria();\n        criteria.setAccuracy(Criteria.ACCURACY_COARSE);\n        String provider = mLocationManager.getBestProvider(criteria, true);\n\n        try {\n            mLocation = mLocationManager.getLastKnownLocation(provider);\n\n            if (mLocation == null) {\n                mLocationView.setVisibility(View.VISIBLE);\n                mLocationListener = new LocationListener() {\n                    @Override\n                    public void onLocationChanged(Location location) {\n                        if (location != null) {\n                            Toast.makeText(SetUpActivity.this, R.string.found_location, Toast.LENGTH_SHORT).show();\n                            mLocation = location;\n                            mConfigSettings.setLatLon(String.valueOf(mLocation.getLatitude()), String.valueOf(mLocation.getLongitude()));\n                            mLocationManager.removeUpdates(this);\n                            if (mLocationView != null) {\n                                mLocationView.setVisibility(View.GONE);\n                            }\n                        }\n                    }\n\n                    @Override\n                    public void onStatusChanged(String provider, int status, Bundle extras) {\n\n                    }\n\n                    @Override\n                    public void onProviderEnabled(String provider) {\n\n                    }\n\n                    @Override\n                    public void onProviderDisabled(String provider) {\n\n                    }\n                };\n                mLocationManager.requestLocationUpdates(provider, HOUR_MILLIS, METERS_MIN, mLocationListener);\n            } else {\n                mLocationView.setVisibility(View.GONE);\n            }\n        } catch (IllegalArgumentException e) {\n            Log.e(\"SetUpActivity\", \"Location manager could not use provider\", e);\n        }\n    }\n\n    private void saveFields() {\n        mConfigSettings.setIsCelsius(mTemperatureChoice.getCheckedRadioButtonId() == R.id.celsius);\n        mConfigSettings.setShowBikingHint(mBikingCheckbox.isChecked());\n        mConfigSettings.setShowMoodDetection(mMoodDetectionCheckbox.isChecked());\n        mConfigSettings.setShowNextCalendarEvent(mShowNextCaledarEventCheckbox.isChecked());\n        mConfigSettings.setShowNewsHeadline(mShowNewsHeadlineCheckbox.isChecked());\n        mConfigSettings.setXKCDPreference(mXKCDCheckbox.isChecked(), mXKCDInvertCheckbox.isChecked());\n        mConfigSettings.setShowCountdown(mCountdownCheckbox.isChecked());\n        if (mNewCountdownCheckbox.isChecked()){\n            mConfigSettings.setCountdownTime(\n                    Integer.parseInt(\"0\"+mCountdownDays.getText().toString()),\n                    Integer.parseInt(\"0\"+mCountdownHours.getText().toString()),\n                    Integer.parseInt(\"0\"+mCountdownMins.getText().toString()),\n                    Integer.parseInt(\"0\"+mCountdownSecs.getText().toString()));\n            mNewCountdownCheckbox.setChecked(false);\n            mNewCountdownView.setVisibility(View.GONE);\n        }\n\n        if (mLocation == null) {\n            mConfigSettings.setLatLon(mLatitude.getText().toString(), mLongitude.getText().toString());\n        } else {\n            mConfigSettings.setLatLon(String.valueOf(mLocation.getLatitude()), String.valueOf(mLocation.getLongitude()));\n        }\n\n        mConfigSettings.setStockTickerSymbol(mStockTickerSymbol.getText().toString());\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/configuration/ConfigurationSettings.java",
    "content": "package com.morristaedt.mirror.configuration;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.graphics.Color;\nimport android.support.annotation.NonNull;\nimport android.text.TextUtils;\n\nimport com.morristaedt.mirror.BuildConfig;\nimport com.morristaedt.mirror.requests.ForecastRequest;\n\nimport java.util.Date;\n\n/**\n * Created by HannahMitt on 9/26/15.\n */\npublic class ConfigurationSettings {\n\n    /**\n     * Hardcode on to enable features outside of their regularly scheduled hours\n     */\n    private static final boolean DEMO_MODE = false;\n\n    private static final String PREFS_MIRROR = \"MirrorPrefs\";\n\n    private static final String FORECAST_UNITS = \"forecast_units\";\n    private static final String TEXT_COLOR = \"text_color\";\n    private static final String BIKING_HINT = \"biking_hint\";\n    private static final String USE_MOOD_DETECTION = \"mood_detection\";\n    private static final String SHOW_CALENDAR = \"show_calendar\";\n    private static final String SHOW_HEADLINE = \"show_headline\";\n    private static final String SHOW_XKCD = \"xkcd\";\n    private static final String INVERT_XKCD = \"invert_xkcd\";\n    private static final String LAT = \"lat\";\n    private static final String LON = \"lon\";\n    private static final String STOCK_TICKER = \"stock_ticker\";\n    private static final String SHOW_COUNTDOWN = \"show_countdown\";\n    private static final String COUNTDOWN_END = \"countdown_end\";\n\n    @NonNull\n    private SharedPreferences mSharedPrefs;\n\n    private String mForecastUnits;\n\n    private boolean mShowBikingHint;\n    private boolean mShowMoodDetection;\n    private boolean mShowNextCalendarEvent;\n    private boolean mShowNewsHeadline;\n    private boolean mShowXKCD;\n    private boolean mInvertXKCD;\n    private boolean mShowCountdown;\n\n    private long mCountdownEnd;\n\n    private String mLatitude;\n    private String mLongitude;\n\n    private String mStockTickerSymbol;\n\n    private int mTextColor;\n\n    public ConfigurationSettings(Context context) {\n        mSharedPrefs = context.getSharedPreferences(PREFS_MIRROR, Context.MODE_PRIVATE);\n        readPrefs();\n    }\n\n    private void readPrefs() {\n        mForecastUnits = mSharedPrefs.getString(FORECAST_UNITS, ForecastRequest.UNITS_US);\n        mTextColor = mSharedPrefs.getInt(TEXT_COLOR, Color.WHITE);\n        mShowBikingHint = mSharedPrefs.getBoolean(BIKING_HINT, false);\n        mShowMoodDetection = mSharedPrefs.getBoolean(USE_MOOD_DETECTION, false);\n        mShowNextCalendarEvent = mSharedPrefs.getBoolean(SHOW_CALENDAR, false);\n        mShowNewsHeadline = mSharedPrefs.getBoolean(SHOW_HEADLINE, false);\n        mShowXKCD = mSharedPrefs.getBoolean(SHOW_XKCD, false);\n        mInvertXKCD = mSharedPrefs.getBoolean(INVERT_XKCD, false);\n        mShowCountdown = mSharedPrefs.getBoolean(SHOW_COUNTDOWN, false);\n        mCountdownEnd = mSharedPrefs.getLong(COUNTDOWN_END, System.currentTimeMillis());\n\n        mLatitude = mSharedPrefs.getString(LAT, \"\");\n        mLongitude = mSharedPrefs.getString(LON, \"\");\n\n        mStockTickerSymbol = mSharedPrefs.getString(STOCK_TICKER, \"\");\n    }\n\n    public void setIsCelsius(boolean isCelsius) {\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putString(FORECAST_UNITS, isCelsius ? ForecastRequest.UNITS_SI : ForecastRequest.UNITS_US);\n        editor.apply();\n    }\n\n    public void setTextColorRed(int red){\n        setTextColor(Color.rgb(red, Color.green(mTextColor), Color.blue(mTextColor)));\n    }\n\n    public void setTextColorGreen(int green){\n        setTextColor(Color.rgb(Color.red(mTextColor), green, Color.blue(mTextColor)));\n    }\n\n    public void setTextColorBlue(int blue){\n        setTextColor(Color.rgb(Color.red(mTextColor), Color.green(mTextColor), blue));\n    }\n\n    public void setTextColor(int color){\n        mTextColor = color;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putInt(TEXT_COLOR, color);\n        editor.apply();\n    }\n\n    public void setShowBikingHint(boolean show) {\n        mShowBikingHint = show;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putBoolean(BIKING_HINT, show);\n        editor.apply();\n    }\n\n    public void setShowMoodDetection(boolean show) {\n        mShowMoodDetection = show;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putBoolean(USE_MOOD_DETECTION, show);\n        editor.apply();\n    }\n\n    public void setShowNextCalendarEvent(boolean show) {\n        mShowNextCalendarEvent = show;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putBoolean(SHOW_CALENDAR, show);\n        editor.apply();\n    }\n\n    public void setShowNewsHeadline(boolean show) {\n        mShowNewsHeadline = show;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putBoolean(SHOW_HEADLINE, show);\n        editor.apply();\n    }\n\n    public void setXKCDPreference(boolean showXKCD, boolean invertXKCDColors) {\n        mShowXKCD = showXKCD;\n        mInvertXKCD = invertXKCDColors;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putBoolean(SHOW_XKCD, showXKCD);\n        editor.putBoolean(INVERT_XKCD, invertXKCDColors);\n        editor.apply();\n    }\n\n    public void setLatLon(String latitude, String longitude) {\n        mLatitude = latitude.trim();\n        mLongitude = longitude.trim();\n\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putString(LAT, mLatitude);\n        editor.putString(LON, mLongitude);\n        editor.apply();\n    }\n\n    public void setStockTickerSymbol(String tickerSymbol) {\n        mStockTickerSymbol = tickerSymbol.replace(\"$\", \"\").trim();\n\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putString(STOCK_TICKER, mStockTickerSymbol);\n        editor.apply();\n    }\n\n    public void setShowCountdown(boolean showCountdown){\n        mShowCountdown = showCountdown;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putBoolean(SHOW_COUNTDOWN, showCountdown);\n        editor.apply();\n    }\n\n    public void setCountdownTime(int days, int hours, int mins, int secs){\n        mCountdownEnd = System.currentTimeMillis();\n        mCountdownEnd += (((days*24l+hours)*60l+mins)*60l+secs)*1000l;\n        SharedPreferences.Editor editor = mSharedPrefs.edit();\n        editor.putLong(COUNTDOWN_END, mCountdownEnd);\n        editor.apply();\n    }\n\n    public boolean getIsCelsius() {\n        return ForecastRequest.UNITS_SI.equals(mForecastUnits);\n    }\n\n    public String getForecastUnits() {\n        return mForecastUnits;\n    }\n\n    public int getTextColor() {\n        return mTextColor;\n    }\n\n    public boolean showBikingHint() {\n        return mShowBikingHint;\n    }\n\n    public boolean showMoodDetection() {\n        return mShowMoodDetection;\n    }\n\n    public boolean showNextCalendarEvent() {\n        return mShowNextCalendarEvent;\n    }\n\n    public boolean showNewsHeadline() {\n        return mShowNewsHeadline;\n    }\n\n    public boolean showXKCD() {\n        return mShowXKCD;\n    }\n\n    public boolean invertXKCD() {\n        return mInvertXKCD;\n    }\n\n    public boolean showCountdown(){\n        return mShowCountdown;\n    }\n\n    public Date getCountdownEnd(){\n        return new Date(mCountdownEnd);\n    }\n\n    public String getLatitude() {\n        return mLatitude;\n    }\n\n    public String getLongitude() {\n        return mLongitude;\n    }\n\n    public boolean showStock() {\n        return !TextUtils.isEmpty(mStockTickerSymbol);\n    }\n\n    public String getStockTickerSymbol() {\n        return mStockTickerSymbol;\n    }\n\n    public static boolean isDebugBuild() {\n        return BuildConfig.DEBUG;\n    }\n\n    /**\n     * Whether we're ignoring timing rules for features\n     *\n     * @return\n     */\n    public static boolean isDemoMode() {\n        return DEMO_MODE;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/BirthdayModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.Locale;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic class BirthdayModule {\n\n    private static HashMap<String, String> mBirthdayMap;\n\n    static {\n        mBirthdayMap = new HashMap<>();\n        mBirthdayMap.put(\"01/17\", \"Hannah\");\n        mBirthdayMap.put(\"05/8\", \"Andy\");\n    }\n\n    public static String getBirthday() {\n        //TODO configuration\n        if (!ConfigurationSettings.isDebugBuild()) {\n            return \"\";\n        }\n\n        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"MM/d\", Locale.US);\n        return mBirthdayMap.get(simpleDateFormat.format(new Date()));\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/CalendarModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.content.ContentResolver;\nimport android.content.Context;\nimport android.database.Cursor;\nimport android.os.AsyncTask;\nimport android.provider.CalendarContract;\nimport android.text.TextUtils;\nimport android.util.Log;\n\nimport java.text.DateFormat;\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\nimport java.util.Date;\n\n/**\n * Created by alex on 12/09/15.\n */\npublic class CalendarModule {\n    public interface CalendarListener {\n        void onCalendarUpdate(String title, String details);\n    }\n\n    public static void getCalendarEvents(final Context context, final CalendarListener calendarListener) {\n        new AsyncTask<Void, Void, Void>() {\n            String title = null;\n            String details = null;\n\n            @Override\n            protected void onPostExecute(Void aVoid) {\n                calendarListener.onCalendarUpdate(title, details);\n            }\n\n            @Override\n            protected Void doInBackground(Void... params) {\n                Cursor cursor;\n                ContentResolver contentResolver = context.getContentResolver();\n                final String[] colsToQuery = new String[]{\n                        CalendarContract.EventsEntity.TITLE,\n                        CalendarContract.EventsEntity.DTSTART,\n                        CalendarContract.EventsEntity.DTEND,\n                        CalendarContract.EventsEntity.EVENT_LOCATION};\n\n                Calendar now = Calendar.getInstance();\n                SimpleDateFormat startFormat = new SimpleDateFormat(\"dd/MM/yy\");\n                String dateString = startFormat.format(now.getTime());\n                long start = now.getTimeInMillis();\n\n                SimpleDateFormat endFormat = new SimpleDateFormat(\"hh:mm:ss dd/MM/yy\");\n                Calendar endOfDay = Calendar.getInstance();\n                Date endofDayDate;\n                try {\n                    endofDayDate = endFormat.parse(\"23:59:59 \" + dateString);\n                    endOfDay.setTime(endofDayDate);\n                } catch (ParseException e) {\n                    Log.e(\"CalendarModule\", e.toString());\n                }\n\n\n                cursor = contentResolver.query(CalendarContract.Events.CONTENT_URI, colsToQuery,\n                        \"( dtstart >\" + start + \") and (dtend  <\" + endOfDay.getTimeInMillis() + \")\",\n                        null, \"dtstart ASC\");\n\n                if (cursor != null) {\n                    if (cursor.getCount() > 0) {\n                        cursor.moveToFirst();\n                        title = cursor.getString(0);\n                        Calendar startTime = Calendar.getInstance();\n                        startTime.setTimeInMillis(cursor.getLong(1));\n                        Calendar endTime = Calendar.getInstance();\n                        endTime.setTimeInMillis(cursor.getLong(2));\n                        DateFormat formatter = SimpleDateFormat.getTimeInstance(DateFormat.SHORT);\n                        details = formatter.format(startTime.getTime()) + \" - \" + formatter.format(endTime.getTime());\n                        if (!TextUtils.isEmpty(cursor.getString(3))) {\n                            details += \" ~ \" + cursor.getString(3);\n                        }\n                    }\n\n                    cursor.close();\n                }\n                return null;\n            }\n        }.execute();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/ChoresModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\n\nimport java.util.Calendar;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic class ChoresModule {\n\n    public static boolean waterPlantsToday() {\n        //TODO configuration\n        if (!ConfigurationSettings.isDebugBuild()) {\n            return false;\n        }\n\n        int dayOfWeek = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);\n        return dayOfWeek == Calendar.TUESDAY || dayOfWeek == Calendar.SATURDAY;\n    }\n\n    public static boolean makeGroceryListToday() {\n        //TODO configuration\n        if (!ConfigurationSettings.isDebugBuild()) {\n            return false;\n        }\n\n        Calendar now = Calendar.getInstance();\n        int dayOfWeek = now.get(Calendar.DAY_OF_WEEK);\n        if (dayOfWeek == Calendar.SUNDAY) {\n            return true;\n        }\n        if (dayOfWeek == Calendar.MONDAY && now.get(Calendar.HOUR_OF_DAY) < 15) {\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/CountdownModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.app.Activity;\n\nimport java.util.Date;\nimport java.util.Timer;\nimport java.util.TimerTask;\n\npublic class CountdownModule {\n\n    public interface CountdownListener {\n        void onCountdownUpdate(String timeLeft);\n    }\n\n    private static Timer timer;\n\n    public static void getTimeRemaining(final Date countdownEnd, final CountdownListener listener){\n        if (timer != null) {\n            timer.cancel();\n        }\n        timer = new Timer();\n\n        timer.scheduleAtFixedRate(new TimerTask() {\n            @Override\n            public void run() {\n                long timeLeft = countdownEnd.getTime() - System.currentTimeMillis();\n                listener.onCountdownUpdate(formatTime(timeLeft));\n            }\n        }, 0, 1000);\n    }\n\n    private static String formatTime(long time) {\n        String formattedTime = \"Time is up!\";\n\n        time /= 1000; //convert to secs\n        if (time <= 0){\n            return formattedTime;\n        }\n        formattedTime = time%60 + \"s\";\n\n        time /= 60; //convert to mins\n        if (time == 0){\n            return formattedTime;\n        }\n        formattedTime = time%60 + \"m \" + formattedTime;\n\n        time /= 60; //convert to hours\n        if (time == 0) {\n            return formattedTime;\n        }\n        formattedTime = time%60 + \"h \" + formattedTime;\n\n        time /= 24; //convert to days\n        if (time == 0) {\n            return formattedTime;\n        }\n        formattedTime = time + \"d \" + formattedTime;\n\n        return formattedTime;\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/DayModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.text.Html;\nimport android.text.Spanned;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\nimport java.util.Locale;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic class DayModule {\n\n    public static Spanned getDay() {\n        SimpleDateFormat formatDayOfMonth = new SimpleDateFormat(\"EEEE\", Locale.US);\n        Calendar now = Calendar.getInstance();\n        int dayOfMonth = now.get(Calendar.DAY_OF_MONTH);\n        return Html.fromHtml(formatDayOfMonth.format(now.getTime()) + \" the \" + dayOfMonth + \"<sup><small>\" + getDayOfMonthSuffix(dayOfMonth) + \"</small></sup>\");\n    }\n\n    private static String getDayOfMonthSuffix(final int n) {\n        if (n >= 11 && n <= 13) {\n            return \"th\";\n        }\n        switch (n % 10) {\n            case 1:\n                return \"st\";\n            case 2:\n                return \"nd\";\n            case 3:\n                return \"rd\";\n            default:\n                return \"th\";\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/ForecastModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.os.AsyncTask;\nimport android.support.annotation.NonNull;\nimport android.util.Log;\n\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\nimport com.morristaedt.mirror.requests.ForecastRequest;\nimport com.morristaedt.mirror.requests.ForecastResponse;\nimport com.morristaedt.mirror.requests.OpenWeatherRequest;\nimport com.morristaedt.mirror.requests.OpenWeatherResponse;\nimport com.morristaedt.mirror.utils.WeekUtil;\n\nimport java.util.Calendar;\nimport java.util.List;\nimport java.util.Locale;\n\nimport retrofit.RestAdapter;\nimport retrofit.RetrofitError;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic class ForecastModule {\n\n    public interface ForecastListener {\n        void onWeatherToday(String weatherToday);\n\n        void onShouldBike(boolean showToday, boolean shouldBike);\n    }\n\n    /**\n     * @param apiKey   The api key for the forecast.io weather api\n     * @param units\n     * @param lat\n     * @param lon\n     * @param listener\n     */\n    public static void getForecastIOHourlyForecast(final String apiKey, final String units, final String lat, final String lon, final ForecastListener listener) {\n        new AsyncTask<Void, Void, ForecastResponse>() {\n\n            @Override\n            protected ForecastResponse doInBackground(Void... params) {\n                RestAdapter restAdapter = new RestAdapter.Builder()\n                        .setEndpoint(\"https://api.forecast.io\")\n                        .build();\n\n                ForecastRequest service = restAdapter.create(ForecastRequest.class);\n                String excludes = \"minutely,daily,flags\";\n\n                try {\n                    return service.getHourlyForecast(apiKey, lat, lon, excludes, units, Locale.getDefault().getLanguage());\n                } catch (RetrofitError error) {\n                    Log.w(\"ForecastModule\", \"Forecast error: \" + error.getMessage());\n                    return null;\n                }\n            }\n\n            @Override\n            protected void onPostExecute(ForecastResponse forecastResponse) {\n                if (forecastResponse != null) {\n                    if (forecastResponse.currently != null) {\n                        listener.onWeatherToday(forecastResponse.currently.getDisplayTemperature() + \" \" + forecastResponse.currently.summary);\n                    }\n\n                    if (forecastResponse.hourly != null && forecastResponse.hourly.data != null && (ConfigurationSettings.isDemoMode() || WeekUtil.isWeekdayBeforeFive())) {\n                        listener.onShouldBike(true, shouldBikeToday(forecastResponse.hourly.data));\n                    } else {\n                        listener.onShouldBike(false, true);\n                    }\n                }\n            }\n\n            private boolean shouldBikeToday(List<ForecastResponse.Hour> hours) {\n                int dayOfMonthToday = Calendar.getInstance().get(Calendar.DAY_OF_MONTH);\n\n                for (ForecastResponse.Hour hour : hours) {\n                    Calendar hourCalendar = hour.getCalendar();\n\n                    // Only check hourly forecast for today\n                    if (hourCalendar.get(Calendar.DAY_OF_MONTH) == dayOfMonthToday) {\n                        int hourOfDay = hourCalendar.get(Calendar.HOUR_OF_DAY);\n                        if (hourOfDay >= 7 && hourOfDay <= 11) {\n                            if (hour.precipProbability >= 0.3) {\n                                return false;\n                            }\n                        } else if (hourOfDay >= 17 && hourOfDay <= 19) {\n                            if (hour.precipProbability >= 0.3) {\n                                return false;\n                            }\n                        }\n                    }\n                }\n\n                return true;\n            }\n        }.execute();\n\n    }\n\n    /**\n     * @param apiKey   The api key for the openweather api\n     * @param units\n     * @param lat\n     * @param lon\n     * @param listener\n     */\n    public static void getOpenWeatherForecast(final String apiKey, final String units, final String lat, final String lon, final ForecastListener listener) {\n        new AsyncTask<Void, Void, OpenWeatherResponse>() {\n\n            @Override\n            protected OpenWeatherResponse doInBackground(Void... params) {\n                RestAdapter restAdapter = new RestAdapter.Builder()\n                        .setEndpoint(\"http://api.openweathermap.org\")\n                        .build();\n\n                OpenWeatherRequest service = restAdapter.create(OpenWeatherRequest.class);\n\n                try {\n                    return service.getCurrentForecast(apiKey, lat, lon, getOpenWeatherUnits(units), Locale.getDefault().getLanguage());\n                } catch (RetrofitError error) {\n                    Log.w(\"ForecastModule\", \"Forecast error: \" + error.getMessage());\n                    return null;\n                }\n            }\n\n            @Override\n            protected void onPostExecute(OpenWeatherResponse response) {\n                if (response != null) {\n                    if (response.main != null) {\n                        listener.onWeatherToday(response.main.getDisplayTemperature() + \" \" + response.getWeatherDescription());\n                    }\n                }\n            }\n\n        }.execute();\n\n    }\n\n    @NonNull\n    private static String getOpenWeatherUnits(String units) {\n        if (units.equalsIgnoreCase(ForecastRequest.UNITS_SI)) {\n            return OpenWeatherRequest.UNITS_METRIC;\n        } else if (units.equalsIgnoreCase(ForecastRequest.UNITS_US)) {\n            return OpenWeatherRequest.UNITS_IMPERIAL;\n        }\n        return units;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/MoodModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.content.Context;\nimport android.content.res.Resources;\nimport android.util.Log;\nimport android.util.SparseArray;\n\nimport com.google.android.gms.vision.CameraSource;\nimport com.google.android.gms.vision.Detector;\nimport com.google.android.gms.vision.face.Face;\nimport com.google.android.gms.vision.face.FaceDetector;\nimport com.morristaedt.mirror.R;\n\nimport java.io.IOException;\nimport java.lang.ref.WeakReference;\n\n/**\n * Created by akodiakson on 9/13/15.\n */\npublic class MoodModule {\n    private static final String TAG = \"MoodModule\";\n    private WeakReference<Context> mContextWeakReference;\n    private CameraSource mCameraSource = null;\n\n    private MoodListener mCallBacks;\n\n    public interface MoodListener {\n        void onShouldGivePositiveAffirmation(String affirmation);\n    }\n\n    public MoodModule(WeakReference<Context> contextWeakReference) {\n        mContextWeakReference = contextWeakReference;\n    }\n\n    public void getCurrentMood(MoodListener moodListener) {\n        createCameraSource();\n        mCallBacks = moodListener;\n    }\n\n    public void release() {\n        if (mCameraSource != null) {\n            mCameraSource.release();\n            mCameraSource = null;\n        }\n    }\n\n    /**\n     * Creates and starts the camera.  Note that this uses a higher resolution in comparison\n     * to other detection examples to enable the barcode detector to detect small barcodes\n     * at long distances.\n     */\n    private void createCameraSource() {\n\n        Context context = mContextWeakReference.get();\n        FaceDetector detector = new FaceDetector.Builder(context)\n                .setClassificationType(FaceDetector.ALL_CLASSIFICATIONS)\n                .build();\n\n        detector.setProcessor(new Detector.Processor<Face>() {\n            @Override\n            public void release() {\n\n            }\n\n            @Override\n            public void receiveDetections(final Detector.Detections<Face> detections) {\n                final SparseArray<Face> detectedItems = detections.getDetectedItems();\n                if (detectedItems.size() != 0) {\n                    final int key = detectedItems.keyAt(0);\n                    final Face face = detectedItems.get(key);\n                    final float isSmilingProbability = face.getIsSmilingProbability();\n                    String feedback = getFeedbackForSmileProbability(isSmilingProbability);\n                    mCallBacks.onShouldGivePositiveAffirmation(feedback);\n                }\n            }\n        });\n\n        if (!detector.isOperational()) {\n            // Note: The first time that an app using face API is installed on a device, GMS will\n            // download a native library to the device in order to do detection.  Usually this\n            // completes before the app is run for the first time.  But if that download has not yet\n            // completed, then the above call will not detect any faces.\n            //\n            // isOperational() can be used to check if the required native library is currently\n            // available.  The detector will automatically become operational once the library\n            // download completes on device.\n            Log.w(TAG, \"Face detector dependencies are not yet available.\");\n        }\n\n        try {\n            mCameraSource = new CameraSource.Builder(context, detector)\n                    .setRequestedPreviewSize(640, 480)\n                    .setFacing(CameraSource.CAMERA_FACING_FRONT)\n                    .setRequestedFps(30.0f)\n                    .build();\n\n            mCameraSource.start();\n        } catch (IOException | RuntimeException e) {\n            Log.e(TAG, \"Something went horribly wrong, with your face.\", e);\n        }\n    }\n\n    private String getFeedbackForSmileProbability(float isSmilingProbability) {\n        final boolean isSmiling = isSmilingProbability > 0.5f;\n        final boolean aFaceIsntDetected = isSmilingProbability <= 0;\n\n        String feedback;\n\n        if (isSmiling || aFaceIsntDetected) {\n            return null;\n        }\n\n        final Resources resources = mContextWeakReference.get().getResources();\n        if (isSmilingProbability < 0.15) {\n            feedback = resources.getString(R.string.it_gets_better);\n        } else if (isSmilingProbability < 0.30) {\n            feedback = resources.getString(R.string.looking_good);\n        } else {\n            feedback = resources.getString(R.string.something_special);\n        }\n\n        return feedback;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/NewsModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.os.AsyncTask;\nimport android.util.Log;\n\nimport org.mcsoxford.rss.RSSFeed;\nimport org.mcsoxford.rss.RSSReader;\nimport org.mcsoxford.rss.RSSReaderException;\n\n/**\n * Created by alex on 21/09/15.\n */\npublic class NewsModule {\n    public interface NewsListener {\n        void onNewNews(String headline);\n    }\n\n    public static void getNewsHeadline(final NewsListener newsListener) {\n        new AsyncTask<Void, Void, String>() {\n            @Override\n            protected void onPostExecute(String s) {\n                super.onPostExecute(s);\n                newsListener.onNewNews(s);\n            }\n\n            @Override\n            protected String doInBackground(Void... params) {\n                RSSReader rssReader = new RSSReader();\n                String url = \"http://feeds.bbci.co.uk/news/world/rss.xml?edition=uk\";\n                try {\n                    RSSFeed feed = rssReader.load(url);\n                    String headline = feed.getItems().get(0).getTitle();\n                    for (int i = 1; i < 10; ++i) {\n                        headline += \"                \" + feed.getItems().get(i).getTitle();\n                    }\n                    return headline;\n                } catch (RSSReaderException e) {\n                    Log.e(\"NewsModule\", \"Error parsing RSS\");\n                    return null;\n                } catch (Exception e) {\n                    // not great to catch general exceptions, but this lib is being sketchy\n                    Log.e(\"NewsModule\", \"Error parsing RSS\");\n                    return null;\n                }\n            }\n        }.execute();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/TimeModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.content.res.Resources;\nimport android.support.annotation.NonNull;\n\nimport com.morristaedt.mirror.R;\n\nimport java.util.Calendar;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic class TimeModule {\n\n    public static String getTimeOfDayWelcome(@NonNull Resources resources) {\n        Calendar now = Calendar.getInstance();\n        int hour = now.get(Calendar.HOUR_OF_DAY);\n        int timeRes;\n        if (hour < 4) {\n            timeRes = R.string.late;\n        } else if (hour < 12) {\n            timeRes = R.string.good_morning;\n        } else if (hour < 17) { // 5pm\n            timeRes = R.string.good_afternoon;\n        } else if (hour < 22) { // 10pm\n            timeRes = R.string.good_evening;\n        } else { // 10pm - midnight is bedtime\n            timeRes = R.string.bedtime;\n        }\n\n        return resources.getString(timeRes, resources.getString(R.string.owners));\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/TrainScheduleModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport java.util.List;\n\n/**\n * Created by asm on 8/23/15.\n */\npublic class TrainScheduleModule {\n\n    public int waitingSecondsForNextArrivalWithBufferSeconds(int bufferSeconds) {\n        /*\n        earliestArrivalAfterNowWithBufferSeconds(bufferSeconds) - (nowDaySeconds + bufferSeconds);\n        */\n        return 0;\n    }\n\n    public int earliestArrivalAfterNowWithBufferSeconds(int bufferSeconds) {\n        // earliestArrivalAfterDaySeconds(nowDaySeconds+bufferSeconds);\n        return 0;\n    }\n\n    public int earliestArrivalAfterDaySeconds (int afterDaySecs) {\n        /*\n        nowSchedule.find {\n            time:\n            Int =>time >= afterDaySecs\n        } match {\n            case Some(time: Int)=>time\n            case _ =>((60 * 60 * 24) + nowSchedule(0))\n        }\n        */\n        return 0;\n    }\n\n    public int nowDaySeconds() {\n        /*\n        val calendar:Calendar = Calendar.getInstance();\n        val now:Long = calendar.getTimeInMillis();\n\n        calendar.set(Calendar.HOUR_OF_DAY, 0);\n        calendar.set(Calendar.MINUTE, 0);\n        calendar.set(Calendar.SECOND, 0);\n        calendar.set(Calendar.MILLISECOND, 0);\n\n        ((now - calendar.getTimeInMillis())/1000L).toInt;\n        */\n        return 0;\n    }\n\n    public int stringToDaySeconds(String daySecsString) {\n        /*\n        val elements = daySecsString.split(\":\")\n        (\n            (elements(0).toInt * 60 * 60)\n                + (elements(1).toInt * 60)\n                + elements(2).toInt\n        ) % (60 * 60 * 24)\n        */\n        return 0;\n    }\n\n    public List<Integer> nowSchedule() {\n        /*\n        Calendar.getInstance().get(Calendar.DAY_OF_WEEK) match {\n        case Calendar.SATURDAY => saturdaySchedule\n        case Calendar.SUNDAY => sundaySchedule\n        case _ => weekdaySchedule\n        */\n        return null;\n    }\n\n    /**\n     * Weekday schedule for the F train out of\n     * station F21N.\n     */\n    /*\n    val weekdaySchedule:List[Int] = List(\n        \"02:30:30\",\n            \"02:50:30\",\n            \"03:10:30\",\n            \"03:30:30\",\n            \"03:50:30\",\n            \"04:10:30\",\n            \"04:30:30\",\n            \"04:50:30\",\n            \"05:10:00\",\n            \"05:24:00\",\n            \"05:38:00\",\n            \"05:50:00\",\n            \"06:02:00\",\n            \"06:14:00\",\n            \"06:24:00\",\n            \"06:34:00\",\n            \"06:44:00\",\n            \"06:52:00\",\n            \"06:59:00\",\n            \"07:05:00\",\n            \"07:11:00\",\n            \"07:17:00\",\n            \"07:23:00\",\n            \"07:29:00\",\n            \"07:34:00\",\n            \"07:39:00\",\n            \"07:44:00\",\n            \"07:49:00\",\n            \"07:53:00\",\n            \"07:59:00\",\n            \"08:03:30\",\n            \"08:08:30\",\n            \"08:13:30\",\n            \"08:17:30\",\n            \"08:21:30\",\n            \"08:25:30\",\n            \"08:29:30\",\n            \"08:33:30\",\n            \"08:37:30\",\n            \"08:43:00\",\n            \"08:48:30\",\n            \"08:53:00\",\n            \"08:58:00\",\n            \"09:03:00\",\n            \"09:08:00\",\n            \"09:14:00\",\n            \"09:20:00\",\n            \"09:26:00\",\n            \"09:32:00\",\n            \"09:37:30\",\n            \"09:44:00\",\n            \"09:51:00\",\n            \"09:58:00\",\n            \"10:06:00\",\n            \"10:14:00\",\n            \"10:20:00\",\n            \"10:29:00\",\n            \"10:34:30\",\n            \"10:42:00\",\n            \"10:50:00\",\n            \"10:59:00\",\n            \"11:04:30\",\n            \"11:11:30\",\n            \"11:20:00\",\n            \"11:27:30\",\n            \"11:35:00\",\n            \"11:42:00\",\n            \"11:50:00\",\n            \"11:57:30\",\n            \"12:05:00\",\n            \"12:12:00\",\n            \"12:20:00\",\n            \"12:27:30\",\n            \"12:35:00\",\n            \"12:42:00\",\n            \"12:50:00\",\n            \"12:57:30\",\n            \"13:05:00\",\n            \"13:12:00\",\n            \"13:20:00\",\n            \"13:27:30\",\n            \"13:35:00\",\n            \"13:42:00\",\n            \"13:50:00\",\n            \"13:57:30\",\n            \"14:05:00\",\n            \"14:12:00\",\n            \"14:19:30\",\n            \"14:25:30\",\n            \"14:31:00\",\n            \"14:37:00\",\n            \"14:42:00\",\n            \"14:49:00\",\n            \"14:54:00\",\n            \"15:01:00\",\n            \"15:06:00\",\n            \"15:12:00\",\n            \"15:18:30\",\n            \"15:25:00\",\n            \"15:30:00\",\n            \"15:37:00\",\n            \"15:42:00\",\n            \"15:48:30\",\n            \"15:53:30\",\n            \"15:58:30\",\n            \"16:01:30\",\n            \"16:08:00\",\n            \"16:12:00\",\n            \"16:18:00\",\n            \"16:23:00\",\n            \"16:25:30\",\n            \"16:31:00\",\n            \"16:34:00\",\n            \"16:38:00\",\n            \"16:41:00\",\n            \"16:46:00\",\n            \"16:50:00\",\n            \"16:54:00\",\n            \"16:57:30\",\n            \"17:02:00\",\n            \"17:06:00\",\n            \"17:10:00\",\n            \"17:14:00\",\n            \"17:18:00\",\n            \"17:22:00\",\n            \"17:26:00\",\n            \"17:31:00\",\n            \"17:35:30\",\n            \"17:40:30\",\n            \"17:45:30\",\n            \"17:51:30\",\n            \"17:57:00\",\n            \"18:01:30\",\n            \"18:06:30\",\n            \"18:11:00\",\n            \"18:18:00\",\n            \"18:22:00\",\n            \"18:26:00\",\n            \"18:33:00\",\n            \"18:38:30\",\n            \"18:44:00\",\n            \"18:49:00\",\n            \"18:53:00\",\n            \"18:58:00\",\n            \"19:04:00\",\n            \"19:09:30\",\n            \"19:14:00\",\n            \"19:20:30\",\n            \"19:25:00\",\n            \"19:30:00\",\n            \"19:36:00\",\n            \"19:42:00\",\n            \"19:48:00\",\n            \"19:54:00\",\n            \"20:00:00\",\n            \"20:06:00\",\n            \"20:12:00\",\n            \"20:18:00\",\n            \"20:24:00\",\n            \"20:29:00\",\n            \"20:36:00\",\n            \"20:42:00\",\n            \"20:48:00\",\n            \"20:54:00\",\n            \"21:02:00\",\n            \"21:09:30\",\n            \"21:17:00\",\n            \"21:24:30\",\n            \"21:32:00\",\n            \"21:39:00\",\n            \"21:44:30\",\n            \"21:54:00\",\n            \"22:04:00\",\n            \"22:14:30\",\n            \"22:24:30\",\n            \"22:35:30\",\n            \"22:47:30\",\n            \"22:59:30\",\n            \"23:11:30\",\n            \"23:23:30\",\n            \"23:35:30\",\n            \"23:47:00\",\n            \"23:59:00\",\n            \"24:10:30\",\n            \"24:22:30\",\n            \"24:35:00\",\n            \"24:50:30\",\n            \"25:10:30\",\n            \"25:30:30\",\n            \"25:50:30\",\n            \"26:10:30\"\n    ).map(stringToDaySeconds(_)).sortWith(_ < _)\n    */\n\n    /**\n     * Saturday schedule for the F train out of\n     * station F21N.\n     */\n    /*\n    val saturdaySchedule:List[Int] = List(\n        \"02:30:30\",\n            \"02:50:30\",\n            \"03:10:30\",\n            \"03:30:30\",\n            \"03:50:30\",\n            \"04:10:30\",\n            \"04:30:30\",\n            \"04:50:30\",\n            \"05:10:30\",\n            \"05:30:30\",\n            \"05:50:30\",\n            \"06:09:30\",\n            \"06:27:00\",\n            \"06:44:00\",\n            \"06:59:30\",\n            \"07:11:30\",\n            \"07:24:30\",\n            \"07:36:30\",\n            \"07:48:30\",\n            \"08:00:30\",\n            \"08:12:30\",\n            \"08:24:30\",\n            \"08:35:30\",\n            \"08:45:30\",\n            \"08:55:30\",\n            \"09:05:30\",\n            \"09:15:30\",\n            \"09:25:30\",\n            \"09:35:30\",\n            \"09:45:30\",\n            \"09:55:30\",\n            \"10:05:30\",\n            \"10:15:30\",\n            \"10:25:30\",\n            \"10:35:30\",\n            \"10:45:30\",\n            \"10:55:30\",\n            \"11:05:30\",\n            \"11:15:30\",\n            \"11:25:30\",\n            \"11:35:30\",\n            \"11:45:30\",\n            \"11:55:30\",\n            \"12:05:30\",\n            \"12:15:30\",\n            \"12:25:30\",\n            \"12:35:30\",\n            \"12:45:30\",\n            \"12:55:30\",\n            \"13:05:30\",\n            \"13:15:30\",\n            \"13:25:30\",\n            \"13:35:30\",\n            \"13:45:30\",\n            \"13:55:30\",\n            \"14:05:30\",\n            \"14:15:30\",\n            \"14:25:30\",\n            \"14:35:30\",\n            \"14:45:30\",\n            \"14:55:30\",\n            \"15:05:30\",\n            \"15:15:30\",\n            \"15:25:30\",\n            \"15:35:30\",\n            \"15:45:30\",\n            \"15:55:30\",\n            \"16:05:30\",\n            \"16:15:30\",\n            \"16:25:30\",\n            \"16:35:30\",\n            \"16:45:30\",\n            \"16:55:30\",\n            \"17:05:30\",\n            \"17:15:30\",\n            \"17:25:30\",\n            \"17:35:30\",\n            \"17:45:30\",\n            \"17:55:30\",\n            \"18:05:30\",\n            \"18:15:30\",\n            \"18:25:30\",\n            \"18:35:30\",\n            \"18:45:30\",\n            \"18:55:30\",\n            \"19:05:30\",\n            \"19:15:30\",\n            \"19:25:30\",\n            \"19:35:30\",\n            \"19:45:30\",\n            \"19:55:30\",\n            \"20:05:30\",\n            \"20:15:30\",\n            \"20:25:30\",\n            \"20:35:30\",\n            \"20:45:30\",\n            \"20:55:30\",\n            \"21:05:30\",\n            \"21:16:00\",\n            \"21:30:00\",\n            \"21:41:30\",\n            \"21:53:30\",\n            \"22:05:30\",\n            \"22:17:30\",\n            \"22:29:30\",\n            \"22:41:00\",\n            \"22:53:00\",\n            \"23:05:00\",\n            \"23:17:00\",\n            \"23:29:00\",\n            \"23:41:00\",\n            \"23:53:00\",\n            \"24:05:00\",\n            \"24:17:00\",\n            \"24:30:30\",\n            \"24:50:30\",\n            \"25:10:30\",\n            \"25:30:30\",\n            \"25:50:30\",\n            \"26:10:30\"\n    ).map(stringToDaySeconds(_)).sortWith(_ < _)\n    */\n\n    /**\n     * Sunday schedule for the F train out of\n     * station F21N.\n     */\n    /*\n    val sundaySchedule:List[Int] = List(\n        \"02:30:30\",\n            \"02:50:30\",\n            \"03:10:30\",\n            \"03:30:30\",\n            \"03:50:30\",\n            \"04:10:30\",\n            \"04:30:30\",\n            \"04:50:30\",\n            \"05:10:30\",\n            \"05:30:30\",\n            \"05:50:30\",\n            \"06:10:30\",\n            \"06:30:30\",\n            \"06:50:30\",\n            \"07:10:30\",\n            \"07:30:00\",\n            \"07:49:00\",\n            \"08:04:00\",\n            \"08:19:30\",\n            \"08:34:30\",\n            \"08:49:30\",\n            \"09:04:30\",\n            \"09:16:30\",\n            \"09:28:30\",\n            \"09:40:30\",\n            \"09:52:30\",\n            \"10:04:30\",\n            \"10:16:30\",\n            \"10:28:30\",\n            \"10:38:30\",\n            \"10:48:30\",\n            \"10:58:30\",\n            \"11:08:30\",\n            \"11:18:30\",\n            \"11:28:30\",\n            \"11:38:30\",\n            \"11:48:30\",\n            \"11:58:30\",\n            \"12:08:30\",\n            \"12:18:30\",\n            \"12:28:30\",\n            \"12:38:30\",\n            \"12:48:30\",\n            \"12:58:30\",\n            \"13:08:30\",\n            \"13:18:30\",\n            \"13:28:30\",\n            \"13:38:30\",\n            \"13:48:30\",\n            \"13:58:30\",\n            \"14:08:30\",\n            \"14:18:30\",\n            \"14:28:30\",\n            \"14:38:30\",\n            \"14:48:30\",\n            \"14:58:30\",\n            \"15:08:30\",\n            \"15:18:30\",\n            \"15:28:30\",\n            \"15:38:30\",\n            \"15:48:30\",\n            \"15:58:30\",\n            \"16:08:30\",\n            \"16:18:30\",\n            \"16:28:30\",\n            \"16:38:30\",\n            \"16:48:30\",\n            \"16:58:30\",\n            \"17:08:30\",\n            \"17:18:30\",\n            \"17:28:30\",\n            \"17:38:30\",\n            \"17:48:30\",\n            \"17:58:30\",\n            \"18:08:30\",\n            \"18:18:30\",\n            \"18:28:30\",\n            \"18:38:30\",\n            \"18:48:30\",\n            \"18:58:30\",\n            \"19:08:30\",\n            \"19:18:30\",\n            \"19:28:30\",\n            \"19:38:30\",\n            \"19:48:30\",\n            \"19:58:30\",\n            \"20:08:30\",\n            \"20:18:30\",\n            \"20:29:30\",\n            \"20:41:30\",\n            \"20:53:30\",\n            \"21:05:30\",\n            \"21:17:30\",\n            \"21:28:30\",\n            \"21:40:30\",\n            \"21:52:30\",\n            \"22:04:30\",\n            \"22:19:00\",\n            \"22:34:00\",\n            \"22:49:00\",\n            \"23:04:00\",\n            \"23:19:00\",\n            \"23:34:00\",\n            \"23:50:30\",\n            \"24:10:30\",\n            \"24:30:30\",\n            \"24:50:30\",\n            \"25:10:30\",\n            \"25:30:30\",\n            \"25:50:30\",\n            \"26:10:30\"\n    ).map(stringToDaySeconds(_)).sortWith(_ < _)\n    */\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/XKCDModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.os.AsyncTask;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\nimport android.text.TextUtils;\nimport android.util.Log;\n\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\nimport com.morristaedt.mirror.requests.XKCDRequest;\nimport com.morristaedt.mirror.requests.XKCDResponse;\n\nimport java.util.Calendar;\n\nimport retrofit.RestAdapter;\nimport retrofit.RetrofitError;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic class XKCDModule {\n\n    public interface XKCDListener {\n        void onNewXKCDToday(String url);\n    }\n\n    /**\n     * Fetch the the latest xkcd comic, but only show it if its new today\n     *\n     * @param listener\n     */\n    public static void getXKCDForToday(final XKCDListener listener) {\n        new AsyncTask<Void, Void, XKCDResponse>() {\n\n            @Override\n            protected XKCDResponse doInBackground(Void... params) {\n                RestAdapter restAdapter = new RestAdapter.Builder()\n                        .setEndpoint(\"http://xkcd.com\")\n                        .build();\n\n                XKCDRequest service = restAdapter.create(XKCDRequest.class);\n                try {\n                    return service.getLatestXKCD();\n                } catch (RetrofitError e) {\n                    Log.w(\"XKCDModule\", \"Error loading xkcd\", e);\n                    return null;\n                }\n            }\n\n            @Override\n            protected void onPostExecute(@Nullable XKCDResponse xkcdResponse) {\n                if (xkcdResponse != null && !TextUtils.isEmpty(xkcdResponse.img)) {\n                    if (ConfigurationSettings.isDemoMode() || isTodaysXKCD(xkcdResponse)) {\n                        listener.onNewXKCDToday(xkcdResponse.img);\n                        return;\n                    }\n                }\n                listener.onNewXKCDToday(null);\n            }\n\n            private boolean isTodaysXKCD(@NonNull XKCDResponse xkcdResponse) {\n                Calendar today = Calendar.getInstance();\n                return xkcdResponse.day == today.get(Calendar.DAY_OF_MONTH) && xkcdResponse.month == (today.get(Calendar.MONTH) + 1) && xkcdResponse.year == today.get(Calendar.YEAR);\n            }\n        }.execute();\n\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/modules/YahooFinanceModule.java",
    "content": "package com.morristaedt.mirror.modules;\n\nimport android.os.AsyncTask;\nimport android.support.annotation.Nullable;\nimport android.util.Log;\n\nimport com.morristaedt.mirror.configuration.ConfigurationSettings;\nimport com.morristaedt.mirror.requests.YahooFinanceRequest;\nimport com.morristaedt.mirror.requests.YahooStockResponse;\n\nimport java.math.BigDecimal;\n\nimport retrofit.RestAdapter;\nimport retrofit.RetrofitError;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic class YahooFinanceModule {\n\n    public interface StockListener {\n        void onNewStockPrice(YahooStockResponse.YahooQuoteResponse quoteResponse);\n    }\n\n    /**\n     * Fetch the the latest stock price, but only show it if its a large change\n     *\n     * @param listener\n     */\n    public static void getStockForToday(final String stockName, final StockListener listener) {\n\n        new AsyncTask<Void, Void, YahooStockResponse>() {\n\n            @Override\n            protected YahooStockResponse doInBackground(Void... params) {\n                RestAdapter restAdapter = new RestAdapter.Builder()\n                        .setEndpoint(\"http://query.yahooapis.com/v1/public\")\n                        .build();\n\n                YahooFinanceRequest service = restAdapter.create(YahooFinanceRequest.class);\n\n                String query = \"select * from yahoo.finance.quotes where symbol in (\\\"\" + stockName + \"\\\")\";\n                String env = \"http://datatables.org/alltables.env\";\n                String format = \"json\";\n                try {\n                    return service.getStockData(query, env, format);\n                } catch (RetrofitError error) {\n                    Log.w(\"YahooFinanceModule\", \"YahooFinance error: \" + error.getMessage());\n                    return null;\n                }\n            }\n\n            @Override\n            protected void onPostExecute(@Nullable YahooStockResponse stockResponse) {\n                if (stockResponse != null && stockResponse.getQuoteResponse() != null) {\n                    YahooStockResponse.YahooQuoteResponse quoteResponse = stockResponse.getQuoteResponse();\n                    if (ConfigurationSettings.isDemoMode() || quoteResponse.getPercentageChange().abs().compareTo(BigDecimal.valueOf(0.03)) >= 0) {\n                        listener.onNewStockPrice(quoteResponse);\n                        return;\n                    }\n                }\n                listener.onNewStockPrice(null);\n            }\n        }.execute();\n\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/receiver/AlarmReceiver.java",
    "content": "package com.morristaedt.mirror.receiver;\n\nimport android.app.AlarmManager;\nimport android.app.PendingIntent;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.PowerManager;\nimport android.os.SystemClock;\n\nimport com.morristaedt.mirror.MirrorActivity;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic class AlarmReceiver extends BroadcastReceiver {\n\n    private static final int REQUEST_CODE = 1001;\n\n    private static final String WAKE_LOCK = \"HomeMirrorWakeLock\";\n    private static final long MINUTES_10 = 10 * 60 * 1000;\n\n    public static void startMirrorUpdates(Context context) {\n        AlarmManager alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n\n        Intent intent = new Intent(context, AlarmReceiver.class);\n        PendingIntent alarmIntent = PendingIntent.getBroadcast(context, REQUEST_CODE, intent, 0);\n\n        alarmMgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + MINUTES_10, MINUTES_10, alarmIntent);\n    }\n\n    public static void stopMirrorUpdates(Context context) {\n        AlarmManager alarmMgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);\n\n        Intent intent = new Intent(context, AlarmReceiver.class);\n        PendingIntent alarmIntent = PendingIntent.getBroadcast(context, REQUEST_CODE, intent, 0);\n\n        alarmMgr.cancel(alarmIntent);\n    }\n\n    @Override\n    public void onReceive(Context context, Intent intent) {\n        PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);\n        PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKE_LOCK);\n        wakeLock.acquire();\n\n        Intent mainActivityIntent = new Intent(context, MirrorActivity.class);\n        mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        context.startActivity(mainActivityIntent);\n\n        wakeLock.release();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/ForecastRequest.java",
    "content": "package com.morristaedt.mirror.requests;\n\nimport retrofit.http.GET;\nimport retrofit.http.Path;\nimport retrofit.http.Query;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic interface ForecastRequest {\n\n    public static final String UNITS_SI = \"si\";\n    public static final String UNITS_US = \"us\";\n\n    @GET(\"/forecast/{apikey}/{lat},{lon}\")\n    ForecastResponse getHourlyForecast(@Path(\"apikey\") String apiKey, @Path(\"lat\") String lat, @Path(\"lon\") String lon, @Query(\"exclude\") String exclude, @Query(\"units\") String units, @Query(\"lang\") String language);\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/ForecastResponse.java",
    "content": "package com.morristaedt.mirror.requests;\n\nimport java.util.ArrayList;\nimport java.util.Calendar;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic class ForecastResponse {\n\n    float latitude;\n    float longitude;\n\n    public ForecastCurrently currently;\n    public ForecastHourly hourly;\n\n    public class ForecastCurrently {\n        public String summary;\n        public float temperature;\n\n        public String getDisplayTemperature() {\n            return String.valueOf(Math.round(temperature)) + (char) 0x00B0;\n        }\n    }\n\n    public class ForecastHourly {\n        String summary;\n        public ArrayList<Hour> data;\n    }\n\n    public class Hour {\n        public long time; // in seconds\n        public String summary;\n        public String precipType;\n        public float precipProbability;\n        public float temperature;\n\n        public Calendar getCalendar() {\n            Calendar calendar = Calendar.getInstance();\n            calendar.setTimeInMillis(time * 1000);\n            return calendar;\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/OpenWeatherRequest.java",
    "content": "package com.morristaedt.mirror.requests;\n\nimport retrofit.http.GET;\nimport retrofit.http.Query;\n\n/**\n */\npublic interface OpenWeatherRequest {\n\n    String UNITS_METRIC = \"metric\";\n    String UNITS_IMPERIAL = \"imperial\";\n\n    @GET(\"/data/2.5/weather\")\n    OpenWeatherResponse getCurrentForecast(@Query(\"APPID\") String apiKey,\n                                           @Query(\"lat\") String lat,\n                                           @Query(\"lon\") String lon,\n                                           @Query(\"units\") String units,\n                                           @Query(\"lang\") String language);\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/OpenWeatherResponse.java",
    "content": "package com.morristaedt.mirror.requests;\n\nimport android.text.TextUtils;\n\nimport java.util.ArrayList;\n\n/**\n */\npublic class OpenWeatherResponse {\n\n    public ArrayList<Weather> weather;\n    public Main main;\n\n    public String getWeatherDescription() {\n        if (weather != null && weather.size() > 0) {\n            return TextUtils.join(\", \", weather);\n        }\n        return \"\";\n    }\n\n    public class Weather {\n        public String description;\n\n        public String getDescription() {\n            return description;\n        }\n\n        @Override\n        public String toString() {\n            return getDescription();\n        }\n    }\n\n    public class Main {\n        float temp;\n\n        public String getDisplayTemperature() {\n            return String.valueOf(Math.round(temp)) + (char) 0x00B0;\n        }\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/XKCDRequest.java",
    "content": "package com.morristaedt.mirror.requests;\n\nimport retrofit.http.GET;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic interface XKCDRequest {\n\n    @GET(\"/info.0.json\")\n    XKCDResponse getLatestXKCD();\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/XKCDResponse.java",
    "content": "package com.morristaedt.mirror.requests;\n\n/**\n * Created by HannahMitt on 8/22/15.\n */\npublic class XKCDResponse {\n\n    public int day;\n    public int month;\n    public int year;\n    public String img;\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/YahooFinanceRequest.java",
    "content": "package com.morristaedt.mirror.requests;\n\nimport retrofit.http.GET;\nimport retrofit.http.Query;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic interface YahooFinanceRequest {\n\n    @GET(\"/yql\")\n    YahooStockResponse getStockData(@Query(\"q\") String query, @Query(\"env\") String env, @Query(\"format\") String format);\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/requests/YahooStockResponse.java",
    "content": "package com.morristaedt.mirror.requests;\n\nimport android.text.TextUtils;\n\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic class YahooStockResponse {\n\n    private YahooQueryResponse query;\n\n    private class YahooQueryResponse {\n        public YahooResultsResponse results;\n    }\n\n    private class YahooResultsResponse {\n        public YahooQuoteResponse quote;\n    }\n\n    public class YahooQuoteResponse {\n        public String symbol;\n        public String PercentChange;\n        public float LastTradePriceOnly;\n\n        public BigDecimal getPercentageChange() {\n            if (!TextUtils.isEmpty(PercentChange)) {\n                BigDecimal decimalPercentage = new BigDecimal(PercentChange.trim().replace(\"%\", \"\")).divide(BigDecimal.valueOf(100), RoundingMode.CEILING);\n                return decimalPercentage;\n            } else {\n                return BigDecimal.valueOf(0);\n            }\n        }\n    }\n\n\n    public YahooQuoteResponse getQuoteResponse() {\n        if (query != null && query.results != null) {\n            return query.results.quote;\n        }\n        return null;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/morristaedt/mirror/utils/WeekUtil.java",
    "content": "package com.morristaedt.mirror.utils;\n\nimport java.util.Calendar;\n\n/**\n * Created by HannahMitt on 8/23/15.\n */\npublic class WeekUtil {\n\n    public static boolean isWeekday() {\n        int dayOfWeek = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);\n        return dayOfWeek != Calendar.SATURDAY && dayOfWeek != Calendar.SUNDAY;\n    }\n\n    public static boolean afterFive() {\n        int hourOfDay = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);\n        return hourOfDay >= 17;\n    }\n\n    public static boolean isWeekdayBeforeFive() {\n        return isWeekday() && !afterFive();\n    }\n\n    public static boolean isWeekdayAfterFive() {\n        return isWeekday() && afterFive();\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/drawable/apptheme_btn_check_holo_dark.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2011 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <!-- Enabled states -->\n        \n    <item android:state_checked=\"true\" android:state_window_focused=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_on_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_window_focused=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_off_holo_dark\" />\n\n    <item android:state_checked=\"true\" android:state_pressed=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_on_pressed_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_pressed=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_off_pressed_holo_dark\" />\n\n    <item android:state_checked=\"true\" android:state_focused=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_on_focused_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_focused=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_off_focused_holo_dark\" />\n\n    <item android:state_checked=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_off_holo_dark\" />\n    <item android:state_checked=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_on_holo_dark\" />\n\n\n    <!-- Disabled states -->\n\n    <item android:state_checked=\"true\" android:state_window_focused=\"false\"\n          android:drawable=\"@drawable/apptheme_btn_check_on_disabled_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_window_focused=\"false\"\n          android:drawable=\"@drawable/apptheme_btn_check_off_disabled_holo_dark\" />\n\n    <item android:state_checked=\"true\" android:state_focused=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_on_disabled_focused_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_focused=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_check_off_disabled_focused_holo_dark\" />\n\n    <item android:state_checked=\"false\" android:drawable=\"@drawable/apptheme_btn_check_off_disabled_holo_dark\" />\n    <item android:state_checked=\"true\" android:drawable=\"@drawable/apptheme_btn_check_on_disabled_holo_dark\" />\n\n</selector>\n"
  },
  {
    "path": "app/src/main/res/drawable/apptheme_btn_radio_holo_dark.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2011 The Android Open Source Project\n\n     Licensed under the Apache License, Version 2.0 (the \"License\");\n     you may not use this file except in compliance with the License.\n     You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n     Unless required by applicable law or agreed to in writing, software\n     distributed under the License is distributed on an \"AS IS\" BASIS,\n     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     See the License for the specific language governing permissions and\n     limitations under the License.\n-->\n\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:state_checked=\"true\" android:state_window_focused=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_on_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_window_focused=\"false\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_off_holo_dark\" />\n          \n    <item android:state_checked=\"true\" android:state_pressed=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_on_pressed_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_pressed=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_off_pressed_holo_dark\" />\n\n    <item android:state_checked=\"true\" android:state_focused=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_on_focused_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_focused=\"true\"\n          android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_off_focused_holo_dark\" />\n\n    <item android:state_checked=\"false\" android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_off_holo_dark\" />\n    <item android:state_checked=\"true\" android:state_enabled=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_on_holo_dark\" />\n\n    <!-- Disabled states -->\n\n    <item android:state_checked=\"true\" android:state_window_focused=\"false\"\n          android:drawable=\"@drawable/apptheme_btn_radio_on_disabled_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_window_focused=\"false\"\n          android:drawable=\"@drawable/apptheme_btn_radio_off_disabled_holo_dark\" />\n\n    <item android:state_checked=\"true\" android:state_focused=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_on_disabled_focused_holo_dark\" />\n    <item android:state_checked=\"false\" android:state_focused=\"true\"\n          android:drawable=\"@drawable/apptheme_btn_radio_off_disabled_focused_holo_dark\" />\n\n    <item android:state_checked=\"false\" android:drawable=\"@drawable/apptheme_btn_radio_off_disabled_holo_dark\" />\n    <item android:state_checked=\"true\" android:drawable=\"@drawable/apptheme_btn_radio_on_disabled_holo_dark\" />\n\n</selector>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_configuration.xml",
    "content": "<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:orientation=\"vertical\"\n        android:padding=\"@dimen/activity_horizontal_margin\"\n        tools:context=\".ConfigurationActivity\">\n\n        <TextView\n            style=\"@style/MirrorText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/set_up\" />\n\n        <TextView\n            style=\"@style/ConfigurationItemText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"Temperature\" />\n\n        <RadioGroup\n            android:id=\"@+id/temperature_group\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"@dimen/item_margin\"\n            android:orientation=\"horizontal\">\n\n            <RadioButton\n                android:id=\"@+id/celsius\"\n                style=\"@style/ConfigurationItemText\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginTop=\"0dp\"\n                android:text=\"Celsius\" />\n\n            <RadioButton\n                android:id=\"@+id/farenheit\"\n                style=\"@style/ConfigurationItemText\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"@dimen/item_margin\"\n                android:layout_marginTop=\"0dp\"\n                android:text=\"Farenheit\" />\n\n        </RadioGroup>\n\n        <TextView\n            style=\"@style/ConfigurationItemText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"Select Text Color\" />\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"@dimen/item_margin\"\n            android:orientation=\"horizontal\">\n\n            <LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_weight=\"4\"\n                android:orientation=\"vertical\">\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"horizontal\">\n                    <TextView\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"R\" />\n\n                    <SeekBar\n                        android:id=\"@+id/ColorPickerRed\"\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"0dp\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_weight=\"1\"\n                        android:max=\"255\"/>\n\n                    <TextView\n                        android:id=\"@+id/ColorShowerRed\"\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:minEms=\"3\"\n                        android:text=\"0\" />\n                </LinearLayout>\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"horizontal\">\n                    <TextView\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"G\" />\n\n                    <SeekBar\n                        android:id=\"@+id/ColorPickerGreen\"\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"0dp\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_weight=\"1\"\n                        android:max=\"255\"/>\n\n                    <TextView\n                        android:id=\"@+id/ColorShowerGreen\"\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:minEms=\"3\"\n                        android:text=\"0\" />\n                </LinearLayout>\n\n                <LinearLayout\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:orientation=\"horizontal\">\n                    <TextView\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:text=\"B\" />\n\n                    <SeekBar\n                        android:id=\"@+id/ColorPickerBlue\"\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"0dp\"\n                        android:layout_height=\"wrap_content\"\n                        android:layout_weight=\"1\"\n                        android:max=\"255\"/>\n\n                    <TextView\n                        android:id=\"@+id/ColorShowerBlue\"\n                        style=\"@style/ConfigurationItemText\"\n                        android:layout_margin=\"0dp\"\n                        android:layout_width=\"wrap_content\"\n                        android:layout_height=\"wrap_content\"\n                        android:minEms=\"3\"\n                        android:text=\"0\" />\n                </LinearLayout>\n            </LinearLayout>\n\n            <View\n                android:id=\"@+id/colored_bar\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"match_parent\"\n                android:layout_weight=\"1\"\n                 />\n        </LinearLayout>\n\n        <CheckBox\n            android:id=\"@+id/biking_checkbox\"\n            style=\"@style/ConfigurationItemText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_vertical\"\n            android:text=\"@string/biking_hint\" />\n\n        <CheckBox\n            android:id=\"@+id/mood_detection_checkbox\"\n            style=\"@style/ConfigurationItemText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_vertical\"\n            android:text=\"@string/mood_detection_option\" />\n\n        <TextView\n            style=\"@style/ConfigurationDescriptionText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/mood_explanation\" />\n\n        <CheckBox\n            android:id=\"@+id/calendar_checkbox\"\n            style=\"@style/ConfigurationItemText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_vertical\"\n            android:text=\"@string/show_calendar_event\" />\n\n        <CheckBox\n            android:id=\"@+id/headline_checkbox\"\n            style=\"@style/ConfigurationItemText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center_vertical\"\n            android:text=\"@string/show_headline\" />\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginBottom=\"@dimen/item_margin\"\n            android:orientation=\"horizontal\">\n\n            <CheckBox\n                android:id=\"@+id/xkcd_checkbox\"\n                style=\"@style/ConfigurationItemText\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginRight=\"@dimen/item_margin\"\n                android:layout_weight=\"1\"\n                android:gravity=\"center_vertical\"\n                android:text=\"@string/show_xkcd\" />\n\n            <CheckBox\n                android:id=\"@+id/xkcd_invert_checkbox\"\n                style=\"@style/ConfigurationItemText\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_weight=\"1\"\n                android:gravity=\"center_vertical\"\n                android:text=\"@string/invert_colors\" />\n        </LinearLayout>\n\n        <LinearLayout\n        android:id=\"@+id/countdown_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\">\n\n            <CheckBox\n                android:id=\"@+id/countdown_checkbox\"\n                style=\"@style/ConfigurationItemText\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:gravity=\"center_vertical\"\n                android:text=\"@string/show_countdown\" />\n\n            <CheckBox\n                android:id=\"@+id/countdown_new_checkbox\"\n                style=\"@style/ConfigurationItemText\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:gravity=\"center_vertical\"\n                android:text=\"@string/new_countdown\" />\n\n            <LinearLayout\n                android:id=\"@+id/new_countdown_view\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"horizontal\">\n\n                <EditText\n                    android:id=\"@+id/countdown_days\"\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:hint=\"@string/time_day\"\n                    android:inputType=\"number\" />\n\n                <TextView\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/time_day_short\" />\n\n                <EditText\n                    android:id=\"@+id/countdown_hours\"\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:hint=\"@string/time_hour\"\n                    android:maxLength=\"2\"\n                    android:inputType=\"number\" />\n\n                <TextView\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/time_hour_short\" />\n\n                <EditText\n                    android:id=\"@+id/countdown_mins\"\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:hint=\"@string/time_min\"\n                    android:maxLength=\"2\"\n                    android:inputType=\"number\" />\n\n                <TextView\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/time_min_short\" />\n\n                <EditText\n                    android:id=\"@+id/countdown_secs\"\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:hint=\"@string/time_sec\"\n                    android:maxLength=\"2\"\n                    android:inputType=\"number\" />\n\n                <TextView\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/time_sec_short\" />\n            </LinearLayout>\n        </LinearLayout>\n\n        <LinearLayout\n            android:id=\"@+id/location_view\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\">\n\n            <RelativeLayout\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"horizontal\">\n\n                <TextView\n                    android:id=\"@+id/location_title\"\n                    style=\"@style/ConfigurationItemText\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:text=\"@string/location\" />\n\n                <TextView\n                    style=\"@style/ConfigurationDescriptionText\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_alignBaseline=\"@id/location_title\"\n                    android:layout_marginLeft=\"@dimen/item_margin\"\n                    android:layout_toRightOf=\"@id/location_title\"\n                    android:text=\"Couldn't detect a recent location\" />\n            </RelativeLayout>\n\n            <LinearLayout\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:orientation=\"horizontal\">\n\n                <EditText\n                    android:id=\"@+id/latitude\"\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginRight=\"@dimen/item_margin\"\n                    android:layout_weight=\"1\"\n                    android:hint=\"@string/latitude\"\n                    android:inputType=\"numberDecimal|numberSigned\" />\n\n                <EditText\n                    android:id=\"@+id/longitude\"\n                    style=\"@style/ConfigurationEditText\"\n                    android:layout_width=\"0dp\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_weight=\"1\"\n                    android:hint=\"@string/longitude\"\n                    android:inputType=\"numberDecimal|numberSigned\" />\n            </LinearLayout>\n        </LinearLayout>\n\n        <TextView\n            style=\"@style/ConfigurationItemText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/stock\" />\n\n        <EditText\n            android:id=\"@+id/stock_name\"\n            style=\"@style/ConfigurationEditText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginRight=\"@dimen/item_margin\"\n            android:hint=\"@string/ticker_symbol\"\n            android:inputType=\"textCapCharacters\" />\n\n        <TextView\n            style=\"@style/ConfigurationDescriptionText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/stock_description\" />\n\n        <Button\n            android:id=\"@+id/launch_button\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"@dimen/item_margin\"\n            android:text=\"@string/launch\"\n            android:textSize=\"@dimen/configuration_text_size\" />\n\n        <TextView\n            style=\"@style/ConfigurationDescriptionText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"@dimen/item_margin\"\n            android:text=\"@string/how_to_stop\" />\n    </LinearLayout>\n</ScrollView>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_mirror.xml",
    "content": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/main_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"right\"\n    android:orientation=\"vertical\"\n    tools:context=\".MainActivity\">\n\n    <TextView\n        android:id=\"@+id/birthday_text\"\n        style=\"@style/MirrorText\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:textSize=\"@dimen/mirror_birthday_text_size\"\n        android:visibility=\"gone\"\n        tools:text=\"Happy Birthday Andy!\" />\n\n    <TextView\n        android:id=\"@+id/day_text\"\n        style=\"@style/MirrorText\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        tools:text=\"Sunday the 22nd\" />\n\n    <include layout=\"@layout/clock\" />\n\n    <TextView\n        android:id=\"@+id/weather_summary\"\n        style=\"@style/MirrorText\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:includeFontPadding=\"false\"\n        tools:text=\"Partly Cloudy\" />\n\n    <TextView\n        android:id=\"@+id/calendar_title\"\n        style=\"@style/MirrorText\"\n        android:visibility=\"gone\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/mirror_item_spacing\"\n        android:ellipsize=\"marquee\"\n        android:focusable=\"true\"\n        android:focusableInTouchMode=\"true\"\n        android:includeFontPadding=\"false\"\n        android:singleLine=\"true\"\n        tools:text=\"Very important meeting\" />\n\n    <TextView\n        android:id=\"@+id/calendar_details\"\n        style=\"@style/MirrorText\"\n        android:visibility=\"gone\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:ellipsize=\"marquee\"\n        android:focusable=\"true\"\n        android:includeFontPadding=\"false\"\n        android:singleLine=\"true\"\n        tools:text=\"11:00-12:00 ~ 10 Downing Street\" />\n\n    <ImageView\n        android:id=\"@+id/xkcd_image\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/mirror_item_spacing\"\n        android:visibility=\"gone\" />\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/mirror_item_spacing\"\n        android:gravity=\"right\"\n        android:orientation=\"vertical\">\n\n        <TextView\n            android:id=\"@+id/hello_text\"\n            style=\"@style/MirrorListText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:visibility=\"gone\"\n            tools:text=\"Good morning, Andy and Hannah\" />\n\n        <TextView\n            android:id=\"@+id/can_bike\"\n            style=\"@style/MirrorListText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:drawableRight=\"@drawable/bike\"\n            android:visibility=\"gone\"\n            tools:text=\"Don't Bike Today\"\n            tools:visibility=\"visible\" />\n\n        <TextView\n            android:id=\"@+id/water_plants\"\n            style=\"@style/MirrorListText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:drawableRight=\"@drawable/air_plant\"\n            android:text=\"@string/water_plants\"\n            android:visibility=\"gone\"\n            tools:visibility=\"visible\" />\n\n        <TextView\n            android:id=\"@+id/grocery_list\"\n            style=\"@style/MirrorListText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:drawableRight=\"@drawable/grocery_bag\"\n            android:text=\"@string/grocery_list\"\n            android:visibility=\"gone\"\n            tools:visibility=\"visible\" />\n\n        <TextView\n            android:id=\"@+id/news_headline\"\n            style=\"@style/MirrorMarqueeText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:ellipsize=\"marquee\"\n            android:marqueeRepeatLimit=\"marquee_forever\"\n            android:singleLine=\"true\"\n            android:visibility=\"gone\"\n            tools:text=\"A news headline\"\n            tools:visiblity=\"visible\" />\n\n        <TextView\n            android:id=\"@+id/stock_text\"\n            style=\"@style/MirrorListText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:drawableRight=\"@drawable/stock\"\n            android:visibility=\"gone\"\n            tools:text=\"$ETSY $13.46\"\n            tools:visibility=\"gone\" />\n\n        <TextView\n            android:id=\"@+id/mood_text\"\n            style=\"@style/MirrorListText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:drawableRight=\"@drawable/smile\"\n            android:visibility=\"gone\"\n            tools:text=\"Just be happy\"\n            tools:visibility=\"visible\" />\n\n        <TextView\n            android:id=\"@+id/countdown_text\"\n            style=\"@style/MirrorListText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:visibility=\"gone\"\n            tools:text=\"Time is up!\"\n            tools:visibility=\"visible\" />\n\n    </LinearLayout>\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/clock.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<DigitalClock xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    style=\"@style/MirrorText\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:format12Hour=\"h:mm\"\n    android:includeFontPadding=\"false\"\n    android:padding=\"0dp\"\n    android:textSize=\"@dimen/mirror_clock_text_size\" />"
  },
  {
    "path": "app/src/main/res/layout-v17/clock.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TextClock xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    style=\"@style/MirrorText\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:format12Hour=\"h:mm\"\n    android:includeFontPadding=\"false\"\n    android:padding=\"0dp\"\n    android:textSize=\"@dimen/mirror_clock_text_size\" />"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n    <dimen name=\"item_margin\">20dp</dimen>\n    <dimen name=\"mirror_item_spacing\">40dp</dimen>\n\n    <dimen name=\"mirror_text_size\">38sp</dimen>\n    <dimen name=\"mirror_clock_text_size\">80sp</dimen>\n    <dimen name=\"mirror_birthday_text_size\">48sp</dimen>\n    <dimen name=\"configuration_text_size\">20sp</dimen>\n    <dimen name=\"configuration_description_size\">14sp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">HomeMirror</string>\n\n    <string name=\"default_mirror_mirror\">Mirror, mirror on the wall. Hannah is the prettiest of them all.</string>\n\n    <!-- Owners -->\n    <string name=\"owners\">Hannah and Andy</string>\n\n    <!-- Time module -->\n    <string name=\"good_morning\">Good morning, %s</string>\n    <string name=\"good_afternoon\">Good afternoon, %s</string>\n    <string name=\"good_evening\">Good evening, %s</string>\n    <string name=\"late\">You\\'re up late, %s</string>\n    <string name=\"bedtime\">Good evening, %s\\n\\nIt\\'s Hannah\\'s bedtime.</string>\n\n    <!-- Forecast module -->\n    <string name=\"bike_today\">Bike Today</string>\n    <string name=\"no_bike_today\">Don\\'t Bike Today</string>\n\n    <!--  Birthday module -->\n    <string name=\"happy_birthday\">Happy Birthday, %s!</string>\n\n    <!-- Chores module -->\n    <string name=\"water_plants\">Water Plants</string>\n    <string name=\"grocery_list\">Grocery List</string>\n\n    <!-- Mood module -->\n    <string name=\"it_gets_better\">Cheer up, bud</string>\n    <string name=\"looking_good\">Looking flyyy</string>\n    <string name=\"something_special\">Yay! Hi sunshine.</string>\n\n    <!-- Set up -->\n    <string name=\"location\">Location</string>\n    <string name=\"set_up\">Set Up</string>\n    <string name=\"latitude\">Latitude</string>\n    <string name=\"longitude\">Longitude</string>\n    <string name=\"launch\">Launch</string>\n    <string name=\"mood_detection_option\">Show mood detection</string>\n    <string name=\"show_xkcd\">Show new xkcd</string>\n    <string name=\"invert_colors\">Invert comic colors</string>\n    <string name=\"show_calendar_event\">Show next calendar event</string>\n    <string name=\"stock\">Stock</string>\n    <string name=\"ticker_symbol\">Ticker symbol, i.e. GOOG</string>\n    <string name=\"show_headline\">Show BBC headline</string>\n    <string name=\"found_location\">Found location</string>\n    <string name=\"mood_explanation\">Uses the front facing camera to read your expression</string>\n    <string name=\"stock_description\">Displays on weekdays if the stock swings more than 3%</string>\n    <string name=\"biking_hint\">Show biking weather hint</string>\n    <string name=\"how_to_stop\">To get back to Set Up and stop mirror updates, swipe up from bottom of launched mirror, and press Back.</string>\n    <string name=\"show_countdown\">Show countdown</string>\n    <string name=\"new_countdown\">New countdown</string>\n    <string name=\"time_day\">day</string>\n    <string name=\"time_hour\">hour</string>\n    <string name=\"time_min\">min</string>\n    <string name=\"time_sec\">sec</string>\n    <string name=\"time_day_short\">d</string>\n    <string name=\"time_hour_short\">h</string>\n    <string name=\"time_min_short\">m</string>\n    <string name=\"time_sec_short\">s</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat\">\n        <!-- Customize your theme here. -->\n        <item name=\"android:background\">@android:color/black</item>\n        <item name=\"android:windowBackground\">@android:color/black</item>\n        <item name=\"android:colorBackground\">@android:color/black</item>\n        <item name=\"android:textSize\">@dimen/mirror_text_size</item>\n        <item name=\"android:textColor\">@android:color/white</item>\n        <item name=\"android:checkboxStyle\">@style/CompatCheckboxStyle</item>\n        <item name=\"android:radioButtonStyle\">@style/CompatRadioButtonStyle</item>\n        <item name=\"android:buttonStyle\">@android:style/Widget.Holo.Button</item>\n    </style>\n\n    <style name=\"CompatCheckboxStyle\" parent=\"@android:style/Widget.Holo.CompoundButton.CheckBox\">\n        <item name=\"android:button\">@drawable/apptheme_btn_check_holo_dark</item>\n    </style>\n\n    <style name=\"CompatRadioButtonStyle\" parent=\"@android:style/Widget.Holo.CompoundButton.RadioButton\">\n        <item name=\"android:button\">@drawable/apptheme_btn_radio_holo_dark</item>\n    </style>\n\n    <style name=\"MirrorText\">\n        <item name=\"android:fontFamily\" tools:targetApi=\"jelly_bean\">sans-serif-light</item>\n        <item name=\"android:gravity\">right|center_vertical</item>\n        <item name=\"android:drawablePadding\">8dp</item>\n    </style>\n\n    <style name=\"MirrorListText\" parent=\"MirrorText\">\n        <item name=\"android:paddingBottom\">@dimen/item_margin</item>\n    </style>\n\n    <style name=\"MirrorMarqueeText\" parent=\"MirrorListText\">\n        <item name=\"android:gravity\"/>\n    </style>\n\n    <style name=\"ConfigurationItemText\">\n        <item name=\"android:fontFamily\" tools:targetApi=\"jelly_bean\">sans-serif</item>\n        <item name=\"android:textSize\">@dimen/configuration_text_size</item>\n        <item name=\"android:layout_marginTop\">@dimen/item_margin</item>\n    </style>\n\n    <style name=\"ConfigurationDescriptionText\">\n        <item name=\"android:fontFamily\" tools:targetApi=\"jelly_bean\">sans-serif</item>\n        <item name=\"android:textSize\">@dimen/configuration_description_size</item>\n    </style>\n\n    <style name=\"ConfigurationEditText\" parent=\"Base.Widget.AppCompat.EditText\">\n        <item name=\"android:textSize\">@dimen/configuration_text_size</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-sw600dp/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n    <dimen name=\"item_margin\">20dp</dimen>\n    <dimen name=\"mirror_item_spacing\">60dp</dimen>\n\n    <dimen name=\"mirror_text_size\">48sp</dimen>\n    <dimen name=\"mirror_clock_text_size\">90sp</dimen>\n    <dimen name=\"mirror_birthday_text_size\">60sp</dimen>\n    <dimen name=\"configuration_text_size\">24sp</dimen>\n    <dimen name=\"configuration_description_size\">18sp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-sw600dp/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <!-- Chores module -->\n    <string name=\"water_plants\">Water Plants Today</string>\n    <string name=\"grocery_list\">Make Grocery List</string>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values-v21/styles.xml",
    "content": "<resources xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <!-- Base application theme. Removes unneeded compat styles -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat\">\n        <!-- Customize your theme here. -->\n        <item name=\"android:background\">@android:color/black</item>\n        <item name=\"android:windowBackground\">@android:color/black</item>\n        <item name=\"android:colorBackground\">@android:color/black</item>\n        <item name=\"android:textSize\">@dimen/mirror_text_size</item>\n        <item name=\"android:textColor\">@android:color/white</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:1.3.0'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n"
  },
  {
    "path": "design/install_assets.sh",
    "content": "#!/bin/sh\n\ncd assets\nfind . -type f -path '*_10.png' | while read l; do F=`echo $l | sed -e \"s/_10//\"`; cp $l ../../app/src/main/res/drawable-mdpi/$F; done\nfind . -type f -path '*_15.png' | while read l; do F=`echo $l | sed -e \"s/_15//\"`; cp $l ../../app/src/main/res/drawable-hdpi/$F; done\nfind . -type f -path '*_20.png' | while read l; do F=`echo $l | sed -e \"s/_20//\"`; cp $l ../../app/src/main/res/drawable-xhdpi/$F; done\ncd -\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sat Aug 22 21:32:22 EDT 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.4-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]