File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ #-*- coding:UTF-8 -*-
2+ import sys
3+ import os
4+ import subprocess
5+
6+ adb_path = os .getenv ('adb_path' )
7+ serial = os .getenv ('serial' )
8+
9+ get_window_animation_scale_cmd = "{0} -s {1} shell settings get global window_animation_scale" .format (adb_path , serial )
10+ get_transition_animation_scale_cmd = "{0} -s {1} shell settings get global transition_animation_scale" .format (adb_path , serial )
11+ get_animator_duration_scale_cmd = "{0} -s {1} shell settings get global animator_duration_scale" .format (adb_path , serial )
12+
13+ get_cmds = [get_window_animation_scale_cmd , get_transition_animation_scale_cmd , get_animator_duration_scale_cmd ]
14+
15+ for cmd in get_cmds :
16+ result = subprocess .check_output (cmd ,
17+ stderr = subprocess .STDOUT ,
18+ shell = True ).strip ()
19+ mode = "0.0"
20+ if result == "0.0" :
21+ mode = "1.0"
22+
23+ put_window_animation_scale_cmd = "{0} -s {1} shell settings put global window_animation_scale {2}" .format (adb_path , serial , mode )
24+ put_transition_animation_scale_cmd = "{0} -s {1} shell settings put global transition_animation_scale {2}" .format (adb_path , serial , mode )
25+ put_animator_duration_scale_cmd = "{0} -s {1} shell settings put global animator_duration_scale {2}" .format (adb_path , serial , mode )
26+
27+ put_cmds = [put_window_animation_scale_cmd , put_transition_animation_scale_cmd , put_animator_duration_scale_cmd ]
28+
29+ for cmd in put_cmds :
30+ sys .stderr .write (cmd )
31+ result = subprocess .check_output (cmd ,
32+ stderr = subprocess .STDOUT ,
33+ shell = True ).strip ()
34+
35+ print (result )
You can’t perform that action at this time.
0 commit comments