Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/* Part of this class uses code from DurationFormatter (see license details below).*/

import android.graphics.Color;

public class Main {
    public static int getLongDurationColor(long duration) {
        if (duration < 24 * 3600 * 1000) {
            return Color.RED;
        }
        if (duration < 2 * 24 * 3600 * 1000) {
            return Color.YELLOW;
        }
        if (duration < 7 * 24 * 3600 * 1000) {
            return Color.GREEN;
        }
        return Color.WHITE;
    }
}