properly count the height of the week holder with day slider

This commit is contained in:
tibbi
2020-06-12 23:01:19 +02:00
parent 3c7962004d
commit 4cd8476ad9
3 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
listener?.updateHoursTopMargin(mView.week_top_holder.height) listener?.updateHoursTopMargin(mView.week_top_holder.height)
checkScrollLimits(scrollView.scrollY) 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 val fullFragmentHeight = (listener?.getFullFragmentHeight() ?: 0) - mView.week_top_holder.height
if (scrollView.height < fullFragmentHeight) { if (scrollView.height < fullFragmentHeight) {
config.weeklyViewItemHeightMultiplier = fullFragmentHeight / 24 / defaultRowHeight config.weeklyViewItemHeightMultiplier = fullFragmentHeight / 24 / defaultRowHeight

View File

@ -257,5 +257,5 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
(viewPager!!.adapter as? MyWeekPagerAdapter)?.updateNotVisibleScaleLevel(viewPager!!.currentItem) (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
} }

View File

@ -37,7 +37,7 @@
android:id="@+id/week_view_view_pager" android:id="@+id/week_view_view_pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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" /> android:layout_toEndOf="@+id/week_view_hours_scrollview" />
<include <include