diff options
| author | Abodunrinwa Toki <toki@google.com> | 2015-06-29 21:17:22 -0700 |
|---|---|---|
| committer | Abodunrinwa Toki <toki@google.com> | 2015-06-29 21:17:22 -0700 |
| commit | 8747f37383c41805800d208c8a4ebeeebeddf2dc (patch) | |
| tree | 8c85161d9027aa4f0219708325c4661493a39cd2 /core/java | |
| parent | b6e0013768f11e47b30cd707fd249b4609cc6ca7 (diff) | |
Fix Floating toolbar overflow width.
Also clean out unused methods.
Bug: 22186458
Change-Id: I5ef03cd7938630c0d607b6fecd540f2bd83bbb65
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/widget/FloatingToolbar.java | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java index 163b8ce746d3..a6e80345fb8a 100644 --- a/core/java/com/android/internal/widget/FloatingToolbar.java +++ b/core/java/com/android/internal/widget/FloatingToolbar.java @@ -1135,7 +1135,7 @@ public final class FloatingToolbar { private final Runnable mCloseOverflow; private MenuItem.OnMenuItemClickListener mOnMenuItemClickListener; - private int mOverflowWidth = 0; + private int mOverflowWidth; private int mSuggestedHeight; /** @@ -1146,7 +1146,6 @@ public final class FloatingToolbar { */ public FloatingToolbarOverflowPanel(Context context, Runnable closeOverflow) { mCloseOverflow = Preconditions.checkNotNull(closeOverflow); - mSuggestedHeight = getScreenHeight(context); mContentView = new LinearLayout(context); mContentView.setOrientation(LinearLayout.VERTICAL); @@ -1270,7 +1269,8 @@ public final class FloatingToolbar { mListView.setLayoutParams(params); } - private int setOverflowWidth() { + private void setOverflowWidth() { + mOverflowWidth = 0; for (int i = 0; i < mListView.getAdapter().getCount(); i++) { MenuItem menuItem = (MenuItem) mListView.getAdapter().getItem(i); Preconditions.checkNotNull(menuItem); @@ -1280,7 +1280,6 @@ public final class FloatingToolbar { mOverflowWidth = Math.max( mListViewItemWidthCalculator.getMeasuredWidth(), mOverflowWidth); } - return mOverflowWidth; } private ListView createOverflowListView() { @@ -1505,18 +1504,4 @@ public final class FloatingToolbar { return context.getResources() .getDimensionPixelSize(R.dimen.floating_toolbar_menu_button_minimum_width); } - - /** - * Returns the device's screen width. - */ - private static int getScreenWidth(Context context) { - return context.getResources().getDisplayMetrics().widthPixels; - } - - /** - * Returns the device's screen height. - */ - private static int getScreenHeight(Context context) { - return context.getResources().getDisplayMetrics().heightPixels; - } } |
