[
  {
    "path": ".gitignore",
    "content": "# built application files\n*.apk\n*.ap_\n\n# files for the dex VM\n*.dex\n\n# Java class files\n*.class\n\n# generated files\nbin/\ngen/\nout/\nbuild/\n.gradle/\n\n# Project files\n*.iml\n.idea/\n# .idea/workspace.xml\n\n# Local configuration file (sdk path, etc)\nlocal.properties\nkeystore.properties\n\n# Windows thumbnail db\n.DS_Store\n\n# Idea non-crucial project fileS\n*.iws\n\n# Sandbox stuff\n_sandbox\n\nsecret.xml\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: android\n\nandroid:\n  components:\n    - tools\n    - platform-tools\n    - build-tools-25.0.3\n    - android-25\n    - extra-android-m2repository\n    - extra-android-support\n\n  licenses:\n  - 'android-sdk-license.*'\n\njdk:\n  - oraclejdk8\n\nbranches:\n  only:\n    - develop\n    - master\n    - /^alpha.*$/\n    - /^beta.*$/\n    - /^release.*$/\n\nnotifications:\n  email: false\n\nsudo: false\n\nbefore_install:\n- export ANDROID_HOME=/usr/local/android-sdk\n- echo \"sdk.dir=$ANDROID_HOME\" > local.properties\nscript: 'travis_retry ./gradlew assembleRelease'\n\nbefore_cache:\n  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock\n\ncache:\n  directories:\n    - $HOME/.gradle/caches/\n    - $HOME/.gradle/wrapper/"
  },
  {
    "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"
  },
  {
    "path": "README.MD",
    "content": "[![Build Status](https://travis-ci.org/BCGDV-ASIA/android-widget-ticktock.svg?branch=master)](https://travis-ci.org/BCGDV-ASIA/android-widget-ticktock) \n[![Download](https://api.bintray.com/packages/bcgdv/android/ticktock/images/download.svg)](https://bintray.com/bcgdv/android/ticktock/_latestVersion) \n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-TickTock%20Widget-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/3556) \n\n# TickTock Widget\n\nThis is a circular widget that can be used to display a count down timer or a count up timer.\n\n![TickTock Widget](http://i.giphy.com/Pdx51JBf5f90A.gif)\n\n## How to include\n\n```groovy\ncompile 'com.bcgdv.asia.lib:ticktock:1.3'\n```\n\n## Usage\n\n```xml\n    <com.bcgdv.asia.lib.ticktock.TickTockView\n        android:layout_width=\"200dp\"\n        android:layout_height=\"200dp\"\n        android:layout_marginTop=\"16dp\"\n        android:layout_gravity=\"center_horizontal\"\n\t\tapp:tickAutoFitText=\"true\"\n        app:tickMiddleColor=\"#333333\"\n        app:tickMoveCounterClockwise=\"true\"\n        app:tickTextColor=\"#CCCCCC\"\n        app:tickDotRadius=\"6dp\"\n        app:tickEmptyRingColor=\"@android:color/white\"\n        app:tickFillRingColor=\"@color/colorPrimary\"\n        app:tickRingThickness=\"3dp\" />\n```\n\n- `tickCircleDuration` - `minute|total_time` the circle completes a full circle every minute or the total time different between startTime and endTime. Default `minute`.\n- `tickAutoFitText` - `boolean` default `true`. The text will be automatically resized to fit in the available space.\n- `tickText` - Optional `String` static text to display in the middle.\n- `tickTextColor` - Optional `color`\n- `tickTextSize` - Optional `dimension` text size if `tickAutoFitText` is not used.\n- `tickMiddleColor` - Optional `color` the color of the center of the color. Color transparent by default.\n- `tickFillRingColor` - Optional `color` the color of the ring when filled. Color white by default.\n- `tickEmptyRingColor` - Optional `color` the color of the ring when empty. Color blue by default.\n- `tickRingThickness` - Optional `dimension` the tickness of the ring in DIP. 3dp by default.\n- `tickDotRadius` - Optional `dimension` the radious in DIP of the dot. 6dp by default.\n- `tickMoveCounterClockwise` Optional `boolean` false by default.\n\n```java\npublic void onCreate(Bundle savedInstanceState) {\n...\n    mCountDown = (TickTockView) findViewById(R.id.view_ticktock_countdown);\n    mCountUp = (TickTockView) findViewById(R.id.view_ticktock_countup);\n    if (mCountDown != null) {\n        mCountDown.setOnTickListener(new TickTockView.OnTickListener() {\n            @Override\n            public String getText(long timeRemaining) {\n                int seconds = (int) (timeRemaining / 1000) % 60;\n                int minutes = (int) ((timeRemaining / (1000 * 60)) % 60);\n                int hours = (int) ((timeRemaining / (1000 * 60 * 60)) % 24);\n                int days = (int) (timeRemaining / (1000 * 60 * 60 * 24));\n                boolean hasDays = days > 0;\n                return String.format(\"%1$02d%4$s %2$02d%5$s %3$02d%6$s\",\n                        hasDays ? days : hours,\n                        hasDays ? hours : minutes,\n                        hasDays ? minutes : seconds,\n                        hasDays ? \"d\" : \"h\",\n                        hasDays ? \"h\" : \"m\",\n                        hasDays ? \"m\" : \"s\");\n            }\n        });\n    }\n\n    if (mCountUp != null) {\n        mCountUp.setOnTickListener(new TickTockView.OnTickListener() {\n            SimpleDateFormat format = new SimpleDateFormat(\"hh:mm:ss\");\n            Date date = new Date();\n            @Override\n            public String getText(long timeRemaining) {\n                date.setTime(System.currentTimeMillis());\n                return format.format(date);\n            }\n        });\n    }\n...\n}\n\n@Override\nprotected void onStart() {\n    super.onStart();\n    Calendar end = Calendar.getInstance();\n    end.add(Calendar.MINUTE, 4);\n    end.add(Calendar.SECOND, 5);\n\n    Calendar start = Calendar.getInstance();\n    start.add(Calendar.MINUTE, -1);\n    if (mCountDown != null) {\n        mCountDown.start(start, end);\n    }\n\n    Calendar c2= Calendar.getInstance();\n    c2.add(Calendar.HOUR, 2);\n    c2.set(Calendar.MINUTE, 0);\n    c2.set(Calendar.SECOND, 0);\n    c2.set(Calendar.MILLISECOND, 0);\n    if (mCountUp != null) {\n        mCountUp.start(c2);\n    }\n}\n\n@Override\nprotected void onStop() {\n    super.onStop();\n    mCountDown.stop();\n    mCountUp.stop();\n}\n```\n\n## Known Issues\n\n- Please report any through GitHub issue tracker.\n\nLicense\n=======\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"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 28\n    buildToolsVersion '27.0.3'\n\n    defaultConfig {\n        applicationId \"com.bcgdv.asia.ticktock\"\n        minSdkVersion 15\n        targetSdkVersion 28\n        versionCode 1\n        versionName \"1.3\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n    lintOptions {\n        abortOnError false\n    }\t\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    testImplementation 'junit:junit:4.12'\n    implementation 'com.android.support:appcompat-v7:28.0.0-beta01'\n    implementation project(path: ':ticktock')\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 C:\\Users\\Ali Muzaffar\\Development\\adt\\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/bcgdv/asia/ticktock/ApplicationTest.java",
    "content": "package com.bcgdv.asia.ticktock;\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.bcgdv.asia.ticktock\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\">\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    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/com/bcgdv/asia/ticktock/MainActivity.java",
    "content": "package com.bcgdv.asia.ticktock;\n\nimport android.os.SystemClock;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.widget.TextView;\n\nimport com.bcgdv.asia.lib.ticktock.TickTockView;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Calendar;\nimport java.util.Date;\n\npublic class MainActivity extends AppCompatActivity {\n    private TickTockView mCountDown = null;\n    private TickTockView mCountUp = null;\n    private TextView mTxtHeadline = null;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        mTxtHeadline = (TextView) findViewById(R.id.txt_headline);\n        mTxtHeadline.setText(\"Hello World2\");\n        mCountDown = (TickTockView) findViewById(R.id.view_ticktock_countdown);\n        mCountUp = (TickTockView) findViewById(R.id.view_ticktock_countup);\n        if (mCountDown != null) {\n            mCountDown.setOnTickListener(new TickTockView.OnTickListener() {\n                @Override\n                public String getText(long timeRemaining) {\n                    int seconds = (int) (timeRemaining / 1000) % 60;\n                    int minutes = (int) ((timeRemaining / (1000 * 60)) % 60);\n                    int hours = (int) ((timeRemaining / (1000 * 60 * 60)) % 24);\n                    int days = (int) (timeRemaining / (1000 * 60 * 60 * 24));\n                    boolean hasDays = days > 0;\n                    return String.format(\"%1$02d%4$s %2$02d%5$s %3$02d%6$s\",\n                            hasDays ? days : hours,\n                            hasDays ? hours : minutes,\n                            hasDays ? minutes : seconds,\n                            hasDays ? \"d\" : \"h\",\n                            hasDays ? \"h\" : \"m\",\n                            hasDays ? \"m\" : \"s\");\n                }\n            });\n        }\n\n        if (mCountUp != null) {\n            mCountUp.setOnTickListener(new TickTockView.OnTickListener() {\n                SimpleDateFormat format = new SimpleDateFormat(\"hh:mm:ss\");\n                Date date = new Date();\n                @Override\n                public String getText(long timeRemaining) {\n                    date.setTime(System.currentTimeMillis());\n                    return format.format(date);\n                }\n            });\n        }\n    }\n\n    @Override\n    protected void onStart() {\n        super.onStart();\n        Calendar end = Calendar.getInstance();\n        end.add(Calendar.MINUTE, 4);\n        end.add(Calendar.SECOND, 5);\n\n        Calendar start = Calendar.getInstance();\n        start.add(Calendar.MINUTE, -1);\n        if (mCountDown != null) {\n            mCountDown.start(start, end);\n        }\n\n        Calendar c2= Calendar.getInstance();\n        c2.add(Calendar.HOUR, 2);\n        c2.set(Calendar.MINUTE, 0);\n        c2.set(Calendar.SECOND, 0);\n        c2.set(Calendar.MILLISECOND, 0);\n        if (mCountUp != null) {\n            mCountUp.start(c2);\n        }\n    }\n\n    @Override\n    protected void onStop() {\n        super.onStop();\n        mCountDown.stop();\n        mCountUp.stop();\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout 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    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:orientation=\"vertical\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    android:background=\"#CCCCCC\"\n    tools:context=\"com.bcgdv.asia.ticktock.MainActivity\">\n\n    <TextView\n        android:id=\"@+id/txt_headline\"\n        style=\"@style/Base.TextAppearance.AppCompat.Headline\"\n        android:layout_marginBottom=\"@dimen/activity_horizontal_margin\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"TickTock Widget\"/>\n\n    <com.bcgdv.asia.lib.ticktock.TickTockView\n        android:id=\"@+id/view_ticktock_countdown\"\n        android:layout_width=\"200dp\"\n        android:layout_height=\"200dp\"\n        app:tickCircleDuration=\"total_time\"\n        android:layout_gravity=\"center_horizontal\" />\n\n    <com.bcgdv.asia.lib.ticktock.TickTockView\n        android:id=\"@+id/view_ticktock_countup\"\n        android:layout_width=\"200dp\"\n        android:layout_height=\"200dp\"\n        android:layout_marginTop=\"16dp\"\n        android:layout_gravity=\"center_horizontal\"\n        app:tickMiddleColor=\"#333333\"\n        app:tickMoveCounterClockwise=\"true\"\n        app:tickTextColor=\"#CCCCCC\"\n        app:tickDotRadius=\"6dp\"\n        app:tickEmptyRingColor=\"@android:color/white\"\n        app:tickFillRingColor=\"@color/colorPrimary\"\n        app:tickRingThickness=\"3dp\" />\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "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</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">TickTock</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/test/java/com/bcgdv/asia/ticktock/ExampleUnitTest.java",
    "content": "package com.bcgdv.asia.ticktock;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tests, switch the Test Artifact in the Build Variants view.\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\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        google()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.1.3'\n        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'\n        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'\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        google()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sat Jul 28 19:30:55 AEST 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-4.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# 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\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\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    JAVACMD=`cygpath --unix \"$JAVACMD\"`\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\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\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%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app', ':ticktock'\n"
  },
  {
    "path": "ticktock/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "ticktock/build.gradle",
    "content": "apply plugin: 'com.android.library'\n\next {\n    bintrayRepo = 'android'\n    bintrayName = 'ticktock'\n\n    publishedGroupId = 'com.bcgdv.asia.lib'\n    libraryName = 'TickTock Widget'\n    artifact = 'ticktock'\n\n    libraryDescription = 'A simple widget that can be used to display menu\\'s which can be animated in and out.'\n\n    siteUrl = 'https://github.com/BCGDV-ASIA/android-widget-ticktock'\n    gitUrl = 'https://github.com/BCGDV-ASIA/android-widget-ticktock.git'\n\n    libraryVersion = '1.3'\n\n    developerId = 'bcgdv'\n    developerName = 'BCGDV Asia'\n    developerEmail = 'support@bcgdv.com'\n\n    licenseName = 'The Apache Software License, Version 2.0'\n    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'\n    allLicenses = [\"Apache-2.0\"]\n}\n\nandroid {\n    compileSdkVersion 28\n    buildToolsVersion \"27.0.3\"\n\n    defaultConfig {\n        minSdkVersion 15\n        targetSdkVersion 28\n        versionCode 1\n        versionName \"1.3\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n    lintOptions {\n        abortOnError false\n    }\t\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    testImplementation 'junit:junit:4.12'\n    implementation 'com.android.support:appcompat-v7:28.0.0-beta01'\n}\n\napply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'\napply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'"
  },
  {
    "path": "ticktock/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 C:\\Users\\Ali Muzaffar\\Development\\adt\\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": "ticktock/src/androidTest/java/com/bcgdv/asia/lib/ticktock/ApplicationTest.java",
    "content": "package com.bcgdv.asia.lib.ticktock;\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": "ticktock/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.bcgdv.asia.lib.ticktock\">\n\n    <application android:allowBackup=\"true\" android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\">\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ticktock/src/main/java/com/bcgdv/asia/lib/ticktock/TickTockView.java",
    "content": "package com.bcgdv.asia.lib.ticktock;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.graphics.Bitmap;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Matrix;\nimport android.graphics.Paint;\nimport android.graphics.Point;\nimport android.graphics.PorterDuff;\nimport android.graphics.PorterDuffXfermode;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.os.Build;\nimport android.os.CountDownTimer;\nimport android.text.TextUtils;\nimport android.util.AttributeSet;\nimport android.view.View;\n\nimport java.util.Calendar;\n\n/**\n * Created by Ali Muzaffar on 10/03/2016.\n */\npublic class TickTockView extends View {\n    private Paint mFillPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Paint mEmptyPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Paint mMiddlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n    private Paint mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n\n    private RectF mArc = new RectF();\n    private Point mCenter = new Point();\n\n    private Canvas mCanvas;\n    private Bitmap mCanvasBitmap;\n    private Matrix mMatrix = new Matrix();\n\n    private float mRingRadius = 100;\n    private float mRingThickness = 3;\n    private float mDotRadius = 6;\n\n    private long mTimeRemaining = 0;\n    private float mTextPadding = 16;\n    private Rect mTextBounds = new Rect();\n    private CharSequence mText = null;\n\n    private int mEmptyRingColor = Color.WHITE;\n    private int mFillRingColor = Color.BLUE;\n    private int mMiddleColor = Color.TRANSPARENT;\n    private int mTextColor = Color.BLUE;\n    private float mTextSize = 80;\n\n    private boolean mCounterClockwise = false;\n    private boolean mAutoFitText = true;\n\n    private OnTickListener mTickListener;\n\n    private final int DURATION_MINUTE = 0;\n    private final int DURATION_TOTAL = 1;\n    private int mCircleDuration = DURATION_MINUTE;\n    private Calendar mStartTime = null;\n    private Calendar mEndTime = null;\n\n    public TickTockView(Context context) {\n        super(context);\n        init(context, null);\n    }\n\n    public TickTockView(Context context, AttributeSet attrs) {\n        super(context, attrs);\n        init(context, attrs);\n    }\n\n    public TickTockView(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        init(context, attrs);\n    }\n\n    @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n    public TickTockView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {\n        super(context, attrs, defStyleAttr, defStyleRes);\n        init(context, attrs);\n    }\n\n    private void init(Context context, AttributeSet attrs) {\n        float multi = context.getResources().getDisplayMetrics().density;\n\n        mRingRadius *= multi;\n        mRingThickness *= multi;\n        mDotRadius *= multi;\n        mTextPadding *= multi;\n\n        TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TickTockView, 0, 0);\n        try {\n            mEmptyRingColor = ta.getColor(R.styleable.TickTockView_tickEmptyRingColor, mEmptyRingColor);\n            mFillRingColor = ta.getColor(R.styleable.TickTockView_tickFillRingColor, mFillRingColor);\n            mMiddleColor = ta.getColor(R.styleable.TickTockView_tickMiddleColor, mMiddleColor);\n            mTextColor = ta.getColor(R.styleable.TickTockView_tickTextColor, mTextColor);\n\n            mRingThickness = ta.getDimension(R.styleable.TickTockView_tickRingThickness, mRingThickness);\n            mDotRadius = ta.getDimension(R.styleable.TickTockView_tickDotRadius, mDotRadius);\n            mTextSize = ta.getDimension(R.styleable.TickTockView_tickTextSize, mTextSize);\n\n            mText = ta.getText(R.styleable.TickTockView_tickText);\n            mAutoFitText = ta.getBoolean(R.styleable.TickTockView_tickAutoFitText, mAutoFitText);\n\n            mCounterClockwise = ta.getBoolean(R.styleable.TickTockView_tickMoveCounterClockwise, mCounterClockwise);\n            mCircleDuration = ta.getInt(R.styleable.TickTockView_tickCircleDuration, mCircleDuration);\n        } finally {\n            ta.recycle();\n        }\n        mEmptyPaint.setColor(mEmptyRingColor);\n        mFillPaint.setColor(mFillRingColor);\n\n        mFillPaint.setStrokeWidth(mRingThickness);\n        mEmptyPaint.setStrokeWidth(mRingThickness);\n\n        mMiddlePaint.setColor(mMiddleColor);\n        if (mMiddleColor == Color.TRANSPARENT) {\n            mMiddlePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));\n        }\n\n        mTextPaint.setColor(mTextColor);\n        mTextPaint.setTextSize(mTextSize);\n\n        if (isInEditMode()) {\n            fitText(mText);\n        }\n\n        calculateEverything();\n    }\n\n    private void calculateEverything() {\n        calculateCenter();\n        calculateArc();\n    }\n\n    private void drawInitialCircle() {\n        if (mCanvas == null || mCanvasBitmap.getWidth() != getWidth() || mCanvasBitmap.getHeight() != getHeight()) {\n            if (mCanvasBitmap != null) {\n                mCanvas = null;\n                mCanvasBitmap.recycle();\n                mCanvasBitmap = null;\n            }\n            mCanvasBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);\n            mCanvas = new Canvas(mCanvasBitmap);\n        }\n\n        mCanvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);\n        mCanvas.drawCircle(mCenter.x, mCenter.y, mRingRadius, mEmptyPaint);\n    }\n\n    private void calculateCenter() {\n        mCenter.x = ((getWidth() + getPaddingLeft()) - getPaddingRight()) / 2;\n        mCenter.y = ((getHeight() + getPaddingTop()) - getPaddingBottom()) / 2;\n    }\n\n    private void calculateArc() {\n        mArc.left = mCenter.x - mRingRadius;\n        mArc.top = mCenter.y - mRingRadius;\n        mArc.right = mCenter.x + mRingRadius;\n        mArc.bottom = mCenter.y + mRingRadius;\n    }\n\n    @Override\n    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n        super.onLayout(changed, left, top, right, bottom);\n        if (changed) {\n            calculateEverything();\n        }\n    }\n\n    @Override\n    protected void onSizeChanged(int w, int h, int oldw, int oldh) {\n        super.onSizeChanged(w, h, oldw, oldh);\n        mRingRadius = ((getMeasuredWidth() - getPaddingLeft()) / 2) - mDotRadius;\n        if (!TextUtils.isEmpty(mText)) {\n            fitText(mText);\n        }\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        super.onDraw(canvas);\n        drawInitialCircle();\n\n        calculateArc();\n        long ms = isInEditMode() ? System.currentTimeMillis() % 60000 : mTimeRemaining % 60000;\n        float angle = (float) (ms * 0.006);\n\n        if (mCircleDuration == DURATION_TOTAL && mStartTime != null) {\n            long totalTime = mEndTime.getTimeInMillis() - mStartTime.getTimeInMillis();\n            float percentage = (((float) mTimeRemaining) / ((float) totalTime));\n            angle = 360f * percentage;\n        }\n\n        if (isInEditMode()) {\n            angle *= -1;\n        }\n\n        //The fill\n        if (!mCounterClockwise) {\n            mCanvas.drawArc(mArc, 270, angle, true, mFillPaint);\n        } else {\n            mCanvas.drawArc(mArc, 270, 360-angle, true, mFillPaint);\n        }\n\n        //Clear the centre\n        mCanvas.drawCircle(mCenter.x, mCenter.y, mRingRadius - mRingThickness, mMiddlePaint);\n\n        drawDot();\n        if (!mCounterClockwise) {\n            mMatrix.setRotate(-angle, mCanvas.getWidth() / 2, mCanvas.getHeight() / 2);\n        } else {\n            mMatrix.setRotate(angle, mCanvas.getWidth() / 2, mCanvas.getHeight() / 2);\n        }\n\n        canvas.drawBitmap(mCanvasBitmap, mMatrix, null);\n        if (isInEditMode()) {\n            mTimeRemaining = System.currentTimeMillis();\n        }\n\n        if (!TextUtils.isEmpty(mText)) {\n            canvas.drawText(mText.toString(), getWidth() / 2 - mTextBounds.width() / 2, getHeight() / 2 + mTextBounds.height() / 2, mTextPaint);\n        }\n    }\n\n    private void drawDot() {\n        float centerX = (mCanvas.getWidth() / 2);\n        float centerY = mDotRadius + mRingThickness / 2;\n        mCanvas.drawCircle(centerX, centerY, mDotRadius, mFillPaint);\n    }\n\n    /**\n     *\n     * @param endTime Calendar the time to count down till.\n     */\n    public void start(Calendar endTime) {\n        if (endTime == null || endTime.before(Calendar.getInstance())) {\n            throw new IllegalArgumentException(\"endTime cannot be null and must be in the future\");\n        }\n\n        //Fix for issue #1 where hot deploying would result in text being rendered incorrectly.\n        if (!TextUtils.isEmpty(mText) && (mTextBounds.width() == 0 || mTextBounds.height() == 0) && mTextSize > 0) {\n            //When code is hot deployed,\n            fitText(mText);\n        }\n\n        mEndTime = endTime;\n\n        if (mTimer != null) {\n            mTimer.cancel();\n        }\n\n        mTimer = new CountDownTimer(endTime.getTimeInMillis() - System.currentTimeMillis(), 16) {\n            @Override\n            public void onTick(long millisUntilFinished) {\n                mTimeRemaining = millisUntilFinished;\n                updateText(mTimeRemaining);\n                invalidate();\n            }\n\n            @Override\n            public void onFinish() {\n                updateText(0);\n                invalidate();\n            }\n        }.start();\n    }\n\n    /**\n     * Only for use with with tickCircleDuration = total_time\n     *\n     * @param startTime Calendar the start time which represents starting point for the circle.\n     * @param endTime Calendar the end time which represents a full circle\n     */\n    public void start(Calendar startTime, Calendar endTime) {\n        if (startTime == null || endTime == null || startTime.after(endTime)) {\n            throw new IllegalArgumentException(\"startTime and endTime cannot be null and startTime must be before endTIme.\");\n        }\n        mStartTime = startTime;\n        start(endTime);\n    }\n\n    private void updateText(long timeRemaining) {\n        if (mTickListener != null) {\n            String text = mTickListener.getText(timeRemaining);\n            if (!TextUtils.isEmpty(text)) {\n                if (mText != null && mText.length() != text.length()) {\n                    mTextPaint.getTextBounds(text, 0, text.length(), mTextBounds);\n                }\n                mText = text;\n            }\n        }\n    }\n\n    /**\n     * Remove stop the timer.\n     */\n    public void stop() {\n        if (mTimer != null) {\n            mTimer.cancel();\n        }\n        mStartTime = null;\n        mEndTime = null;\n    }\n\n    private void fitText(CharSequence text) {\n        if (TextUtils.isEmpty(text)) {\n            return;\n        }\n        if (mAutoFitText) {\n            float textWidth = mFillPaint.measureText(text.toString());\n            float multi = ((mRingRadius * 2) - mTextPadding * 2) / textWidth;\n            mTextPaint.setTextSize(mFillPaint.getTextSize() * multi);\n        }\n        mTextPaint.getTextBounds(mText.toString(), 0, mText.length(), mTextBounds);\n    }\n\n\n    @Override\n    protected void onDetachedFromWindow() {\n        if (mTimer != null) {\n\n        }\n        super.onDetachedFromWindow();\n    }\n\n    /**\n     * Listen for tick events.\n     *\n     * @param l OnTickListener\n     */\n    public void setOnTickListener(OnTickListener l) {\n        mTickListener = l;\n    }\n\n    private CountDownTimer mTimer = null;\n\n    public interface OnTickListener {\n        String getText(long timeRemainingInMillis);\n    }\n}\n"
  },
  {
    "path": "ticktock/src/main/res/values/attrs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <declare-styleable name=\"TickTockView\">\n        <attr name=\"tickTextSize\" format=\"dimension\" />\n        <attr name=\"tickRingThickness\" format=\"dimension\" />\n        <attr name=\"tickDotRadius\" format=\"dimension\" />\n        <attr name=\"tickTextColor\" format=\"color\" />\n        <attr name=\"tickEmptyRingColor\" format=\"color\" />\n        <attr name=\"tickFillRingColor\" format=\"color\" />\n        <attr name=\"tickMiddleColor\" format=\"color\" />\n        <attr name=\"tickText\" format=\"string\" />\n        <attr name=\"tickMoveCounterClockwise\" format=\"boolean\" />\n        <attr name=\"tickAutoFitText\" format=\"boolean\" />\n        <attr name=\"tickCircleDuration\" format=\"enum\">\n            <enum name=\"minute\" value=\"0\"/>\n            <enum name=\"total_time\" value=\"1\" />\n        </attr>\n    </declare-styleable>\n</resources>"
  },
  {
    "path": "ticktock/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">ticktocklib</string>\n</resources>\n"
  },
  {
    "path": "ticktock/src/test/java/com/bcgdv/asia/lib/ticktock/ExampleUnitTest.java",
    "content": "package com.bcgdv.asia.lib.ticktock;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tests, switch the Test Artifact in the Build Variants view.\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  }
]