diff options
| author | yongga <yongga@codeaurora.org> | 2016-01-14 14:12:35 +0800 |
|---|---|---|
| committer | yongga <yongga@codeaurora.org> | 2016-01-14 14:12:35 +0800 |
| commit | 7b5ff03ffafff8bc40ddadcc83864d6039b96836 (patch) | |
| tree | 77920b245bce6a3c67a1c9fc11aa350b403f488b /src/com/android | |
| parent | 0e1d913b28c9cf36ae94f09cacc80b9e6be6f155 (diff) | |
| download | android_packages_apps_Gallery2-7b5ff03ffafff8bc40ddadcc83864d6039b96836.tar.gz android_packages_apps_Gallery2-7b5ff03ffafff8bc40ddadcc83864d6039b96836.tar.bz2 android_packages_apps_Gallery2-7b5ff03ffafff8bc40ddadcc83864d6039b96836.zip | |
Gallery2: fix edit panel's label is overlaped in edit page.
Edit panel's label is overlaped in edit page.
Move the label to the bottom.
Change-Id: I8860d6fd9dc86a53135d85b15c5d13de7bf60cb7
CRs-Fixed: 959499
Diffstat (limited to 'src/com/android')
| -rw-r--r-- | src/com/android/gallery3d/filtershow/category/IconView.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/category/IconView.java b/src/com/android/gallery3d/filtershow/category/IconView.java index 089203acf..4823cd1a6 100644 --- a/src/com/android/gallery3d/filtershow/category/IconView.java +++ b/src/com/android/gallery3d/filtershow/category/IconView.java @@ -108,10 +108,16 @@ public class IconView extends View { // justify to the left. x = mMargin; } - int y = canvas.getHeight() / 2 ;//- 2*mMargin; + int y = canvas.getHeight() - getTextHeight(mPaint) / 2 - mMargin; canvas.drawText(text, x, y, mPaint); } + private int getTextHeight(Paint paint){ + paint.setTextSize(mTextSize); + Paint.FontMetrics fontMetrics = paint.getFontMetrics(); + return (int)(Math.ceil(fontMetrics.descent - fontMetrics.ascent) + 2); + } + protected void drawOutlinedText(Canvas canvas, String text) { mPaint.setColor(getBackgroundColor()); mPaint.setStyle(Paint.Style.STROKE); |
