Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangcongtao
2020-09-24 19:30:55 +08:00
7 changed files with 98 additions and 10 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" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -115,7 +115,7 @@ android {
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友
@@ -137,7 +137,7 @@ android {
// 是否使用高德sdk自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否加载引导模块
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'false'
buildConfigField 'boolean', 'LOAD_GUIDE_MODULE', 'true'
// 是否支持换肤
buildConfigField 'boolean', 'IS_SKIN_SUPPORTED', 'true'
// 是否支持查询导航目的地车友

View File

@@ -7,6 +7,7 @@ import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
@@ -426,17 +427,21 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
*/
@Override
public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
}
private void showSlideMapVoiceGuide() {
long intervalTime = SharedPrefsMgr.getInstance(getContext()).getLong(KEY_SHARE_INNER_GUIDE_TIME, 0);
int shareItemSum = SharedPrefsMgr.getInstance(getContext()).getInt(KEY_SHARE_INNER_GUIDE, 0);
if (shareItemSum < VOICE_ALERT_COUNT) {
long time = System.currentTimeMillis();
Logger.d(TAG, " onMapChanged shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + "---time = " + time);
Logger.d(TAG, " showSlideMapVoiceGuide shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + "---time = " + time);
if (intervalTime == 0) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_INNER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_INNER_GUIDE, ++shareItemSum);
AIAssist.getInstance(getContext()).speakTTSVoice(mInnerGuideVoiceStrings[0]);
} else {
Logger.d(TAG, " onMapChanged else interval = " + (time - intervalTime));
Logger.d(TAG, " showSlideMapVoiceGuide else interval = " + (time - intervalTime));
if ((time - intervalTime) > ONE_DAY_TIME) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_INNER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_INNER_GUIDE, ++shareItemSum);
@@ -446,12 +451,30 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
AIAssist.getInstance(getContext()).speakTTSVoice(mInnerGuideVoiceStrings[2]);
}
} else {
Logger.e(TAG, " onMapChanged else < ONE_DAY_TIME ");
Logger.e(TAG, " showSlideMapVoiceGuide else < ONE_DAY_TIME ");
}
}
}
}
@Override
public void onTouch(MotionEvent motionEvent) {
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_UP:
if (motionEvent.getX() > 200) {
showSlideMapVoiceGuide();
}
break;
case MotionEvent.ACTION_MOVE:
break;
}
}
/**
* 由于Launcher和Independent对于天气的表现形式不太一样所以通过此方法区分处理

View File

@@ -1,15 +1,19 @@
package com.mogo.module.v2x.adapter.holder;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoNaviInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.v2x.V2XConst;
@@ -20,6 +24,10 @@ import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
import com.zhidao.carchattingprovider.MogoDriverInfo;
import java.util.HashMap;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
@@ -32,6 +40,9 @@ public abstract class V2XBaseViewHolder<T>
extends RecyclerView.ViewHolder
implements IMogoNaviListener {
private static final String TAG = "V2XBaseViewHolder";
private ICarsChattingProvider mCarsChattingProvider;
public V2XBaseViewHolder(@NonNull View itemView) {
super(itemView);
}
@@ -72,6 +83,28 @@ public abstract class V2XBaseViewHolder<T>
delayedCloseWindow();
}
public void triggerIVReportHead(MarkerExploreWay noveltyInfo) {
Log.d(TAG,"点击头像"+mCarsChattingProvider);
try {
mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
MogoDriverInfo mogoDriverInfo = new MogoDriverInfo();
int ageNumber = noveltyInfo.getUserInfo().getAgeNumber();
mogoDriverInfo.setAge(ageNumber);
String gender = noveltyInfo.getUserInfo().getGender();
mogoDriverInfo.setGender(gender != null ? gender:null);
String sn = noveltyInfo.getUserInfo().getSn();
mogoDriverInfo.setSn(sn != null ? sn:"");
String name = noveltyInfo.getUserInfo().getUserName();
mogoDriverInfo.setUserName(name != null ? name:"");
mogoDriverInfo.setUserHead(noveltyInfo.getUserInfo().getUserHead());
mCarsChattingProvider.showUserWindow(MODULE_NAME, mogoDriverInfo, this.itemView.getContext());
} catch (Exception e) {
Log.d(TAG,"点击头像发生错误--triggerIVReportHead"+e);
e.printStackTrace();
}
}
/**
* 打电话
*/
@@ -160,6 +193,7 @@ public abstract class V2XBaseViewHolder<T>
delayedCloseWindow();
}
/**
* 显示自定义 Toast
*

View File

@@ -54,7 +54,6 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
// 上传事件的用户信息
private MarkerUserInfo mUserInfo = new MarkerUserInfo();
// 语音控制导航
private V2XVoiceCallbackListener mNaviCb = (command, intent) -> triggerStartNavi(mNoveltyInfo);
// 语音控制拨打电话
@@ -66,6 +65,8 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
e.printStackTrace();
}
};
// 查看车辆信息
private V2XVoiceCallbackListener mVoiceOpenCarInfoLis = ((command, intent) -> triggerIVReportHead(mNoveltyInfo));
public V2XOtherSeekHelpVH(ViewGroup viewGroup) {
super(LayoutInflater.from(viewGroup.getContext())
@@ -95,7 +96,9 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING,
mCallChartingCb)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP,
mCallChartingCb);
mCallChartingCb)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP,
mVoiceOpenCarInfoLis);
}
@Override
@@ -106,7 +109,8 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP)
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP);
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP);
}
});
}
@@ -130,6 +134,12 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
} catch (Exception e) {
e.printStackTrace();
}
ivHead.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
triggerIVReportHead(mNoveltyInfo);
}
});
// 只有自研车机才会 有车聊聊通话
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {

View File

@@ -48,6 +48,7 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
* date : 2020/3/11 4:35 PM
* desc : 道路事件详情
* version: 1.0
*
* @author donghongyu
*/
public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
@@ -109,6 +110,13 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
showLiveCar(mV2XEventShowEntity);
}
};
// 查看车辆信息
private V2XVoiceCallbackListener v2xVoiceOpenCarInfoListener = new V2XVoiceCallbackListener() {
@Override
public void onCallback(String command, Intent intent) {
triggerIVReportHead(mNoveltyInfo);
}
};
private void init(View itemView) {
ivEventImg = itemView.findViewById(R.id.ivEventImg);
@@ -146,7 +154,9 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_TRUE,
v2XVoiceCallbackReportTrueListener)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_ERROR,
v2XVoiceCallbackReportErrorListener);
v2XVoiceCallbackReportErrorListener)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP,
v2xVoiceOpenCarInfoListener);
}
@Override
@@ -239,6 +249,10 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
ivEventZan.setOnClickListener(v -> {
triggerZan(mNoveltyInfo);
});
ivReportHead.setOnClickListener(v -> {
triggerIVReportHead(mNoveltyInfo);
});
}
} catch (Exception e) {
e.printStackTrace();

View File

@@ -225,6 +225,12 @@ public class V2XVoiceConstants {
public static final String COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP_WORDS = {"我的分享"};
/*
* 查看车辆信息
* */
public static final String COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP";
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP_UN_WAKEUP_WORDS = {"查看车辆信息"};
static {
// 免唤醒 默认
sVoiceCmds.put(COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP, COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP_WORDS);
@@ -251,6 +257,7 @@ public class V2XVoiceConstants {
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP_WORDS);
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP_WORDS);
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP_WORDS);
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP_UN_WAKEUP_WORDS);
//默认