forked from upstream-mirrors/quik
Fix Bubble TextView issue with Enter to separate lines
This commit is contained in:
@@ -95,29 +95,6 @@ public class QKTextView extends TextView {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
|
||||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
|
||||||
|
|
||||||
int specModeW = MeasureSpec.getMode(widthMeasureSpec);
|
|
||||||
if (specModeW != MeasureSpec.EXACTLY) {
|
|
||||||
Layout layout = getLayout();
|
|
||||||
int linesCount = layout.getLineCount();
|
|
||||||
if (linesCount > 1) {
|
|
||||||
float textRealMaxWidth = 0;
|
|
||||||
for (int n = 0; n < linesCount; ++n) {
|
|
||||||
textRealMaxWidth = Math.max(textRealMaxWidth, layout.getLineWidth(n));
|
|
||||||
}
|
|
||||||
int w = Math.round(textRealMaxWidth);
|
|
||||||
if (w < getMeasuredWidth()) {
|
|
||||||
super.onMeasure(MeasureSpec.makeMeasureSpec(w, MeasureSpec.AT_MOST),
|
|
||||||
heightMeasureSpec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnColorBackground(boolean onColorBackground) {
|
public void setOnColorBackground(boolean onColorBackground) {
|
||||||
if (onColorBackground != mOnColorBackground) {
|
if (onColorBackground != mOnColorBackground) {
|
||||||
mOnColorBackground = onColorBackground;
|
mOnColorBackground = onColorBackground;
|
||||||
|
|||||||
Reference in New Issue
Block a user