|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectActivity
uk.ac.stir.cs.android.easter.EasterActivity
public class EasterActivity
Calculate the date of Easter Sunday for a range of years in the Gregorian calendar. The algorithm is taken from "Puzzles and Paradoxes", T. H. O'Beirne, 1965 (p. 180).
Field Summary | |
---|---|
private static int |
ABOUT_PADDING
Padding for "About Easter" popup |
private static int |
ABOUT_TEXT_SIZE
Text size for "About Easter" popup |
private java.util.Calendar |
currentCalendar
Current calendar |
private int |
currentYear
Current year |
private java.text.DateFormat |
dateFormat
Date format |
private TextView |
dateList
Date list |
private static int |
DATES_MAX
Maximum difference between start and end years |
private WheelView |
endYear1
End year digitis |
private WheelView |
endYear2
End year digitis |
private WheelView |
endYear3
End year digitis |
private WheelView |
endYear4
End year digitis |
private WheelView |
startYear1
Start year digitis |
private WheelView |
startYear2
Start year digitis |
private WheelView |
startYear3
Start year digitis |
private WheelView |
startYear4
Start year digitis |
private static int |
WHEEL_TEXT_SIZE
Size of text in wheel |
private static int |
WHEEL_VISIBLE
Number of visible items in wheel |
private static int |
YEAR_MAX
Maximum start year |
private static int |
YEAR_MIN
Minimum start year (first Easter of the Gregorian calendar) |
Constructor Summary | |
---|---|
EasterActivity()
|
Method Summary | |
---|---|
private WheelView |
createWheel(int identifier)
Create a wheel with digits 0..9. |
private java.lang.String |
getEaster(int year)
Return Easter Sunday date in localised form for the given year. |
void |
listDates(View view)
Display list of Easter dates from start to end year. |
void |
onCreate(Bundle savedInstanceState)
React to activity creation by setting up key variables. |
boolean |
onCreateOptionsMenu(Menu menu)
Create options menu. |
boolean |
onOptionsItemSelected(MenuItem item)
Handle menu selection. |
void |
resetYears(View view)
Reset start and end years to current year. |
private void |
setYears(int start,
int end,
boolean animate)
Set start and end year dates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int ABOUT_PADDING
private static final int ABOUT_TEXT_SIZE
private static final int DATES_MAX
private static final int WHEEL_TEXT_SIZE
private static final int WHEEL_VISIBLE
private static final int YEAR_MIN
private static final int YEAR_MAX
private java.util.Calendar currentCalendar
private int currentYear
private java.text.DateFormat dateFormat
private TextView dateList
private WheelView endYear1
private WheelView endYear2
private WheelView endYear3
private WheelView endYear4
private WheelView startYear1
private WheelView startYear2
private WheelView startYear3
private WheelView startYear4
Constructor Detail |
---|
public EasterActivity()
Method Detail |
---|
private WheelView createWheel(int identifier)
identifier
- wheel widget identifier
private java.lang.String getEaster(int year)
year
- year for Easter
public void listDates(View view)
view
- current viewpublic void onCreate(Bundle savedInstanceState)
savedInstanceState
- saved statepublic boolean onCreateOptionsMenu(Menu menu)
item
- menu itempublic boolean onOptionsItemSelected(MenuItem item)
item
- menu itempublic void resetYears(View view)
view
- current viewprivate void setYears(int start, int end, boolean animate)
start
- start yearend
- end yearanimate
- whether to animate the change
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |