Merge branch 'dev' into demo/shunyi_v2v_merge
# Conflicts: # app/src/main/java/com/mogo/launcher/MogoApplication.java # config.gradle # foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java # modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml # modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml # modules/mogo-module-extensions/src/main/res/values/dimens.xml # modules/mogo-module-media/src/main/java/com/mogo/module/media/window/MediaWindow2.java # modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help.xml # modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml # modules/mogo-module-v2x/src/main/res/values/dimens.xml # services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java # services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java # upload.sh
This commit is contained in:
@@ -30,8 +30,9 @@ import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.share.IMogoShareManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.service.tanlu.IMogoTanluProvider;
|
||||
import com.mogo.service.share.IMogoTanluProvider;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.service.windowview.IMogoWindowManager;
|
||||
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
@@ -76,6 +77,7 @@ public class V2XServiceManager {
|
||||
private static IMogoADASController mIMogoADASController;
|
||||
private static IMogoIntentManager mMogoIntentManager;
|
||||
private static IMogoEntranceButtonController mMogoEntranceButtonController;
|
||||
private static IMogoOnlineCarListPanelProvider mMogoOnlineCarListPanelProvider;
|
||||
|
||||
private static V2XRefreshModel mV2XRefreshModel;
|
||||
private static V2XMarkerService mV2XMarkerService;
|
||||
@@ -113,6 +115,7 @@ public class V2XServiceManager {
|
||||
mIMogoMarkerService = mMogoServiceApis.getMarkerService();
|
||||
mIMogoShareManager = mMogoServiceApis.getShareManager();
|
||||
mIMogoTanluProvider = mMogoServiceApis.getTanluApi();
|
||||
mMogoOnlineCarListPanelProvider = mMogoServiceApis.getOnlineCarPanelApi();
|
||||
|
||||
mMarkerManager = mMapService.getMarkerManager(context);
|
||||
mNavi = mMapService.getNavi(context);
|
||||
@@ -265,4 +268,7 @@ public class V2XServiceManager {
|
||||
}
|
||||
|
||||
|
||||
public static IMogoOnlineCarListPanelProvider getMogoOnlineCarListPanelProvider() {
|
||||
return mMogoOnlineCarListPanelProvider;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.module.common.view.CustomRatingBar;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.entity.panel.V2XShareEventDescription;
|
||||
import com.mogo.module.v2x.entity.panel.V2XShareEventItem;
|
||||
@@ -90,7 +91,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (likeNum != null) {
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(likeNum);
|
||||
}
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating((float) enthusiasmIndex);
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating((float) 2.5);
|
||||
}
|
||||
}
|
||||
} else if (holder instanceof shareItemViewHolder) {
|
||||
@@ -171,7 +172,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
class shareDescriptionViewHolder extends RecyclerView.ViewHolder {
|
||||
private TextView shareNumTextView;
|
||||
private TextView approveNumTextView;
|
||||
private RatingBar ratingBar;
|
||||
private CustomRatingBar ratingBar;
|
||||
|
||||
public shareDescriptionViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.v2x.adapter.holder;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -48,9 +49,11 @@ 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> {
|
||||
private static final String TAG = "V2XRoadEventVH";
|
||||
private MogoImageView ivEventImg;
|
||||
private MogoImageView ivReportHead;
|
||||
private ImageView ivEventPlay;
|
||||
@@ -109,6 +112,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,12 +156,23 @@ 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
|
||||
public void onViewDetachedFromWindow(View v) {
|
||||
// Logger.w(MODULE_NAME, "列表View V2XRoadEventDetailVH 触发 onViewDetachedFromWindow");
|
||||
Log.d(TAG,"onViewDetachedFromWindow unRegister");
|
||||
// 反注册语音交互
|
||||
V2XVoiceManager.INSTANCE
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_CHATTING)
|
||||
.unRegisterWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_ZAN)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_ZAN_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_TRUE)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_FEEDBACK_ERROR)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_CAR_INFO_UN_WAKEUP);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -239,6 +260,10 @@ public class V2XRoadEventVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
ivEventZan.setOnClickListener(v -> {
|
||||
triggerZan(mNoveltyInfo);
|
||||
});
|
||||
|
||||
ivReportHead.setOnClickListener(v -> {
|
||||
triggerIVReportHead(mNoveltyInfo);
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -53,9 +53,16 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
private val mV2XShareEventsFragment = V2XShareEventsFragment()
|
||||
|
||||
companion object {
|
||||
private val fragment = V2XEventPanelFragment()
|
||||
private var fragment: V2XEventPanelFragment? = null
|
||||
fun getInstance(): V2XEventPanelFragment {
|
||||
return fragment
|
||||
if (fragment == null) {
|
||||
synchronized(this) {
|
||||
if (fragment == null) {
|
||||
fragment = V2XEventPanelFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
return fragment as V2XEventPanelFragment
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +187,8 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
|
||||
override fun onDestroyView() {
|
||||
mediator?.detach()
|
||||
// 避免内存泄漏
|
||||
fragment = null
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.mogo.module.v2x.network.V2XRefreshCallback;
|
||||
import com.mogo.module.v2x.network.V2XShareNetworkModel;
|
||||
import com.mogo.module.v2x.presenter.ShareEventsPresenter;
|
||||
import com.mogo.module.v2x.utils.ThreadUtils;
|
||||
import com.mogo.module.v2x.view.V2XNetworkLoadingView;
|
||||
import com.mogo.module.common.view.NetworkLoadingView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
|
||||
private V2XShareNetworkModel v2XShareNetworkModel;
|
||||
|
||||
//动画
|
||||
private V2XNetworkLoadingView loadingView;
|
||||
private NetworkLoadingView loadingView;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -182,9 +182,13 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
|
||||
|
||||
private void animatioonAcction(int visible) {
|
||||
if (visible == View.VISIBLE) {
|
||||
loadingView.start();
|
||||
if (loadingView != null) {
|
||||
loadingView.start();
|
||||
}
|
||||
} else {
|
||||
loadingView.stop();
|
||||
if (loadingView != null) {
|
||||
loadingView.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -39,11 +38,9 @@ import com.mogo.module.v2x.adapter.V2XSurroundingAdapter;
|
||||
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
|
||||
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
|
||||
import com.mogo.module.v2x.presenter.SurroundingEventPresenter;
|
||||
import com.mogo.module.v2x.utils.animation.AnimationResources;
|
||||
import com.mogo.module.v2x.utils.animation.V2XAnimationManager;
|
||||
import com.mogo.module.v2x.view.SurroundingEventView;
|
||||
import com.mogo.module.common.view.NetworkLoadingView;
|
||||
import com.mogo.module.v2x.view.SurroundingMarginDecoration;
|
||||
import com.mogo.module.v2x.view.V2XNetworkLoadingView;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
@@ -75,7 +72,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
|
||||
private SurroundingEventPresenter surroundingEventPresenter;
|
||||
private List<SurroundingConstruction> poiInfosList = new ArrayList<>();
|
||||
private IMogoServiceApis mApis;
|
||||
private V2XNetworkLoadingView mloadingImage;
|
||||
private NetworkLoadingView mloadingImage;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -109,8 +106,9 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
|
||||
// mRecyclerView.setHasFixedSize(true);
|
||||
mRecyclerView.setOverScrollMode(OVER_SCROLL_NEVER);
|
||||
GridLayoutManager layoutManage = new GridLayoutManager(getContext(), 2);
|
||||
// int spacingInPixels = getContext().getResources().getDimensionPixelSize(R.dimen.module_v2x_surrounding_item_bottom_right_textsize);
|
||||
// mRecyclerView.addItemDecoration(new SurroundingMarginDecoration(spacingInPixels));
|
||||
int spacingInPixels = getContext().getResources().getDimensionPixelSize(R.dimen.module_v2x_surrounding_item_bottom_right_textsize);
|
||||
int spacingInPixelsLeft = getContext().getResources().getDimensionPixelSize(R.dimen.module_v2x_surrounding_item_maigin_left);
|
||||
mRecyclerView.addItemDecoration(new SurroundingMarginDecoration(spacingInPixels, spacingInPixelsLeft));
|
||||
mRecyclerView.setLayoutManager(layoutManage);
|
||||
|
||||
mAdapter = new V2XSurroundingAdapter(getActivity(), poiInfosList, this);
|
||||
|
||||
@@ -5,8 +5,6 @@ import android.content.Intent;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.service.carinfo.CarStateInfo;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.scenario.IV2XScenarioManager;
|
||||
@@ -64,6 +62,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
// 提取之前存储的场景
|
||||
if (v2XMessageEntity != null) {
|
||||
|
||||
|
||||
// 广播给应用内部其它模块
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
@@ -109,6 +108,9 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
|
||||
// 展示最新的消息
|
||||
if (mV2XScenario != null) {
|
||||
if (v2XMessageEntity.getType() != V2XMessageEntity.V2XTypeEnum.ALERT_CAR_FOR_HELP) {
|
||||
hidOtherPanel();
|
||||
}
|
||||
mV2XScenario.init(v2XMessageEntity);
|
||||
mV2XScenarioSet.put(v2XMessageEntity.getType(), mV2XScenario);
|
||||
}
|
||||
@@ -116,4 +118,13 @@ public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void hidOtherPanel() {
|
||||
try {
|
||||
// 与其它面板互斥
|
||||
V2XServiceManager.getMogoOnlineCarListPanelProvider().hidePanel();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,8 @@ package com.mogo.module.v2x.scenario.scene.road;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
@@ -15,8 +13,6 @@ import com.mogo.module.v2x.scenario.scene.livecar.V2XRoadLiveCarScenario;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.utils.ADASUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.service.tanlu.IMogoTanluProvider;
|
||||
import com.mogo.service.tanlu.TanluUploadParams;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
@@ -92,12 +88,18 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
public void show() {
|
||||
try {
|
||||
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
|
||||
// 设置TTS
|
||||
getV2XMessageEntity().getContent().getTts(false);
|
||||
// 广播给ADAS
|
||||
ADASUtils.broadcastToADAS(
|
||||
V2XServiceManager.getContext(),
|
||||
getV2XMessageEntity().getContent());
|
||||
//只展示不播报 不广播
|
||||
|
||||
boolean onlyShow = getV2XMessageEntity().isOnlyShow();
|
||||
|
||||
if (onlyShow == false){
|
||||
// 设置TTS
|
||||
getV2XMessageEntity().getContent().getTts(false);
|
||||
// 广播给ADASzzz
|
||||
ADASUtils.broadcastToADAS(
|
||||
V2XServiceManager.getContext(),
|
||||
getV2XMessageEntity().getContent());
|
||||
}
|
||||
|
||||
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
|
||||
getV2XMessageEntity().getContent().getNoveltyInfo());
|
||||
@@ -204,7 +206,9 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
public void onViewAdded(View view) {
|
||||
Logger.d(MODULE_NAME, "展示 Window 动画结束");
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
drawPOI();
|
||||
if (getV2XMessageEntity() != null && getV2XMessageEntity().isNeedAddLine() == true){
|
||||
drawPOI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,12 @@ import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.module.v2x.utils.TestOnLineCarUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.zhidao.carchattingprovider.MogoDriverInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static android.text.style.TtsSpan.GENDER_MALE;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
@@ -45,6 +48,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
private Button mBtnTriggerFatigueDrivingEvent;
|
||||
private Button mBtnTriggerSeekHelpEvent;
|
||||
private Button mBtnTriggerParkEvent;
|
||||
private Button mBtnTriggerCallUserInfo;
|
||||
|
||||
public static V2XTestConsoleWindow getInstance(Context context) {
|
||||
if (mV2XTestConsoleWindow == null) {
|
||||
@@ -83,6 +87,17 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
mBtnTriggerFatigueDrivingEvent = findViewById(R.id.btnTriggerFatigueDrivingEvent);
|
||||
mBtnTriggerSeekHelpEvent = findViewById(R.id.btnTriggerSeekHelpEvent);
|
||||
mBtnTriggerParkEvent = findViewById(R.id.btnTriggerParkEvent);
|
||||
mBtnTriggerCallUserInfo = findViewById(R.id.btnTriggerCallUserInfo);
|
||||
|
||||
mBtnTriggerCallUserInfo.setOnClickListener(v -> {
|
||||
MogoDriverInfo mogoDriverInfo = new MogoDriverInfo();
|
||||
mogoDriverInfo.setAge(24);
|
||||
mogoDriverInfo.setGender(GENDER_MALE);
|
||||
mogoDriverInfo.setSn("12345678");
|
||||
mogoDriverInfo.setUserName("测试");
|
||||
mogoDriverInfo.setUserHead("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1600872867592&di=994e371880ca6ae2814f553e0d0e4139&imgtype=0&src=http%3A%2F%2Fp3.ssl.cdn.btime.com%2Ft014c5d8a1e5cef12ba.jpg%3Fsize%3D506x543");
|
||||
V2XServiceManager.getCarsChattingProvider().showUserWindow("CAR_CALL_USER_TO_" + V2XConst.MODULE_NAME,mogoDriverInfo,context);
|
||||
});
|
||||
|
||||
mBtnTriggerOpen.setOnClickListener(v ->
|
||||
V2XServiceManager
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.module.v2x.utils.animation;
|
||||
|
||||
interface Animation {
|
||||
|
||||
void start();
|
||||
|
||||
void stop();
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.mogo.module.v2x.utils.animation;
|
||||
|
||||
|
||||
import com.mogo.module.v2x.R;
|
||||
|
||||
public class AnimationResources {
|
||||
public static final int loadingRes[] = {
|
||||
// R.drawable.v_to_x_loading_car0000,
|
||||
// R.drawable.v_to_x_loading_car0002,
|
||||
// R.drawable.v_to_x_loading_car0004,
|
||||
// R.drawable.v_to_x_loading_car0006,
|
||||
// R.drawable.v_to_x_loading_car0008,
|
||||
// R.drawable.v_to_x_loading_car0010,
|
||||
// R.drawable.v_to_x_loading_car0012,
|
||||
// R.drawable.v_to_x_loading_car0014,
|
||||
// R.drawable.v_to_x_loading_car0016,
|
||||
// R.drawable.v_to_x_loading_car0018,
|
||||
// R.drawable.v_to_x_loading_car0020,
|
||||
// R.drawable.v_to_x_loading_car0022,
|
||||
// R.drawable.v_to_x_loading_car0024,
|
||||
// R.drawable.v_to_x_loading_car0025,
|
||||
// R.drawable.v_to_x_loading_car0027,
|
||||
// R.drawable.v_to_x_loading_car0029,
|
||||
// R.drawable.v_to_x_loading_car0031,
|
||||
// R.drawable.v_to_x_loading_car0033,
|
||||
// R.drawable.v_to_x_loading_car0035,
|
||||
// R.drawable.v_to_x_loading_car0037,
|
||||
// R.drawable.v_to_x_loading_car0039,
|
||||
// R.drawable.v_to_x_loading_car0041,
|
||||
// R.drawable.v_to_x_loading_car0043,
|
||||
// R.drawable.v_to_x_loading_car0045,
|
||||
// R.drawable.v_to_x_loading_car0047,
|
||||
// R.drawable.v_to_x_loading_car0048,
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.module.v2x.utils.animation;
|
||||
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
|
||||
public class DelegateDrawable implements Animation {
|
||||
|
||||
private AnimationDrawable drawable;
|
||||
|
||||
public DelegateDrawable(AnimationDrawable drawable) {
|
||||
this.drawable = drawable;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
if (drawable != null) {
|
||||
drawable.start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (drawable != null) {
|
||||
drawable.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.mogo.module.v2x.utils.animation;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
public class V2XAnimationManager implements Animation {
|
||||
|
||||
private static final String TAG = "V2XAnimationManager";
|
||||
private ProgressBar targetImageView;
|
||||
private boolean isStarted = false;
|
||||
|
||||
private int mStartIndex = 0;
|
||||
|
||||
private final static int MSG_LOOP = 3004;
|
||||
private long INTERVAL = 100L;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
switch (msg.what) {
|
||||
case MSG_LOOP:
|
||||
if (isStarted) {
|
||||
// targetImageView.setImageResource( AnimationResources.loadingRes[mStartIndex++ % AnimationResources.loadingRes.length] );
|
||||
mHandler.sendEmptyMessageDelayed(MSG_LOOP, INTERVAL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void animationWithTarget(ProgressBar imageView, int[] resources, int duration) {
|
||||
targetImageView = imageView;
|
||||
INTERVAL = duration;
|
||||
start();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
synchronized public void start() {
|
||||
isStarted = true;
|
||||
mHandler.sendEmptyMessage(MSG_LOOP);
|
||||
if (targetImageView != null) {
|
||||
targetImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
synchronized public void stop() {
|
||||
isStarted = false;
|
||||
mHandler.removeMessages(MSG_LOOP);
|
||||
if (targetImageView != null) {
|
||||
targetImageView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void soptWithError() {
|
||||
stop();
|
||||
if (targetImageView != null) {
|
||||
targetImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void release() {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
@@ -12,20 +12,24 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
*/
|
||||
public class SurroundingMarginDecoration extends RecyclerView.ItemDecoration {
|
||||
private int margin ;
|
||||
private int marginLeft ;
|
||||
|
||||
public SurroundingMarginDecoration(int space) {
|
||||
public SurroundingMarginDecoration(int space, int left) {
|
||||
margin = space;
|
||||
marginLeft = left;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
||||
outRect.bottom = margin;
|
||||
outRect.right = 0;
|
||||
//由于每行都只有2个,所以第一个都是2的倍数,把左边距设为0
|
||||
|
||||
//由于每行都只有2个,所以第一个都是2的倍数
|
||||
if (parent.getChildLayoutPosition(view) % 2 == 0) {
|
||||
outRect.left = 0;
|
||||
outRect.left = marginLeft;
|
||||
outRect.right = margin / 2;
|
||||
} else {
|
||||
outRect.left = margin;
|
||||
outRect.left = margin / 2;
|
||||
outRect.right = marginLeft;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
package com.mogo.module.v2x.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.utils.animation.AnimationResources;
|
||||
import com.mogo.module.v2x.utils.animation.V2XAnimationManager;
|
||||
|
||||
public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
|
||||
private ProgressBar loadView;
|
||||
private TextView textView;
|
||||
private V2XAnimationManager v2XAnimationManager;
|
||||
public Button refresButton;
|
||||
private String loadingText = "正在获取信息…";
|
||||
|
||||
public V2XNetworkLoadingView(Context context) {
|
||||
|
||||
super(context);
|
||||
}
|
||||
|
||||
public V2XNetworkLoadingView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
LayoutInflater.from(context).inflate(R.layout.v2x_network_loading_item, this);
|
||||
initView();
|
||||
/*
|
||||
添加动画图片资源
|
||||
* */
|
||||
setLoadingImage(AnimationResources.loadingRes);
|
||||
}
|
||||
|
||||
public V2XNetworkLoadingView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
v2XAnimationManager = new V2XAnimationManager();
|
||||
loadView = findViewById(R.id.loading_imageview);
|
||||
textView = findViewById(R.id.loading_text);
|
||||
refresButton = findViewById(R.id.refresh_button);
|
||||
}
|
||||
|
||||
public void setLoadingText(String text) {
|
||||
if (textView != null) {
|
||||
textView.setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
public void setLoadingImage(int[] resources) {
|
||||
v2XAnimationManager.animationWithTarget(loadView, resources, 100);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (v2XAnimationManager != null) {
|
||||
v2XAnimationManager.start();
|
||||
this.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (refresButton != null) {
|
||||
refresButton.setVisibility(GONE);
|
||||
}
|
||||
if (textView != null) {
|
||||
textView.setText(loadingText);
|
||||
}
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
if (v2XAnimationManager != null) {
|
||||
v2XAnimationManager.stop();
|
||||
this.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void stopWithError(String errormsg, int showRefreshButton) {
|
||||
if (v2XAnimationManager != null) {
|
||||
v2XAnimationManager.soptWithError();
|
||||
}
|
||||
if (textView != null) {
|
||||
textView.setText(errormsg);
|
||||
}
|
||||
if (refresButton != null) {
|
||||
refresButton.setVisibility(showRefreshButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -248,6 +248,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);
|
||||
@@ -274,6 +280,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);
|
||||
|
||||
//2020-6-24 顺义演示需求添加,现合并至launcher 更新时间:2020-08-25
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_CALL_FRONT_CAR_DEMO_UN_WAKEUP, COMMAND_ZHIDAO_V2X_CALL_FRONT_CAR_DEMO_UN_WAKEUP_WORDS);
|
||||
|
||||
Reference in New Issue
Block a user