├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── misc.xml ├── modules.xml └── runConfigurations.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── zhuyong │ │ └── MainActivity.java │ └── res │ ├── layout │ └── activity_main.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── art └── countdownview.gif ├── build.gradle ├── countdownview ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── zhuyong │ │ └── countdownciew │ │ └── CountDownView.java │ └── res │ └── values │ ├── attrs.xml │ └── strings.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | /countdownview/build/* 11 | /countdownview/.iml 12 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #CountDownView 2 | #欢迎star~感谢 3 | ### 效果图预览 4 | ![](/art/countdownview.gif) 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 | 61 | ``` 62 | 63 | ##如何添加依赖库: 64 | 65 | - **Add it in your root build.gradle at the end of repositories:** 66 | 67 | ``` 68 | 69 | allprojects { 70 | repositories { 71 | ... 72 | maven { url 'https://jitpack.io' } 73 | } 74 | } 75 | 76 | ``` 77 | 78 | 79 | - **Add the dependency** 80 | 81 | ``` 82 | 83 | dependencies { 84 | 85 | compile 'com.github.SuperKotlin:CountDownView:1.0.0' 86 | 87 | } 88 | 89 | ``` 90 | 91 | 92 | 93 | ### 详细博客介绍地址: [自定义View_手撸一个启动页倒计时View](http://www.jianshu.com/p/2b5ef5e18fe5) 94 | 95 | ### 关于我 96 | - 我的简书:[BraveJoy](http://www.jianshu.com/users/c96d2a9d160f/timeline) 97 | - 我的github:[SuperKotlin](https://github.com/SuperKotlin) -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.0" 6 | defaultConfig { 7 | applicationId "com.zhuyong.countdownview" 8 | minSdkVersion 14 9 | targetSdkVersion 26 10 | versionCode 1 11 | versionName "1.0.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:26.+' 28 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 29 | testCompile 'junit:junit:4.12' 30 | compile project(':countdownview') 31 | } 32 | -------------------------------------------------------------------------------- /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 C:\Users\zhuyong\AppData\Local\Android\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 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/zhuyong/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.zhuyong; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Toast; 7 | 8 | import com.zhuyong.countdownciew.CountDownView; 9 | import com.zhuyong.countdownview.R; 10 | 11 | public class MainActivity extends AppCompatActivity { 12 | 13 | private CountDownView mCdView1; 14 | private CountDownView mCdView2; 15 | private CountDownView mCdView3; 16 | private CountDownView mCdView4; 17 | private CountDownView mCdView5; 18 | private CountDownView mCdView6; 19 | private CountDownView mCdView7; 20 | private CountDownView mCdView8; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.activity_main); 26 | mCdView1 = (CountDownView) findViewById(R.id.cd_view1); 27 | mCdView1.setOnLoadingFinishListener(new CountDownView.OnLoadingFinishListener() { 28 | @Override 29 | public void finish() { 30 | Toast.makeText(MainActivity.this, "加载动画执行结束", Toast.LENGTH_SHORT).show(); 31 | } 32 | }); 33 | 34 | mCdView2 = (CountDownView) findViewById(R.id.cd_view2); 35 | mCdView3 = (CountDownView) findViewById(R.id.cd_view3); 36 | mCdView4 = (CountDownView) findViewById(R.id.cd_view4); 37 | mCdView5 = (CountDownView) findViewById(R.id.cd_view5); 38 | mCdView6 = (CountDownView) findViewById(R.id.cd_view6); 39 | mCdView7 = (CountDownView) findViewById(R.id.cd_view7); 40 | mCdView8 = (CountDownView) findViewById(R.id.cd_view8); 41 | 42 | findViewById(R.id.btn_start).setOnClickListener(new View.OnClickListener() { 43 | @Override 44 | public void onClick(View view) { 45 | mCdView1.start(); 46 | mCdView2.start(); 47 | mCdView3.start(); 48 | mCdView4.start(); 49 | mCdView5.start(); 50 | mCdView6.start(); 51 | mCdView7.start(); 52 | mCdView8.start(); 53 | } 54 | }); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 28 | 29 | 43 | 44 | 45 | 46 | 51 | 52 | 66 | 67 | 82 | 83 | 84 | 89 | 90 | 104 | 105 | 120 | 121 | 122 | 127 | 128 | 142 | 143 | 158 | 159 | 160 |