[sonar] fix sonar plm
This commit is contained in:
@@ -30,7 +30,6 @@ import okhttp3.RequestBody;
|
||||
* @since: 10/28/21
|
||||
*/
|
||||
public class NoticeNetWorkManager {
|
||||
private static volatile NoticeNetWorkManager requestNoticeManager;
|
||||
private final INoticeApiService mNoticeApiService;
|
||||
|
||||
private NoticeNetWorkManager() {
|
||||
@@ -39,14 +38,11 @@ public class NoticeNetWorkManager {
|
||||
}
|
||||
|
||||
public static NoticeNetWorkManager getInstance() {
|
||||
if (requestNoticeManager == null) {
|
||||
synchronized (NoticeNetWorkManager.class) {
|
||||
if (requestNoticeManager == null) {
|
||||
requestNoticeManager = new NoticeNetWorkManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return requestNoticeManager;
|
||||
return Holder.requestNoticeManager;
|
||||
}
|
||||
|
||||
private static final class Holder{
|
||||
private static final NoticeNetWorkManager requestNoticeManager = new NoticeNetWorkManager();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +84,7 @@ public class NoticeNetWorkManager {
|
||||
* 反馈交警是否接受事故任务
|
||||
*
|
||||
* @param infoId 事故id
|
||||
* @param sn
|
||||
* @param sn sn
|
||||
* @param status 是否接受 0否 1是
|
||||
*/
|
||||
public void sendAccidentAcceptStatus(String infoId, String sn, int status) {
|
||||
|
||||
@@ -6,14 +6,12 @@ import android.text.TextUtils;
|
||||
|
||||
//播放试听
|
||||
public class Audition implements MediaPlayer.OnPreparedListener, MediaPlayer.OnCompletionListener{
|
||||
private static volatile Audition INSTANCE;
|
||||
public MediaPlayer mediaPlayer;
|
||||
private String oldPath;
|
||||
private OnAuditionListener listener;
|
||||
|
||||
public interface OnAuditionListener {
|
||||
void onAuditionCompletion();
|
||||
|
||||
}
|
||||
|
||||
public void registerOnAuditionListener(OnAuditionListener listener) {
|
||||
@@ -28,16 +26,12 @@ public class Audition implements MediaPlayer.OnPreparedListener, MediaPlayer.OnC
|
||||
}
|
||||
|
||||
public static Audition getInstance() {
|
||||
if (INSTANCE == null) {
|
||||
synchronized (Audition.class) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new Audition();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INSTANCE;
|
||||
return Holder.INSTANCE;
|
||||
}
|
||||
|
||||
private static final class Holder{
|
||||
private static final Audition INSTANCE = new Audition();
|
||||
}
|
||||
|
||||
public boolean isPlaying() {
|
||||
return mediaPlayer != null && mediaPlayer.isPlaying();
|
||||
|
||||
@@ -7,9 +7,7 @@ import com.zhjt.mogo_core_function_devatools.badcase.record.listener.RecordListe
|
||||
|
||||
|
||||
public class RecordManager {
|
||||
private static final String TAG = RecordManager.class.getSimpleName();
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private volatile static RecordManager instance;
|
||||
private final RecordHelper recordHelper;
|
||||
/**
|
||||
* 录音配置
|
||||
@@ -21,14 +19,11 @@ public class RecordManager {
|
||||
}
|
||||
|
||||
public static RecordManager getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (RecordManager.class) {
|
||||
if (instance == null) {
|
||||
instance = new RecordManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
return Holder.instance;
|
||||
}
|
||||
|
||||
private static final class Holder{
|
||||
private static final RecordManager instance = new RecordManager();
|
||||
}
|
||||
|
||||
// /**
|
||||
|
||||
@@ -12,19 +12,18 @@ import androidx.annotation.Nullable;
|
||||
|
||||
public class SharpView extends View {
|
||||
|
||||
private int mWidth =0; //三角形的宽度
|
||||
private int mHeight =0; //三角形的高度
|
||||
private Context mContext;
|
||||
private int mWidth = 0; //三角形的宽度
|
||||
private int mHeight = 0; //三角形的高度
|
||||
private final Paint paint = new Paint();
|
||||
private final Path path = new Path();
|
||||
|
||||
public SharpView(Context context) {
|
||||
super(context);
|
||||
this.mContext=context;
|
||||
initView();
|
||||
}
|
||||
|
||||
public SharpView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
this.mContext=context;
|
||||
initView();
|
||||
}
|
||||
|
||||
@@ -32,28 +31,27 @@ public class SharpView extends View {
|
||||
mWidth = 25;
|
||||
mHeight = 25;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
setMeasuredDimension(mWidth,mHeight);
|
||||
setMeasuredDimension(mWidth, mHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
super.onDraw(canvas);
|
||||
//创建画笔
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(Color.parseColor("#FFFFFFFF"));
|
||||
paint.setAntiAlias(true); //抗锯齿
|
||||
paint.setStyle(Paint.Style.FILL);//实线
|
||||
//创建路径
|
||||
Path path = new Path();
|
||||
path.moveTo(0,mHeight);
|
||||
path.lineTo(mWidth,mHeight);
|
||||
path.lineTo(mWidth/2,0);
|
||||
path.moveTo(0, mHeight);
|
||||
path.lineTo(mWidth, mHeight);
|
||||
path.lineTo(mWidth / 2.0f, 0);
|
||||
path.close();//闭合路径
|
||||
//画在画布上
|
||||
canvas.drawPath(path,paint);
|
||||
canvas.drawPath(path, paint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import static com.mogo.eagle.core.data.biz.dispatch.DispatchAdasAutoPilotLocRece
|
||||
import static com.mogo.eagle.core.data.biz.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_TYPE_START;
|
||||
import static com.mogo.eagle.core.data.biz.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_TYPE_STOP;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
@@ -12,6 +13,7 @@ import com.mogo.eagle.core.data.biz.dispatch.DispatchAdasAutoPilotLocReceiverBea
|
||||
|
||||
public class DispatchDialogManager {
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static volatile DispatchDialogManager manager;
|
||||
private static final byte[] obj = new byte[0];
|
||||
private final Context mContext;
|
||||
|
||||
@@ -22,13 +22,13 @@ import com.mogo.eagle.core.function.hmi.R;
|
||||
public class SpeedChartView extends View {
|
||||
|
||||
//中心的文字描述
|
||||
private String mDes = "KM/H";
|
||||
private final String mDes = "KM/H";
|
||||
//根据数据显示的圆弧Paint
|
||||
private Paint mArcPaint;
|
||||
//圆弧颜色
|
||||
private int mArcColor;
|
||||
//圆弧的画笔的宽度
|
||||
private float mStrokeWith = getResources().getDimension(R.dimen.module_ext_arcView_stroke_with);
|
||||
private final float mStrokeWith = getResources().getDimension(R.dimen.module_ext_arcView_stroke_with);
|
||||
//文字描述的paint
|
||||
private Paint mTextPaint;
|
||||
|
||||
@@ -37,9 +37,9 @@ public class SpeedChartView extends View {
|
||||
//当前数据
|
||||
private int currentValue;
|
||||
//最大数据
|
||||
private int maxValue = 240;
|
||||
private final int maxValue = 240;
|
||||
//圆弧背景的开始和结束间的夹角大小
|
||||
private float mAngle = 270;
|
||||
private final float mAngle = 270;
|
||||
//上次绘制圆弧夹角
|
||||
private float lastAngle = 0;
|
||||
|
||||
@@ -73,13 +73,13 @@ public class SpeedChartView extends View {
|
||||
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
|
||||
//绘制中心的数值
|
||||
mTextPaint.getTextBounds(mValue, 0, mValue.length(), mRect);
|
||||
canvas.drawText(mValue, getWidth() / 2, getHeight() / 2 + mRect.height() / 2 - 10, mTextPaint);
|
||||
canvas.drawText(mValue, getWidth() / 2.0f, getHeight() / 2.0f + mRect.height() / 2.0f - 10, mTextPaint);
|
||||
|
||||
mTextPaint.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
|
||||
//绘制中心文字描述
|
||||
mTextPaint.setTextSize(getResources().getDimension(R.dimen.module_ext_arcView_des_text_size));
|
||||
mTextPaint.getTextBounds(mDes, 0, mDes.length(), mRect);
|
||||
canvas.drawText(mDes, getWidth() / 2, getHeight() * 17 / 20 + mRect.height() / 2, mTextPaint);
|
||||
canvas.drawText(mDes, getWidth() / 2.0f, getHeight() * 17.0f / 20.0f + mRect.height() / 2.0f, mTextPaint);
|
||||
}
|
||||
|
||||
private void drawArc(Canvas canvas) {
|
||||
|
||||
@@ -27,6 +27,7 @@ public class RouteOverlayDrawer {
|
||||
private Handler mRenderHandler;
|
||||
private final IMoGoOverlayManager mogoOverlayManager;
|
||||
private static volatile RouteOverlayDrawer sInstance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
private Polyline.Options mPolylineOptions;
|
||||
private static final int COLOR_LIGHT = Color.parseColor("#BAEBF5");
|
||||
|
||||
@@ -55,7 +56,7 @@ public class RouteOverlayDrawer {
|
||||
|
||||
public static RouteOverlayDrawer getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (RouteOverlayDrawer.class) {
|
||||
synchronized (obj) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new RouteOverlayDrawer();
|
||||
}
|
||||
|
||||
@@ -142,11 +142,7 @@ public class CarOverlay {
|
||||
|
||||
if (directionMarker == null) {
|
||||
directionMarker = aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f).setFlat(true).icon(fourCornersDescriptor).position(mLatLng));
|
||||
if (isDirectionVisible) {
|
||||
directionMarker.setVisible(true);
|
||||
} else {
|
||||
directionMarker.setVisible(false);
|
||||
}
|
||||
directionMarker.setVisible(isDirectionVisible);
|
||||
}
|
||||
carMarker.setVisible(true);
|
||||
newAngle = bearing;
|
||||
@@ -269,7 +265,7 @@ public class CarOverlay {
|
||||
}
|
||||
try {
|
||||
IPoint p = carMarker.getGeoPoint();
|
||||
double newX = 0, newY = 0;
|
||||
double newX, newY;
|
||||
if (currentFrameIndex++ < carMoveAnimationFrameNum) {
|
||||
newX = mapAnchorBackup.x + dXOffStep * currentFrameIndex;
|
||||
newY = mapAnchorBackup.y + dYOffStep * currentFrameIndex;
|
||||
|
||||
Reference in New Issue
Block a user