Skip to content

Commit

Permalink
feat: Support for UISettings.AnimationsEnabled on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Nov 1, 2020
1 parent bdc1420 commit d78bebf
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/Uno.UWP/UI/ViewManagement/UISettings.Android.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
namespace Windows.UI.ViewManagement
using Android.OS;
using Uno.UI;
using Settings = Android.Provider.Settings;

namespace Windows.UI.ViewManagement
{
public partial class UISettings
{
public bool AnimationsEnabled
{
get
{
//TODO
return false;
float duration, transition;
if (Build.VERSION.SdkInt >= BuildVersionCodes.JellyBeanMr1)
{

duration = Settings.Global.GetFloat(
ContextHelper.Current.ContentResolver,
Settings.Global.AnimatorDurationScale, 1);
transition = Settings.Global.GetFloat(
ContextHelper.Current.ContentResolver,
Settings.Global.TransitionAnimationScale, 1);
}
else
{
#pragma warning disable CS0618 // Type or member is obsolete
duration = Settings.System.GetFloat(
ContextHelper.Current.ContentResolver,
Settings.System.AnimatorDurationScale, 1);
transition = Settings.System.GetFloat(
ContextHelper.Current.ContentResolver,
Settings.System.TransitionAnimationScale, 1);
#pragma warning restore CS0618 // Type or member is obsolete
}
return duration != 0 && transition != 0;
}
}
}
Expand Down

0 comments on commit d78bebf

Please sign in to comment.