测试代码修改
字段名称修改 UI
This commit is contained in:
@@ -89,7 +89,7 @@ public class NoticeBannerView extends ConstraintLayout {
|
||||
noticeBannerCheck.setOnClickListener(v -> {
|
||||
mNoticeTrafficDialog = new NoticeTrafficDialog(mContext, mPushData);
|
||||
mNoticeTrafficDialog.show();
|
||||
WarningFloat.dismiss(WaringConst.MODULE_NAME);
|
||||
// WarningFloat.dismiss(WaringConst.MODULE_NAME);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
private TextView connect;//连接
|
||||
private NoticeTrafficAdapter adapter;
|
||||
private ArrayList dataArrayList = new ArrayList();
|
||||
private NoticeTrafficStyleInfo.NoticeTrafficStyleInfoResult mTrafficStyleInfo;
|
||||
private NoticeTrafficStyleInfo.NoticeTrafficAccountInfo mTrafficStyleInfo;
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) {
|
||||
super(context);
|
||||
@@ -368,19 +368,19 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
@Override
|
||||
public void callBackWithResult(NoticeTrafficStyleInfo trafficInfo) {
|
||||
Log.d(TAG, "交通事故详情::" + trafficInfo);
|
||||
mTrafficStyleInfo = trafficInfo.getResult();
|
||||
mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo();
|
||||
infoRefresh(mTrafficStyleInfo);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void infoRefresh(NoticeTrafficStyleInfo.NoticeTrafficStyleInfoResult info) {
|
||||
private void infoRefresh(NoticeTrafficStyleInfo.NoticeTrafficAccountInfo info) {
|
||||
if (dataArrayList.size() > 0) {
|
||||
dataArrayList.clear();
|
||||
}
|
||||
NoticeValue laiYuan = new NoticeValue();
|
||||
laiYuan.setKey("事故来源:");
|
||||
laiYuan.setValue("--");
|
||||
laiYuan.setValue(info.getUploadType());
|
||||
dataArrayList.add(laiYuan);
|
||||
|
||||
NoticeValue zeRen = new NoticeValue();
|
||||
@@ -410,7 +410,11 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
|
||||
NoticeValue status = new NoticeValue();
|
||||
status.setKey("处理状态:");
|
||||
status.setValue(info.getOperaStatus());
|
||||
if (info.getOperaStatus() == "0"){
|
||||
status.setValue("待处理");
|
||||
}else {
|
||||
status.setValue("已处理");
|
||||
}
|
||||
dataArrayList.add(status);
|
||||
|
||||
NoticeValue location = new NoticeValue();
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/notice_traffic_placeholder"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/notice_traffic_placeholder"
|
||||
app:layout_constraintBottom_toBottomOf="@id/video_player"
|
||||
app:layout_constraintEnd_toEndOf="@id/video_player"
|
||||
app:layout_constraintStart_toStartOf="@id/video_player"
|
||||
@@ -84,7 +84,7 @@
|
||||
android:id="@+id/traffic_info_recyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="@dimen/dp_80"
|
||||
android:layout_marginLeft="@dimen/dp_70"
|
||||
android:layout_marginTop="@dimen/dp_38"
|
||||
android:layout_marginRight="@dimen/dp_80"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
<dimen name="dp_54">54px</dimen>
|
||||
<dimen name="dp_56">56px</dimen>
|
||||
<dimen name="dp_62">62px</dimen>
|
||||
<dimen name="dp_70">70px</dimen>
|
||||
<dimen name="dp_75">80px</dimen>
|
||||
<dimen name="dp_80">80px</dimen>
|
||||
<dimen name="dp_140">140px</dimen>
|
||||
<dimen name="dp_150">150px</dimen>
|
||||
<dimen name="dp_180">180px</dimen>
|
||||
|
||||
@@ -81,7 +81,7 @@ public class NoticeNetWorkManager {
|
||||
@Override
|
||||
public void onNext(@NonNull NoticeTrafficStyleInfo noticeTrafficStyleInfo) {
|
||||
Log.d(TAG, "onNext:"+noticeTrafficStyleInfo);
|
||||
if (noticeTrafficStyleInfo != null) {
|
||||
if (noticeTrafficStyleInfo.getResult().getAccidentInfo() != null) {
|
||||
callBack.callBackWithResult(noticeTrafficStyleInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class TestNoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
val video: String = "https://view.2amok.com/20200219/012d8e2a55f227e90d76056bb6aab5e4.mp4"
|
||||
pushData.poiImgUrl = video
|
||||
pushData.type = 1
|
||||
pushData.infoId = "909821120032526336"
|
||||
pushData.infoId = "909754135789686784"
|
||||
CallerHmiManager.showTrafficBanner(pushData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,35 +10,35 @@ import java.io.Serializable;
|
||||
* @since: 10/26/21
|
||||
*/
|
||||
public class NoticeTrafficStyleInfo extends BaseData {
|
||||
private NoticeTrafficStyleInfoResult mResult;
|
||||
public NoticeTrafficStyleInfoResult result;
|
||||
|
||||
public NoticeTrafficStyleInfoResult getResult() {
|
||||
return mResult;
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(NoticeTrafficStyleInfoResult result) {
|
||||
mResult = result;
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NoticeTrafficStyleInfo{" +
|
||||
"mResult=" + mResult +
|
||||
"result=" + result +
|
||||
'}';
|
||||
}
|
||||
|
||||
public class NoticeTrafficStyleInfoResult extends BaseData{
|
||||
public class NoticeTrafficAccountInfo implements Serializable{
|
||||
private String infoId;//事故id
|
||||
private String poiType;//事故类型
|
||||
private long dataCreateTime;//事故发生时间
|
||||
private long dataHandleTime;//事故处理时间
|
||||
private String operaStatus;//事故处理状态
|
||||
private String reason;//事故原因
|
||||
private String uploadAddress;//事故地点名称
|
||||
private String troubleTypeName;//事故等级描述
|
||||
private double lat;//纬度
|
||||
private double lon;//经度
|
||||
|
||||
private double lat;//纬度
|
||||
private String troubleTypeName;//事故等级描述
|
||||
private String uploadType;//事故等级描述
|
||||
private String uploadAddress;//事故地点名称
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
@@ -119,19 +119,47 @@ public class NoticeTrafficStyleInfo extends BaseData {
|
||||
this.troubleTypeName = troubleTypeName;
|
||||
}
|
||||
|
||||
public String getUploadType() {
|
||||
return uploadType;
|
||||
}
|
||||
|
||||
public void setUploadType(String uploadType) {
|
||||
this.uploadType = uploadType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NoticeTrafficStyleInfo{" +
|
||||
return "NoticeTrafficAccountInfo{" +
|
||||
"infoId='" + infoId + '\'' +
|
||||
", poiType='" + poiType + '\'' +
|
||||
", dataCreateTime=" + dataCreateTime +
|
||||
", dataHandleTime=" + dataHandleTime +
|
||||
", operaStatus='" + operaStatus + '\'' +
|
||||
", reason='" + reason + '\'' +
|
||||
", uploadAddress='" + uploadAddress + '\'' +
|
||||
", troubleTypeName='" + troubleTypeName + '\'' +
|
||||
", lat=" + lat +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", troubleTypeName='" + troubleTypeName + '\'' +
|
||||
", uploadType='" + uploadType + '\'' +
|
||||
", uploadAddress='" + uploadAddress + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public class NoticeTrafficStyleInfoResult implements Serializable{
|
||||
private NoticeTrafficAccountInfo accidentInfo;
|
||||
|
||||
public NoticeTrafficAccountInfo getAccidentInfo() {
|
||||
return accidentInfo;
|
||||
}
|
||||
|
||||
public void setAccidentInfo(NoticeTrafficAccountInfo accidentInfo) {
|
||||
this.accidentInfo = accidentInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NoticeTrafficStyleInfoResult{" +
|
||||
"accidentInfo=" + accidentInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user