diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt index 69d9d92c3..61d93af35 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragment.kt @@ -69,7 +69,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { super.onCreate(savedInstanceState) res = context!!.resources config = context!!.config - rowHeight = res.getDimension(R.dimen.weekly_view_row_height) + rowHeight = config.weeklyViewItemHeight weekTimestamp = arguments!!.getLong(WEEK_START_TIMESTAMP) dimPastEvents = config.dimPastEvents primaryColor = context!!.getAdjustedPrimaryColor() @@ -228,7 +228,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { addNewLine() - val fullHeight = res.getDimension(R.dimen.weekly_view_events_height) + val fullHeight = rowHeight * 24 val minuteHeight = fullHeight / (24 * 60) val minimalHeight = res.getDimension(R.dimen.weekly_view_minimal_event_height).toInt() val density = Math.round(res.displayMetrics.density) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt index 1e19edd06..2f9068053 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Config.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.calendar.pro.helpers import android.content.Context import android.media.AudioManager +import com.simplemobiletools.calendar.pro.R import com.simplemobiletools.calendar.pro.extensions.config import com.simplemobiletools.calendar.pro.extensions.scheduleCalDAVSync import com.simplemobiletools.commons.extensions.getDefaultAlarmTitle @@ -178,4 +179,8 @@ class Config(context: Context) : BaseConfig(context) { var exportPastEvents: Boolean get() = prefs.getBoolean(EXPORT_PAST_EVENTS, false) set(exportPastEvents) = prefs.edit().putBoolean(EXPORT_PAST_EVENTS, exportPastEvents).apply() + + var weeklyViewItemHeight: Float + get() = prefs.getFloat(WEEKLY_VIEW_ITEM_HEIGHT, context.resources.getDimension(R.dimen.weekly_view_row_height)) + set(weeklyViewItemHeight) = prefs.edit().putFloat(WEEKLY_VIEW_ITEM_HEIGHT, weeklyViewItemHeight).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt index 9965734de..9545fb520 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Constants.kt @@ -74,6 +74,7 @@ const val DEFAULT_EVENT_TYPE_ID = "default_event_type_id" const val ALLOW_CHANGING_TIME_ZONES = "allow_changing_time_zones" const val LAST_EXPORT_PATH = "last_export_path" const val EXPORT_PAST_EVENTS = "export_past_events" +const val WEEKLY_VIEW_ITEM_HEIGHT = "weekly_view_item_height" // repeat_rule for monthly and yearly repetition const val REPEAT_SAME_DAY = 1 // i.e. 25th every month, or 3rd june (if yearly repetition)