diff options
author | Sai Cheemalapati <saicheems@google.com> | 2014-06-09 11:36:43 -0700 |
---|---|---|
committer | Sai Cheemalapati <saicheems@google.com> | 2014-06-09 11:36:43 -0700 |
commit | 99085ebd8abb775a550d0f9c5c559b0b10ca2e6a (patch) | |
tree | 61f4c928397668875c4a9ee5710ca01f05934882 | |
parent | 49378067cde003c0443d6837c01085ee63482889 (diff) |
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
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 12 |
1 files changed, 8 insertions, 4 deletions
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 */, |