From 99085ebd8abb775a550d0f9c5c559b0b10ca2e6a Mon Sep 17 00:00:00 2001 From: Sai Cheemalapati Date: Mon, 9 Jun 2014 11:36:43 -0700 Subject: Fix floating action button position in landscape. Floating action button should always be fixed to the right side of the screen in landscape orientation. Bug: 15386162 Change-Id: Ic14fa184ffdf4ad7b817930217ea3d3fca901949 --- src/com/android/dialer/DialtactsActivity.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 53e438d6d..db9bb2ade 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -1128,7 +1128,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O // Only scroll the button when the first tab is selected. The button should scroll from // the middle to right position only on the transition from the first tab to the second // tab. - if (position == ListsFragment.TAB_INDEX_SPEED_DIAL) { + if (position == ListsFragment.TAB_INDEX_SPEED_DIAL && !mIsLandscape) { mFloatingActionButtonController.onPageScrolled(positionOffset); } } @@ -1187,9 +1187,13 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O align = mIsLandscape ? FloatingActionButtonController.ALIGN_QUARTER_RIGHT : FloatingActionButtonController.ALIGN_MIDDLE; } else { - align = mCurrentTabPosition == ListsFragment.TAB_INDEX_SPEED_DIAL - ? FloatingActionButtonController.ALIGN_MIDDLE - : FloatingActionButtonController.ALIGN_RIGHT; + if (!mIsLandscape) { + align = mCurrentTabPosition == ListsFragment.TAB_INDEX_SPEED_DIAL + ? FloatingActionButtonController.ALIGN_MIDDLE + : FloatingActionButtonController.ALIGN_RIGHT; + } else { + align = FloatingActionButtonController.ALIGN_RIGHT; + } } mFloatingActionButtonController.align(align, 0 /* offsetX */, -- cgit v1.2.3