thellmund / Android-Week-View

Display highly customizable calendar views in your Android app
Apache License 2.0
188 stars 97 forks source link

I am adding one event but 3 events are shown in column #97

Closed lakhwinderdebut closed 5 years ago

lakhwinderdebut commented 5 years ago

I dont know its a bug or a feature When the visible days are set to 1, then after adding a single event, it shows three

Please check the code for it

override fun onMonthChange(startDate: Calendar, endDate: Calendar): List<WeekViewDisplayable> { return getEvents() }

private fun getEvents(): List<WeekViewDisplayable<Event>> {
    Log.e("getEvents","getEvents")
    val events = mutableListOf<WeekViewDisplayable<Event>>()

    val startTime = Calendar.getInstance()
    startTime.set(Calendar.HOUR_OF_DAY, 3)
    startTime.set(Calendar.MINUTE, 0)
    val endTime = startTime.clone() as Calendar
    endTime.add(Calendar.MINUTE, 50)

    val event  = createEvent(1,"MY EVENT ", startTime, endTime, R.color.colorAccent, isAllDay = false, isCanceled = false)

    events.add(event)

    return events
}

check the screenshot

https://imge.to/i/d5Qz6

thellmund commented 5 years ago

Duplicate of #8. Hope to improve this soon (see #87).

lakhwinderdebut commented 5 years ago

How to set the event width?

I need to show three events at the same time in a single day so I need them to column for a single day

thellmund commented 5 years ago

WeekView automatically puts events that take place at the same time into columns. For instance, if you have three events that start at 10 AM on the same date, each event will occupy a third of the width.