to top
Android APIs
public class

MonthDisplayHelper

extends Object
java.lang.Object
   ↳ android.util.MonthDisplayHelper

Class Overview

Helps answer common questions that come up when displaying a month in a 6 row calendar grid format. Not thread safe.

Summary

Public Constructors

? Examples
MonthDisplayHelper(int year, int month, int weekStartDay)

? Examples
MonthDisplayHelper(int year, int month)
Public Methods

? Examples
int getColumnOf(int day)

? Examples
int getDayAt(int row, int column)

? Examples
int[] getDigitsForRow(int row)

? Examples
int getFirstDayOfMonth()

? Examples
int getMonth()

? Examples
int getNumberOfDaysInMonth()

? Examples
int getOffset()

? Examples
int getRowOf(int day)

? Examples
int getWeekStartDay()

? Examples
int getYear()

? Examples
boolean isWithinCurrentMonth(int row, int column)

? Examples
void nextMonth()
Increment the month.

? Examples
void previousMonth()
Decrement the month.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MonthDisplayHelper (int year, int month, int weekStartDay)

Added in API level 1

Parameters
year The year.
month The month.
weekStartDay What day of the week the week should start.

public MonthDisplayHelper (int year, int month)

Added in API level 1

Public Methods

public int getColumnOf (int day)

Added in API level 1

Returns
  • Which column day is in.

public int getDayAt (int row, int column)

Added in API level 1

Parameters
row The row, 0-5, starting from the top.
column The column, 0-6, starting from the left.
Returns
  • The day at a particular row, column

public int[] getDigitsForRow (int row)

Added in API level 1

Parameters
row Which row (0-5).
Returns
  • the digits of the month to display in one of the 6 rows of a calendar month display.

public int getFirstDayOfMonth ()

Added in API level 1

Returns
  • The first day of the month using a constants such as SUNDAY.

public int getMonth ()

Added in API level 1

public int getNumberOfDaysInMonth ()

Added in API level 1

Returns
  • The number of days in the month.

public int getOffset ()

Added in API level 1

Returns
  • The offset from displaying everything starting on the very first box. For example, if the calendar is set to display the first day of the week as Sunday, and the month starts on a Wednesday, the offset is 3.

public int getRowOf (int day)

Added in API level 1

Returns
  • Which row day is in.

public int getWeekStartDay ()

Added in API level 1

public int getYear ()

Added in API level 1

public boolean isWithinCurrentMonth (int row, int column)

Added in API level 1

Returns
  • Whether the row and column fall within the month.

public void nextMonth ()

Added in API level 1

Increment the month.

public void previousMonth ()

Added in API level 1

Decrement the month.

No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.