diff options
| author | nicolasroard <nicolasroard@google.com> | 2013-08-14 17:49:21 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-08-14 17:49:22 +0000 |
| commit | 1603c9657a6355ce2c720463483c3a744c27005e (patch) | |
| tree | 5d1c313fe48de7a2b3606b701e03d5c80af5d732 | |
| parent | cd29fd9e74482c51d7db109e5b1d0cf60f7fe3b5 (diff) | |
| parent | 4b82f6f516ae100ae7c88441f4372dda65f01179 (diff) | |
| download | android_packages_apps_Gallery2-1603c9657a6355ce2c720463483c3a744c27005e.tar.gz android_packages_apps_Gallery2-1603c9657a6355ce2c720463483c3a744c27005e.tar.bz2 android_packages_apps_Gallery2-1603c9657a6355ce2c720463483c3a744c27005e.zip | |
Merge "Fix add button size and placement in looks" into gb-ub-photos-carlsbad
| -rw-r--r-- | src/com/android/gallery3d/filtershow/category/CategoryAdapter.java | 13 | ||||
| -rw-r--r-- | src/com/android/gallery3d/filtershow/category/CategoryView.java | 9 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java b/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java index 54aca54c5..51ae07fc2 100644 --- a/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java +++ b/src/com/android/gallery3d/filtershow/category/CategoryAdapter.java @@ -88,11 +88,20 @@ public class CategoryAdapter extends ArrayAdapter<Action> { Action action = getItem(position); view.setAction(action, this); int width = mItemWidth; + int height = mItemHeight; if (action.getType() == Action.SPACER) { - width = width / 2; + if (mOrientation == CategoryView.HORIZONTAL) { + width = width / 2; + } else { + height = height / 2; + } + } + if (action.getType() == Action.ADD_ACTION + && mOrientation == CategoryView.VERTICAL) { + height = height / 2; } view.setLayoutParams( - new ListView.LayoutParams(width, mItemHeight)); + new ListView.LayoutParams(width, height)); view.setTag(position); view.invalidate(); return view; diff --git a/src/com/android/gallery3d/filtershow/category/CategoryView.java b/src/com/android/gallery3d/filtershow/category/CategoryView.java index 18079f5a5..7e7fc1751 100644 --- a/src/com/android/gallery3d/filtershow/category/CategoryView.java +++ b/src/com/android/gallery3d/filtershow/category/CategoryView.java @@ -73,6 +73,9 @@ public class CategoryView extends IconView if (mAction.getType() == Action.CROP_VIEW) { return true; } + if (mAction.getType() == Action.ADD_ACTION) { + return true; + } return false; } @@ -84,7 +87,11 @@ public class CategoryView extends IconView mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setColor(mSpacerColor); - canvas.drawCircle(getWidth() / 2, getHeight() / 2, getWidth() / 5, mPaint); + if (getOrientation() == CategoryView.VERTICAL) { + canvas.drawCircle(getWidth() / 2, getHeight() / 2, getHeight() / 5, mPaint); + } else { + canvas.drawCircle(getWidth() / 2, getHeight() / 2, getWidth() / 5, mPaint); + } } public void onDraw(Canvas canvas) { |
