Replies: 3 comments
-
I've transferred this to Discussions, as some of what you bring up could be bugs, and some could be feature requests. For the issues you've brought up, if you feel the defaults are not correct (As with issue 3) or bugs (issue 4), I would file them as their own bugs with reproduction projects showing the issue. If you want to also fix them you can then link them to your own PR and that would make it easier to verify that they are fixed. For your first two points, you're welcome to open a PR for them. IMO I would look into the CommunityToolkit first for those, as it may be a better fit as a generic helper there rather than in the framework proper. |
Beta Was this translation helpful? Give feedback.
-
PR #15906 for issues 1 and 2 |
Beta Was this translation helpful? Give feedback.
-
About issue 3: The problem is not that the default is not correct, is that you can give more flexibility showing a feature already supported in Animation. What I am proposing is something like this: public static Task TranslateTo(this VisualElement view, double x, double y, uint length = 250, Easing? easing = null, uint rate = 16) for all animation methods. It also brings consistency between Animation and these extension methods. The rate is the only one that is missing and I am not sure why. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All.
We have been developing a simple game using MAUI and have developed some improvements that may be useful to the large community. We can produce PR with any combination of the following features:
1- Add 'TranslateXTo' and 'TranslateYTo' methods similar to 'ScaleXTo' and 'ScaleYTo'. This is very simple and should theoretically be more performant than the 'TranslateTo' method.
2- Detect in 'TranslateTo' when the movement is in only one dimension and then use the new 'TranslateXTo' / 'TranslateYTo' for better performance.
3- Add a 'uint rate=16' additional parameter to all animation methods instead of using a hardcoded number (now 16). 16 is too high a framerate for a lot of mobile devices.
4- [Android] Hack for bug await doesn't return when the animations are disabled on the OS. This is a hack and we aren't sure this (ViewExtensions ) is the right place to fix it, but we do something like:
if (IsAnimationsEnabled)// Checked on Android as 0 != Android.Provider.Settings.Global.GetFloat(Platform.CurrentActivity?.ContentResolver, Android.Provider.Settings.Global.AnimatorDurationScale, 1)
new Animation(UpdateProperty, start, end, easing).Commit(view, name, rate, length, finished: (_, wasCanceled) => tcs.SetResult(wasCanceled));
else// Animations disabled
Task.Run(async () =>
{
UpdateProperty(end);
await Task.Delay((int)length);
tcs.SetResult(true);
});
Beta Was this translation helpful? Give feedback.
All reactions