Skip to content

It's a `Count Down Chronometer` widget of android base on Chronometer. (Android倒计时控件)

License

Notifications You must be signed in to change notification settings

rednels/CountDownChronometer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CountDownChronometer

It's a Count Down Chronometer widget of android base on Chronometer. (Android倒计时控件) Try the view by demo

How To

  1. Copy com.vcokey.widget.CountDownChronometer to your own project;
  2. Add the widget in your xml
<com.vcokey.widget.CountDownChronometer
    android:padding="16dp"
    android:id="@+id/countdownchronometer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
  1. In your Activity, you can set the format of display String, use

    CountDownChronometer.setFormat(" %s ", CountDownChronometer.FLAG_TIME_FORMAT_CUSTOM)

    to set format like Chronometer;

    you have two choices of format, try use CountDownChronometer.FLAG_TIME_FORMAT_DEFAULT to see a default format.

  2. Use CountDownChronometer.setTime(int) to init the view with the int value which means the seconds you want to count down;

  3. You can add a listener to observer the count down event, just use setOnChronometerTickListener

TIPS

  1. setTime(seconds,baseTime,currentTime)can count down the time from baseTime you give.

LISENCE

Copyright 2015 vcokey

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

It's a `Count Down Chronometer` widget of android base on Chronometer. (Android倒计时控件)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages