diff options
author | Filip Gruszczynski <gruszczy@google.com> | 2016-02-03 16:52:59 -0800 |
---|---|---|
committer | Filip Gruszczynski <gruszczy@google.com> | 2016-02-04 09:01:05 -0800 |
commit | c17d8b79afd02133b021d89b536c812578308329 (patch) | |
tree | 42a6752998fda312170eb6717c653595e60b0777 /cmds/am | |
parent | 3bc8dd8eddc103a32a66a9cf3aa411f1f0615f2d (diff) |
Infrastructure for animating of maximizing pip activity.
Bug: 25672053
Change-Id: Ie8a83c626680e01ff7115f40731ab9e6c13769c0
Diffstat (limited to 'cmds/am')
-rw-r--r-- | cmds/am/src/com/android/commands/am/Am.java | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index 9d81c438360f..a74a1ca7cbe6 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -1774,18 +1774,33 @@ public class Am extends BaseCommand { System.err.println("Error: invalid input bounds"); return; } - resizeStack(stackId, bounds, 0, false); + resizeStack(stackId, bounds, 0); } private void runStackResizeAnimated() throws Exception { String stackIdStr = nextArgRequired(); int stackId = Integer.valueOf(stackIdStr); - final Rect bounds = getBounds(); - if (bounds == null) { - System.err.println("Error: invalid input bounds"); - return; + final Rect bounds; + if ("null".equals(mArgs.peekNextArg())) { + bounds = null; + } else { + bounds = getBounds(); + if (bounds == null) { + System.err.println("Error: invalid input bounds"); + return; + } + } + resizeStackUnchecked(stackId, bounds, 0, true); + } + + private void resizeStackUnchecked(int stackId, Rect bounds, int delayMs, boolean animate) { + try { + mAm.resizeStack(stackId, bounds, false, false, animate); + Thread.sleep(delayMs); + } catch (RemoteException e) { + showError("Error: resizing stack " + e); + } catch (InterruptedException e) { } - resizeStack(stackId, bounds, 0, true); } private void runStackResizeDocked() throws Exception { @@ -1802,20 +1817,13 @@ public class Am extends BaseCommand { } } - private void resizeStack(int stackId, Rect bounds, int delayMs, boolean animate) + private void resizeStack(int stackId, Rect bounds, int delayMs) throws Exception { if (bounds == null) { showError("Error: invalid input bounds"); return; } - - try { - mAm.resizeStack(stackId, bounds, false, false, animate); - Thread.sleep(delayMs); - } catch (RemoteException e) { - showError("Error: resizing stack " + e); - } catch (InterruptedException e) { - } + resizeStackUnchecked(stackId, bounds, delayMs, false); } private void runStackPositionTask() throws Exception { @@ -1924,7 +1932,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - minPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); - resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); + resizeStack(DOCKED_STACK_ID, bounds, delayMs); } System.out.println("Growing docked stack side=" + side); @@ -1932,7 +1940,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, maxPoint - currentPoint); currentPoint += maxChange; setBoundsSide(bounds, side, currentPoint); - resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); + resizeStack(DOCKED_STACK_ID, bounds, delayMs); } System.out.println("Back to Original size side=" + side); @@ -1940,7 +1948,7 @@ public class Am extends BaseCommand { maxChange = Math.min(stepSize, currentPoint - startPoint); currentPoint -= maxChange; setBoundsSide(bounds, side, currentPoint); - resizeStack(DOCKED_STACK_ID, bounds, delayMs, false); + resizeStack(DOCKED_STACK_ID, bounds, delayMs); } } |