From a524ae57ec8fce9532ed998c63a5577fce738fd5 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Tue, 5 Aug 2014 18:01:05 -0700 Subject: 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 --- .../android/dialer/widget/ActionBarControllerTest.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'tests/src/com/android') 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); } -- cgit v1.2.3