Skip to content

Commit

Permalink
更新到2.0版本
Browse files Browse the repository at this point in the history
1. 代码重构+优化
2. 增加所有xml配置项的代码设置方法(mCountdownView.dynamicShow(DynamicConfig dynamicConfig))
3. 增加代码动态配置的Demo界面
4. fix iwgang#8
4. fix iwgang#9
  • Loading branch information
iwgang committed Jun 19, 2016
1 parent 4106d49 commit 0513f3f
Show file tree
Hide file tree
Showing 23 changed files with 3,164 additions and 1,013 deletions.
Binary file added Demo_2.0.apk
Binary file not shown.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
buildToolsVersion "21.1.2"

defaultConfig {
applicationId "cn.iwgang.countdownviewdemo"
Expand All @@ -23,5 +23,6 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.github.iwgang:familiarrecyclerview:1.3.0'
compile 'cn.qqtheme.framework:ColorPicker:1.1.3'
compile project(':library')
}
12 changes: 8 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cn.iwgang.countdownviewdemo" >
package="cn.iwgang.countdownviewdemo">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme">
<activity
android:name="cn.iwgang.countdownviewdemo.MainActivity"
android:label="@string/app_name" >
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".DynamicShowActivity" android:windowSoftInputMode="stateHidden" />
<activity android:name=".ListViewActivity" />
<activity android:name=".RecyclerViewActivity" />
</application>

</manifest>
476 changes: 476 additions & 0 deletions app/src/main/java/cn/iwgang/countdownviewdemo/DynamicShowActivity.java

Large diffs are not rendered by default.

36 changes: 34 additions & 2 deletions app/src/main/java/cn/iwgang/countdownviewdemo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package cn.iwgang.countdownviewdemo;

import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import cn.iwgang.countdownview.CountdownView;

Expand All @@ -22,10 +23,20 @@ protected void onCreate(Bundle savedInstanceState) {
mCvCountdownViewTest1.start(time1);

CountdownView mCvCountdownViewTest2 = (CountdownView)findViewById(R.id.cv_countdownViewTest2);
mCvCountdownViewTest1.setTag("test2");
mCvCountdownViewTest2.setTag("test2");
long time2 = (long)30 * 60 * 1000;
mCvCountdownViewTest2.start(time2);

CountdownView mCvCountdownViewTest21 = (CountdownView)findViewById(R.id.cv_countdownViewTest21);
mCvCountdownViewTest21.setTag("test21");
long time21 = (long)24 * 60 * 60 * 1000;
mCvCountdownViewTest21.start(time21);

CountdownView mCvCountdownViewTest22 = (CountdownView)findViewById(R.id.cv_countdownViewTest22);
mCvCountdownViewTest22.setTag("test22");
long time22 = (long)30 * 60 * 1000;
mCvCountdownViewTest22.start(time22);

CountdownView mCvCountdownViewTest3 = (CountdownView)findViewById(R.id.cv_countdownViewTest3);
long time3 = (long)9 * 60 * 60 * 1000;
mCvCountdownViewTest3.start(time3);
Expand Down Expand Up @@ -60,6 +71,27 @@ protected void onProgressUpdate(Long... values) {
long time6 = (long)2 * 60 * 60 * 1000;
mCvCountdownViewTest6.start(time6);


findViewById(R.id.btn_toDynamicShowActivity).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, DynamicShowActivity.class));
}
});

findViewById(R.id.btn_toListViewActivity).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, ListViewActivity.class));
}
});

findViewById(R.id.btn_toRecyclerViewActivity).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, RecyclerViewActivity.class));
}
});
}

@Override
Expand Down
Binary file added app/src/main/res/drawable/test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0513f3f

Please sign in to comment.