animation_duration_scale problem

Post your questions and help other users.

Moderator: Martin

Post Reply
qwertz
Posts: 25
Joined: 14 Oct 2015 07:37

animation_duration_scale problem

Post by qwertz » 16 Aug 2016 07:42

Hi Dudes,

following challenge:
I want to create a simple flow which pulls down / expands the notification drawer without lag on marshmallow.

AFAIK there is an internal API bug in Android 6 causing the slowdown of this animation. Furthermore I have read that this can be fixed by reducing the animation duration scale in developer settings from default 1x to off.

As this should only be set for notification pulldown I thought of setting this off directly before Control UI: notifications(); and afterwards back to 1x.

So flow looks like this:

set animation_duration_scale = 0.0
control ui: notifications();
set animation_duration_scale = 1.0

So far so good but animation is still slow. I think this is because if you change this value you have to switch display off and back on to take effect.

Martin, how to get around this?
If there is no possibility are there any other methods to achieve my goal?

I noticed if you double like:

control ui: notifications();
control ui: notifications();

It notification comes down fast first but then starts again slow...

Thanks for reading :-)

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: animation_duration_scale problem

Post by MURTUMA » 16 Aug 2016 14:56

I'm not sure if I experience the same bug but I too have problems opening notification tray. The Control UI: notifications() does not work on my phone at all, so I solved the problem with following action.

Action Execute Root Command: input swipe <x1> <y1> <x2> <y2> <duration in milliseconds> (I use values 0 0 0 799 200)

This simulates the usual swipe gesture which is used to open the notification tray. However, it works only on rooted phone, but I assume yous is? I noticed that about 200ms is fastest that still produces reliably working outcome. Anything faster and the bug appears and won't open the notification tray. The fastest usable time might differ between phones so I suggest starting from 50 and increasing the number by steps of 10-20ms until you're satisfied with the results.

qwertz
Posts: 25
Joined: 14 Oct 2015 07:37

Re: animation_duration_scale problem

Post by qwertz » 17 Aug 2016 10:58

Hi,
thanks for reply. This is a great idea I have not thought of yet ;)

Only one question on your solution:
Where is data for duration to be entered?

I used Execute Root Command: input swipe <x1> <y1> <x2> <y2> but as there are only 4 parameters I wonder if duration is to be added just in the same way like a somewhat hidden parameter? Or is this duration value to be added somewhere else?

Please explain.

Thanks again.

qwertz
Posts: 25
Joined: 14 Oct 2015 07:37

Re: animation_duration_scale problem

Post by qwertz » 17 Aug 2016 11:06

Nevermind I think I got it. Can be appended just like in your example.

This duration value represents the swipe speed? Like high value for swiping fast and reverse?

Thanks again

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: animation_duration_scale problem

Post by MURTUMA » 17 Aug 2016 13:31

The duration determines how long the gesture takes to complete. If you use the same coordinates for both start and end points but use for example 500ms, it would simulate a long press that lasts half a second.

qwertz
Posts: 25
Joined: 14 Oct 2015 07:37

Re: animation_duration_scale problem

Post by qwertz » 18 Aug 2016 06:35

Thanks a lot for your explanations Murtuma :)
Have a nice day all and consider this closed.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: animation_duration_scale problem

Post by MURTUMA » 18 Aug 2016 09:33

At your service. ;)

Post Reply