Material-calendarview: Animate layout changes when switching between week view mode and month view mode

Created on 4 May 2016  路  6Comments  路  Source: prolificinteractive/material-calendarview

Hi,
This is an absolutely fabulous library! One question --is there a way to animate the mode switching from week mode to month mode, and vice versa? Right now, it just collapses and expands, and for an application I'm working on, it's too much of a jump. I would like to mimic the Google Calendar's layout animation when switching between modes.

enhancement

Most helpful comment

I want to add swipe up and down on material calendar view so that swipe down gives month view and swipe up gives week view, the library already has viewpager set for scrolling right and left. Is there any way I can add swipe up and down too? When I add swipe up and down, scrolling doesn't work.

All 6 comments

The transition does seem jarring. We'll look into it!

@ekchang Will be much appreciated!

Having looked into it, the best way to accomplish this is by setting android:animateLayoutChanges="true" on your parent layout and setting LayoutTransition#enableTransitionType(CHANGING) on the parent as well.

I played around with adding it to the library but decided against it--mainly, it may have undesirable side effects because now MCV impacts its parent (and thus any siblings who you may not want to animate will now animate their changes).

Closing--feel free to submit a PR or comment if manually setting the transition on your parent isn't sufficient. Thanks!

I couldn't get it working by setting animation on parent Layout

Couldn't either

I want to add swipe up and down on material calendar view so that swipe down gives month view and swipe up gives week view, the library already has viewpager set for scrolling right and left. Is there any way I can add swipe up and down too? When I add swipe up and down, scrolling doesn't work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

broakenmedia picture broakenmedia  路  5Comments

erylljoy24 picture erylljoy24  路  3Comments

chuks picture chuks  路  5Comments

damianflannery picture damianflannery  路  4Comments

Xirate picture Xirate  路  5Comments