├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── scopes
│ └── scope_settings.xml
└── vcs.xml
├── CountdownTimer.iml
├── LICENSE
├── ProgressWheel
├── .gitignore
├── AndroidManifest.xml
├── MIT-LICENSE.txt
├── README.md
├── build.gradle
├── build.xml
├── proguard-project.txt
├── proguard.cfg
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ ├── header.png
│ │ ├── ic_launcher.png
│ │ ├── icon.png
│ │ ├── login_gradient.png
│ │ ├── login_gradient_flip.png
│ │ └── logo.png
│ ├── drawable-ldpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── layout
│ │ ├── main.xml
│ │ ├── progress_spinner.xml
│ │ └── progress_wheel_activity.xml
│ └── values
│ │ ├── attrs.xml
│ │ └── strings.xml
├── sample_image.png
├── sample_image_2.png
├── sample_image_3.png
├── sample_image_4.png
└── src
│ └── com
│ └── todddavies
│ └── components
│ └── progressbar
│ ├── ProgressWheel.java
│ └── main.java
├── README.md
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── cardinalsolutions
│ │ └── countdowntimer
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cardinalsolutions
│ │ └── countdowntimer
│ │ ├── CountdownTimerActivity.java
│ │ └── Logger.java
│ └── res
│ ├── drawable-hdpi
│ ├── cardinal_bird.png
│ ├── ic_launcher.png
│ └── img_cardinal_logo.png
│ ├── drawable-mdpi
│ ├── cardinal_bird.png
│ ├── ic_launcher.png
│ └── img_cardinal_logo.png
│ ├── drawable-xhdpi
│ ├── cardinal_bird.png
│ ├── dolf_bird.cardinal_bird.png
│ ├── ic_dialog_time_org.png
│ ├── ic_launcher.png
│ └── img_cardinal_logo.png
│ ├── layout
│ └── activity_countdown_timer.xml
│ ├── values-sw600dp
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── img
└── countdown.png
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/workspace.xml
4 | /.idea/libraries
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | Countdown Timer
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | Android API 19 Platform
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CountdownTimer.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License (MIT)
2 |
3 | Copyright (c) 2013 Cardinal Solutions
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ProgressWheel/.gitignore:
--------------------------------------------------------------------------------
1 | # built application files
2 | *.apk
3 | *.ap_
4 |
5 | # files for the dex VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # generated files
12 | bin/
13 | gen/
14 |
15 | # Local configuration file (sdk path, etc)
16 | local.properties
17 |
18 | # Eclipse project files
19 | .classpath
20 | .project
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
25 | # Intellij project files
26 | *.iml
27 | *.ipr
28 | *.iws
29 | .idea/
30 |
31 | # Mac system files
32 | .DS_Store
33 |
34 | #Gradle
35 | .gradle
36 | gradle
37 | build
38 |
--------------------------------------------------------------------------------
/ProgressWheel/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ProgressWheel/MIT-LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ProgressWheel/README.md:
--------------------------------------------------------------------------------
1 | Progress Wheel
2 | =============
3 |
4 | This is a custom component for Android intended for use instead of a progress bar.
5 |
6 | 
7 | 
8 | 
9 | 
10 |
11 | A complete walkthrough of how to use this component in your app
12 | -------------
13 |
14 | **XML:**
15 | To implement the view in your xml layout do the following:
16 |
17 | 1. Add the following to your attrs.xml file (in res/values):
18 | ``` xml
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ```
36 |
37 | 2. Add the following code to the root view of your layout:
38 | `xmlns:ProgressWheel="http://schemas.android.com/apk/res/com.visualdenim.schooltraq"`
39 |
40 | 3. Add the widget code in the appropriate place in your xml file. Here's a sample implementation:
41 | ``` xml
42 |
55 | ```
56 |
57 | **Java:**
58 | First you need to either get a ProgressWheel from a layout file, or initalise one. Do this by:
59 |
60 | - `ProgressWheel pw = new ProgressWheel(myContext, myAttributes);`
61 | - `ProgressWheel pw = (ProgressWheel) findViewById(R.id.pw_spinner);`
62 |
63 | To spin the progress wheel, you just call .`spin()` and to stop it spinning, you call `.stopSpinning()`
64 |
65 | Incrementing the progress wheel is slightly more tricky, you call `.incrementProgress()`. However, this is out of 360,
66 | (because a circle has 360 degrees), and will automatically reset once you get past 360. A percentage display is
67 | automatically displayed.
68 |
69 | Using as a library project
70 | --------------------------
71 |
72 | To use it as a library in Android Studio, please edit build.gradle.
73 |
74 | Modify:
75 |
76 | apply plugin: 'android'
77 |
78 | Into:
79 |
80 | apply plugin: 'android-library'
81 |
82 | Since Android SDK Tools revision 17 (released March 2012), this component can
83 | be used as a library project. In this case, you do *not* need to copy anything
84 | into your project's attrs.xml, and you must use the following namespace URI,
85 | instead of the above:
86 |
87 | `xmlns:ProgressWheel="http://schemas.android.com/apk/res-auto"`
88 |
89 | Otherwise, usage should be the same.
90 |
91 |
92 | Todd Davies - 2012
93 |
--------------------------------------------------------------------------------
/ProgressWheel/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | }
5 |
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:0.12.+'
8 | }
9 | }
10 |
11 | apply plugin: 'com.android.library'
12 |
13 | android {
14 |
15 | compileSdkVersion 20
16 | buildToolsVersion "20"
17 |
18 | defaultConfig {
19 | minSdkVersion 8
20 | targetSdkVersion 20
21 | }
22 |
23 | sourceSets {
24 | main {
25 | manifest.srcFile 'AndroidManifest.xml'
26 | java.srcDirs = ['src']
27 | resources.srcDirs = ['src']
28 | renderscript.srcDirs = ['src']
29 | res.srcDirs = ['res']
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ProgressWheel/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
49 |
50 |
51 |
52 |
56 |
57 |
69 |
70 |
71 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/ProgressWheel/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/ProgressWheel/proguard.cfg:
--------------------------------------------------------------------------------
1 | -optimizationpasses 5
2 | -dontusemixedcaseclassnames
3 | -dontskipnonpubliclibraryclasses
4 | -dontpreverify
5 | -verbose
6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7 |
8 | -keep public class * extends android.app.Activity
9 | -keep public class * extends android.app.Application
10 | -keep public class * extends android.app.Service
11 | -keep public class * extends android.content.BroadcastReceiver
12 | -keep public class * extends android.content.ContentProvider
13 | -keep public class * extends android.app.backup.BackupAgentHelper
14 | -keep public class * extends android.preference.Preference
15 | -keep public class com.android.vending.licensing.ILicensingService
16 |
17 | -keepclasseswithmembernames class * {
18 | native ;
19 | }
20 |
21 | -keepclasseswithmembers class * {
22 | public (android.content.Context, android.util.AttributeSet);
23 | }
24 |
25 | -keepclasseswithmembers class * {
26 | public (android.content.Context, android.util.AttributeSet, int);
27 | }
28 |
29 | -keepclassmembers class * extends android.app.Activity {
30 | public void *(android.view.View);
31 | }
32 |
33 | -keepclassmembers enum * {
34 | public static **[] values();
35 | public static ** valueOf(java.lang.String);
36 | }
37 |
38 | -keep class * implements android.os.Parcelable {
39 | public static final android.os.Parcelable$Creator *;
40 | }
41 |
--------------------------------------------------------------------------------
/ProgressWheel/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system use,
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 |
10 | android.library=true
11 | # Project target.
12 | target=android-19
13 |
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-hdpi/header.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-hdpi/header.png
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-hdpi/login_gradient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-hdpi/login_gradient.png
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-hdpi/login_gradient_flip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-hdpi/login_gradient_flip.png
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/ProgressWheel/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ProgressWheel/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
23 |
24 |
25 |
26 |
31 |
32 |
38 |
39 |
42 |
43 |
47 |
48 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/ProgressWheel/res/layout/progress_spinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/ProgressWheel/res/layout/progress_wheel_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
21 |
22 |
26 |
27 |
30 |
31 |
33 |
34 |
47 |
48 |
49 |
52 |
53 |
67 |
68 |
82 |
83 |
84 |
85 |
86 |
87 |
95 |
96 |
--------------------------------------------------------------------------------
/ProgressWheel/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/ProgressWheel/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Hello World, main!
5 | ProgressBar
6 |
7 |
--------------------------------------------------------------------------------
/ProgressWheel/sample_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/sample_image.png
--------------------------------------------------------------------------------
/ProgressWheel/sample_image_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/sample_image_2.png
--------------------------------------------------------------------------------
/ProgressWheel/sample_image_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/sample_image_3.png
--------------------------------------------------------------------------------
/ProgressWheel/sample_image_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/ProgressWheel/sample_image_4.png
--------------------------------------------------------------------------------
/ProgressWheel/src/com/todddavies/components/progressbar/ProgressWheel.java:
--------------------------------------------------------------------------------
1 | package com.todddavies.components.progressbar;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Canvas;
6 | import android.graphics.Paint;
7 | import android.graphics.Paint.Style;
8 | import android.graphics.RectF;
9 | import android.graphics.Shader;
10 | import android.os.Handler;
11 | import android.os.Message;
12 | import android.util.AttributeSet;
13 | import android.view.View;
14 |
15 |
16 | /**
17 | * An indicator of progress, similar to Android's ProgressBar.
18 | * Can be used in 'spin mode' or 'increment mode'
19 | *
20 | * @author Todd Davies
21 | *
22 | * Licensed under the Creative Commons Attribution 3.0 license see:
23 | * http://creativecommons.org/licenses/by/3.0/
24 | */
25 | public class ProgressWheel extends View {
26 |
27 | //Sizes (with defaults)
28 | private int layout_height = 0;
29 | private int layout_width = 0;
30 | private int fullRadius = 100;
31 | private int circleRadius = 80;
32 | private int barLength = 60;
33 | private int barWidth = 20;
34 | private int rimWidth = 20;
35 | private int textSize = 20;
36 | private float contourSize = 0;
37 |
38 | //Padding (with defaults)
39 | private int paddingTop = 5;
40 | private int paddingBottom = 5;
41 | private int paddingLeft = 5;
42 | private int paddingRight = 5;
43 |
44 | //Colors (with defaults)
45 | private int barColor = 0xAA000000;
46 | private int contourColor = 0xAA000000;
47 | private int circleColor = 0x00000000;
48 | private int rimColor = 0xAADDDDDD;
49 | private int textColor = 0xFF000000;
50 |
51 | //Paints
52 | private Paint barPaint = new Paint();
53 | private Paint circlePaint = new Paint();
54 | private Paint rimPaint = new Paint();
55 | private Paint textPaint = new Paint();
56 | private Paint contourPaint = new Paint();
57 |
58 | //Rectangles
59 | @SuppressWarnings("unused")
60 | private RectF rectBounds = new RectF();
61 | private RectF circleBounds = new RectF();
62 | private RectF circleOuterContour = new RectF();
63 | private RectF circleInnerContour = new RectF();
64 |
65 | //Animation
66 | //The amount of pixels to move the bar by on each draw
67 | private int spinSpeed = 2;
68 | //The number of milliseconds to wait inbetween each draw
69 | private int delayMillis = 0;
70 | private Handler spinHandler = new Handler() {
71 | /**
72 | * This is the code that will increment the progress variable
73 | * and so spin the wheel
74 | */
75 | @Override
76 | public void handleMessage(Message msg) {
77 | invalidate();
78 | if (isSpinning) {
79 | progress += spinSpeed;
80 | if (progress > 360) {
81 | progress = 0;
82 | }
83 | spinHandler.sendEmptyMessageDelayed(0, delayMillis);
84 | }
85 | //super.handleMessage(msg);
86 | }
87 | };
88 | int progress = 0;
89 | boolean isSpinning = false;
90 |
91 | //Other
92 | private String text = "";
93 | private String[] splitText = {};
94 |
95 | /**
96 | * The constructor for the ProgressWheel
97 | *
98 | * @param context
99 | * @param attrs
100 | */
101 | public ProgressWheel(Context context, AttributeSet attrs) {
102 | super(context, attrs);
103 |
104 | parseAttributes(context.obtainStyledAttributes(attrs,
105 | R.styleable.ProgressWheel));
106 | }
107 |
108 | //----------------------------------
109 | //Setting up stuff
110 | //----------------------------------
111 |
112 | /*
113 | * When this is called, make the view square.
114 | * From: http://www.jayway.com/2012/12/12/creating-custom-android-views-part-4-measuring-and-how-to-force-a-view-to-be-square/
115 | *
116 | */
117 | @Override
118 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
119 | // The first thing that happen is that we call the superclass
120 | // implementation of onMeasure. The reason for that is that measuring
121 | // can be quite a complex process and calling the super method is a
122 | // convenient way to get most of this complexity handled.
123 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
124 |
125 | // We can’t use getWidth() or getHight() here. During the measuring
126 | // pass the view has not gotten its final size yet (this happens first
127 | // at the start of the layout pass) so we have to use getMeasuredWidth()
128 | // and getMeasuredHeight().
129 | int size = 0;
130 | int width = getMeasuredWidth();
131 | int height = getMeasuredHeight();
132 | int widthWithoutPadding = width - getPaddingLeft() - getPaddingRight();
133 | int heigthWithoutPadding = height - getPaddingTop() - getPaddingBottom();
134 |
135 | // Finally we have some simple logic that calculates the size of the view
136 | // and calls setMeasuredDimension() to set that size.
137 | // Before we compare the width and height of the view, we remove the padding,
138 | // and when we set the dimension we add it back again. Now the actual content
139 | // of the view will be square, but, depending on the padding, the total dimensions
140 | // of the view might not be.
141 | if (widthWithoutPadding > heigthWithoutPadding) {
142 | size = heigthWithoutPadding;
143 | } else {
144 | size = widthWithoutPadding;
145 | }
146 |
147 | // If you override onMeasure() you have to call setMeasuredDimension().
148 | // This is how you report back the measured size. If you don’t call
149 | // setMeasuredDimension() the parent will throw an exception and your
150 | // application will crash.
151 | // We are calling the onMeasure() method of the superclass so we don’t
152 | // actually need to call setMeasuredDimension() since that takes care
153 | // of that. However, the purpose with overriding onMeasure() was to
154 | // change the default behaviour and to do that we need to call
155 | // setMeasuredDimension() with our own values.
156 | setMeasuredDimension(size + getPaddingLeft() + getPaddingRight(), size + getPaddingTop() + getPaddingBottom());
157 | }
158 |
159 | /**
160 | * Use onSizeChanged instead of onAttachedToWindow to get the dimensions of the view,
161 | * because this method is called after measuring the dimensions of MATCH_PARENT & WRAP_CONTENT.
162 | * Use this dimensions to setup the bounds and paints.
163 | */
164 | @Override
165 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {
166 | super.onSizeChanged(w, h, oldw, oldh);
167 |
168 | // Share the dimensions
169 | layout_width = w;
170 | layout_height = h;
171 |
172 | setupBounds();
173 | setupPaints();
174 | invalidate();
175 | }
176 |
177 | /**
178 | * Set the properties of the paints we're using to
179 | * draw the progress wheel
180 | */
181 | private void setupPaints() {
182 | barPaint.setColor(barColor);
183 | barPaint.setAntiAlias(true);
184 | barPaint.setStyle(Style.STROKE);
185 | barPaint.setStrokeWidth(barWidth);
186 |
187 | rimPaint.setColor(rimColor);
188 | rimPaint.setAntiAlias(true);
189 | rimPaint.setStyle(Style.STROKE);
190 | rimPaint.setStrokeWidth(rimWidth);
191 |
192 | circlePaint.setColor(circleColor);
193 | circlePaint.setAntiAlias(true);
194 | circlePaint.setStyle(Style.FILL);
195 |
196 | textPaint.setColor(textColor);
197 | textPaint.setStyle(Style.FILL);
198 | textPaint.setAntiAlias(true);
199 | textPaint.setTextSize(textSize);
200 |
201 | contourPaint.setColor(contourColor);
202 | contourPaint.setAntiAlias(true);
203 | contourPaint.setStyle(Style.STROKE);
204 | contourPaint.setStrokeWidth(contourSize);
205 | }
206 |
207 | /**
208 | * Set the bounds of the component
209 | */
210 | private void setupBounds() {
211 | // Width should equal to Height, find the min value to steup the circle
212 | int minValue = Math.min(layout_width, layout_height);
213 |
214 | // Calc the Offset if needed
215 | int xOffset = layout_width - minValue;
216 | int yOffset = layout_height - minValue;
217 |
218 | // Add the offset
219 | paddingTop = this.getPaddingTop() + (yOffset / 2);
220 | paddingBottom = this.getPaddingBottom() + (yOffset / 2);
221 | paddingLeft = this.getPaddingLeft() + (xOffset / 2);
222 | paddingRight = this.getPaddingRight() + (xOffset / 2);
223 |
224 | int width = getWidth(); //this.getLayoutParams().width;
225 | int height = getHeight(); //this.getLayoutParams().height;
226 |
227 | rectBounds = new RectF(paddingLeft,
228 | paddingTop,
229 | width - paddingRight,
230 | height - paddingBottom);
231 |
232 | circleBounds = new RectF(paddingLeft + barWidth,
233 | paddingTop + barWidth,
234 | width - paddingRight - barWidth,
235 | height - paddingBottom - barWidth);
236 | circleInnerContour = new RectF(circleBounds.left + (rimWidth / 2.0f) + (contourSize / 2.0f), circleBounds.top + (rimWidth / 2.0f) + (contourSize / 2.0f), circleBounds.right - (rimWidth / 2.0f) - (contourSize / 2.0f), circleBounds.bottom - (rimWidth / 2.0f) - (contourSize / 2.0f));
237 | circleOuterContour = new RectF(circleBounds.left - (rimWidth / 2.0f) - (contourSize / 2.0f), circleBounds.top - (rimWidth / 2.0f) - (contourSize / 2.0f), circleBounds.right + (rimWidth / 2.0f) + (contourSize / 2.0f), circleBounds.bottom + (rimWidth / 2.0f) + (contourSize / 2.0f));
238 |
239 | fullRadius = (width - paddingRight - barWidth) / 2;
240 | circleRadius = (fullRadius - barWidth) + 1;
241 | }
242 |
243 | /**
244 | * Parse the attributes passed to the view from the XML
245 | *
246 | * @param a the attributes to parse
247 | */
248 | private void parseAttributes(TypedArray a) {
249 | barWidth = (int) a.getDimension(R.styleable.ProgressWheel_barWidth,
250 | barWidth);
251 |
252 | rimWidth = (int) a.getDimension(R.styleable.ProgressWheel_rimWidth,
253 | rimWidth);
254 |
255 | spinSpeed = (int) a.getDimension(R.styleable.ProgressWheel_spinSpeed,
256 | spinSpeed);
257 |
258 | delayMillis = a.getInteger(R.styleable.ProgressWheel_delayMillis,
259 | delayMillis);
260 | if (delayMillis < 0) {
261 | delayMillis = 0;
262 | }
263 |
264 | barColor = a.getColor(R.styleable.ProgressWheel_barColor, barColor);
265 |
266 | barLength = (int) a.getDimension(R.styleable.ProgressWheel_barLength,
267 | barLength);
268 |
269 | textSize = (int) a.getDimension(R.styleable.ProgressWheel_textSize,
270 | textSize);
271 |
272 | textColor = (int) a.getColor(R.styleable.ProgressWheel_textColor,
273 | textColor);
274 |
275 | //if the text is empty , so ignore it
276 | if (a.hasValue(R.styleable.ProgressWheel_text)) {
277 | setText(a.getString(R.styleable.ProgressWheel_text));
278 | }
279 |
280 | rimColor = (int) a.getColor(R.styleable.ProgressWheel_rimColor,
281 | rimColor);
282 |
283 | circleColor = (int) a.getColor(R.styleable.ProgressWheel_circleColor,
284 | circleColor);
285 |
286 | contourColor = a.getColor(R.styleable.ProgressWheel_contourColor, contourColor);
287 | contourSize = a.getDimension(R.styleable.ProgressWheel_contourSize, contourSize);
288 |
289 |
290 | // Recycle
291 | a.recycle();
292 | }
293 |
294 | //----------------------------------
295 | //Animation stuff
296 | //----------------------------------
297 |
298 | protected void onDraw(Canvas canvas) {
299 | super.onDraw(canvas);
300 | //Draw the inner circle
301 | canvas.drawArc(circleBounds, 360, 360, false, circlePaint);
302 | //Draw the rim
303 | canvas.drawArc(circleBounds, 360, 360, false, rimPaint);
304 | canvas.drawArc(circleOuterContour, 360, 360, false, contourPaint);
305 | canvas.drawArc(circleInnerContour, 360, 360, false, contourPaint);
306 | //Draw the bar
307 | if (isSpinning) {
308 | canvas.drawArc(circleBounds, progress - 90, barLength, false,
309 | barPaint);
310 | } else {
311 | canvas.drawArc(circleBounds, -90, progress, false, barPaint);
312 | }
313 | //Draw the text (attempts to center it horizontally and vertically)
314 | float textHeight = textPaint.descent() - textPaint.ascent();
315 | float verticalTextOffset = (textHeight / 2) - textPaint.descent();
316 |
317 | for (String s : splitText) {
318 | float horizontalTextOffset = textPaint.measureText(s) / 2;
319 | canvas.drawText(s, this.getWidth() / 2 - horizontalTextOffset,
320 | this.getHeight() / 2 + verticalTextOffset, textPaint);
321 | }
322 | }
323 |
324 | /**
325 | * Check if the wheel is currently spinning
326 | */
327 |
328 | public boolean isSpinning() {
329 | if(isSpinning){
330 | return true;
331 | } else {
332 | return false;
333 | }
334 | }
335 |
336 | /**
337 | * Reset the count (in increment mode)
338 | */
339 | public void resetCount() {
340 | progress = 0;
341 | setText("0%");
342 | invalidate();
343 | }
344 |
345 | /**
346 | * Turn off spin mode
347 | */
348 | public void stopSpinning() {
349 | isSpinning = false;
350 | progress = 0;
351 | spinHandler.removeMessages(0);
352 | }
353 |
354 |
355 | /**
356 | * Puts the view on spin mode
357 | */
358 | public void spin() {
359 | isSpinning = true;
360 | spinHandler.sendEmptyMessage(0);
361 | }
362 |
363 | /**
364 | * Increment the progress by 1 (of 360)
365 | */
366 | public void incrementProgress() {
367 | isSpinning = false;
368 | progress++;
369 | if (progress > 360)
370 | progress = 0;
371 | // setText(Math.round(((float) progress / 360) * 100) + "%");
372 | spinHandler.sendEmptyMessage(0);
373 | }
374 |
375 |
376 | /**
377 | * Set the progress to a specific value
378 | */
379 | public void setProgress(int i) {
380 | isSpinning = false;
381 | progress = i;
382 | spinHandler.sendEmptyMessage(0);
383 | }
384 |
385 | //----------------------------------
386 | //Getters + setters
387 | //----------------------------------
388 |
389 | /**
390 | * Set the text in the progress bar
391 | * Doesn't invalidate the view
392 | *
393 | * @param text the text to show ('\n' constitutes a new line)
394 | */
395 | public void setText(String text) {
396 | this.text = text;
397 | splitText = this.text.split("\n");
398 | }
399 |
400 | public int getCircleRadius() {
401 | return circleRadius;
402 | }
403 |
404 | public void setCircleRadius(int circleRadius) {
405 | this.circleRadius = circleRadius;
406 | }
407 |
408 | public int getBarLength() {
409 | return barLength;
410 | }
411 |
412 | public void setBarLength(int barLength) {
413 | this.barLength = barLength;
414 | }
415 |
416 | public int getBarWidth() {
417 | return barWidth;
418 | }
419 |
420 | public void setBarWidth(int barWidth) {
421 | this.barWidth = barWidth;
422 | }
423 |
424 | public int getTextSize() {
425 | return textSize;
426 | }
427 |
428 | public void setTextSize(int textSize) {
429 | this.textSize = textSize;
430 | }
431 |
432 | public int getPaddingTop() {
433 | return paddingTop;
434 | }
435 |
436 | public void setPaddingTop(int paddingTop) {
437 | this.paddingTop = paddingTop;
438 | }
439 |
440 | public int getPaddingBottom() {
441 | return paddingBottom;
442 | }
443 |
444 | public void setPaddingBottom(int paddingBottom) {
445 | this.paddingBottom = paddingBottom;
446 | }
447 |
448 | public int getPaddingLeft() {
449 | return paddingLeft;
450 | }
451 |
452 | public void setPaddingLeft(int paddingLeft) {
453 | this.paddingLeft = paddingLeft;
454 | }
455 |
456 | public int getPaddingRight() {
457 | return paddingRight;
458 | }
459 |
460 | public void setPaddingRight(int paddingRight) {
461 | this.paddingRight = paddingRight;
462 | }
463 |
464 | public int getBarColor() {
465 | return barColor;
466 | }
467 |
468 | public void setBarColor(int barColor) {
469 | this.barColor = barColor;
470 | }
471 |
472 | public int getCircleColor() {
473 | return circleColor;
474 | }
475 |
476 | public void setCircleColor(int circleColor) {
477 | this.circleColor = circleColor;
478 | }
479 |
480 | public int getRimColor() {
481 | return rimColor;
482 | }
483 |
484 | public void setRimColor(int rimColor) {
485 | this.rimColor = rimColor;
486 | }
487 |
488 |
489 | public Shader getRimShader() {
490 | return rimPaint.getShader();
491 | }
492 |
493 | public void setRimShader(Shader shader) {
494 | this.rimPaint.setShader(shader);
495 | }
496 |
497 | public int getTextColor() {
498 | return textColor;
499 | }
500 |
501 | public void setTextColor(int textColor) {
502 | this.textColor = textColor;
503 | }
504 |
505 | public int getSpinSpeed() {
506 | return spinSpeed;
507 | }
508 |
509 | public void setSpinSpeed(int spinSpeed) {
510 | this.spinSpeed = spinSpeed;
511 | }
512 |
513 | public int getRimWidth() {
514 | return rimWidth;
515 | }
516 |
517 | public void setRimWidth(int rimWidth) {
518 | this.rimWidth = rimWidth;
519 | }
520 |
521 | public int getDelayMillis() {
522 | return delayMillis;
523 | }
524 |
525 | public void setDelayMillis(int delayMillis) {
526 | this.delayMillis = delayMillis;
527 | }
528 | }
529 |
--------------------------------------------------------------------------------
/ProgressWheel/src/com/todddavies/components/progressbar/main.java:
--------------------------------------------------------------------------------
1 | package com.todddavies.components.progressbar;
2 |
3 | import android.app.Activity;
4 | import android.graphics.Bitmap;
5 | import android.graphics.BitmapShader;
6 | import android.graphics.Shader;
7 | import android.graphics.drawable.ShapeDrawable;
8 | import android.graphics.drawable.shapes.RectShape;
9 | import android.os.Bundle;
10 | import android.view.View;
11 | import android.view.View.OnClickListener;
12 | import android.widget.Button;
13 |
14 | /**
15 | * A sample activity showing some of the functions of the progress bar
16 | */
17 | public class main extends Activity {
18 | boolean running;
19 | ProgressWheel pw_two;
20 | ProgressWheel pw_three;
21 | ProgressWheel pw_four;
22 | //ProgressWheel pw_five;
23 | int progress = 0;
24 |
25 | @Override
26 | public void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.progress_wheel_activity);
29 | pw_two = (ProgressWheel) findViewById(R.id.progressBarTwo);
30 | pw_three = (ProgressWheel) findViewById(R.id.progressBarThree);
31 | pw_four = (ProgressWheel) findViewById(R.id.progressBarFour);
32 | //pw_five = (ProgressWheel) findViewById(R.id.progressBarFive);
33 |
34 | ShapeDrawable bg = new ShapeDrawable(new RectShape());
35 | int[] pixels = new int[] { 0xFF2E9121, 0xFF2E9121, 0xFF2E9121,
36 | 0xFF2E9121, 0xFF2E9121, 0xFF2E9121, 0xFFFFFFFF, 0xFFFFFFFF};
37 | Bitmap bm = Bitmap.createBitmap(pixels, 8, 1, Bitmap.Config.ARGB_8888);
38 | Shader shader = new BitmapShader(bm,
39 | Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
40 | pw_three.setRimShader(shader);
41 |
42 | pw_three.spin();
43 | pw_four.spin();
44 |
45 | final Runnable r = new Runnable() {
46 | public void run() {
47 | running = true;
48 | while(progress<361) {
49 | pw_two.incrementProgress();
50 | progress++;
51 | try {
52 | Thread.sleep(15);
53 | } catch (InterruptedException e) {
54 | // TODO Auto-generated catch block
55 | e.printStackTrace();
56 | }
57 | }
58 | running = false;
59 | }
60 | };
61 |
62 | Button spin = (Button) findViewById(R.id.btn_spin);
63 | spin.setOnClickListener(new OnClickListener() {
64 | public void onClick(View v) {
65 | if(!running) {
66 | if(pw_two.isSpinning) {
67 | pw_two.stopSpinning();
68 | }
69 | pw_two.resetCount();
70 | pw_two.setText("Loading...");
71 | pw_two.spin();
72 | }
73 | }
74 | });
75 |
76 | Button increment = (Button) findViewById(R.id.btn_increment);
77 | increment.setOnClickListener(new OnClickListener() {
78 | public void onClick(View v) {
79 | if(!running) {
80 | progress = 0;
81 | pw_two.resetCount();
82 | Thread s = new Thread(r);
83 | s.start();
84 | }
85 | }
86 | });
87 | }
88 |
89 | @Override
90 | public void onPause() {
91 | super.onPause();
92 | progress = 361;
93 | pw_two.stopSpinning();
94 | pw_two.resetCount();
95 | pw_two.setText("Click\none of the\nbuttons");
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Countdown Timer for Android
2 |
3 | ## Overview
4 |
5 | This is an activity that performs a countdown to a specified target date/time. In my usage, I developed an app that couldn't be viewed util a specific date/time. So, the countdown timer was my launch activity for that app. When the countdown expired I simply closed the countdown timer activiy and started the main application activity.
6 |
7 | 
8 |
9 | ## Usage
10 |
11 | For this project, I utilized Todd Davies' [ProgressWheel](https://github.com/Todd-Davies/ProgressWheel) in combination with a standard Android CountdownTimer, to display a clock that counts down to a date/time of the developers choosing. The target time objects (hour, minute, second, monthDay, month, year) are set in the CountdownTimerActivty class, and the countdown starts from now. All of the colors are customizable in the resource XMLs. For specifics on editing the ring colors, see the [ProgressWheel](https://github.com/Todd-Davies/ProgressWheel) project (although it's fairly intuitive if you check out the activity_countdown_timer.xml).
12 |
13 | ## Author / License
14 |
15 | Copyright Cardinal Solutions 2013. Licensed under the MIT license.
16 |
17 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 20
5 | buildToolsVersion '20.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.cardinalsolutions.countdowntimer"
9 | minSdkVersion 16
10 | targetSdkVersion 20
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | runProguard false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile project(':ProgressWheel')
25 | }
26 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/sking/Documents/Development/android-sdk/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/cardinalsolutions/countdowntimer/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.cardinalsolutions.countdowntimer;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cardinalsolutions/countdowntimer/CountdownTimerActivity.java:
--------------------------------------------------------------------------------
1 | package com.cardinalsolutions.countdowntimer;
2 | import android.app.Activity;
3 | import android.os.Bundle;
4 | import android.os.CountDownTimer;
5 | import android.text.format.Time;
6 | import android.view.animation.Animation;
7 | import android.view.animation.RotateAnimation;
8 | import android.widget.TextView;
9 | import com.todddavies.components.progressbar.ProgressWheel;
10 |
11 | /**
12 | * Countdown Timer
13 | *
14 | * CountdownTimerActivity is the main activity of this application. To configure is a utility class that allows the developer to turn off logging by setting the LOGGING
15 | * flag to false prior to generating an APK.
16 | *
17 | * @author Shane King
18 | * 28 Aug 2014
19 | * 10:00
20 | */
21 | public class CountdownTimerActivity extends Activity {
22 |
23 | private static final String TAG = "CountdownTimer";
24 |
25 | private TextView mCountdownNote;
26 | private ProgressWheel mDaysWheel;
27 | private TextView mDaysLabel;
28 | private ProgressWheel mHoursWheel;
29 | private TextView mHoursLabel;
30 | private ProgressWheel mMinutesWheel;
31 | private TextView mMinutesLabel;
32 | private ProgressWheel mSecondsWheel;
33 | private TextView mSecondsLabel;
34 |
35 | // Timer setup
36 | Time conferenceTime = new Time(Time.getCurrentTimezone());
37 | int hour = 22;
38 | int minute = 33;
39 | int second = 0;
40 | int monthDay = 28;
41 | // month is zero based...7 == August
42 | int month = 7;
43 | int year;
44 |
45 | // Values displayed by the timer
46 | private int mDisplayDays;
47 | private int mDisplayHours;
48 | private int mDisplayMinutes;
49 | private int mDisplaySeconds;
50 |
51 | @Override
52 | protected void onCreate(Bundle savedInstanceState) {
53 | super.onCreate(savedInstanceState);
54 | setContentView(R.layout.activity_countdown_timer);
55 |
56 | configureViews();
57 | configureConferenceDate();
58 |
59 | }
60 |
61 | private void configureViews() {
62 |
63 | this.conferenceTime.setToNow();
64 | this.year = conferenceTime.year;
65 |
66 | this.mCountdownNote = (TextView) findViewById(R.id.activity_countdown_timer_note);
67 | this.mDaysWheel = (ProgressWheel) findViewById(R.id.activity_countdown_timer_days);
68 | this.mHoursWheel = (ProgressWheel) findViewById(R.id.activity_countdown_timer_hours);
69 | this.mMinutesWheel = (ProgressWheel) findViewById(R.id.activity_countdown_timer_minutes);
70 | this.mSecondsWheel = (ProgressWheel) findViewById(R.id.activity_countdown_timer_seconds);
71 | this.mDaysLabel = (TextView) findViewById(R.id.activity_countdown_timer_days_text);
72 | this.mHoursLabel = (TextView) findViewById(R.id.activity_countdown_timer_hours_text);
73 | this.mMinutesLabel = (TextView) findViewById(R.id.activity_countdown_timer_minutes_text);
74 | this.mSecondsLabel = (TextView) findViewById(R.id.activity_countdown_timer_seconds_text);
75 |
76 | }
77 |
78 | private void configureConferenceDate() {
79 | conferenceTime.set(second, minute, hour, monthDay, month, year);
80 | conferenceTime.normalize(true);
81 | long confMillis = conferenceTime.toMillis(true);
82 |
83 | Time nowTime = new Time(Time.getCurrentTimezone());
84 | nowTime.setToNow();
85 | nowTime.normalize(true);
86 | long nowMillis = nowTime.toMillis(true);
87 |
88 | long milliDiff = confMillis - nowMillis;
89 |
90 | new CountDownTimer(milliDiff, 1000) {
91 |
92 | @Override
93 | public void onTick(long millisUntilFinished) {
94 | // decompose difference into days, hours, minutes and seconds
95 | CountdownTimerActivity.this.mDisplayDays = (int) ((millisUntilFinished / 1000) / 86400);
96 | CountdownTimerActivity.this.mDisplayHours = (int) (((millisUntilFinished / 1000) - (CountdownTimerActivity.this.mDisplayDays * 86400)) / 3600);
97 | CountdownTimerActivity.this.mDisplayMinutes = (int) (((millisUntilFinished / 1000) - ((CountdownTimerActivity.this.mDisplayDays * 86400) + (CountdownTimerActivity.this.mDisplayHours * 3600))) / 60);
98 | CountdownTimerActivity.this.mDisplaySeconds = (int) ((millisUntilFinished / 1000) % 60);
99 |
100 | CountdownTimerActivity.this.mDaysWheel.setText(String.valueOf(CountdownTimerActivity.this.mDisplayDays));
101 | CountdownTimerActivity.this.mDaysWheel.setProgress(CountdownTimerActivity.this.mDisplayDays);
102 |
103 | CountdownTimerActivity.this.mHoursWheel.setText(String.valueOf(CountdownTimerActivity.this.mDisplayHours));
104 | CountdownTimerActivity.this.mHoursWheel.setProgress(CountdownTimerActivity.this.mDisplayHours * 15);
105 |
106 | CountdownTimerActivity.this.mMinutesWheel.setText(String.valueOf(CountdownTimerActivity.this.mDisplayMinutes));
107 | CountdownTimerActivity.this.mMinutesWheel.setProgress(CountdownTimerActivity.this.mDisplayMinutes * 6);
108 |
109 | Animation an = new RotateAnimation(0.0f, 90.0f, 250f, 273f);
110 | an.setFillAfter(true);
111 |
112 | CountdownTimerActivity.this.mSecondsWheel.setText(String.valueOf(CountdownTimerActivity.this.mDisplaySeconds));
113 | CountdownTimerActivity.this.mSecondsWheel.setProgress(CountdownTimerActivity.this.mDisplaySeconds * 6);
114 | }
115 |
116 | @Override
117 | public void onFinish() {
118 | //TODO: this is where you would launch a subsequent activity if you'd like. I'm currently just setting the seconds to zero
119 | Logger.d(TAG, "Timer Finished...");
120 | CountdownTimerActivity.this.mSecondsWheel.setText("0");
121 | CountdownTimerActivity.this.mSecondsWheel.setProgress(0);
122 | }
123 | }.start();
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/app/src/main/java/com/cardinalsolutions/countdowntimer/Logger.java:
--------------------------------------------------------------------------------
1 | package com.cardinalsolutions.countdowntimer;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * Countdown Timer
7 | *
8 | * Logger is a utility class that allows the developer to turn off logging by setting the LOGGING
9 | * flag to false prior to generating an APK.
10 | *
11 | * @author Shane King
12 | * 28 Aug 2014
13 | * 10:00
14 | */
15 | public class Logger {
16 |
17 | private static final boolean LOGGING = true;
18 | private static final String TAG = "Countdown Timer: ";
19 |
20 | public static void i(String className, String message) {
21 | if (LOGGING) {
22 | Log.i(TAG, className + " - " + message);
23 | }
24 | }
25 |
26 | public static void d(String className, String message) {
27 | if (LOGGING) {
28 | Log.d(TAG, className + " - " + message);
29 | }
30 | }
31 |
32 | public static void v(String className, String message) {
33 | if (LOGGING) {
34 | Log.v(TAG, className + " - " + message);
35 | }
36 | }
37 |
38 | public static void e(String className, String message, Exception e) {
39 | if (LOGGING) {
40 | Log.e(TAG, className + " - " + message, e);
41 | }
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/cardinal_bird.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-hdpi/cardinal_bird.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/img_cardinal_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-hdpi/img_cardinal_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/cardinal_bird.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-mdpi/cardinal_bird.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/img_cardinal_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-mdpi/img_cardinal_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/cardinal_bird.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-xhdpi/cardinal_bird.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/dolf_bird.cardinal_bird.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-xhdpi/dolf_bird.cardinal_bird.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_dialog_time_org.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-xhdpi/ic_dialog_time_org.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/img_cardinal_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/app/src/main/res/drawable-xhdpi/img_cardinal_logo.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_countdown_timer.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
31 |
32 |
46 |
47 |
61 |
62 |
76 |
77 |
91 |
92 |
93 |
94 |
102 |
103 |
114 |
115 |
126 |
127 |
138 |
139 |
150 |
151 |
152 |
165 |
166 |
178 |
179 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1.5dp
5 | 9dp
6 | 22.5dp
7 | 30dp
8 | 33dp
9 |
10 |
11 | 24sp
12 | 30sp
13 | 36sp
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #FFFFFF
5 | #605F64
6 | #7F8285
7 | #B0B0B0
8 | #D31145
9 | #2173B9
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1dp
6 | 6dp
7 | 15dp
8 | 20dp
9 | 22dp
10 |
11 |
12 | 16sp
13 | 20sp
14 | 24sp
15 | 16dp
16 | 16dp
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Countdown Timer
5 | Content Description
6 | Thanks for checking out the Countdown Timer.\n\nThis timer is
7 | ideal for use in counting down an event start date, down to the second!! Feel free to
8 | use it in your app.
9 | days
10 | hrs
11 | mins
12 | secs
13 | CountdownTimerActivity
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:0.12.+'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/img/countdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CardinalNow/Android-CountdownTimer/32fd6a437b80c8b97468b5c0ee423f2d9525f4cf/img/countdown.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':ProgressWheel'
2 |
--------------------------------------------------------------------------------