Merge remote-tracking branch 'origin/dev_merge_shunyi_vr_map' into dev_merge_shuyi_vr_map
# Conflicts: # gradle.properties
This commit is contained in:
@@ -435,6 +435,7 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.guideshow
|
||||
implementation rootProject.ext.dependencies.moduleextensions
|
||||
implementation rootProject.ext.dependencies.modulemap
|
||||
implementation rootProject.ext.dependencies.moduleSmallMap
|
||||
} else {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':foudations:mogo-base-websocket-sdk')
|
||||
@@ -451,6 +452,7 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-monitor')
|
||||
implementation project(':modules:mogo-module-extensions')
|
||||
implementation project(':modules:mogo-module-map')
|
||||
implementation project(':modules:mogo-module-smp')
|
||||
}
|
||||
|
||||
apply from: "./functions/perform.gradle"
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.module.main.service.MogoMainService;
|
||||
import com.mogo.module.push.base.PushUIConstants;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.module.small.map.IMogoSmallMapProvider;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.utils.ObuConfig;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
@@ -99,6 +100,9 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_CRASH_WARNING, "CrashWarning" ) );
|
||||
// MogoModulePaths.addModule( new MogoModule( IMogoMachineVisionProvider.path, "IMogoMachineVisionProvider" ) );
|
||||
|
||||
// 小地图模块
|
||||
MogoModulePaths.addModule( new MogoModule( IMogoSmallMapProvider.path, "IMogoSmallMapProvider" ) );
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake" ) );
|
||||
|
||||
if ( !DebugConfig.isLauncher() ) {
|
||||
|
||||
@@ -111,6 +111,7 @@ ext {
|
||||
guideshow : "com.mogo.module:module-guide:${MOGO_MODULE_GUIDESHOW_VERSION}",
|
||||
// V2X
|
||||
moduleV2x : "com.mogo.module:module-v2x:${MOGO_MODULE_V2X_VERSION}",
|
||||
moduleSmallMap : "com.mogo.module:module-small-map:${MOGO_MODULES_SMALL_MAP}",
|
||||
modulemedia : "com.mogo.module:module-media:${MOGO_MODULE_MEDIA_VERSION}",
|
||||
modulesearch : "com.mogo.module:module-search:${MOGO_MODULE_SEARCH_VERSION}",
|
||||
// push
|
||||
|
||||
@@ -130,6 +130,7 @@ TTS_NOOP_VERSION=2.0.12
|
||||
# 自研地图
|
||||
MAP_CUSTOM_VERSION=2.0.12
|
||||
MOGO_MODULES_MVISION_VERSION=2.0.12
|
||||
MOGO_MODULES_SMALL_MAP=1.0.0
|
||||
# httpdns
|
||||
HTTPDNS_TENCENT_VERSION = 2.0.12
|
||||
HTTPDNS_BASE_VERSION = 2.0.12
|
||||
|
||||
@@ -30,6 +30,9 @@ class MogoSnapshotSetData implements Parcelable {
|
||||
//红绿灯
|
||||
private CloudRoadData trafficLight;
|
||||
|
||||
//路边摄像头
|
||||
private CloudRoadData camera;
|
||||
|
||||
// 自车速度 本地添加
|
||||
public double curSpeed = 0.0;
|
||||
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.mogo.module.media.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Paint.Align;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.module.media.R;
|
||||
|
||||
/**
|
||||
* 环形进度条
|
||||
*/
|
||||
public class PercentageRingView extends View {
|
||||
private Paint mCirclePaint;
|
||||
private Paint mTextPaint;
|
||||
private Paint mArcPaint;
|
||||
private int mCircleX;
|
||||
private int mCircleY;
|
||||
private float mCurrentAngle;
|
||||
private RectF mArcRectF;
|
||||
private float mStartSweepValue;
|
||||
private float mTargetPercent;
|
||||
private float mCurrentPercent;
|
||||
|
||||
private int mRadius;
|
||||
private int mCircleBackground;
|
||||
private int mRingColor;
|
||||
private int mTextSize;
|
||||
private int mTextColor;
|
||||
|
||||
|
||||
public PercentageRingView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
init(context);
|
||||
}
|
||||
|
||||
public PercentageRingView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
//自定义属性 values/attr
|
||||
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PercentageRing);
|
||||
//中间圆的背景颜色 默认为浅紫色
|
||||
mCircleBackground = typedArray.getColor(R.styleable.PercentageRing_circleBackground, 0xffafb4db);
|
||||
//外圆环的颜色 默认为深紫色
|
||||
mRingColor = typedArray.getColor(R.styleable.PercentageRing_ringColor, 0xff6950a1);
|
||||
//中间圆的半径 默认为60
|
||||
mRadius = typedArray.getInt(R.styleable.PercentageRing_radius, 60);
|
||||
//字体颜色 默认为白色
|
||||
mTextColor = typedArray.getColor(R.styleable.PercentageRing_textColor, 0xffffffff);
|
||||
//最后一定要调用这个 释放掉TypedArray
|
||||
typedArray.recycle();
|
||||
//初始化数据
|
||||
init(context);
|
||||
}
|
||||
|
||||
public PercentageRingView(Context context) {
|
||||
super(context);
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init(Context context) {
|
||||
//圆环开始角度 -90° 正北方向
|
||||
mStartSweepValue = -90;
|
||||
//当前角度
|
||||
mCurrentAngle = 0;
|
||||
//当前百分比
|
||||
mCurrentPercent = 0;
|
||||
//设置中心园的画笔
|
||||
mCirclePaint = new Paint();
|
||||
mCirclePaint.setAntiAlias(true);
|
||||
mCirclePaint.setColor(mCircleBackground);
|
||||
mCirclePaint.setStyle(Paint.Style.FILL);
|
||||
//设置文字的画笔
|
||||
mTextPaint = new Paint();
|
||||
mTextPaint.setColor(mTextColor);
|
||||
mTextPaint.setAntiAlias(true);
|
||||
mTextPaint.setStyle(Paint.Style.FILL);
|
||||
mTextPaint.setStrokeWidth((float) (0.025 * mRadius));
|
||||
mTextPaint.setTextSize(mRadius / 2);
|
||||
mTextPaint.setTextAlign(Align.CENTER);
|
||||
//设置外圆环的画笔
|
||||
mArcPaint = new Paint();
|
||||
mArcPaint.setAntiAlias(true);
|
||||
mArcPaint.setColor(mRingColor);
|
||||
mArcPaint.setStyle(Paint.Style.STROKE);
|
||||
// mArcPaint.setStrokeWidth((float) (0.075 * mRadius));
|
||||
mArcPaint.setStrokeWidth((float) (0.17 * mRadius));
|
||||
//获得文字的字号 因为要设置文字在圆的中心位置
|
||||
mTextSize = (int) mTextPaint.getTextSize();
|
||||
}
|
||||
|
||||
//主要是测量wrap_content时候的宽和高,因为宽高一样,只需要测量一次宽即可,高等于宽
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
setMeasuredDimension(measure(widthMeasureSpec), measure(widthMeasureSpec));
|
||||
//设置圆心坐标
|
||||
mCircleX = getMeasuredWidth() / 2;
|
||||
mCircleY = getMeasuredHeight() / 2;
|
||||
//如果半径大于圆心横坐标,需要手动缩小半径的值,否则就画到外面去了
|
||||
if (mRadius > mCircleX) {
|
||||
//设置半径大小为圆心横坐标到原点的距离
|
||||
mRadius = mCircleX;
|
||||
mRadius = (int) (mCircleX - 0.075 * mRadius);
|
||||
//因为半径改变了,所以要重新设置一下字体宽度
|
||||
mTextPaint.setStrokeWidth((float) (0.025 * mRadius));
|
||||
//重新设置字号
|
||||
mTextPaint.setTextSize(mRadius / 2);
|
||||
//重新设置外圆环宽度
|
||||
// mArcPaint.setStrokeWidth((float) (0.075 * mRadius));
|
||||
mArcPaint.setStrokeWidth((float) (0.17 * mRadius));
|
||||
//重新获得字号大小
|
||||
mTextSize = (int) mTextPaint.getTextSize();
|
||||
}
|
||||
//画中心园的外接矩形,用来画圆环用
|
||||
mArcRectF = new RectF(mCircleX - mRadius, mCircleY - mRadius, mCircleX + mRadius, mCircleY + mRadius);
|
||||
}
|
||||
|
||||
//当wrap_content的时候,view的大小根据半径大小改变,但最大不会超过屏幕
|
||||
private int measure(int measureSpec) {
|
||||
int result = 0;
|
||||
int specMode = MeasureSpec.getMode(measureSpec);
|
||||
int specSize = MeasureSpec.getSize(measureSpec);
|
||||
if (specMode == MeasureSpec.EXACTLY) {
|
||||
result = specSize;
|
||||
} else {
|
||||
result = (int) (1.075 * mRadius * 2);
|
||||
if (specMode == MeasureSpec.AT_MOST) {
|
||||
result = Math.min(result, specSize);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
//开始画中间圆、文字和外圆环
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
//画中间圆
|
||||
canvas.drawCircle(mCircleX, mCircleY, mRadius, mCirclePaint);
|
||||
//画圆环
|
||||
canvas.drawArc(mArcRectF, mStartSweepValue, mCurrentAngle, false, mArcPaint);
|
||||
//画文字
|
||||
canvas.drawText(String.valueOf(mCurrentPercent) + "%", mCircleX, mCircleY + mTextSize / 4, mTextPaint);
|
||||
//判断当前百分比是否小于设置目标的百分比
|
||||
if (mCurrentPercent < mTargetPercent) {
|
||||
//当前百分比+1
|
||||
mCurrentPercent += 1;
|
||||
//当前角度+360
|
||||
mCurrentAngle += 3.6;
|
||||
//每10ms重画一次
|
||||
postInvalidateDelayed(10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//设置目标的百分比
|
||||
public void setTargetPercent(int percent) {
|
||||
this.mTargetPercent = percent;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import com.mogo.module.media.presenter.PresenterFactory;
|
||||
import com.mogo.module.media.utils.Utils;
|
||||
import com.mogo.module.media.view.IMusicView;
|
||||
import com.mogo.module.media.widget.AnimCircleImageView;
|
||||
import com.mogo.module.media.widget.PercentageRingView;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
@@ -65,6 +66,10 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
private boolean mIsCallChatWindowVisible;
|
||||
|
||||
private ICallProviderResponse mCallProviderResponse;
|
||||
private PercentageRingView mPercentageRingView;
|
||||
private ImageView mPauseImage;
|
||||
private AnimCircleImageView mAnimCircleImageView;
|
||||
|
||||
|
||||
public void initMedia(Context context) {
|
||||
mContext = context;
|
||||
@@ -122,71 +127,129 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mHasAddWindow) {
|
||||
if (!mHasAddWindow) { //TODO
|
||||
mHasAddWindow = true;
|
||||
mWindowView =
|
||||
LayoutInflater.from(mContext).inflate(R.layout.module_media_music_window_alert_layout, null);
|
||||
mCircleImg = mWindowView.findViewById(R.id.window_circle_img);
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
int yPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location);
|
||||
int xPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
int statusBarHeight = WindowUtils.getStatusBarHeight(mContext);
|
||||
Logger.d(TAG,
|
||||
"yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight);
|
||||
Log.d(TAG, "addMediaWindoView");
|
||||
FrameLayout.LayoutParams params =
|
||||
new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height));
|
||||
params.leftMargin = xPos;
|
||||
params.topMargin = yPos;
|
||||
ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false);
|
||||
updateWindowUI(true);
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
mPresenter.openApp();
|
||||
}
|
||||
});
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
mWindowView =
|
||||
LayoutInflater.from(mContext).inflate(R.layout.module_media_music_window_alert_layout_new, null);
|
||||
mPercentageRingView = mWindowView.findViewById(R.id.window_circle_bg);
|
||||
mAnimCircleImageView = mWindowView.findViewById(R.id.window_circle_img_new);
|
||||
mPauseImage = mWindowView.findViewById(R.id.window_play_pause_new);
|
||||
|
||||
mWindowPlayPause.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mMediaInfoData != null) {
|
||||
if (mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PAUSE_OR_STOP) {
|
||||
mPresenter.play(mMediaInfoData);
|
||||
} else {
|
||||
// 没有做详细判断,不是暂停就是播放
|
||||
mPresenter.pause(mMediaInfoData);
|
||||
}
|
||||
} else {
|
||||
if (mPauseImage != null) {
|
||||
mPauseImage.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
|
||||
int yPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_new);
|
||||
int xPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x_new);
|
||||
int statusBarHeight = WindowUtils.getStatusBarHeight(mContext);
|
||||
Logger.d(TAG,
|
||||
"yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight);
|
||||
Log.d(TAG, "addMediaWindoView");
|
||||
FrameLayout.LayoutParams params =
|
||||
new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width_new), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height_new));
|
||||
params.leftMargin = xPos;
|
||||
params.topMargin = yPos;
|
||||
ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false);
|
||||
updateWindowUI(true);
|
||||
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
mPresenter.openApp();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
mWindowPlayNext.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mPresenter != null) {
|
||||
mPresenter.next();
|
||||
mPauseImage.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mMediaInfoData != null) {
|
||||
if (mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PAUSE_OR_STOP) {
|
||||
mPresenter.play(mMediaInfoData);
|
||||
} else {
|
||||
// 没有做详细判断,不是暂停就是播放
|
||||
mPresenter.pause(mMediaInfoData);
|
||||
}
|
||||
} else {
|
||||
mPresenter.openApp();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if ( mIsCallChatWindowVisible ) {
|
||||
Logger.d( TAG, "vr mWindowView.setVisibility: status = " + mIsCallChatWindowVisible );
|
||||
mWindowView.setVisibility(View.GONE);
|
||||
} else {
|
||||
mWindowView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if ( mIsCallChatWindowVisible ) {
|
||||
Logger.d( TAG, "mWindowView.setVisibility: status = " + mIsCallChatWindowVisible );
|
||||
mWindowView.setVisibility(View.GONE);
|
||||
} else {
|
||||
mWindowView.setVisibility(View.VISIBLE);
|
||||
mWindowView =
|
||||
LayoutInflater.from(mContext).inflate(R.layout.module_media_music_window_alert_layout, null);
|
||||
mCircleImg = mWindowView.findViewById(R.id.window_circle_img);
|
||||
mScrollText = mWindowView.findViewById(R.id.window_scroll_txt);
|
||||
mWindowPlayPause = mWindowView.findViewById(R.id.window_play_pause);
|
||||
mWindowPlayNext = mWindowView.findViewById(R.id.window_music_next);
|
||||
mWindowCurrTime = mWindowView.findViewById(R.id.window_current_time);
|
||||
mWindowMaxTime = mWindowView.findViewById(R.id.window_max_time);
|
||||
mWindowProgress = mWindowView.findViewById(R.id.window_progress_bar);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
int yPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location);
|
||||
int xPos =
|
||||
getContext().getResources().getDimensionPixelOffset(R.dimen.module_media_music_state_location_x);
|
||||
int statusBarHeight = WindowUtils.getStatusBarHeight(mContext);
|
||||
Logger.d(TAG,
|
||||
"yPos: " + yPos + " xPos: " + xPos + " statusBarHeight: " + statusBarHeight);
|
||||
Log.d(TAG, "addMediaWindoView");
|
||||
FrameLayout.LayoutParams params =
|
||||
new FrameLayout.LayoutParams((int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_width), (int) mContext.getResources().getDimension(R.dimen.module_media_pop_window_height));
|
||||
params.leftMargin = xPos;
|
||||
params.topMargin = yPos;
|
||||
ServiceMediaHandler.getMogoWindowManager().addView(mWindowView, params, false);
|
||||
updateWindowUI(true);
|
||||
mWindowView.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
mPresenter.openApp();
|
||||
}
|
||||
});
|
||||
|
||||
mWindowPlayPause.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mMediaInfoData != null) {
|
||||
if (mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PAUSE_OR_STOP) {
|
||||
mPresenter.play(mMediaInfoData);
|
||||
} else {
|
||||
// 没有做详细判断,不是暂停就是播放
|
||||
mPresenter.pause(mMediaInfoData);
|
||||
}
|
||||
} else {
|
||||
mPresenter.openApp();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mWindowPlayNext.setOnClickListener(new NoDoubleClickListener() {
|
||||
@Override
|
||||
public void onClicks(View view) {
|
||||
if (mPresenter != null) {
|
||||
mPresenter.next();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if ( mIsCallChatWindowVisible ) {
|
||||
Logger.d( TAG, "mWindowView.setVisibility: status = " + mIsCallChatWindowVisible );
|
||||
mWindowView.setVisibility(View.GONE);
|
||||
} else {
|
||||
mWindowView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,41 +277,71 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mScrollText != null) {
|
||||
mScrollText.setText(mMediaInfoData.getMediaName());
|
||||
}
|
||||
|
||||
if (first || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_BUFF) {
|
||||
if (mWindowMaxTime != null) {
|
||||
mWindowMaxTime.setText(Utils.calculateTime((int) mMediaInfoData.getMaxTime()));
|
||||
}
|
||||
if (mWindowCurrTime != null) {
|
||||
mWindowCurrTime.setText(Utils.calculateTime((int) mMediaInfoData.getCurTime()));
|
||||
}
|
||||
|
||||
if( mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) {
|
||||
// kw音乐做的容错
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play);
|
||||
}
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.startAnim();
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
if (first || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_BUFF) {
|
||||
if( mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) {
|
||||
// kw音乐做的容错
|
||||
if (mPauseImage != null) {
|
||||
mPauseImage.setImageResource(R.drawable.module_media_window_pop_play);
|
||||
}
|
||||
if (mAnimCircleImageView != null) {
|
||||
mAnimCircleImageView.startAnim();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) {
|
||||
int size =
|
||||
mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size);
|
||||
Logger.d(TAG, "overload: " + size);
|
||||
com.bumptech.glide.request.RequestOptions options =
|
||||
new com.bumptech.glide.request.RequestOptions()
|
||||
.placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size);
|
||||
GlideApp.with(mContext).asBitmap().apply(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options));
|
||||
if (mAnimCircleImageView != null) {
|
||||
if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) {
|
||||
int size =
|
||||
mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size_new);
|
||||
Logger.d(TAG, "overload: " + size);
|
||||
com.bumptech.glide.request.RequestOptions options =
|
||||
new com.bumptech.glide.request.RequestOptions()
|
||||
.placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size);
|
||||
GlideApp.with(mContext).asBitmap().apply(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mAnimCircleImageView, options));
|
||||
// GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options));
|
||||
}else{
|
||||
mCircleImg.setImageResource(R.drawable.module_media_default_music_img);
|
||||
}else{
|
||||
mAnimCircleImageView.setImageResource(R.drawable.module_media_default_music_img);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (mScrollText != null) {
|
||||
mScrollText.setText(mMediaInfoData.getMediaName());
|
||||
}
|
||||
|
||||
if (first || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING || mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_BUFF) {
|
||||
if (mWindowMaxTime != null) {
|
||||
mWindowMaxTime.setText(Utils.calculateTime((int) mMediaInfoData.getMaxTime()));
|
||||
}
|
||||
if (mWindowCurrTime != null) {
|
||||
mWindowCurrTime.setText(Utils.calculateTime((int) mMediaInfoData.getCurTime()));
|
||||
}
|
||||
|
||||
if( mMediaInfoData.getPlayState() == MusicConstant.PLAY_STATE_PLAYING) {
|
||||
// kw音乐做的容错
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play);
|
||||
}
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.startAnim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
if(mMediaInfoData!=null&&mMediaInfoData.getMediaImg()!=null&&!mMediaInfoData.getMediaImg().isEmpty()) {
|
||||
int size =
|
||||
mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size);
|
||||
Logger.d(TAG, "overload: " + size);
|
||||
com.bumptech.glide.request.RequestOptions options =
|
||||
new com.bumptech.glide.request.RequestOptions()
|
||||
.placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size);
|
||||
GlideApp.with(mContext).asBitmap().apply(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options));
|
||||
// GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options));
|
||||
}else{
|
||||
mCircleImg.setImageResource(R.drawable.module_media_default_music_img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,12 +358,22 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
Log.d(TAG, "onMusicPlaying===" + mMediaInfoData);
|
||||
isFirstPlay = false;
|
||||
updateWindowUI(false);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play);
|
||||
}
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
if (mPauseImage != null) {
|
||||
mPauseImage.setImageResource(R.drawable.module_media_window_pop_play);
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.startAnim();
|
||||
if (mAnimCircleImageView != null) {
|
||||
mAnimCircleImageView.startAnim();
|
||||
}
|
||||
} else {
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_play);
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.startAnim();
|
||||
}
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG, true);
|
||||
@@ -280,12 +383,22 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
public void onMusicPause() {
|
||||
Logger.d(TAG, "onMusicPause: ===" + mMediaInfoData);
|
||||
Log.d(TAG, "onMusicPause: ===" + mMediaInfoData);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
if (mPauseImage != null) {
|
||||
mPauseImage.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.stopAnim();
|
||||
if (mAnimCircleImageView != null) {
|
||||
mAnimCircleImageView.stopAnim();
|
||||
}
|
||||
} else {
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
|
||||
if (mAnimCircleImageView != null) {
|
||||
mAnimCircleImageView.stopAnim();
|
||||
}
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG,false);
|
||||
@@ -295,12 +408,22 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
public void onMusicStopped() {
|
||||
Logger.d(TAG, "onMusicStopped===" + mMediaInfoData);
|
||||
Log.d(TAG, "onMusicStopped===" + mMediaInfoData);
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
if (mPauseImage != null) {
|
||||
mPauseImage.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.stopAnim();
|
||||
if (mAnimCircleImageView != null) {
|
||||
mAnimCircleImageView.stopAnim();
|
||||
}
|
||||
} else {
|
||||
if (mWindowPlayPause != null) {
|
||||
mWindowPlayPause.setImageResource(R.drawable.module_media_window_pop_pause);
|
||||
}
|
||||
|
||||
if (mCircleImg != null) {
|
||||
mCircleImg.stopAnim();
|
||||
}
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setMediaPlayStatus(TAG,false);
|
||||
@@ -318,22 +441,37 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
@Override
|
||||
public void onMusicProgress(long current, long total) {
|
||||
// Logger.d(TAG, "onMusicProgress==current: " + current + " total: " + total);
|
||||
if (mMediaInfoData != null) {
|
||||
mMediaInfoData.setCurTime((int) current);
|
||||
mMediaInfoData.setMaxTime((int) total);
|
||||
}
|
||||
if (mWindowCurrTime != null) {
|
||||
mWindowCurrTime.setText(Utils.calculateTime((int) current));
|
||||
mWindowMaxTime.setText(Utils.calculateTime((int) total));
|
||||
}
|
||||
try {
|
||||
int progress =
|
||||
(int) ((current * 1.0f * 100) / (total * 1.0f));
|
||||
if (mWindowProgress != null) {
|
||||
mWindowProgress.setProgress(progress);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
try {
|
||||
int progress =
|
||||
(int) ((current * 1.0f * 100) / (total * 1.0f));
|
||||
if (mPercentageRingView != null) {
|
||||
mPercentageRingView.setVisibility(View.VISIBLE);
|
||||
Log.d(TAG, "progress vr = " + progress);
|
||||
mPercentageRingView.setTargetPercent(progress);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
if (mMediaInfoData != null) {
|
||||
mMediaInfoData.setCurTime((int) current);
|
||||
mMediaInfoData.setMaxTime((int) total);
|
||||
}
|
||||
if (mWindowCurrTime != null) {
|
||||
mWindowCurrTime.setText(Utils.calculateTime((int) current));
|
||||
mWindowMaxTime.setText(Utils.calculateTime((int) total));
|
||||
}
|
||||
try {
|
||||
int progress =
|
||||
(int) ((current * 1.0f * 100) / (total * 1.0f));
|
||||
if (mWindowProgress != null) {
|
||||
Log.d(TAG, "progress = " + progress);
|
||||
mWindowProgress.setProgress(progress);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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/module_media_pop_window_size"
|
||||
android:layout_height="@dimen/module_media_pop_window_size">
|
||||
|
||||
<com.mogo.module.media.widget.PercentageRingView
|
||||
android:id="@+id/window_circle_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:circleBackground="@color/modules_media_music_bg_color"
|
||||
app:radius="100"
|
||||
app:ringColor="@color/modules_media_music_circle_color" />
|
||||
|
||||
<com.mogo.module.media.widget.AnimCircleImageView
|
||||
android:id="@+id/window_circle_img_new"
|
||||
android:layout_width="@dimen/module_media_pop_window_anim_img_size_new"
|
||||
android:layout_height="@dimen/module_media_pop_window_anim_img_size_new"
|
||||
android:src="@drawable/module_media_default_music_img"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/window_play_pause_new"
|
||||
android:layout_width="@dimen/module_media_pop_window_pause"
|
||||
android:layout_height="@dimen/module_media_pop_window_pause"
|
||||
android:background="@drawable/module_media_play_bg_selector"
|
||||
android:src="@drawable/module_media_window_pop_play"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
<resources>
|
||||
<dimen name="module_media_music_state_location">872px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">1067px</dimen>
|
||||
|
||||
<dimen name="module_media_music_state_location_new">40px</dimen>
|
||||
<dimen name="module_media_music_state_location_x_new">1760px</dimen>
|
||||
<!-- lcc start-->
|
||||
<dimen name="module_media_back_width">660px</dimen>
|
||||
<dimen name="module_media_back_height">660px</dimen>
|
||||
@@ -63,9 +64,14 @@
|
||||
|
||||
<dimen name="module_media_pop_window_width">600px</dimen>
|
||||
<dimen name="module_media_pop_window_height">140px</dimen>
|
||||
<dimen name="module_media_pop_window_width_new">116px</dimen>
|
||||
<dimen name="module_media_pop_window_height_new">116px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">112px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">30px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">80px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size_new">90px</dimen>
|
||||
<dimen name="module_media_pop_window_pause">60px</dimen>
|
||||
<dimen name="module_media_pop_window_size">116px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">230px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">14px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">35px</dimen>
|
||||
|
||||
@@ -35,4 +35,12 @@
|
||||
<attr format="color" name="civ_fill_color"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PercentageRing">
|
||||
<attr name="radius" format="integer"/>
|
||||
<attr name="circleBackground" format="color"/>
|
||||
<attr name="ringColor" format="color"/>
|
||||
<attr name="textColor" format = "color"/>
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -2,4 +2,6 @@
|
||||
<resources>
|
||||
<color name="modules_media_music_title_text_color">#fff</color>
|
||||
<color name="modules_media_music_time_text_color">#7affffff</color>
|
||||
<color name="modules_media_music_bg_color">#444E6E</color>
|
||||
<color name="modules_media_music_circle_color">#B63737</color>
|
||||
</resources>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<resources>
|
||||
<dimen name="module_media_music_state_location">467px</dimen>
|
||||
<dimen name="module_media_music_state_location_x">573px</dimen>
|
||||
<dimen name="module_media_music_state_location_new">80px</dimen>
|
||||
<dimen name="module_media_music_state_location_x_new">930px</dimen>
|
||||
|
||||
<!-- lcc start-->
|
||||
<dimen name="module_media_back_width">352px</dimen>
|
||||
@@ -63,9 +65,13 @@
|
||||
|
||||
<dimen name="module_media_pop_window_width">338px</dimen>
|
||||
<dimen name="module_media_pop_window_height">82px</dimen>
|
||||
<dimen name="module_media_pop_window_width_new">116px</dimen>
|
||||
<dimen name="module_media_pop_window_height_new">116px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_height">60px</dimen>
|
||||
<dimen name="module_media_pop_window_inner_padding">18px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size">44px</dimen>
|
||||
<dimen name="module_media_pop_window_anim_img_size_new">55px</dimen>
|
||||
<dimen name="module_media_pop_window_pause">60px</dimen>
|
||||
<dimen name="module_media_pop_window_text_width">123px</dimen>
|
||||
<dimen name="module_media_pop_window_text_margin">10px</dimen>
|
||||
<dimen name="module_media_pop_window_text_top_size">18px</dimen>
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
}
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.alibaba.arouter'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.3"
|
||||
|
||||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||||
// buildToolsVersion rootProject.ext.android.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||||
versionCode Integer.valueOf(VERSION_CODE)
|
||||
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@@ -22,6 +26,7 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
@@ -30,7 +35,25 @@ android {
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'com.google.android.material:material:1.2.1'
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
api rootProject.ext.dependencies.mogomapapi
|
||||
api rootProject.ext.dependencies.mogoutils
|
||||
api rootProject.ext.dependencies.mogocommons
|
||||
api rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
} else {
|
||||
api project(":libraries:mogo-map")
|
||||
api project(":libraries:mogo-map-api")
|
||||
api project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
api project(':services:mogo-service-api')
|
||||
implementation project(':modules:mogo-module-common')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
3
modules/mogo-module-smp/gradle.properties
Normal file
3
modules/mogo-module-smp/gradle.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
GROUP=com.mogo.module
|
||||
POM_ARTIFACT_ID=module-small-map
|
||||
VERSION_CODE=1
|
||||
@@ -2,4 +2,10 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.module.small.map">
|
||||
|
||||
<application>
|
||||
<service
|
||||
android:name=".SmallMapService"
|
||||
android:exported="false"
|
||||
android:process=":smallMap" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.mogo.module.small.map;
|
||||
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:36 PM
|
||||
*/
|
||||
public interface IMogoSmallMapProvider extends IMogoModuleProvider {
|
||||
String path = "/small_map/api";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.mogo.module.small.map;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.common.entity.MogoSnapshotSetData;
|
||||
import com.mogo.module.common.machinevision.IMachineVisionInterface;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:35 PM
|
||||
*/
|
||||
public class SmallMapService extends Service {
|
||||
private static final String TAG = "MachineVisionMapService";
|
||||
private IBinder mBinder;
|
||||
private WindowManagerView mMachineVisionMapViewManager;
|
||||
private SmallMapView mMapView;
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
mBinder = new SmallMapServiceBinder();
|
||||
addMachineVisionMapView();
|
||||
Logger.d(TAG, "onBind");
|
||||
return mBinder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRebind(Intent intent) {
|
||||
super.onRebind(intent);
|
||||
addMachineVisionMapView();
|
||||
Logger.d(TAG, "onRebind");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUnbind(Intent intent) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
}
|
||||
|
||||
private void addMachineVisionMapView() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 小地图与大地图之间进程通讯
|
||||
*/
|
||||
public class SmallMapServiceBinder extends IMachineVisionInterface.Stub {
|
||||
|
||||
@Override
|
||||
public void postData(MogoSnapshotSetData data) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideViewIfExist() throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showViewIfExist() throws RemoteException {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.module.small.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.map.MogoBaseMapView;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:35 PM
|
||||
*/
|
||||
public class SmallMapView extends MogoBaseMapView {
|
||||
private final String TAG = "SmallMapView";
|
||||
|
||||
public SmallMapView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public SmallMapView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public SmallMapView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addDleMaps() {
|
||||
Log.d(TAG, "addDleMaps……");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display2DMap(boolean invokeCreateAuto, boolean invokeResumeAuto) {
|
||||
Log.d(TAG, "display2DMap……");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayVRMap(boolean invokeCreateAuto, boolean invokeResumeAuto) {
|
||||
Log.d(TAG, "displayVRMap……");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.mogo.module.small.map;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:35 PM
|
||||
*/
|
||||
public class SmallMapViewHandler {
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mogo.module.small.map;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:34 PM
|
||||
*/
|
||||
@Route(path = IMogoSmallMapProvider.path)
|
||||
public class SmallVisionProvider implements IMogoSmallMapProvider {
|
||||
private final String TAG = "SmallVisionProvider";
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View createView(Context context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
return TAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return ModuleType.TYPE_SERVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Log.d(TAG, "小地图模块初始化……");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Log.d(TAG, "小地图模块销毁……");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
if (poitype != null) {
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setText(EventTypeUtils.getPoiTypeStr(poitype));
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(EventTypeUtils.getPoiTypeBg(poitype));
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(EventTypeUtils.getPoiTypeBgForShareItem(poitype));
|
||||
|
||||
}
|
||||
if (address != null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -8,6 +9,8 @@ import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
@@ -25,6 +28,7 @@ import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.glide.GlideRoundedCornersTransform;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -44,6 +48,7 @@ import static com.mogo.module.v2x.V2XConst.VR_MODE;
|
||||
*/
|
||||
public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
|
||||
private Context mContext;
|
||||
private MogoImageView ivHead;
|
||||
private TextView tvName;
|
||||
private TextView tvDistance;
|
||||
@@ -73,6 +78,7 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
public V2XOtherSeekHelpVH(ViewGroup viewGroup) {
|
||||
super(LayoutInflater.from(viewGroup.getContext())
|
||||
.inflate(VR_MODE ? R.layout.item_v2x_fault_help_vr : R.layout.item_v2x_fault_help, viewGroup, false));
|
||||
mContext = viewGroup.getContext();
|
||||
ivHead = itemView.findViewById(R.id.ivFaultHelpHead);
|
||||
tvName = itemView.findViewById(R.id.tvFaultHelpName);
|
||||
tvDistance = itemView.findViewById(R.id.tvFaultHelpDistance);
|
||||
@@ -179,8 +185,13 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
}
|
||||
try {
|
||||
if (!TextUtils.isEmpty(mV2XPushMessageEntity.getHeadImgUrl())) {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(mV2XPushMessageEntity.getHeadImgUrl(), ivHead);
|
||||
if (VR_MODE) {
|
||||
Glide.with(mContext).load(mV2XPushMessageEntity.getHeadImgUrl()).apply(RequestOptions.bitmapTransform(
|
||||
new GlideRoundedCornersTransform(20, GlideRoundedCornersTransform.CornerType.LEFT))).into(ivHead);
|
||||
} else {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(mV2XPushMessageEntity.getHeadImgUrl(), ivHead);
|
||||
}
|
||||
}
|
||||
tvName.setText(mV2XPushMessageEntity.getDisplayName());
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -9,6 +10,8 @@ import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
@@ -33,8 +36,11 @@ import com.mogo.module.v2x.voice.V2XVoiceCallbackListener;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.service.impl.imageloader.glide.transform.GlideRoundBitmapTransform;
|
||||
import com.mogo.utils.ArrayUtils;
|
||||
import com.mogo.utils.BitmapHelper;
|
||||
import com.mogo.utils.DateTimeUtils;
|
||||
import com.mogo.utils.glide.GlideRoundedCornersTransform;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
@@ -58,6 +64,7 @@ import static com.mogo.module.v2x.V2XConst.VR_MODE;
|
||||
*/
|
||||
public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
private static final String TAG = "V2XRoadEventVH";
|
||||
private Context mContext;
|
||||
private MogoImageView ivEventImg;
|
||||
private MogoImageView ivReportHead;
|
||||
private ImageView ivEventPlay;
|
||||
@@ -144,6 +151,7 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail_vr, viewGroup, false) :
|
||||
LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_v2x_event_detail, viewGroup, false)
|
||||
);
|
||||
mContext = viewGroup.getContext();
|
||||
init(itemView);
|
||||
// 设置视图状态监听
|
||||
itemView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||
@@ -206,8 +214,13 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
imgUrl = mNoveltyInfo.getItems().get(0).getUrl();
|
||||
}
|
||||
if (!TextUtils.isEmpty(imgUrl)) {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(imgUrl, ivEventImg);
|
||||
if (VR_MODE) {
|
||||
Glide.with(mContext).load(imgUrl).apply(RequestOptions.bitmapTransform(
|
||||
new GlideRoundedCornersTransform(20, GlideRoundedCornersTransform.CornerType.LEFT))).into(ivEventImg);
|
||||
} else {
|
||||
V2XServiceManager.getImageLoader()
|
||||
.displayImage(imgUrl, ivEventImg);
|
||||
}
|
||||
}
|
||||
if (url.contains(".mp4")) {
|
||||
ivEventImg.setOnClickListener(v -> {
|
||||
|
||||
@@ -121,6 +121,36 @@ public class EventTypeUtils {
|
||||
return strBg;
|
||||
}
|
||||
|
||||
/*
|
||||
* VR模式下道路类型影响到分享列表 (VR模式暂时没有事件面板,所以可以删除此方法,公用上边的getPoiTypeBg)
|
||||
* */
|
||||
public static int getPoiTypeBgForShareItem(String poiType) {
|
||||
int strBg;
|
||||
switch (poiType) {
|
||||
case V2XPoiTypeEnum.FOURS_PARKING: // 停车场
|
||||
case V2XPoiTypeEnum.GAS_STATION: // 加油站
|
||||
strBg = R.drawable.bg_v2x_event_type_blue;
|
||||
break;
|
||||
case V2XPoiTypeEnum.FOURS_BLOCK_UP: // 拥堵
|
||||
case V2XPoiTypeEnum.FOURS_LIVING: // 实时路况
|
||||
case V2XPoiTypeEnum.FOURS_NEALY: // 身边
|
||||
strBg = R.drawable.bg_v2x_event_type_orange;
|
||||
break;
|
||||
case V2XPoiTypeEnum.TRAFFIC_CHECK:// 交通检查
|
||||
case V2XPoiTypeEnum.ROAD_CLOSED:// 封路
|
||||
case V2XPoiTypeEnum.FOURS_ROAD_WORK:// 施工
|
||||
case V2XPoiTypeEnum.FOURS_PONDING:// 积水
|
||||
case V2XPoiTypeEnum.FOURS_FOG: // 浓雾
|
||||
case V2XPoiTypeEnum.FOURS_ICE: // 结冰
|
||||
case V2XPoiTypeEnum.FOURS_ACCIDENT: // 事故
|
||||
strBg = R.drawable.bg_v2x_event_type_read;
|
||||
break;
|
||||
default:
|
||||
strBg = R.drawable.bg_v2x_event_type_read;
|
||||
break;
|
||||
}
|
||||
return strBg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是道路预警事件
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:miv_bottomLeftRadius="@dimen/dp_20"
|
||||
app:miv_failureHolder="@drawable/v2x_icon_live_logo"
|
||||
app:miv_overlayImageId="@drawable/v2x_icon_live_logo"
|
||||
app:miv_placeHolder="@drawable/v2x_icon_live_logo"
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
android:layout_width="@dimen/module_v2x_event_button_size_vr"
|
||||
android:layout_height="@dimen/module_v2x_event_button_size_vr"
|
||||
android:src="@drawable/selector_nav_btn"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
Reference in New Issue
Block a user