FileDocCategorySizeDatePackage
Utils.javaAPI DocAndroid 1.5 API3478Wed May 06 22:42:42 BST 2009com.android.calendar

Utils

public class Utils extends Object

Fields Summary
public static final String[]
englishNthDay
Constructors Summary
Methods Summary
public static final voidapplyAlphaAnimation(android.widget.ViewFlipper v)

        AlphaAnimation in = new AlphaAnimation(0.0f, 1.0f);

        in.setStartOffset(0);
        in.setDuration(500);

        AlphaAnimation out = new AlphaAnimation(1.0f, 0.0f);

        out.setStartOffset(0);
        out.setDuration(500);

        v.setInAnimation(in);
        v.setOutAnimation(out);
    
public static java.lang.StringformatMonthYear(android.text.format.Time time)
Formats the given Time object so that it gives the month and year (for example, "September 2007").

param
time the time to format
return
the string containing the weekday and the date

        Resources res = Resources.getSystem();
        return time.format(res.getString(com.android.internal.R.string.month_year));
    
public static java.lang.StringformatNth(int nth)


         
        return "the " + englishNthDay[nth];
    
static voidsetTimeToStartOfDay(android.text.format.Time time)
Sets the time to the beginning of the day (midnight) by clearing the hour, minute, and second fields.

        time.second = 0;
        time.minute = 0;
        time.hour = 0;
    
public static voidstartActivity(android.content.Context context, java.lang.String className, long time)

        Intent intent = new Intent(Intent.ACTION_VIEW);

        intent.setClassName(context, className);
        intent.putExtra(EVENT_BEGIN_TIME, time);

        context.startActivity(intent);
    
public static final android.text.format.TimetimeFromIntent(android.content.Intent intent)

        Time time = new Time();
        time.set(timeFromIntentInMillis(intent));
        return time;
    
public static final longtimeFromIntentInMillis(android.content.Intent intent)
If the given intent specifies a time (in milliseconds since the epoch), then that time is returned. Otherwise, the current time is returned.

        // If the time was specified, then use that.  Otherwise, use the current time.
        long millis = intent.getLongExtra(EVENT_BEGIN_TIME, -1);
        if (millis == -1) {
            millis = System.currentTimeMillis();
        }
        return millis;