-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
/countdownview/build/* | ||
/countdownview/.iml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#BalloonRelativeLayout | ||
#欢迎star~感谢 | ||
### 效果图预览 | ||
![](/art/countdownviewx.gif) | ||
|
||
#属性值: | ||
|
||
``` | ||
<declare-styleable name="CountDownView"> | ||
<!--view半径--> | ||
<attr name="cd_circle_radius" format="dimension" /> | ||
<!--画笔宽度--> | ||
<attr name="cd_arc_width" format="dimension" /> | ||
<!--画笔颜色--> | ||
<attr name="cd_arc_color" format="color" /> | ||
<!--背景颜色--> | ||
<attr name="cd_bg_color" format="color" /> | ||
<!--字体颜色--> | ||
<attr name="cd_text_color" format="color" /> | ||
<!--字体尺寸--> | ||
<attr name="cd_text_size" format="dimension" /> | ||
<!--动画执行时长--> | ||
<attr name="cd_animator_time" format="integer" /> | ||
<!--时间单位--> | ||
<attr name="cd_animator_time_unit" format="string" /> | ||
<!--动画进退方式--> | ||
<attr name="cd_retreat_type" format="enum"> | ||
<!--外层的圆弧逐渐变长--> | ||
<enum name="forward" value="1" /> | ||
<!--外层的圆弧逐渐减短--> | ||
<enum name="back" value="2" /> | ||
</attr> | ||
<!--加载进度的开始位置--> | ||
<attr name="cd_location" format="enum"> | ||
<enum name="left" value="1" /> | ||
<enum name="top" value="2" /> | ||
<enum name="right" value="3" /> | ||
<enum name="bottom" value="4" /> | ||
</attr> | ||
</declare-styleable> | ||
|
||
``` | ||
|
||
#如何使用: | ||
|
||
``` | ||
<com.zhuyong.countdownciew.CountDownView | ||
android:id="@+id/cd_view3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:cd_animator_time="6" | ||
app:cd_animator_time_unit="S" | ||
app:cd_arc_color="#000000" | ||
app:cd_arc_width="2dp" | ||
app:cd_bg_color="#AFF2F2" | ||
app:cd_circle_radius="40dp" | ||
app:cd_location="left" | ||
app:cd_retreat_type="forward" | ||
app:cd_text_color="#FF4081" | ||
app:cd_text_size="14sp" /> | ||
``` | ||
|
||
##如何添加依赖库: | ||
|
||
- **Add it in your root build.gradle at the end of repositories:** | ||
|
||
``` | ||
|
||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
|
||
|
||
``` | ||
|
||
|
||
- **Add the dependency** | ||
|
||
``` | ||
dependencies { | ||
compile 'com.github.SuperKotlin:countdownview:1.0.0' | ||
} | ||
``` | ||
|
||
|
||
|
||
### 详细博客介绍地址: [启动页倒计时](http://www.jianshu.com/p/619cc65d66a5) | ||
|
||
### 关于我 | ||
- 我的简书:[BraveJoy](http://www.jianshu.com/users/c96d2a9d160f/timeline) | ||
- 我的github:[SuperKotlin](https://github.com/SuperKotlin) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 26 | ||
buildToolsVersion "26.0.0" | ||
defaultConfig { | ||
applicationId "com.zhuyong.countdownview" | ||
minSdkVersion 14 | ||
targetSdkVersion 26 | ||
versionCode 1 | ||
versionName "1.0.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(include: ['*.jar'], dir: 'libs') | ||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
compile 'com.android.support:appcompat-v7:26.+' | ||
compile 'com.android.support.constraint:constraint-layout:1.0.2' | ||
testCompile 'junit:junit:4.12' | ||
compile project(':countdownview') | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\Users\zhuyong\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.zhuyong.countdownview"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name="com.zhuyong.MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.zhuyong; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Toast; | ||
|
||
import com.zhuyong.countdownciew.CountDownView; | ||
import com.zhuyong.countdownview.R; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
private CountDownView mCdView1; | ||
private CountDownView mCdView2; | ||
private CountDownView mCdView3; | ||
private CountDownView mCdView4; | ||
private CountDownView mCdView5; | ||
private CountDownView mCdView6; | ||
private CountDownView mCdView7; | ||
private CountDownView mCdView8; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
mCdView1 = (CountDownView) findViewById(R.id.cd_view1); | ||
mCdView1.setOnLoadingFinishListener(new CountDownView.OnLoadingFinishListener() { | ||
@Override | ||
public void finish() { | ||
Toast.makeText(MainActivity.this, "加载动画执行结束", Toast.LENGTH_SHORT).show(); | ||
} | ||
}); | ||
|
||
mCdView2 = (CountDownView) findViewById(R.id.cd_view2); | ||
mCdView3 = (CountDownView) findViewById(R.id.cd_view3); | ||
mCdView4 = (CountDownView) findViewById(R.id.cd_view4); | ||
mCdView5 = (CountDownView) findViewById(R.id.cd_view5); | ||
mCdView6 = (CountDownView) findViewById(R.id.cd_view6); | ||
mCdView7 = (CountDownView) findViewById(R.id.cd_view7); | ||
mCdView8 = (CountDownView) findViewById(R.id.cd_view8); | ||
|
||
findViewById(R.id.btn_start).setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
mCdView1.start(); | ||
mCdView2.start(); | ||
mCdView3.start(); | ||
mCdView4.start(); | ||
mCdView5.start(); | ||
mCdView6.start(); | ||
mCdView7.start(); | ||
mCdView8.start(); | ||
} | ||
}); | ||
} | ||
|
||
} |