Skip to content
Jesse Hoobergs edited this page Feb 9, 2018 · 7 revisions

You can customize the look of the WeekView in xml.

  • Use the following attributes in xml.
  • All these attributes also have getters and setters to enable you to change the style dynamically.
Attribute Default Value Description
allDayEventHeight 100 The height of all day events.
autoLimitTime false If set to true, the range of visible hours is automatically set to the smallest range in which all events take place. If there are for example only events between 10u and 18u, only the hours 10 until 18 are visible.
columnGap 10 The gap between days
dayBackgroundColor #F5F5F5 The backgroundcolor of a day
dropListenerEnabled false Whether items can be dropped on the weekview
eventCornerRadius 0 The radius of the corners of the event rectangles
eventMarginVertical 0 Set the top and bottom margin of the event. The event will keep this margin from the top and bottom edge. This margin is useful for differentiating consecutive events
eventPadding 8 The padding inside the event
eventTextColor #000000 The text color of events
eventTextSize 12 the text size on events
firstDayOfWeek Monday Set the first day of the week.
futureBackgroundColor #F5F5F5 The backgroundcolor of the future
futureWeekendBackgroundColor #000000 The backgroundcolor of future weekend days
headerColumnBackground #FFFFFF Background color of header column (left bar with hours)
headerColumnPadding 10 Padding of header coluln
headerColumnTextColor #000000 Text color of header column
headerRowBackgroundColor #FFFFFF Background color of header row (top bar with dates)
headerRowPadding 10 Padding of header row
horizontalFlingEnabled true Whether the week view should fling horizontally
hourHeight 50 The default height of an hour (can be used for zooming etc)
hourSeparatorColor #E6E6E6 Color of the hourlines
hourSeparatorHeight 2 Height of the hourlines
maxHourHeight 250 The max height of an hour. Can be seen as max zoom level
maxTime 24 The heighest hour that is shown in the view
minHourHeight 0 The minimal height of an hour. Can be seen as min zoom level
minTime 0 The lowest hour that is shown in the view
minOverlappingMinutes 0 The minimal amount of overlap of 2 events needed to be seen as overlapping events
newEventColor #3C93D9 Color of a new event placeholder
newEventIdentifier "-100" The identifier of the newly created event
newEventIconResource "ic_input_add" The drawable resource shown on a new event
newEventLengthInMinutes 60 The length of the new event placeholder
newEventTimeResolutionInMinutes 15 The resolution of the starttime of a new event. If set to 15 for example, the minutes of the time can only be 0, 15, 30 or 45.
noOfVisibleDays 3 The number of visible days
nowLineColor #666666 The color of the now line
nowLineThickness 5 The height of the now line
overlappingEventGap 0 The gap between overlapping events
pastBackgroundColor #E3E3E3 The backgroundcolor of the past
pastWeekendBackgroundColor #000000 The backgroundcolor of past weekend days
scrollDuration 250 The duration of the scroll.
showDistinctPastFutureColor false Whether past and future days should have two different background colors. The past and future day colors are defined by the attributes futureBackgroundColor and pastBackgroundColor
showDistinctWeekendColor false Whether weekends should have a background color different from the normal day background color. The weekend background colors are defined by the attributes futureWeekendBackgroundColor and pastWeekendBackgroundColor.
showFirstDayOfWeekFirst false If set to true, the first day of the week, will always be shown as first day. First day of the week is used only when the week view is first drawn. It does not have any effect after the user starts scrolling horizontally. Note: This method will only work if the week view is set to display more than 6 days at once
showNowLine false Whether to show the now line or not
textSize 12 Textsize for header row and time column
timeColumnResolution 60 The resolution of the time column in minutes
todayBackgroundColor #EFF7FE The background color of the current day
todayHeaderTextColor #2789E4 The textcolor of the header of the current day
verticalFlingEnabled true Whether the week view should fling vertically
xScrollingSpeed 1 The scrolling speed factor in horizontal direction
zoomFocusPoint 0 The focused point (percentage of the view height) where the week view is zoomed around. This point will not move while zooming. You can declare it as a fraction app:focusPoint="30%" and if is not declared the top of the view is used.
zoomFocusPointEnabled true If you set this to false the zoomFocusPoint won't take effect any more while zooming. The zoom will always be focused at the center of your gesture.
Clone this wiki locally