Class DayItem
- java.lang.Object
-
- com.evanv.taskapp.ui.main.recycler.DayItem
-
public class DayItem extends java.lang.Object
Representation of a day for the outer recyclerview in the MainActivity. Contains two sub-RecyclerViews, represented by EventItem and TaskItem.- Author:
- Evan Voogd
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDayString()
Returns string representing the day this DayItem representsjava.util.List<EventItem>
getEvents()
Returns the List of EventItems to be displayed in recyclerviewint
getIndex()
Returns how many days past today's date this DayItem represents, which can be used as an index into the taskSchedule/eventSchedule ArrayLists for easy completion/deletion of events and tasks without using convoluted recycler index logic.java.util.List<TaskItem>
getTasks()
Returns the List of TaskItems to be displayed in recyclerviewvoid
setDayString(java.lang.String dayString)
Sets the string representing the day this DayItem representsvoid
setEvents(java.util.List<EventItem> events)
Sets the List of EventItems to be displayed in recyclerviewvoid
setTasks(java.util.List<TaskItem> tasks)
Sets the List of TaskItems to be displayed in recyclerview
-
-
-
Constructor Detail
-
DayItem
public DayItem(java.lang.String dayString, java.util.List<EventItem> events, java.util.List<TaskItem> tasks, int index)
Creates a DayItem to be used in MainActivity's recyclerview- Parameters:
dayString
- string of the day this DayItem representsevents
- list of EventItems to be displayed in recyclerviewtasks
- list of TaskItems to be displayed in recyclerviewindex
- how many days past today's date this DayItem represents
-
-
Method Detail
-
getIndex
public int getIndex()
Returns how many days past today's date this DayItem represents, which can be used as an index into the taskSchedule/eventSchedule ArrayLists for easy completion/deletion of events and tasks without using convoluted recycler index logic.- Returns:
- index into task/eventSchedule representing this DayItem
-
getDayString
public java.lang.String getDayString()
Returns string representing the day this DayItem represents- Returns:
- a string representing the day this DayItem represents
-
setDayString
public void setDayString(java.lang.String dayString)
Sets the string representing the day this DayItem represents- Parameters:
dayString
- a string representing the day this DayItem represents
-
getEvents
public java.util.List<EventItem> getEvents()
Returns the List of EventItems to be displayed in recyclerview- Returns:
- a List of EventItems to be displayed in recyclerview
-
setEvents
public void setEvents(java.util.List<EventItem> events)
Sets the List of EventItems to be displayed in recyclerview- Parameters:
events
- a List of EventItems to be displayed in recyclerview
-
getTasks
public java.util.List<TaskItem> getTasks()
Returns the List of TaskItems to be displayed in recyclerview- Returns:
- a List of TaskItems to be displayed in recyclerview
-
setTasks
public void setTasks(java.util.List<TaskItem> tasks)
Sets the List of TaskItems to be displayed in recyclerview- Parameters:
tasks
- a List of TaskItems to be displayed in recyclerview
-
-