This commit is contained in:
zhongchao
2021-04-13 19:59:40 +08:00
7 changed files with 16 additions and 17 deletions

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);

View File

@@ -199,18 +199,18 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
if (mV2XPushMessageEntity.getDistance() > 1000) {
SpanUtils.with(tvDistance)
.append("" + (int) mV2XPushMessageEntity.getDistance() / 1000)
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.dp_42 : R.dimen.module_v2x_event_distance_text))
.append("公里")
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.dp_42 : R.dimen.module_v2x_event_distance_title))
.create();
} else {
SpanUtils.with(tvDistance)
.append("" + (int) mV2XPushMessageEntity.getDistance())
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
.setFontSize((int) itemView.getResources().getDimension(V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.dimen.dp_42 : R.dimen.module_v2x_event_distance_text))
.append("")
.setFontSize((int) itemView.getResources().getDimension(
V2XServiceManager.getMoGoStatusManager().isVrMode() ?
R.dimen.module_v2x_event_distance_title_vr : R.dimen.module_v2x_event_distance_title))
R.dimen.dp_42 : R.dimen.module_v2x_event_distance_title))
.create();
}
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#88000000" />
<solid android:color="#dd000000" />
<corners android:radius="@dimen/dp_20" />
</shape>

View File

@@ -2,8 +2,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#C57406"
android:startColor="#FCB932" />
android:endColor="#FFBF29"
android:startColor="#FFBF29" />
<corners android:bottomLeftRadius="@dimen/dp_20" android:topRightRadius="@dimen/dp_20"/>
</shape>

View File

@@ -35,13 +35,11 @@
android:layout_marginTop="15dp"
android:background="@drawable/bg_v2x_event_type_orange_vr"
android:gravity="center"
android:paddingTop="@dimen/dp_2"
android:paddingBottom="@dimen/dp_5"
android:text="求助"
android:textColor="@android:color/white"
android:textSize="@dimen/module_v2x_event_type_title_text_size"
android:textSize="@dimen/sp_20"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/ivFaultHelpHead"
@@ -81,12 +79,11 @@
android:id="@+id/tvFaultHelpDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_40"
android:layout_marginRight="@dimen/dp_40"
android:layout_marginEnd="@dimen/dp_42"
android:layout_marginRight="@dimen/dp_42"
android:gravity="center_vertical"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_42"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/ivFaultHelpEventCall"
app:layout_constraintEnd_toStartOf="@+id/ivFaultHelpEventCall"
app:layout_constraintTop_toTopOf="@+id/ivFaultHelpEventCall"
@@ -97,7 +94,7 @@
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/selector_talk_btn"
android:src="@drawable/v2x_event_icon_tel_vr"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/ivFaultHelpEventNavi"
@@ -109,8 +106,7 @@
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/selector_nav_btn"
android:visibility="gone"
android:src="@drawable/v2x_event_icon_daohang_vr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"