The goal of this v0.7.0 release is to redesign JZCalendarWeekView scroll pagination effect.
This issue is actually caused by using setContentOffset
method to do pagination effect. The scenario is when users swiped view(willEndDragging
called) then they swipe again or touch screen. The result might be
- Flickering view issue #40 #46 #51
- view stopped at the touch position(wrong position). For further touch screen description, you can refer to this StackOverflow question which is asked and answered by myself.
In order to redesign the pagination effect, I have to change setContentOffset
method to settargetContentOffset
and the property initialContentOffset
set in willBeginDragging
should be deleted because it shouldn't be considered. I don't care where it started, I only care where it should scroll to with the current state. Also, scrollSections
for sectionScroll
type has been deleted too.
In order to achieve this goal, some methods are refactored and fixed as well.
-
3f976fb
getDateForX
,getDateForY
andgetDateForPoint
are quite confused and misused in the past because the calculation method for gesture point x inUICollectionView
is different fromUICollectionView
contentOffset
x. As a result, those methods are refactored to 6 different methods, which are
getDateForContentOffsetX
,getDateForContentOffsetY
,getDateForContentOffset
(ForcontentOffset
)
getDateForPointX
,getDateForPointY
,getDateForPoint
(For gesture point) -
f027db9
ScrollDirection
has been redesigned, the previous solution is actually implemented by WRCalendarView, which cannot get actual direction sometimes and it highly depends on the propertyinitialContentOffset
which we want to delete.
Unfortunately, two small issues are also introduced in this new pagination effect.
-
Even though I set the
deceleratingRate
tofast
, the last few milliseconds of scrolling animation are still very slow, which is not as fast assetContentOffset
. -
Because of the first issue, it will take more time to scroll to the required
targetContentOffset
, if you scroll again at the same time, it won't work. It means you cannot scroll very fast to the third page only if the last animation finished and view reloaded.
If you have any good suggestions for the deceleratingRate
issue, let me know.
One more issue fixed out of this goal is
af9fc0a Fixed cell rendering issue #54 by replacing overlap calculation method