中文

CountdownView

Android countdown view,use canvas draw,supports multiple styles

Download demo apk

Screenshot

 

 

 

Gradle

compile 'com.github.iwgang:countdownview:2.1.6'

Code

CountdownView mCvCountdownView = (CountdownView)findViewById(R.id.cv_countdownViewTest1);mCvCountdownView.start(995550000); // Millisecond// orfor (int time=0; time<1000; time++) {    mCvCountdownView.updateShow(time);}

Layout

Customization

attr type default
isHideTimeBackground boolean true
timeBgColor color #444444
timeBgSize dimension timeSize + 2dp * 4
timeBgRadius dimension 0
isShowTimeBgDivisionLine boolean true
timeBgDivisionLineColor color #30FFFFFF
timeBgDivisionLineSize dimension 0.5dp
timeTextSize dimension 12sp
timeTextColor color #000000
isTimeTextBold boolean false
isShowDay boolean auto show (has value show if not hide)
isShowHour boolean auto show (has value show if not hide)
isShowMinute boolean true
isShowSecond boolean true
isShowMillisecond boolean false
isConvertDaysToHours boolean false
suffixTextSize dimension 12sp
suffixTextColor color #000000
isSuffixTextBold boolean false
suffixGravity 'top' or 'center' or 'bottom' 'center'
suffix string ':'
suffixDay string null
suffixHour string null
suffixMinute string null
suffixSecond string null
suffixMillisecond string null
suffixLRMargin dimension left 3dp right 3dp
suffixDayLeftMargin dimension 0
suffixDayRightMargin dimension 0
suffixHourLeftMargin dimension 0
suffixHourRightMargin dimension 0
suffixMinuteLeftMargin dimension 0
suffixMinuteRightMargin dimension 0
suffixSecondLeftMargin dimension 0
suffixSecondRightMargin dimension 0
suffixMillisecondLeftMargin dimension 0
isShowTimeBgBorder boolean false
timeBgBorderColor color #000000
timeBgBorderSize dimension 1dp
timeBgBorderRadius dimension 0

Other

  • Multiple countdownView specified value
    // step 1    mCvCountdownView.setTag(R.id.name, uid);    // step 2    @Override    public void onEnd(CountdownView cv) {        Object nameTag = cv.getTag(R.id.uid);        if (null != nameTag) {            Log.i(TAG, "name = " + nameTag.toString());        }    }
  • Dynamic show
    dynamicShow(DynamicConfig dynamicConfig)
  • Countdown complete callback
    setOnCountdownEndListener(OnCountdownEndListener onCountdownEndListener);
  • Interval callback
    setOnCountdownIntervalListener(long interval, OnCountdownIntervalListener onCountdownIntervalListener);

更多相关文章

  1. Android(安卓)中英文切换工具类
  2. Volley框架网络访问String,JsonObject,JsonArray
  3. android 从Assets中读取中文文本
  4. Android(安卓)权限中文描述大全
  5. Android向服务器上传中文乱码解决
  6. Android(安卓)中文 API (101) —— AsyncTask
  7. android之文字处理
  8. Android(安卓)3.0 r1 API中文文档(113) ――SlidingDrawer
  9. Android中文联系人排序及检索补丁的原理(090819更新)

随机推荐

  1. 谨慎使用第三方软件!安卓新型恶意软件,可窃
  2. 2011.09.14——— android listview的横
  3. Android(安卓)AVD之Socket Connect Time
  4. Android(安卓)ApiDemos示例解析(166):Vie
  5. android Activity.java 源码
  6. android 多线程刷新Location
  7. android中引入okhttp
  8. SQLiteException: no such column:好
  9. Android(安卓)- monkey 参数说明
  10. 第七天android:弹球1