diff options
author | nicolasroard <nicolasroard@google.com> | 2013-08-14 10:48:21 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-08-14 10:48:21 -0700 |
commit | 4b82f6f516ae100ae7c88441f4372dda65f01179 (patch) | |
tree | d09ca97f3b5699757f03e148fa6a2929c2d3f2d5 /src/com/android/gallery3d/filtershow/category | |
parent | 5af55f4f37c3d8fd471144f1175a45e2933ca015 (diff) | |
download | android_packages_apps_Gallery2-4b82f6f516ae100ae7c88441f4372dda65f01179.tar.gz android_packages_apps_Gallery2-4b82f6f516ae100ae7c88441f4372dda65f01179.tar.bz2 android_packages_apps_Gallery2-4b82f6f516ae100ae7c88441f4372dda65f01179.zip |
Fix add button size and placement in looks
Change-Id: I5c7fd0f460de222e76228ea3da9703d4b579aeca
Diffstat (limited to 'src/com/android/gallery3d/filtershow/category')
-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) { |