No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
example Fix when time is over in Demo Nov 16, 2015
gradle/wrapper init project Nov 8, 2015
library Code Clean Nov 16, 2015
screenshots init Nov 8, 2015
.gitignore init project Nov 8, 2015
README.md update Dec 4, 2015
build.gradle upload to Jcenter Nov 13, 2015
gradle.properties init project Nov 8, 2015
gradlew init project Nov 8, 2015
gradlew.bat init project Nov 8, 2015
settings.gradle add libary Nov 8, 2015

README.md

CountDownTextView

A simple countdown widget and easy to use.

###Simple

demo

###Usage

    compile 'com.ufreedom.countdowntextview:library:0.1.0'

You can give it a start time in the SystemClock.elapsedRealtime timebase, and it counts down from that.

By default it will not update the time value in text but give a callback onTick(),If you want to display the current timer value ,Please use setAutoDisplayText(true).

By default the display timer value is in the form "MM:SS" or "HH:MM:SS", you can use setTimeFormat() to use other format :

Time Format Display
TIME_FORMAT_D_H_M_S DD:HH:MM:SS
TIME_FORMAT_H_M_S HH:MM:SS
TIME_FORMAT_M_S MM:SS
TIME_SHOW_S SS
long timeInFuture = SystemClock.elapsedRealtime + 1000 * 60 * 20;//20 minutes

CountDownTextView countDownTextView = findViewById(R.id.countDownTextView)
countDownTextView.setTimeInFuture(timeInFuture);
countDownTextView.setAutoShowText(true);
countDownTextView.start();

###Callback

    public interface CountDownCallback {

        /**
         * Callback fired on regular interval.
         * @param millisUntilFinished The amount of time until finished.
         */
        void onTick(CountDownTextView countDownTextView,long millisUntilFinished);

        /**
         * Callback fired when the time is up.
         */
        void onFinish(CountDownTextView countDownTextView);
        
    }