From 64d674bb389d89f9d94c75f2b7cab705961d5c2d Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Wed, 4 Jun 2014 09:37:21 -0700 Subject: Fix SearchFragment translation after orientation change. Small edit to Andrew's CL 477577 - fixes the translation of the ListView after switching to landscape when the Dialpad is open and the ActionBar is up. Change-Id: I8ef00e65aa37a15d5ce5c987de18311fe5320e46 --- src/com/android/dialer/list/SearchFragment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java index 6abfcaa79..d9dc735d7 100644 --- a/src/com/android/dialer/list/SearchFragment.java +++ b/src/com/android/dialer/list/SearchFragment.java @@ -172,9 +172,12 @@ public class SearchFragment extends PhoneNumberPickerFragment { // Use negative shadow height instead of 0 to account for the 9-patch's shadow. int startTranslationValue = mActivity.isDialpadShown() ? mActionBarHeight - mShadowHeight: -mShadowHeight; - int endTranslationValue = - mActivity.isDialpadShown() ? -mShadowHeight : mActionBarHeight -mShadowHeight; - + int endTranslationValue = 0; + // Prevents ListView from being translated down after a rotation when the ActionBar is up. + if (animate || mActivity.isActionBarShowing()) { + endTranslationValue = + mActivity.isDialpadShown() ? 0 : mActionBarHeight -mShadowHeight; + } if (animate) { Interpolator interpolator = mActivity.isDialpadShown() ? AnimUtils.EASE_IN : AnimUtils.EASE_OUT ; -- cgit v1.2.3