From 4cd8476ad9dab9c337706df61a0b8dc54b8ee6ac Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 12 Jun 2020 23:01:19 +0200 Subject: [PATCH] properly count the height of the week holder with day slider --- .../simplemobiletools/calendar/pro/fragments/WeekFragment.kt | 2 +- .../calendar/pro/fragments/WeekFragmentsHolder.kt | 2 +- app/src/main/res/layout/fragment_week_holder.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 cb4d9ff20..7947ae1b0 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 @@ -156,7 +156,7 @@ class WeekFragment : Fragment(), WeeklyCalendar { listener?.updateHoursTopMargin(mView.week_top_holder.height) checkScrollLimits(scrollView.scrollY) - // fix some glitches like at swiping from a fully scaled out fragment will all-day events to an empty one + // fix some glitches like at swiping from a fully scaled out fragment with all-day events to an empty one val fullFragmentHeight = (listener?.getFullFragmentHeight() ?: 0) - mView.week_top_holder.height if (scrollView.height < fullFragmentHeight) { config.weeklyViewItemHeightMultiplier = fullFragmentHeight / 24 / defaultRowHeight diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt index 5aa94a354..a0cd07745 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt @@ -257,5 +257,5 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener { (viewPager!!.adapter as? MyWeekPagerAdapter)?.updateNotVisibleScaleLevel(viewPager!!.currentItem) } - override fun getFullFragmentHeight() = weekHolder!!.week_view_holder.height + override fun getFullFragmentHeight() = weekHolder!!.week_view_holder.height - weekHolder!!.week_view_seekbar.height - weekHolder!!.week_view_days_count_divider.height } diff --git a/app/src/main/res/layout/fragment_week_holder.xml b/app/src/main/res/layout/fragment_week_holder.xml index 90728275c..d50ac983e 100644 --- a/app/src/main/res/layout/fragment_week_holder.xml +++ b/app/src/main/res/layout/fragment_week_holder.xml @@ -37,7 +37,7 @@ android:id="@+id/week_view_view_pager" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_above="@+id/week_view_seekbar" + android:layout_above="@+id/week_view_days_count_divider" android:layout_toEndOf="@+id/week_view_hours_scrollview" />