diff options
author | Sai Cheemalapati <saicheems@google.com> | 2014-06-09 20:51:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-09 20:51:56 +0000 |
commit | 60705c110c1e516ad13619e95add1124473cf7b9 (patch) | |
tree | a2fe067272637d23f66eb991b660d52d1189e003 | |
parent | aa3350fe6fc21945e52f4a1096e68e73757ad2bf (diff) | |
parent | 99085ebd8abb775a550d0f9c5c559b0b10ca2e6a (diff) |
Merge "Fix floating action button position in landscape."
-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 */, |