This commit is contained in:
unknown
2020-11-09 11:11:18 +08:00
14 changed files with 169 additions and 110 deletions

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -26,7 +26,7 @@ class AutoNaviBroadcastIntentHandler implements IMogoIntentListener {
manager.registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, this );
}
public void unregister(IMogoIntentManager manager ) {
public void unregister( IMogoIntentManager manager ) {
mCallback = null;
manager.unregisterIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, this );
}
@@ -68,6 +68,9 @@ class AutoNaviBroadcastIntentHandler implements IMogoIntentListener {
}
}
} else if ( keyType == 10048 ) {
if ( !intent.getBooleanExtra( "callback", true ) ) {
return;
}
//0自动; 1白天; 2黑夜;
int dayNightMode = intent.getIntExtra( "EXTRA_DAY_NIGHT_MODE", -1 );
if ( dayNightMode == 0 ) {

View File

@@ -1,5 +1,9 @@
package com.mogo.module.map;
import android.content.Context;
import android.content.Intent;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.utils.logger.Logger;
@@ -52,6 +56,7 @@ class MapControlCommandHandler {
case VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP:
case VoiceConstants.CMD_MAP_DAY_TIME_MODE:
mCallback.onDayNightModeChanged( EnumMapUI.Type_Light );
notifyAMap(EnumMapUI.Type_Light);
break;
case VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP:
case VoiceConstants.CMD_MAP_HISTORY:
@@ -63,10 +68,12 @@ class MapControlCommandHandler {
case VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP:
case VoiceConstants.CMD_MAP_NIGHT_MODE:
mCallback.onDayNightModeChanged( EnumMapUI.Type_Night );
notifyAMap(EnumMapUI.Type_Night);
break;
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP:
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
mCallback.onDayNightModeChanged( EnumMapUI.Type_AUTO_LIGHT_Night );
notifyAMap(EnumMapUI.Type_AUTO_LIGHT_Night);
break;
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
mCallback.onDisplayOverview();
@@ -91,4 +98,32 @@ class MapControlCommandHandler {
}
}
private void notifyAMap( EnumMapUI ui ) {
if ( ui == null ) {
return;
}
int KEY_TYPE = 10048;
int state = 0;//2黑夜;1白天 ;0自动
switch ( ui ) {
case Type_Light:
state = 1;
break;
case Type_Night:
state = 2;
break;
case Type_AUTO_LIGHT_Night:
state = 0;
break;
}
Intent intent = new Intent();
intent.setAction( "AUTONAVI_STANDARD_BROADCAST_RECV" );
intent.putExtra( "KEY_TYPE", KEY_TYPE );
intent.setFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
// 避免在内部再次调用
intent.putExtra( "callback", false );
intent.putExtra( "EXTRA_DAY_NIGHT_MODE", state );
AbsMogoApplication.getApp().sendBroadcast( intent );
}
}

View File

@@ -160,13 +160,13 @@ class LauncherCardRefresher {
private ZhidaoRefreshModel mZhidaoRefreshModel;
private LauncherCardRefreshStrategy mExplorerWayOrOnlineCarDataStrategy = new LauncherCardRefreshStrategy(
40 * ONE_MINUTE, null, MSG_EXPLORER_WAY_OR_ONLINE_CAR_DATA
1 * ONE_MINUTE, null, MSG_EXPLORER_WAY_OR_ONLINE_CAR_DATA
);
private LauncherCardRefreshStrategy mInduceStrategy = new LauncherCardRefreshStrategy(
18 * ONE_MINUTE, mExplorerWayOrOnlineCarDataStrategy, MSG_INDUCE
);
private LauncherCardRefreshStrategy mLauncherCardConfigStrategy = new LauncherCardRefreshStrategy(
2 * ONE_MINUTE, mExplorerWayOrOnlineCarDataStrategy, MSG_REFRESH_DEFAULT_CARD
1 * ONE_MINUTE, mExplorerWayOrOnlineCarDataStrategy, MSG_REFRESH_DEFAULT_CARD
);
private LauncherCardRefreshStrategy mRefreshStrategy = mLauncherCardConfigStrategy;
@@ -190,7 +190,6 @@ class LauncherCardRefresher {
}
mHandler.sendEmptyMessageDelayed( MSG_LOAD_NET_CONFIG, delay );
startInduceStrategy();
SharedPrefsMgr.getInstance( mContext ).putLong( KEY_LauncherCardTipLastTipTime, System.currentTimeMillis() );
}
/**
@@ -218,6 +217,9 @@ class LauncherCardRefresher {
if ( !mStart ) {
return;
}
if ( mRefreshStrategy == null ) {
return;
}
mRefreshStop = false;
mHandler.removeMessages( mRefreshStrategy.getMsgType() );
mHandler.sendEmptyMessageDelayed( mRefreshStrategy.getMsgType(), mRefreshStrategy.getInterval() );
@@ -238,7 +240,9 @@ class LauncherCardRefresher {
}
private void startNextRefreshStrategy() {
mRefreshStrategy = mRefreshStrategy.getNext();
if ( mRefreshStrategy != null ) {
mRefreshStrategy = mRefreshStrategy.getNext();
}
restart();
}
@@ -394,12 +398,8 @@ class LauncherCardRefresher {
return;
}
if ( mDefaultConfigCounter++ >= 1 ) {
return;
}
int counter = SharedPrefsMgr.getInstance( mContext ).getInt( KEY_LauncherCardTipCounter, 0 );
if ( counter >= 5 ) {
if ( counter >= 1 ) {
long lastTipTime = SharedPrefsMgr.getInstance( mContext ).getLong( KEY_LauncherCardTipLastTipTime, 0L );
if ( System.currentTimeMillis() - lastTipTime < 7 * ONE_DAY ) {
return;
@@ -417,6 +417,9 @@ class LauncherCardRefresher {
} catch ( Exception e ) {
e.printStackTrace();
}
if ( mDefaultConfigCounter++ >= 1 ) {
return;
}
startLoopDefaultConfigStrategy();
}

View File

@@ -290,7 +290,11 @@ public class TanluManager implements IMogoMarkerClickListener,
@Override
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
if (mKeywords.equals("附近")) {
speakFailVoice("未发现附近的特殊路况");
} else {
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
}
moveToMarcker(currentLat, currentLon);
return;
}
@@ -307,7 +311,11 @@ public class TanluManager implements IMogoMarkerClickListener,
public void onQueryRoadInfoFail(@NotNull String msg, int code) {
Logger.e(TAG, "onQueryRoadInfoFail ----- msg = " + msg);
// speakFailVoice(searchfaileVoiceStrings[1]);
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
if (mKeywords.equals("附近")) {
speakFailVoice("未发现附近的特殊路况");
} else {
speakFailVoice("未发现" + mKeywords + "附近的特殊路况");
}
moveToMarcker(currentLat, currentLon);
}

View File

@@ -39,6 +39,7 @@ object UploadHelper {
// }
// } else {
if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
Logger.d("UploadHelper", "upload is going -- ")
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
} else {
@@ -59,6 +60,7 @@ object UploadHelper {
} else {
// 没网就直接提示失败
Logger.e("UploadHelper", "upload not net ")
AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络")
TipToast.tip("分享失败,请检查网络", TipDrawable(context.resources.getDrawable(R.drawable.module_share_upload_fail)))
}
@@ -72,7 +74,6 @@ object UploadHelper {
if (shareItemSum < VOICE_ALERT_COUNT) {
Log.d("UploadHelper", "shareItemSum = $shareItemSum --- intervalTime = $intervalTime --type = ${type}")
var time = System.currentTimeMillis()
Log.d("UploadHelper", "time = $time ")
if (intervalTime == 0.toLong()) {
SharedPrefsMgr.getInstance(context).putLong(KEY_CLICK_SHARE_ITEM_TIME, time)
SharedPrefsMgr.getInstance(context).putInt(KEY_CLICK_SHARE_ITEM_BUTTON, ++shareItemSum)

View File

@@ -126,6 +126,8 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
} else {
// 记录行进距离
tripDistance += com.mogo.module.service.Utils.calculateLineDistance(lastLon, lastLat, lon, lat).toInt()
lastLon = lon
lastLat = lat
val current = SystemClock.uptimeMillis()
if (startRecordDistanceTime == 0L) {
startRecordDistanceTime = current
@@ -154,7 +156,9 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
* 没有有效前车距离或者前车距离小于5m
*/
private fun isClose(): Boolean {
return frontDistance in 1..4 || frontDistance == -1
val r = (frontDistance in 1..4) || (frontDistance == -1)
Logger.d(TAG,"r: $r")
return r
}
private fun uploadAverageSpeed(average: Float) {

View File

@@ -191,25 +191,26 @@ public class V2XCarForHelpScenario extends AbsV2XScenario<Boolean> implements IM
if (v2xFaultHelpDialog == null) {
v2xFaultHelpDialog = new V2XSeekHelpDialog(V2XServiceManager.getContext());
}
v2xFaultHelpDialog.setOnClickListener(new V2XSeekHelpDialog.OnClickListener() {
@Override
public void onClickLeft() {
//放弃求助
/* if (V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
V2XServiceManager.getMoGoStatusManager().setSeekHelping(TAG, false);
}*/
closeButton();
v2xFaultHelpDialog.dismiss();
}
@Override
public void onClickRight() {
//继续求助
v2xFaultHelpDialog.dismiss();
}
});
v2xFaultHelpDialog.show();
// v2xFaultHelpDialog.setOnClickListener(new V2XSeekHelpDialog.OnClickListener() {
// @Override
// public void onClickLeft() {
// //放弃求助
// /* if (V2XServiceManager.getMoGoStatusManager().isSeekHelping()) {
// V2XServiceManager.getMoGoStatusManager().setSeekHelping(TAG, false);
// }*/
// closeButton();
// v2xFaultHelpDialog.dismiss();
// }
//
// @Override
// public void onClickRight() {
// //继续求助
// v2xFaultHelpDialog.dismiss();
//
// }
// });
// v2xFaultHelpDialog.show();
closeButton();
}

View File

@@ -68,7 +68,7 @@ public class V2XSeekHelpButton implements IV2XButton {
@Override
public void close() {
if (tv != null) {
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("将为您取消", null);
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("取消", null);
tv.setVisibility(View.GONE);
V2XServiceManager.getV2XRefreshModel().cancelHelpSignal(new V2XRefreshCallback<BaseData>() {
@Override

View File

@@ -84,15 +84,18 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
public void show() {
try {
Logger.d(TAG, "使用windowManager实现");
if ( windowManager == null ) {
windowManager = new WindowManagerView.Builder(
V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2).getContext()
).contentView(this).build();
}
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
unRegisterVoiceCmd();
registerVoiceCmd();
windowManager.show();
// if ( windowManager == null ) {
// windowManager = new WindowManagerView.Builder(
// V2XServiceManager.getMogoEntranceButtonController().getButton(ButtonIndex.BUTTON2).getContext()
// ).contentView(this).build();
// }
// AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("确定要解除求助状态吗");
// unRegisterVoiceCmd();
// registerVoiceCmd();
// windowManager.show();
handleLeft();
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("已取消");
} catch (Exception e) {
e.printStackTrace();
}
@@ -120,7 +123,7 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
if (mListener != null) {
mListener.onClickLeft();
}
unRegisterVoiceCmd();
// unRegisterVoiceCmd();
}
//继续求助
@@ -128,7 +131,7 @@ public class V2XSeekHelpDialog extends ConstraintLayout implements View.OnClickL
if (mListener != null) {
mListener.onClickRight();
}
unRegisterVoiceCmd();
// unRegisterVoiceCmd();
}
private void registerVoiceCmd() {

View File

@@ -18,7 +18,7 @@ import com.mogo.module.v2x.R;
*
* @author donghongyu
*/
public class HeartLikeView extends LinearLayout {
public class HeartLikeView extends LinearLayout implements Animator.AnimatorListener {
private ImageView mIllegalParkingLike;
private AnimatorSet mAnimatorSet;
@@ -46,36 +46,36 @@ public class HeartLikeView extends LinearLayout {
mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(),
R.anim.v2x_like_heart_animation);
mAnimatorSet.setTarget(mIllegalParkingLike);
mAnimatorSet.addListener(this);
}
mAnimatorSet.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
isAnimator = false;
if (mOnClickCallListener != null) {
mOnClickCallListener.onClicked(HeartLikeView.this);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
mAnimatorSet.start();
}
});
}
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
isAnimator = false;
if (mOnClickCallListener != null) {
mOnClickCallListener.onClicked(HeartLikeView.this);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
public interface OnClickCallListener {
/**
* 点击回调

View File

@@ -18,7 +18,7 @@ import com.mogo.module.v2x.R;
*
* @author donghongyu
*/
public class HeartUnLikeView extends LinearLayout {
public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorListener {
private ImageView mIllegalParkingUnLike;
private AnimatorSet mAnimatorSet;
@@ -46,36 +46,36 @@ public class HeartUnLikeView extends LinearLayout {
mAnimatorSet = (AnimatorSet) AnimatorInflater.loadAnimator(getContext(),
R.anim.v2x_unlike_heart_animation);
mAnimatorSet.setTarget(mIllegalParkingUnLike);
mAnimatorSet.addListener(this);
}
mAnimatorSet.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
isAnimator = false;
if (mOnClickCallListener != null) {
mOnClickCallListener.onClicked(HeartUnLikeView.this);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
mAnimatorSet.start();
}
});
}
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
isAnimator = false;
if (mOnClickCallListener != null) {
mOnClickCallListener.onClicked(HeartUnLikeView.this);
}
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
public interface OnClickCallListener {
/**
* 点击回调

View File

@@ -83,12 +83,12 @@ class SimpleCoverVideoPlayer : StandardGSYVideoPlayer {
}
override fun updateStartImage() {
// super.updateStartImage()
//
// when (mCurrentState) {
// GSYVideoView.CURRENT_STATE_PAUSE -> start.visibility = View.VISIBLE
// else -> start.visibility = View.INVISIBLE
// }
super.updateStartImage()
when (mCurrentState) {
GSYVideoView.CURRENT_STATE_PAUSE -> start.visibility = View.VISIBLE
else -> start.visibility = View.INVISIBLE
}
}
fun setFullClickListener(listener: OnClickListener) {

View File

@@ -71,13 +71,14 @@
<!--GSYVideoControlView mLoadingProgressBar-->
//加载中圈圈
<ProgressBar
android:id="@+id/loading"
android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateTint="#256BFF"
android:visibility="gone" />
<ProgressBar
android:id="@+id/loading"
android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateTint="#256BFF"
android:visibility="gone" />
</RelativeLayout>