Rg.Plugins.Popup
Rg.Plugins.Popup copied to clipboard
[UWP] Slide-in MoveAnimation does not work on UWP
🐛 Bug Report
We use the following code for popup animation
<pages:PopupPage.Animation>
<animations:MoveAnimation PositionIn="Bottom"
PositionOut="Bottom"
DurationIn="300"
DurationOut="300"
EasingIn="SinOut"
EasingOut="SinIn"/>
</pages:PopupPage.Animation>
The slide-in and slide-out animations work on Android, but on UWP, the slide-in animation does not work, the popup just appears. The slide-out animation works. Even if we use e.g. DurationIn="2000", it is the same (the background needs more time to become dark, but there is no animation).
Version: 2.0.0.7
hey @apines-gms-online-de I'm sorry for being late on this.
Could you try and flip the easing in/easing out and see what happens? and just in general mess with the configuration of this move animation? This is quite an unusual bug, so just wondering if there is a deeper layer going on
I confirm, same problem. I tried to flip easing in/out, without success. Related to #410?
@YZahringer good find, and thank you for the follow up.
since this one is simple to recreate, I'll try to do so when I am on my windows computer
Seems like https://github.com/rotorgames/Rg.Plugins.Popup/blob/6a706ee4f10ff17097e83e29bd0b81878313cd15/Rg.Plugins.Popup/Animations/Base/BaseAnimation.cs#L40
doesn't return the correct values on UWP, when Appearing gets called. Both content.Width and page.Width will return -1.
@pledi thanks for this, im trying to get around to the UWP issues, interesting that this would get it wrong, i wonder if it might help another issue im having
not works on my macOS and UWP projects too
I wrote a simple workaround, first I used the original MoveAnimation as my new custom animation and override the GetLeftOffset method:
protected override int GetLeftOffset(View content, Page page)
{
return (int)(content.WidthRequest + page.WidthRequest) / 2;
}
The only thing left is setting the WidthRequest Property of the PopupPage Page and Content in XAML.
I've got a small workaround for this issue add these in your UWP project's App.xaml
<Style TargetType="rg:PopupPageRenderer">
<Setter Property="ChildrenTransitions">
<Setter.Value>
<TransitionCollection>
<EdgeUIThemeTransition Edge="Bottom" />
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
I've got a small workaround for this issue add these in your UWP project's App.xaml
<Style TargetType="rg:PopupPageRenderer"> <Setter Property="ChildrenTransitions"> <Setter.Value> <TransitionCollection> <EdgeUIThemeTransition Edge="Bottom" /> </TransitionCollection> </Setter.Value> </Setter> </Style>
Thanks!