diff options
author | Romain Guy <romainguy@android.com> | 2009-05-14 15:44:42 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-05-14 15:44:42 -0700 |
commit | 809a7f6080312f3e12f1a3a30eacf0e0c7627305 (patch) | |
tree | 8ddb55675d2ce2aa6ad03b2ead4d3dae5446571c /core/java/com | |
parent | d4103d0d143f3774a2fc9e35afb0fffc2160d7fc (diff) | |
download | frameworks_base-809a7f6080312f3e12f1a3a30eacf0e0c7627305.zip frameworks_base-809a7f6080312f3e12f1a3a30eacf0e0c7627305.tar.gz frameworks_base-809a7f6080312f3e12f1a3a30eacf0e0c7627305.tar.bz2 |
New feature to track down #1846038. Adds the ability to export flags encoded in int values so as to make them human readable in HierarchyViewer.
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/view/menu/IconMenuView.java | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/core/java/com/android/internal/view/menu/IconMenuView.java b/core/java/com/android/internal/view/menu/IconMenuView.java index 6034a1e..b81c2b3 100644 --- a/core/java/com/android/internal/view/menu/IconMenuView.java +++ b/core/java/com/android/internal/view/menu/IconMenuView.java @@ -498,19 +498,23 @@ public final class IconMenuView extends ViewGroup implements ItemInvoker, MenuVi @Override protected void onDraw(Canvas canvas) { - if (mHorizontalDivider != null) { + Drawable drawable = mHorizontalDivider; + if (drawable != null) { // If we have a horizontal divider to draw, draw it at the remembered positions - for (int i = mHorizontalDividerRects.size() - 1; i >= 0; i--) { - mHorizontalDivider.setBounds(mHorizontalDividerRects.get(i)); - mHorizontalDivider.draw(canvas); + final ArrayList<Rect> rects = mHorizontalDividerRects; + for (int i = rects.size() - 1; i >= 0; i--) { + drawable.setBounds(rects.get(i)); + drawable.draw(canvas); } } - - if (mVerticalDivider != null) { + + drawable = mVerticalDivider; + if (drawable != null) { // If we have a vertical divider to draw, draw it at the remembered positions - for (int i = mVerticalDividerRects.size() - 1; i >= 0; i--) { - mVerticalDivider.setBounds(mVerticalDividerRects.get(i)); - mVerticalDivider.draw(canvas); + final ArrayList<Rect> rects = mVerticalDividerRects; + for (int i = rects.size() - 1; i >= 0; i--) { + drawable.setBounds(rects.get(i)); + drawable.draw(canvas); } } } @@ -520,14 +524,12 @@ public final class IconMenuView extends ViewGroup implements ItemInvoker, MenuVi } @Override - public LayoutParams generateLayoutParams(AttributeSet attrs) - { + public LayoutParams generateLayoutParams(AttributeSet attrs) { return new IconMenuView.LayoutParams(getContext(), attrs); } @Override - protected boolean checkLayoutParams(ViewGroup.LayoutParams p) - { + protected boolean checkLayoutParams(ViewGroup.LayoutParams p) { // Override to allow type-checking of LayoutParams. return p instanceof IconMenuView.LayoutParams; } |