Following on from this question I further evolved the demo messages example in an attempt to create page transitions between two pages with core-lists.
I'm trying to achieve the following:
Note the pages change when the fabs are clicked.
I've had some success but can't get it to work correctly in all aspects as can be seen from my jsbin.
I suspect part of the problem relates to sizing the divs that wrap the core-lists. I can't figure out how they to size these but I believe they are important to the transition effect.
Note also that the flexible padding on the sides of the lists is also important to preserve (similar to what exists on the real inbox)
First, there's no slide-from-left
transition. You will need to remove everything related to it in your code.
I have found that the hero-transition
doesn't work well with slide-from-right
transition. A possible alternative would be, wrap those two paper-fab
s in another core-animated-pages
.
<core-animated-pages id="pages" selected="{{selected}}"
transitions="slide-from-right"
on-show-snooze="{{showSnooze}}" on-show-inbox="{{showInbox}}"
content
layout vertical flex>
<inbox-editor scrolltarget="{{$.panel.scroller}}" flex>
</inbox-editor>
<snooze-editor scrolltarget="{{$.panel.scroller}}" flex>
</snooze-editor>
</core-animated-pages>
</core-scroll-header-panel>
<core-animated-pages selected="{{selected}}" transitions="hero-transition" style="position:absolute; bottom:48px;">
<section>
<paper-fab class="fab-yellow" icon="add" hero hero-id="primary"
on-tap="{{showSnooze}}">
</paper-fab>
</section>
<section>
<paper-fab class="fab-red" icon="done" hero hero-id="primary"
on-tap="{{showInbox}}">
</paper-fab>
</section>
</core-animated-pages>
Please see this jsbin for reference. Notice that the paper-fab
s move just like they are animated with a slide
transition ('cause hero-transition
animates the shape and position between elements, in this case, the animation transition should look identical to a slide
one)! So maybe, you don't need to apply the hero-transition
at all?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With