Android time control extension based on countdownview

First of all, I wish you all success in the new year and good luck in the year of the chicken. Last year, there was a problem left when we made the time control, that is, there has been no good solution for the timing control. We really want to make countdownview support both timing and countdown. Based on this idea, we have today's article. The principle is not introduced. In fact, it is very simple. The main reason is that we know how to use this control. The advantages of this control are:

*Realize the unification of positive countdown * optimize the adapter and no longer bind the control ID * implement positive Countdown with one attribute * no alias is set for specific time attributes

Specific usage

1. XML file

Attribute app: iscountup = "false" means countdown, and true means positive timing

2. Entity class

To inherit timeentity eg:

3. The adapter is as follows

The countdown is mainly = = pay attention to initializing the Endtime attribute when the data source, that is, the deadline and the corresponding entityid==

Positive timing = = mainly initializes createtime when obtaining the data source, that is, the start time and entityid==

Download source code

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>