Skip to content

CountdownView

DV Infosys edited this page Jul 17, 2019 · 1 revision

Code

CountdownView mCvCountdownViewTest1 = (CountdownView)findViewById(R.id.countdown_view);
        mCvCountdownViewTest1.setTag("test1");
        long time1 = (long)5 * 60 * 60 * 1000;
        mCvCountdownViewTest1.start(time1);

Layout

<com.dvinfosys.widgets.CountdownView.CountdownView
            android:id="@+id/countdown_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="20dp"
            app:isHideTimeBackground="false"
            app:isShowDay="false"
            app:isShowHour="false"
            app:isShowMillisecond="true"
            app:isShowMinute="true"
            app:isShowSecond="true"
            app:suffixGravity="center"
            app:suffixTextColor="#000000"
            app:suffixTextSize="30sp"
            app:timeBgDivisionLineSize="1dp"
            app:timeBgRadius="3dp"
            app:timeBgSize="50dp"
            app:timeTextColor="#FFFFFF"
            app:timeTextSize="30sp" />

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
Clone this wiki locally