Bug 1320605 - The shrunk height just nee to cover the text itself. r=sebastian
MozReview-Commit-ID: BdoLEOKjvxw
--- a/mobile/android/base/java/org/mozilla/gecko/widget/FadedMultiColorTextView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/FadedMultiColorTextView.java
@@ -52,18 +52,19 @@ public class FadedMultiColorTextView ext
final int right = getWidth() - getCompoundPaddingRight();
final float left = right - fadeWidth;
updateGradientShader(needsEllipsis, right);
final float center = getHeight() / 2;
// Shrink height of gradient to prevent it overlaying parent view border.
- final float top = center - getTextSize() + 2;
- final float bottom = center + getTextSize() - 2;
+ // The shrunk size just nee to cover the text itself.
+ final float top = center - getTextSize() / 2;
+ final float bottom = center + getTextSize() / 2;
canvas.drawRect(left, top, right, bottom, fadePaint);
}
}
private void updateGradientShader(final boolean needsEllipsis, final int gradientEndRight) {
final int backgroundColor =
fadeBackgroundColorList.getColorForState(getDrawableState(), Color.RED);