Closed AndreiMisiukevich closed 6 years ago
One important note is animations will generally be disabled during battery saver mode, which is were I first came across this.
Should this also scale animations appropriately if AnimatorDurationScale
is not 0
or 1
? I don't know if there are any circumstances that can cause that besides changing it in the device developer options.
Also, the random snippet I found suggests the code you have works only on API 17 (JellyBeanMr1
, 4.2) or above, and lower versions should use Settings.System
instead of Settings.Global
:
var resolver = Application.Context.ContentResolver;
var scale = Settings.System.AnimatorDurationScale;
return Settings.System.GetFloat(resolver, scale, 1) > 0;
@AndreiMisiukevich just making sure I'm understanding. If we have the following animation
var animation = new Animation (v =>
{
System.Diagnostics.Debug.WriteLine($"Animation happening:{v}");
thing.Scale = v;
}, 1, 20);
animation.Commit(page, "SimpleAnimation", 16, 10000, Easing.Linear, (v, c) =>
{
System.Diagnostics.Debug.WriteLine($"Animation Completed");
thing.Scale = 1;
}, () => false);
Right now it'll output
Animation happening:1
Animation happening:20
Animation happening:Animation Completed
Are you saying it should just be
Animation happening:20
Animation happening:Animation Completed
Hi there
If user disabled animations on his device, Animation.Commit would do nothing. So, committing animation doesn't affect view's at all. In my opinion, it would be better handle it next way:
if animations are disabled, we call handler on last step at once.
I fixed such issue for my plugin by adding
I skipped some properties (Repeat and finished (Action), because i have no need in them, but i think it will be possible to add them as well as existing ones)
More info: there https://github.com/AndreiMisiukevich/CardView/issues/93