Merge branch 'll' into dev_MogoAP_eagle-1030_211020_8.0.14
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -16,7 +17,10 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst;
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat;
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.utils.BitmapHelper;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.glide.GlideRoundedCornersTransform;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
@@ -56,12 +60,23 @@ public class NoticeBannerView extends ConstraintLayout {
|
||||
public void refreshWithData(NoticeTrafficStylePushData pushData) {
|
||||
mPushData = pushData;
|
||||
noticePushTitle.setText(pushData.getMsg());
|
||||
noticePushContent.setText(pushData.getContent());
|
||||
if (pushData.getType() == 1) { //1 是图片, 2 是视频
|
||||
noticePushContent.setText(pushData.getTitle());
|
||||
if (pushData.getType() == 0) { //0 是图片, 1 是视频
|
||||
iconImageView.setVisibility(View.GONE);
|
||||
GlideApp.with(this).load(pushData.getPoiImgUrl()).optionalTransform(new GlideRoundedCornersTransform
|
||||
(30f, GlideRoundedCornersTransform.CornerType.LEFT)).into(styleImageView);
|
||||
} else {
|
||||
iconImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bitmap firstBitmap = BitmapHelper.getVideoThumbnail(mPushData.getPoiImgUrl());/*获取第一帧图*/
|
||||
ThreadUtils.runOnUiThread(()->{
|
||||
styleImageView.setImageBitmap(firstBitmap);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 交警类型弹框
|
||||
* @description 交警事故详情弹框
|
||||
* @since: 10/26/21
|
||||
*/
|
||||
public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
@@ -70,10 +70,8 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
public void initView() {
|
||||
setContentView(R.layout.notice_dialog_traffic_police);
|
||||
setCanceledOnTouchOutside(true);
|
||||
playerShow();//视频播放器
|
||||
playerShow();//视频播放器及接操作按钮
|
||||
recyclerVie();//详情信息列表
|
||||
otherFunctionButton();
|
||||
netWorkStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,13 +90,31 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
releasePlayer();
|
||||
dismiss();
|
||||
});
|
||||
accept = findViewById(R.id.accept_traffic);
|
||||
refuse = findViewById(R.id.refuse_traffic);
|
||||
connect = findViewById(R.id.notice_connect);
|
||||
accept.setOnClickListener(v -> {
|
||||
feedBackTraffic(1);
|
||||
});
|
||||
refuse.setOnClickListener(v -> {
|
||||
feedBackTraffic(0);
|
||||
});
|
||||
//重新连接
|
||||
connect.setOnClickListener(v -> {
|
||||
netWorkStatus();
|
||||
startLive();
|
||||
requestTrafficInfo();
|
||||
});
|
||||
requestTrafficInfo();
|
||||
netWorkStatus();
|
||||
if (mPushData.getType() == 1) {
|
||||
startLive();
|
||||
} else {
|
||||
MogoApisHandler.getInstance().getApis().getImageLoaderApi().displayImage(mPushData.getPoiImgUrl(),
|
||||
thumbnailImage);
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
mVideoPlayer.setVisibility(View.INVISIBLE);
|
||||
playImageView.setVisibility(View.INVISIBLE);
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mVideoPlayer.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -132,25 +148,6 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
|
||||
}
|
||||
|
||||
private void otherFunctionButton() {
|
||||
accept = findViewById(R.id.accept_traffic);
|
||||
refuse = findViewById(R.id.refuse_traffic);
|
||||
connect = findViewById(R.id.notice_connect);
|
||||
accept.setOnClickListener(v -> {
|
||||
feedBackTraffic(1);
|
||||
});
|
||||
refuse.setOnClickListener(v -> {
|
||||
feedBackTraffic(0);
|
||||
});
|
||||
//重新连接
|
||||
connect.setOnClickListener(v -> {
|
||||
netWorkStatus();
|
||||
startLive();
|
||||
requestTrafficInfo();
|
||||
});
|
||||
requestTrafficInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param i 是否接受交通事故任务
|
||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||
@@ -436,8 +433,10 @@ public class NoticeTrafficDialog extends BaseFloatDialog {
|
||||
Log.d(TAG, "网络可用");
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
connect.setVisibility(View.GONE);
|
||||
thumbnailImage.setBackgroundResource(R.drawable.notice_traffic_placeholder);
|
||||
} else {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setBackgroundResource(R.drawable.notice_unsuccess_traffic);
|
||||
connect.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -46,7 +46,6 @@
|
||||
android:id="@+id/thumbnail_image"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/notice_unsuccess_traffic"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="@id/video_player"
|
||||
app:layout_constraintEnd_toEndOf="@id/video_player"
|
||||
|
||||
@@ -38,8 +38,9 @@ class TestNoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
//图片
|
||||
val image: String = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201609%2F26%2F20160926081306_GM2tv.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1638511084&t=92def7498b526dcba3fceda17c43fcb8"
|
||||
//视频
|
||||
pushData.poiImgUrl = "https://vd2.bdstatic.com/mda-mk1347dzxdmcre0y/sc/cae_h264/1635819498112313003/mda-mk1347dzxdmcre0y.mp4?v_from_s=hkapp-haokan-tucheng&auth_key=1635837585-0-0-5295f6658c7711ba7b4d3ef478a7fbaa&bcevod_channel=searchbox_feed&pd=1&pt=3&abtest="
|
||||
pushData.type = 1
|
||||
val video: String = "https://vd2.bdstatic.com/mda-mk1347dzxdmcre0y/sc/cae_h264/1635819498112313003/mda-mk1347dzxdmcre0y.mp4?v_from_s=hkapp-haokan-tucheng&auth_key=1635837585-0-0-5295f6658c7711ba7b4d3ef478a7fbaa&bcevod_channel=searchbox_feed&pd=1&pt=3&abtest="
|
||||
pushData.poiImgUrl = image
|
||||
pushData.type = 0
|
||||
pushData.infoId = "905543067497902080"
|
||||
CallerHmiManager.showTrafficBanner(pushData)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user