new#适配联想pad

This commit is contained in:
wujifei
2021-05-14 14:51:51 +08:00
parent 41cb1dfd27
commit 4ef9314aac
23 changed files with 166 additions and 58 deletions

View File

@@ -28,7 +28,7 @@ public class ArcView extends View {
//圆弧颜色
private int mArcColor;
//圆弧的画笔的宽度
private float mStrokeWith = 10;
private float mStrokeWith = dp2px(10);
//文字描述的paint
private Paint mTextPaint;
@@ -77,7 +77,7 @@ public class ArcView extends View {
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
//绘制中心文字描述
mTextPaint.setTextSize(28);
mTextPaint.setTextSize(dp2px(28));
mTextPaint.getTextBounds(mDes, 0, mDes.length(), mRect);
canvas.drawText(mDes, getWidth() / 2, getHeight() * 17 / 20 + mRect.height() / 2, mTextPaint);
}
@@ -116,7 +116,7 @@ public class ArcView extends View {
//设置文本的对齐方式
mTextPaint.setTextAlign(Paint.Align.CENTER);
//mTextPaint.setTextSize(getResources().getDimensionPixelSize(R.dimen.dp_12));
mTextPaint.setTextSize(80);
mTextPaint.setTextSize(dp2px(80));
}

View File

@@ -7,7 +7,6 @@
android:layout_height="match_parent">
<include
layout="@layout/module_ext_layout_extensions"
android:layout_width="match_parent"
@@ -28,8 +27,8 @@
<FrameLayout
android:id="@+id/fl_speed"
android:layout_width="@dimen/dp_300"
android:layout_height="@dimen/dp_300"
android:layout_width="@dimen/module_ext_speed_width"
android:layout_height="@dimen/module_ext_speed_height"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:background="@drawable/yi_biao_pan_bg_nor"
@@ -41,8 +40,8 @@
<com.mogo.module.extensions.view.ArcView
android:id="@+id/moudule_arc"
android:layout_width="@dimen/dp_200"
android:layout_height="@dimen/dp_200"
android:layout_width="@dimen/module_ext_arcView_width"
android:layout_height="@dimen/module_ext_arcView_height"
android:layout_gravity="center" />
</FrameLayout>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_ext_top_view_width_in_vr_mode">1100px</dimen>
<dimen name="module_ext_speed_width">460px</dimen>
<dimen name="module_ext_speed_height">460px</dimen>
<dimen name="module_ext_arcView_width">320px</dimen>
<dimen name="module_ext_arcView_height">320px</dimen>
</resources>

View File

@@ -98,7 +98,8 @@
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize">40px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_distance_unit_textSize_small">30px</dimen>
<dimen name="module_ext_navi_info_panel_next_info_road_textSize">34px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_marginTop">24px
</dimen>
<dimen name="module_ext_navi_info_panel__arrive_destination_estimate_info_textSize">28px</dimen>
<dimen name="module_ext_navi_info_turn_icon_margin_bottom">24px</dimen>
<dimen name="module_ext_voice_msg_padding_top">17px</dimen>
@@ -181,4 +182,10 @@
<dimen name="module_video_window_height_content">393px</dimen>
<dimen name="module_video_window_width_content">700px</dimen>
<dimen name="module_ext_speed_width">300px</dimen>
<dimen name="module_ext_speed_height">300px</dimen>
<dimen name="module_ext_arcView_width">200px</dimen>
<dimen name="module_ext_arcView_height">200px</dimen>
</resources>

View File

@@ -2,6 +2,8 @@ package com.mogo.module.main.utils;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.View;
import com.mogo.module.main.R;
@@ -44,4 +46,9 @@ public class DisplayEffectsHelper {
public void display() {
animatorSet.start();
}
private float dp2px(float dp) {
DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics();
return dp * metrics.density;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 KiB

View File

@@ -26,6 +26,7 @@ import com.zhidao.carchattingprovider.MogoDriverInfo;
import java.util.List;
import static android.text.style.TtsSpan.GENDER_MALE;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
* V2X 测试面板广播接收,目的是可以通过广播调用起来面板
@@ -166,6 +167,13 @@ public class TestPanelBroadcastReceiver extends BroadcastReceiver {
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT);
} else if (sceneType == 20) { //test visualAngle UI
V2XServiceManager.getMapService().getMapUIController().changeMapVisualAngle(VisualAngleMode.MODE_CLOSE_SIGHT);
} else if (sceneType == 21) {// 自车求助
V2XMessageEntity<Boolean> v2XMessageEntity =
TestOnLineCarUtils.getV2XScenarioCarForHelpEventData();
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent);
V2XServiceManager.getMoGoStatusManager().setSeekHelping(MODULE_NAME, true);
}
}

View File

@@ -84,7 +84,7 @@ public class V2XSeekHelpButton implements IV2XButton {
doAction();
});
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
(int) V2XUtils.getApp().getResources().getDimension(R.dimen.dp_150));
(int) V2XUtils.getApp().getResources().getDimension(R.dimen.module_v2x_car_for_help_window_height));
V2XServiceManager.getMogoTopViewManager().addView(topView, layoutParams);
}

View File

@@ -465,4 +465,25 @@ public class TestOnLineCarUtils {
}
return null;
}
/**
* 自车求助测试数据
*/
public static V2XMessageEntity<Boolean> getV2XScenarioCarForHelpEventData() {
try {
V2XMessageEntity<Boolean> v2xMessageEntity = new V2XMessageEntity<>();
// 控制类型
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP);
// 设置数据
v2xMessageEntity.setContent(true);
// 控制展示状态
v2xMessageEntity.setShowState(true);
return v2xMessageEntity;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#000000" />
<corners android:radius="@dimen/dp_20" />
<corners android:radius="20dp" />
</shape>

View File

@@ -222,14 +222,14 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_140"
android:layout_height="@dimen/module_v2x_road_event_height"
android:background="@drawable/bg_v2x_event_bg">
<com.mogo.service.imageloader.MogoImageView
android:id="@+id/iv_event"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:layout_marginLeft="@dimen/dp_30"
android:layout_width="@dimen/module_v2x_road_event_icon_width"
android:layout_height="@dimen/module_v2x_road_event_icon_height"
android:layout_marginLeft="24dp"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -252,18 +252,18 @@
android:id="@+id/tv_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/dp_480"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:maxWidth="480dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:textColor="@color/v2x_white_color"
android:textSize="@dimen/dp_32" />
android:textSize="30sp" />
<ImageView
android:id="@+id/iv_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:paddingLeft="@dimen/dp_42"
android:layout_marginTop="6dp"
android:paddingLeft="22dp"
android:src="@drawable/icon_play"
android:visibility="gone" />
</LinearLayout>
@@ -273,9 +273,9 @@
android:id="@+id/tv_line"
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_70"
android:alpha="0.3"
android:background="@color/v2x_line_color"
android:visibility="gone"
android:alpha="0.3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tv_play"
app:layout_constraintStart_toEndOf="@+id/ll_event"
@@ -285,13 +285,13 @@
<TextView
android:id="@+id/tv_play"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_140"
android:layout_height="@dimen/module_v2x_road_event_height"
android:gravity="center"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:text="播放"
android:textColor="@color/v2x_event_play_text"
android:textSize="@dimen/dp_30"
android:textSize="24sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -2,23 +2,23 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_800"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2x_fault_help_width"
android:layout_height="@dimen/module_v2x_fault_help_height"
android:layout_marginTop="@dimen/dp_8"
android:background="@drawable/bg_v2x_event_bg"
tools:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_140"
android:layout_height="@dimen/module_v2x_fault_help_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.mogo.service.imageloader.MogoImageView
android:id="@+id/ivFaultHelpHead"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2x_fault_help_height"
android:layout_height="@dimen/module_v2x_fault_help_height"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/rlRoadEventList"
app:layout_constraintStart_toStartOf="parent"
@@ -30,12 +30,12 @@
<TextView
android:id="@+id/tvImgTextContent"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_35"
android:layout_width="@dimen/module_v2x_fault_help_img_content_width"
android:layout_height="@dimen/module_v2x_fault_help_img_content_height"
android:layout_marginTop="15dp"
android:background="@drawable/bg_v2x_event_type_orange_vr"
android:gravity="center"
android:paddingTop="@dimen/dp_2"
android:paddingTop="2dp"
android:paddingBottom="@dimen/dp_5"
android:text="求助"
android:textColor="@android:color/white"
@@ -50,9 +50,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_24"
android:layout_marginTop="@dimen/dp_27"
android:layout_marginTop="@dimen/module_v2x_fault_help_name_margin_top"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_40"
android:textSize="@dimen/module_v2x_fault_help_name_text_size"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/ivFaultHelpHead"
app:layout_constraintTop_toTopOf="parent"
@@ -65,10 +65,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_27"
android:layout_marginBottom="@dimen/module_v2x_fault_help_time_margin_bottom"
android:alpha="0.59"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_24"
android:textSize="@dimen/module_v2x_fault_help_time_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/ivFaultHelpHead"
tools:text="15:30发布求助信息" />
@@ -83,7 +83,7 @@
android:layout_marginRight="@dimen/dp_42"
android:gravity="center_vertical"
android:textColor="#FFFFFF"
android:textSize="@dimen/dp_42"
android:textSize="@dimen/module_v2x_fault_help_distance_text_size"
app:layout_constraintBottom_toBottomOf="@+id/ivFaultHelpEventCall"
app:layout_constraintEnd_toStartOf="@+id/ivFaultHelpEventCall"
app:layout_constraintTop_toTopOf="@+id/ivFaultHelpEventCall"
@@ -91,8 +91,8 @@
<ImageView
android:id="@+id/ivFaultHelpEventCall"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_width="@dimen/module_v2x_fault_help_event_call_width"
android:layout_height="@dimen/module_v2x_fault_help_event_call_width"
android:layout_marginRight="@dimen/dp_40"
android:src="@drawable/v2x_event_icon_tel_vr"
android:visibility="gone"
@@ -103,9 +103,9 @@
<ImageView
android:id="@+id/ivFaultHelpEventNavi"
android:layout_width="@dimen/dp_80"
android:layout_height="@dimen/dp_80"
android:layout_marginRight="@dimen/dp_40"
android:layout_width="@dimen/module_v2x_fault_help_event_call_width"
android:layout_height="@dimen/module_v2x_fault_help_event_call_width"
android:layout_marginRight="@dimen/module_v2x_fault_help_event_navi_margin_right"
android:src="@drawable/v2x_event_icon_daohang_vr"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -5,10 +5,10 @@
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_640"
android:layout_height="@dimen/dp_140"
android:alpha="0.7"
android:layout_width="@dimen/module_v2x_car_for_help_width"
android:layout_height="@dimen/module_v2x_car_for_help_height"
android:layout_marginTop="@dimen/dp_8"
android:alpha="0.7"
android:background="@drawable/bg_v2x_event_bg"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -16,8 +16,8 @@
<ImageView
android:id="@+id/iv_event"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_100"
android:layout_width="@dimen/module_v2x_car_for_help_icon_width"
android:layout_height="@dimen/module_v2x_car_for_help_icon_height"
android:layout_marginLeft="@dimen/dp_30"
android:scaleType="fitXY"
android:src="@drawable/icon_car_for_help"
@@ -29,19 +29,19 @@
android:id="@+id/tv_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/dp_480"
android:maxWidth="@dimen/module_v2x_car_for_help_event_maxwidth"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:text="正在为您发起求助"
android:textColor="@color/v2x_white_color"
android:textSize="@dimen/dp_32"
android:textSize="@dimen/module_v2x_car_for_help_event_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_event"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="@dimen/dp_0_5"
android:layout_height="@dimen/dp_70"
android:layout_height="@dimen/dp_72"
android:alpha="0.3"
android:background="@color/v2x_line_color"
app:layout_constraintBottom_toBottomOf="parent"
@@ -50,14 +50,12 @@
<TextView
android:id="@+id/tv_cancel"
android:layout_width="@dimen/dp_140"
android:layout_height="@dimen/dp_140"
android:layout_width="@dimen/module_v2x_car_for_help_height"
android:layout_height="@dimen/module_v2x_car_for_help_height"
android:gravity="center"
android:paddingLeft="@dimen/dp_40"
android:paddingRight="@dimen/dp_40"
android:text="取消"
android:textColor="@color/v2x_car_for_help_cancel"
android:textSize="@dimen/dp_30"
android:textSize="@dimen/module_v2x_car_for_help_cancel_text_size"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/dp_822"
android:layout_height="@dimen/dp_182"
android:layout_height="@dimen/module_v2x_event_window_height_vr"
android:layout_marginTop="@dimen/dp_8">
<androidx.recyclerview.widget.RecyclerView

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_v2x_event_window_height_vr">227px</dimen>
<dimen name="module_v2x_road_event_height">187px</dimen>
<dimen name="module_v2x_road_event_icon_width">133px</dimen>
<dimen name="module_v2x_road_event_icon_height">133px</dimen>
<dimen name="module_v2x_fatigue_driving_window_height_ground">234px</dimen>
<dimen name="module_v2x_fault_help_width">1067px</dimen>
<dimen name="module_v2x_fault_help_height">187px</dimen>
<dimen name="module_v2x_fault_help_img_content_width">107px</dimen>
<dimen name="module_v2x_fault_help_img_content_height">47px</dimen>
<dimen name="module_v2x_fault_help_name_margin_top">35px</dimen>
<dimen name="module_v2x_fault_help_name_text_size">48px</dimen>
<dimen name="module_v2x_fault_help_time_margin_bottom">35px</dimen>
<dimen name="module_v2x_fault_help_time_text_size">36px</dimen>
<dimen name="module_v2x_fault_help_distance_text_size">64px</dimen>
<dimen name="module_v2x_fault_help_event_call_width">108px</dimen>
<dimen name="module_v2x_fault_help_event_navi_margin_right">53px</dimen>
<dimen name="module_v2x_car_for_help_window_height">200px</dimen>
<dimen name="module_v2x_car_for_help_width">854px</dimen>
<dimen name="module_v2x_car_for_help_height">187px</dimen>
<dimen name="module_v2x_car_for_help_icon_width">133px</dimen>
<dimen name="module_v2x_car_for_help_icon_height">133px</dimen>
<dimen name="module_v2x_car_for_help_event_maxwidth">480px</dimen>
<dimen name="module_v2x_car_for_help_event_text_size">42px</dimen>
<dimen name="module_v2x_car_for_help_cancel_text_size">40px</dimen>
</resources>

View File

@@ -128,4 +128,30 @@
<dimen name="v2x_driving_heigt">46px</dimen>
<dimen name="v2x_recommond_route_size">26px</dimen>
<dimen name="module_v2x_road_event_height">140px</dimen>
<dimen name="module_v2x_road_event_icon_width">100px</dimen>
<dimen name="module_v2x_road_event_icon_height">100px</dimen>
<dimen name="module_v2x_fault_help_width">800px</dimen>
<dimen name="module_v2x_fault_help_height">140px</dimen>
<dimen name="module_v2x_fault_help_img_content_width">80px</dimen>
<dimen name="module_v2x_fault_help_img_content_height">35px</dimen>
<dimen name="module_v2x_fault_help_name_margin_top">27px</dimen>
<dimen name="module_v2x_fault_help_name_text_size">40px</dimen>
<dimen name="module_v2x_fault_help_time_margin_bottom">27px</dimen>
<dimen name="module_v2x_fault_help_time_text_size">24px</dimen>
<dimen name="module_v2x_fault_help_distance_text_size">42px</dimen>
<dimen name="module_v2x_fault_help_event_call_width">80px</dimen>
<dimen name="module_v2x_fault_help_event_navi_margin_right">40px</dimen>
<dimen name="module_v2x_car_for_help_window_height">150px</dimen>
<dimen name="module_v2x_car_for_help_width">640px</dimen>
<dimen name="module_v2x_car_for_help_height">140px</dimen>
<dimen name="module_v2x_car_for_help_icon_width">100px</dimen>
<dimen name="module_v2x_car_for_help_icon_height">100px</dimen>
<dimen name="module_v2x_car_for_help_event_maxwidth">480px</dimen>
<dimen name="module_v2x_car_for_help_event_text_size">32px</dimen>
<dimen name="module_v2x_car_for_help_cancel_text_size">30px</dimen>
</resources>