Android Open Source - vitdroid-android Minute Labeler

From Project

Back to project page vitdroid-android.


The source code is released under:

Apache License

If you think the Android project vitdroid-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

//from   w  w w  .j a  v  a  2s .  c  om
import java.util.Calendar;


 * A Labeler that displays minutes
public class MinuteLabeler extends Labeler {
    private final String mFormatString;

    public MinuteLabeler(String formatString) {
        super(45, 60);
        mFormatString = formatString;

    public TimeObject add(long time, int val) {
        return timeObjectfromCalendar(Util.addMinutes(time, val, minuteInterval));

    protected TimeObject timeObjectfromCalendar(Calendar c) {
      if (minuteInterval>1) {
        int minutes = c.get(Calendar.MINUTE);
        c.set(Calendar.MINUTE, minutes-(minutes%minuteInterval));
        return Util.getMinute(c, mFormatString, minuteInterval);


Java Source Code List