From 2df205218c1f42720de5ec20959fe41b6c0511fb Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 14 Nov 2022 11:44:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AD=89=E7=BA=A7=E5=92=8C?= =?UTF-8?q?=E7=B2=89=E4=B8=9D=E5=9B=A2=E7=9A=84=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 4 ++-- .../main/java/com/yunbao/live/utils/LiveTextRender.java | 8 +++++++- live/src/main/res/layout/live_medal_icon.xml | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config.gradle b/config.gradle index 8affa5db3..74c89ff01 100644 --- a/config.gradle +++ b/config.gradle @@ -10,9 +10,9 @@ ext { manifestPlaceholders = [ //正式 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", //測試 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java index 6d3dca23f..d80f52705 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java @@ -525,8 +525,14 @@ public class LiveTextRender { mPaint.setColor(Color.WHITE); mPaint.setTextSize(50); mPaint.setTypeface(font); + int indexX = 80; //水印的位置坐标 - mCanvas.drawText(level, 80, 53, mPaint); + if (level.length() > 2) { + indexX = 75; + } else { + indexX = 84; + } + mCanvas.drawText(level, indexX, 53, mPaint); mCanvas.save(); mCanvas.restore(); return mNewBitmap; diff --git a/live/src/main/res/layout/live_medal_icon.xml b/live/src/main/res/layout/live_medal_icon.xml index 6c6433a46..d54c23f82 100644 --- a/live/src/main/res/layout/live_medal_icon.xml +++ b/live/src/main/res/layout/live_medal_icon.xml @@ -15,10 +15,11 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:paddingLeft="15dp" + android:layout_marginTop="1dp" android:text="主播" android:layout_marginBottom="1dp" android:textColor="@color/white" - android:textSize="10sp" /> + android:textSize="8sp" /> \ No newline at end of file