fix#【#521】 【必现】鹰眼模式下,收到故障求助,无导航按钮

This commit is contained in:
wujifei
2021-04-13 19:33:42 +08:00
parent 52bba1a378
commit bcbf035e5e

View File

@@ -8,6 +8,7 @@ import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.View;
@@ -69,10 +70,12 @@ public class ArcView extends View {
private void drawText(Canvas canvas) {
Rect mRect = new Rect();
String mValue = String.valueOf(currentValue);
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
//绘制中心的数值
mTextPaint.getTextBounds(mValue, 0, mValue.length(), mRect);
canvas.drawText(mValue, getWidth() / 2, getHeight() / 2 + mRect.height() / 2, mTextPaint);
canvas.drawText(mValue, getWidth() / 2, getHeight() / 2 + mRect.height() / 2-10, mTextPaint);
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
//绘制中心文字描述
mTextPaint.setTextSize(28);
mTextPaint.getTextBounds(mDes, 0, mDes.length(), mRect);