diff options
author | Yorke Lee <yorkelee@google.com> | 2014-08-05 18:01:05 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-08-06 12:21:11 -0700 |
commit | a524ae57ec8fce9532ed998c63a5577fce738fd5 (patch) | |
tree | 5c6989580c37c2dfd45dcb19d908ab962c8a564e /tests/src/com | |
parent | 0e6d7b0458e5ed52c9e53ad0ddea0a3e6fc3d768 (diff) |
Fix some action bar logic
* Restore action bar slid state only after onCreateOptionsMenu, when it has
an effect
* ActionBarController is now the only way to make changes to the offset of
the action bar so that it can appropriately restore its state
Bug: 16710397
Change-Id: Id9e0ebe210c89df0be56b32aa3bbd959cce88621
Diffstat (limited to 'tests/src/com')
-rw-r--r-- | tests/src/com/android/dialer/widget/ActionBarControllerTest.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/src/com/android/dialer/widget/ActionBarControllerTest.java b/tests/src/com/android/dialer/widget/ActionBarControllerTest.java index c67ea35aa..cafa747f2 100644 --- a/tests/src/com/android/dialer/widget/ActionBarControllerTest.java +++ b/tests/src/com/android/dialer/widget/ActionBarControllerTest.java @@ -16,6 +16,7 @@ package com.android.dialer.widget; +import android.app.ActionBar; import android.content.Context; import android.test.InstrumentationTestCase; import android.test.suitebuilder.annotation.SmallTest; @@ -57,13 +58,8 @@ public class ActionBarControllerTest extends InstrumentationTestCase { } @Override - public int getActionBarHideOffset() { - return actionBarHideOffset; - } - - @Override - public void setActionBarHideOffset(int hideOffset) { - actionBarHideOffset = hideOffset; + public ActionBar getActionBar() { + return null; } } @@ -139,7 +135,7 @@ public class ActionBarControllerTest extends InstrumentationTestCase { assertActionBarState(false, false, false); // No search query typed in the dialpad, but action bar was not showing before - mActionBarController.slideActionBarUp(false); + mActionBarController.slideActionBar(true /* slideUp */, false /* animate */); mActivityUi.shouldShowActionBar = false; mSearchBox.setVisible(false); mActionBarController.onDialpadDown(); @@ -147,7 +143,7 @@ public class ActionBarControllerTest extends InstrumentationTestCase { // Something typed in the dialpad - so remain in search UI and slide the expanded search // box down - mActionBarController.slideActionBarUp(false); + mActionBarController.slideActionBar(true /* slideUp */, false /* animate */); mActivityUi.shouldShowActionBar = true; mActivityUi.hasSearchQuery= true; mSearchBox.setVisible(false); @@ -168,7 +164,7 @@ public class ActionBarControllerTest extends InstrumentationTestCase { mActivityUi.hasSearchQuery = true; mSearchBox.expand(true, false); mSearchBox.setVisible(true); - mActionBarController.slideActionBarUp(false); + mActionBarController.slideActionBar(true /* slideUp */, false /* animate */); mActionBarController.onDialpadUp(); assertActionBarState(true, false, true); } |