add minimal height to events without end timestamp

This commit is contained in:
tibbi 2017-01-18 23:33:04 +01:00
parent a2aa3e8a8c
commit b4c18aafe7
3 changed files with 4 additions and 2 deletions

View File

@ -85,6 +85,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
override fun updateWeeklyCalendar(events: List<Event>) {
val fullHeight = mRes.getDimension(R.dimen.weekly_view_events_height)
val minuteHeight = fullHeight / (24 * 60)
val minimalHeight = mRes.getDimension(R.dimen.weekly_view_minimal_event_height).toInt()
val eventColor = context.config.primaryColor
val sideMargin = mRes.displayMetrics.density.toInt()
(0..6).map { getColumnWithId(it) }
@ -107,7 +108,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
rightMargin = sideMargin
topMargin = (startMinutes * minuteHeight).toInt()
width = layout.width
height = (duration * minuteHeight).toInt() - sideMargin
height = if (event.startTS == event.endTS) minimalHeight else (duration * minuteHeight).toInt() - sideMargin
}
}
}

View File

@ -2,4 +2,4 @@
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="10dp"/>
android:layout_height="wrap_content"/>

View File

@ -7,6 +7,7 @@
<dimen name="weekly_view_row_minus_one_height">59dp</dimen>
<dimen name="weekly_view_events_height">1440dp</dimen> <!-- weekly_view_row_height * 24 hours -->
<dimen name="weekly_view_day_letters_height">40dp</dimen>
<dimen name="weekly_view_minimal_event_height">10dp</dimen>
<dimen name="min_widget_width">250dp</dimen>
<dimen name="min_widget_height">250dp</dimen>