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

This commit is contained in:
wangcongtao
2020-11-23 17:50:05 +08:00
44 changed files with 211 additions and 197 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_map_amap_my_location_bg_size">370px</dimen>
<dimen name="module_map_amap_my_location_icon_width">78px</dimen>
<dimen name="module_map_amap_my_location_icon_height">120px</dimen>
<dimen name="module_map_amap_my_location_bg_size">360px</dimen>
<dimen name="module_map_amap_my_location_icon_width">63px</dimen>
<dimen name="module_map_amap_my_location_icon_height">96px</dimen>
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="path_width">60px</dimen>
<dimen name="module_map_amap_my_location_icon_width">33px</dimen>
<dimen name="module_map_amap_my_location_icon_height">50px</dimen>
<dimen name="module_map_amap_my_location_bg_size">146px</dimen>
<dimen name="module_map_amap_my_location_icon_width">36px</dimen>
<dimen name="module_map_amap_my_location_icon_height">53px</dimen>
<dimen name="module_map_amap_my_location_bg_size">194px</dimen>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -5,7 +5,7 @@
android:id="@+id/module_map_amap_my_location_bg_iv"
android:layout_width="@dimen/module_map_amap_my_location_bg_size"
android:layout_height="@dimen/module_map_amap_my_location_bg_size"
android:src="@drawable/map_api_ic_current_location2"/>
android:src="@drawable/module_common_my_location_bg"/>
<ImageView
android:id="@+id/module_map_amap_my_location_iv"
android:layout_width="@dimen/module_map_amap_my_location_icon_width"

View File

@@ -245,8 +245,8 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
private void requestCarModelList() {
Map<String, String> params = new HashMap<>(8);
params.put("sn", Utils.getSn());
// params.put("sn", "ZD802B1932L00617");
// params.put("sn", Utils.getSn());
params.put("sn", "ZD802B1932L00617");
mNetWork.create(UserInfoNetApiServices.class, DztHttpConstant.getBaseUrl()).
requestCarModelList(params).
subscribeOn(Schedulers.io()).

View File

@@ -2,13 +2,13 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#ff113361" android:startColor="#ff124B98" android:type="linear" />
<gradient android:angle="135" android:endColor="#59000000" android:startColor="#59000000" android:type="linear" />
<corners android:radius="@dimen/module_ext_common_corner" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#ff1e57a4" android:startColor="#ff1f7eff" android:type="linear" />
<gradient android:angle="135" android:endColor="#2164BF" android:startColor="#1F9AFF" android:type="linear" />
<corners android:radius="@dimen/module_ext_common_corner" />
</shape>
</item>

View File

@@ -103,8 +103,8 @@
<ImageView
android:id="@+id/module_entrance_id_uploading"
android:layout_width="@dimen/module_entrance_id_uploading_width"
android:layout_height="@dimen/module_entrance_id_uploading_height"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:scaleType="fitCenter"

View File

@@ -278,6 +278,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
super.onResume();
mMogoStatusManager.setMainPageResumeStatus( TAG, true );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
mServiceApis.getAdasControllerApi().showADAS();
}
@@ -310,6 +311,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
@Override
protected void onStop() {
super.onStop();
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, true );
}
@Override
@@ -356,6 +358,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostNaviListener();
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostMapListener();
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
mMogoFragmentManager.unregisterMainFragmentStackTransactionListener();
mMogoFragmentManager = null;
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().destroy();

View File

@@ -151,6 +151,7 @@ public class SchemeIntent implements IMogoStatusChangedListener {
if (TextUtils.isEmpty(type)) {
return;
}
Log.d("语音打开事件面板type",type);
switch (type) {
case TYPE_NAVI:
handleNaviIntent(target);
@@ -163,12 +164,15 @@ public class SchemeIntent implements IMogoStatusChangedListener {
break;
case TYPE_SHOW_ONLINE_CAR_PANEL:
handleShowOnlineCarPanel(target);
break;
case TYPE_SHOW_HISTORY_PANEL:
handleShowSharePanel(0);
handleShowEventPanel(0);
break;
case TYPE_SHOW_SURROUNDING_PANEL:
handleShowSharePanel(1);
handleShowEventPanel(1);
break;
case TYPE_SHOW_SHARE_PANEL:
handleShowSharePanel(2);
handleShowEventPanel(2);
break;
default:
break;
@@ -224,8 +228,8 @@ public class SchemeIntent implements IMogoStatusChangedListener {
/*
* 语音打开事件面板
* */
private void handleShowSharePanel(int item) {
Logger.d(TAG, "语音打开事件面板");
private void handleShowEventPanel(int item) {
Logger.d(TAG, "语音打开事件面板" + String.valueOf(item));
mApis.getEventPanelManager().showPanelWithSelectedItem(item);
}

View File

@@ -6,14 +6,11 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.location.Location;
import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import androidx.annotation.NonNull;
@@ -48,7 +45,6 @@ import com.mogo.module.service.launchercard.LauncherCardRefresher;
import com.mogo.module.service.marker.MapMarkerManager;
import com.mogo.module.service.network.RefreshCallback;
import com.mogo.module.service.network.RefreshModel;
import com.mogo.module.service.network.bean.TtsConfigEntity;
import com.mogo.module.service.ttsConfig.TtsConfigModleData;
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushData;
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushResponse;
@@ -63,7 +59,6 @@ import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.intent.IMogoIntentManager;
import com.mogo.service.launcher.IMogoLauncher;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoActionManager;
import com.mogo.service.module.IMogoRegisterCenter;
@@ -78,12 +73,12 @@ import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
import com.zhidao.carchattingprovider.ICallChatResponse;
import com.zhidao.carchattingprovider.ICallProviderResponse;
import com.zhidao.carchattingprovider.ICarsChattingProvider;
import com.zhidao.smartv2x.common.utils.LoggerUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONObject;
import java.util.List;
@@ -256,13 +251,13 @@ public class MogoServices implements IMogoMapListener,
/**
* 手动刷新回调
*/
private RefreshCallback mCustomRefreshCallback = new RefreshCallback< MarkerResponse >() {
private RefreshCallback mCustomRefreshCallback = new RefreshCallback<MarkerResponse>() {
@Override
public void onSuccess( MarkerResponse o ) {
MapMarkerManager.getInstance().onSyncMarkerResponse( o );
public void onSuccess(MarkerResponse o) {
MapMarkerManager.getInstance().onSyncMarkerResponse(o);
mLoopRequest = false;
// 用户手动操作地图刷新成功后,设置状态为 true引发延时策略
mStatusManager.setUserInteractionStatus( ServiceConst.TYPE, true, true );
mStatusManager.setUserInteractionStatus(ServiceConst.TYPE, true, true);
}
@Override
@@ -338,12 +333,16 @@ public class MogoServices implements IMogoMapListener,
}
mIsMainPageFirstResume = false;
LauncherCardRefresher.getInstance(mContext).stop();
playAppTts();
} else {
unregisterInternalUnWakeupWords();
stopAutoRefreshStrategy();
}
}
@Override
public void onMainPageIsBackgroundStatusChanged(boolean isBackground) {
if (isBackground) {
closeAllPanel();
}
}
@@ -402,96 +401,10 @@ public class MogoServices implements IMogoMapListener,
*/
private void closeAllPanel() {
LoggerUtils.log("zy=======stop");
// TODO @钟超 需要修改下kotlin的校验
mCallProviderResponse = new ICallProviderResponse(){
mCallProviderResponse = new ICallChatResponse() {
@Override
public void mute(boolean b) {
}
@Override
public void matchInvokeResult(boolean b, @NotNull String s) {
}
@Override
public void match(@NotNull String s) {
}
@Override
public void invokeCallData(@NotNull String s) {
}
@Override
public void hangUp(boolean b) {
}
@Override
public void error(@NotNull String s) {
}
@Override
public void cancelMatch(boolean b) {
}
@Override
public void call(@NotNull String s) {
}
@Override
public void userWindowStatus(boolean b) {
}
@Override
public void userInfoCallBack(@Nullable String s, @Nullable String s1) {
}
@Override
public void isOnLine(boolean b, @Nullable String s) {
}
@Override
public void isFriend(boolean b) {
}
@Override
public void invisibleUser(boolean b) {
}
@Override
public void hideUserWindowError(@NotNull String s) {
}
@Override
public void canCall(boolean b) {
}
@Override
public void callInvokeError(@NotNull String s) {
}
@Override
public void addFriend(boolean b) {
}
@Override
public void callWindowStatus( boolean b ) {
public void hideUserWindowError(@NotNull String errorMsg) {
LoggerUtils.log("zy=======errorMsg:" + errorMsg);
}
};
MogoApisHandler.getInstance().getApis().getShareManager().dismissShareDialog();
@@ -582,58 +495,58 @@ public class MogoServices implements IMogoMapListener,
}
private void initWorkThread() {
mThreadHandler = new Handler( WorkThreadHandler.getInstance().getLooper() ) {
mThreadHandler = new Handler(WorkThreadHandler.getInstance().getLooper()) {
@Override
public void handleMessage( Message msg ) {
super.handleMessage( msg );
if ( msg.what == ServiceConst.MSG_MAP_CHANGED ) {
if ( msg.obj instanceof RefreshObject ) {
RefreshObject ro = ( ( RefreshObject ) msg.obj );
if ( invokeRefreshWhenTranslationByUser( ro.mLonLat ) ) {
notifyRefreshData( ro.mLonLat, ro.mRadius, ro.mCallback );
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == ServiceConst.MSG_MAP_CHANGED) {
if (msg.obj instanceof RefreshObject) {
RefreshObject ro = ((RefreshObject) msg.obj);
if (invokeRefreshWhenTranslationByUser(ro.mLonLat)) {
notifyRefreshData(ro.mLonLat, ro.mRadius, ro.mCallback);
mLastCustomRefreshCenterLocation = ro.mLonLat;
}
}
} else if ( msg.what == ServiceConst.MSG_REQUEST_DATA ) {
if ( msg.obj instanceof RefreshObject ) {
RefreshObject ro = ( ( RefreshObject ) msg.obj );
if ( ro.mLonLat == null ) {
} else if (msg.what == ServiceConst.MSG_REQUEST_DATA) {
if (msg.obj instanceof RefreshObject) {
RefreshObject ro = ((RefreshObject) msg.obj);
if (ro.mLonLat == null) {
invokeAutoRefreshStrategy();
Logger.w( TAG, "lonLat is null." );
Logger.w(TAG, "lonLat is null.");
return;
}
mRefreshModel.refreshExplorerWayData( ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback );
MapMarkerManager.getInstance().getOnlineCarDataByAutoRefreshStrategy( ro.mLonLat );
mRefreshModel.refreshExplorerWayData(ro.mLonLat, ro.mRadius, ro.mAmount, ro.mCallback);
MapMarkerManager.getInstance().getOnlineCarDataByAutoRefreshStrategy(ro.mLonLat);
Logger.i( TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius, ro.mLonLat, mLastZoomLevel, ro.mAmount );
Logger.i(TAG, "刷新半径 = %s, 点 = %s, zoomLevel = %s, amount = %s", ro.mRadius, ro.mLonLat, mLastZoomLevel, ro.mAmount);
}
} else if ( msg.what == ServiceConst.MSG_LOCK_CAR ) {
if ( mStatusManager.isSearchUIShow() ) {
} else if (msg.what == ServiceConst.MSG_LOCK_CAR) {
if (mStatusManager.isSearchUIShow()) {
return;
}
mStatusManager.setUserInteractionStatus( TAG, true, false );
mStatusManager.setUserInteractionStatus(TAG, true, false);
mUiController.recoverLockMode();
}
}
};
}
private void registerMogoReceiver( Context context ) {
if ( context == null ) {
private void registerMogoReceiver(Context context) {
if (context == null) {
return;
}
List< MogoModule > modules = MogoModulePaths.getModules();
if ( modules.isEmpty() || modules == null ) {
List<MogoModule> modules = MogoModulePaths.getModules();
if (modules.isEmpty() || modules == null) {
return;
}
mAIAssistReceiver = new MogoReceiver( context );
mAIAssistReceiver = new MogoReceiver(context);
IntentFilter filter = new IntentFilter();
if ( modules != null && !modules.isEmpty() ) {
for ( MogoModule module : modules ) {
if ( TextUtils.isEmpty( module.getBroadcastAction() ) ) {
if (modules != null && !modules.isEmpty()) {
for (MogoModule module : modules) {
if (TextUtils.isEmpty(module.getBroadcastAction())) {
continue;
}
filter.addAction( module.getBroadcastAction() );
filter.addAction(module.getBroadcastAction());
}
}
filter.addAction(MogoReceiver.VOICE_ACTION);
@@ -717,30 +630,30 @@ public class MogoServices implements IMogoMapListener,
}
private void stopAutoRefreshStrategy() {
stopAutoRefreshStrategy( true );
stopAutoRefreshStrategy(true);
}
private void stopAutoRefreshStrategy( boolean stopOnlineCarRefresh ) {
mHandler.removeMessages( ServiceConst.MSG_TYPE_REFRESH_DECREASE );
if ( stopOnlineCarRefresh ) {
private void stopAutoRefreshStrategy(boolean stopOnlineCarRefresh) {
mHandler.removeMessages(ServiceConst.MSG_TYPE_REFRESH_DECREASE);
if (stopOnlineCarRefresh) {
MapMarkerManager.getInstance().stopAutoRefresh();
}
}
@Override
public void onLockMap( boolean isLock ) {
mThreadHandler.removeMessages( ServiceConst.MSG_LOCK_CAR );
if ( !isLock ) {
mThreadHandler.sendEmptyMessageDelayed( ServiceConst.MSG_LOCK_CAR, ServiceConst.DEFAULT_AUTO_REFRESH_WHEN_INTERRUPT );
public void onLockMap(boolean isLock) {
mThreadHandler.removeMessages(ServiceConst.MSG_LOCK_CAR);
if (!isLock) {
mThreadHandler.sendEmptyMessageDelayed(ServiceConst.MSG_LOCK_CAR, ServiceConst.DEFAULT_AUTO_REFRESH_WHEN_INTERRUPT);
}
}
@Override
public void onMapChanged( MogoLatLng latLng, float zoom, float tilt, float bearing ) {
public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
MapMarkerManager.getInstance().syncLocation( latLng.lon, latLng.lat );
MapMarkerManager.getInstance().syncLocation(latLng.lon, latLng.lat);
if ( mIsCameraInited ) {
if (mIsCameraInited) {
mLastZoomLevel = zoom;
mLastCustomRefreshCenterLocation = latLng;
mIsCameraInited = false;
@@ -750,26 +663,26 @@ public class MogoServices implements IMogoMapListener,
// 部分非用户操作导致地图视图变化:绘线、圈点等不触发用户刷新
// 消费状态
if ( mStatusManager.isUserInteracted() ) {
if (mStatusManager.isUserInteracted()) {
mLastCustomRefreshCenterLocation = latLng;
mLastZoomLevel = zoom;
Logger.d( TAG, "user interacted" );
Logger.d(TAG, "user interacted");
return;
}
// v2x // adas 状态下不做任何操作
if ( mStatusManager.isV2XShow() ) {
if (mStatusManager.isV2XShow()) {
mLastCustomRefreshCenterLocation = latLng;
mLastZoomLevel = zoom;
Logger.d( TAG, "user v2x show" );
Logger.d(TAG, "user v2x show");
return;
}
// 搜索页面显示时不做任何策略
if ( mStatusManager.isSearchUIShow() ) {
if (mStatusManager.isSearchUIShow()) {
mLastCustomRefreshCenterLocation = latLng;
mLastZoomLevel = zoom;
Logger.d( TAG, "user search Ui show" );
Logger.d(TAG, "user search Ui show");
return;
}

View File

@@ -24,6 +24,9 @@ abstract class StatusChangedAdapter implements IMogoStatusChangedListener {
case MAIN_PAGE_RESUME:
onMainPageResumeStatusChanged( isTrue );
break;
case MAIN_PAGE_IS_BACKGROUND:
onMainPageIsBackgroundStatusChanged( isTrue );
break;
case SEEK_HELPING:
onSeekHelpingStatusChanged( isTrue );
break;
@@ -42,6 +45,8 @@ abstract class StatusChangedAdapter implements IMogoStatusChangedListener {
public abstract void onMainPageResumeStatusChanged( boolean resume );
public abstract void onMainPageIsBackgroundStatusChanged( boolean isBackground );
public abstract void onSeekHelpingStatusChanged( boolean isSeekingHelping );
public abstract void onAccStatusChanged( boolean accOn );

View File

@@ -3,6 +3,7 @@ package com.mogo.module.service.unwake;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.template.IProvider;
@@ -73,16 +74,21 @@ public class GlobalUnwakeManager implements IProvider, IMogoIntentListener, IMog
MogoApisHandler.getInstance().getApis().getShareManager().onGlobalUnwake(intentStr, intent);
break;
case VOICE_QUERY_HISTORY_INDEX:
Log.d("语音指令","VOICE_QUERY_HISTORY_INDEX");
Intent startForHis = new Intent( Intent.ACTION_VIEW );
startForHis.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
startForHis.setData( Uri.parse( "mogo://launcher/main/switch2?type=showHistoryPanel" ) );
context.startActivity( startForHis );
break;
case VOICE_QUERY_SURROUNDING_INDEX:
Log.d("语音指令","VOICE_QUERY_SURROUNDING_INDEX");
Intent startForSurrounding = new Intent( Intent.ACTION_VIEW );
startForSurrounding.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
startForSurrounding.setData( Uri.parse( "mogo://launcher/main/switch2?type=showSurroundingPanel" ) );
context.startActivity( startForSurrounding );
break;
case VOICE_QUERY_HEART_INDEX:
Log.d("语音指令","VOICE_QUERY_HEART_INDEX");
Intent start = new Intent( Intent.ACTION_VIEW );
start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
start.setData( Uri.parse( "mogo://launcher/main/switch2?type=showSharePanel" ) );

View File

@@ -1,5 +1,6 @@
package com.mogo.module.v2x;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.v2x.listener.V2XMessageListener_401003;
import com.mogo.module.v2x.listener.V2XMessageListener_401005;
import com.mogo.module.v2x.listener.V2XMessageListener_401006;
@@ -55,7 +56,10 @@ public class V2XSocketManager {
Logger.d(MODULE_NAME, "开始注册Socket通道....");
register401011();
register401012();
register401005();
// M1 不基于地图的版本不接收道路求助,原因是车机内置地图版本不一样
if (DebugConfig.isMapBased()) {
register401005();
}
register401007();
register401009();
// TODO 这里是前瞻需求,量产版本需要注释

View File

@@ -9,6 +9,7 @@ import android.text.Spanned
import android.text.style.AbsoluteSizeSpan
import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.RadioButton
@@ -256,24 +257,23 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
* 语音查询热心指数需求
* */
fun showPanelWithSelectedItem(item: Int) {
mV2XShareEventsFragment.fromVoice = true
if (isPanelShow()) {
if (mRbScenarioHistory?.isChecked == true) {
mV2XScenarioHistoryFragment.ttsForVoiceCheckout()
}
if (mRbSurroundingEvent?.isChecked == true) {
mV2XSurroundingFragment.ttsForVoiceCheckout()
}
if (mRbShareEvents?.isChecked == true) {
mV2XShareEventsFragment.ttsForVoiceCheck()
try {
when (item) {
0 -> mV2XScenarioHistoryFragment.ttsForVoiceCheckout()
1 -> mV2XSurroundingFragment.ttsForVoiceCheckout()
else -> mV2XShareEventsFragment.ttsForVoiceCheckout()
}
} catch (e: java.lang.Exception) {
}
} else {
showPanel()
selectWithItem(item)
}
}
private fun initDetail() {
mDetailRecyclerView!!.addItemDecoration(SpacesItemDecoration(resources.getDimension(R.dimen.share_item_padding).toInt()))
mSurroundingDetailAdapter = V2XSurroundingDetailAdapter(activity, markerExploreWays)
@@ -347,10 +347,14 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
return typeName
}
/*
* 语音查询事件面板内容
* */
private fun selectWithItem(item: Int) {
when (item) {
0 -> {
try {
mV2XScenarioHistoryFragment.fromVoice = true
mRbScenarioHistory?.isChecked = true
} catch (e: java.lang.Exception) {
e.printStackTrace()
@@ -358,6 +362,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
1 -> {
try {
mV2XSurroundingFragment.fromVoice = true
mRbSurroundingEvent?.isChecked = true
} catch (e: java.lang.Exception) {
e.printStackTrace()
@@ -365,6 +370,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
2 -> {
try {
mV2XShareEventsFragment.fromVoice = true
mRbShareEvents?.isChecked = true
} catch (e: java.lang.Exception) {
e.printStackTrace()
@@ -376,6 +382,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
fun showPanel() {
Logger.d(MODULE_NAME, "in fragment show panel")
mClPanelContainer?.visibility = View.VISIBLE
if (DebugConfig.isMapBased()) {
V2XVoiceManager.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP, mCloeEventCb)
}

View File

@@ -38,7 +38,7 @@ import java.util.List;
public class V2XScenarioHistoryFragment
extends MvpFragment<V2XScenarioHistoryFragment, ScenarioHistoryPresenter> {
private String TAG = "ScenarioHistoryFragment";
public Boolean fromVoice = false;
private V2XListEmptyView mEmptyView;
private LinearLayout mClHistoryList;
private RecyclerView mRecyclerView;
@@ -128,6 +128,10 @@ public class V2XScenarioHistoryFragment
mClHistoryList.setVisibility(View.GONE);
}
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
if (fromVoice == true){
ttsForVoiceCheckout();
fromVoice = false;
}
ttsForHistoryFirstToday();
}
});

View File

@@ -105,7 +105,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
dataArrayList.add(resultData.getResult().getEnthusiasmIndex());
if (fromVoice == true) {
try {
ttsForVoiceCheck();
ttsForVoiceCheckout();
} catch (Exception e) {
}
@@ -140,7 +140,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
/*
* 语音打开我的分享,TTS播报
* */
public void ttsForVoiceCheck() {
public void ttsForVoiceCheckout() {
int shareNum = resultData.getResult().getEnthusiasmIndex().getShareNum();
int approveNum = resultData.getResult().getEnthusiasmIndex().getLikeNum();
double enthusiasm = resultData.getResult().getEnthusiasmIndex().getEnthusiasmIndex();

View File

@@ -84,7 +84,7 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
private List<SurroundingConstruction> poiInfosList = new ArrayList<>();
private IMogoServiceApis mApis;
private NetworkLoadingView mloadingImage;
public Boolean fromVoice = false;
@Override
protected int getLayoutId() {
@@ -199,6 +199,10 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
mRecyclerView.setVisibility(View.GONE);
mEmptyLayout.setVisibility(View.VISIBLE);
}
if (fromVoice == true) {
ttsForVoiceCheckout();
fromVoice = false;
}
ttsForSurroundingFirstToday();
}

View File

@@ -126,22 +126,25 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
}
}
// 只有自研车机才有疲劳驾驶检测
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
V2XAlarmServer.getFatigueDrivingShow(location, drivingShowEntity -> {
Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity));
// M1 不基于地图的版本没有疲劳检测,原因是车机内置地图版本不一样
if (DebugConfig.isMapBased()) {
// 只有自研车机才有疲劳驾驶检测
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) {
V2XAlarmServer.getFatigueDrivingShow(location, drivingShowEntity -> {
Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity));
String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2";
trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style);
String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2";
trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style);
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = new V2XMessageEntity<>();
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING);
v2XMessageEntity.setContent(drivingShowEntity);
v2XMessageEntity.setShowState(drivingShowEntity.isShowWindow());
// 广播给ADAS Launcher
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), drivingShowEntity);
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
});
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = new V2XMessageEntity<>();
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING);
v2XMessageEntity.setContent(drivingShowEntity);
v2XMessageEntity.setShowState(drivingShowEntity.isShowWindow());
// 广播给ADAS Launcher
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), drivingShowEntity);
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
});
}
}
// 巡航处理

View File

@@ -4,6 +4,7 @@ import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
@@ -36,8 +37,16 @@ public class HeartLikeView extends LinearLayout implements Animator.AnimatorList
public HeartLikeView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
inflate(context, R.layout.view_heart_like, this);
mIllegalParkingLike = findViewById(R.id.ivIllegalParkingLike);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.HeartLikeView, defStyleAttr,
0);
boolean showGrayBack = typedArray.getBoolean(R.styleable.HeartLikeView_showGrayBack, false);
if (showGrayBack) {
inflate(context, R.layout.view_heart_like_gray_back, this);
mIllegalParkingLike = findViewById(R.id.ivLikeForGrayBack);
} else {
inflate(context, R.layout.view_heart_like, this);
mIllegalParkingLike = findViewById(R.id.ivIllegalParkingLike);
}
setOnClickListener(v -> {
if (!isAnimator) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -81,7 +81,7 @@
android:textSize="@dimen/panel_list_item_title_size"
app:layout_constraintBottom_toBottomOf="@+id/tagEventType"
app:layout_constraintStart_toEndOf="@+id/tagEventType"
app:layout_constraintTop_toTopOf="@+id/tagEventType" />¬
app:layout_constraintTop_toTopOf="@+id/tagEventType" />
<com.mogo.module.v2x.view.HeartLikeView
android:id="@+id/llIllegalParkingLike"
@@ -90,7 +90,8 @@
android:layout_marginEnd="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/llIllegalParkingUnLike"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
app:showGrayBack="true" />
<com.mogo.module.v2x.view.HeartUnLikeView
android:id="@+id/llIllegalParkingUnLike"

View File

@@ -74,6 +74,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dp_40"
app:showGrayBack="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/surrounding_road_unlike"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llIllegalParkingLike"
android:layout_width="@dimen/module_v2x_event_button_size"
android:layout_height="@dimen/module_v2x_event_button_size"
android:background="@drawable/icon_gray_back_heart"
android:gravity="center">
<ImageView
android:id="@+id/ivLikeForGrayBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_heart_like_for_gray_back" />
</LinearLayout>

View File

@@ -7,4 +7,8 @@
<style name="customTabLayoutTextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:textSize">@dimen/dp_40</item>
</style>
<declare-styleable name="HeartLikeView">
<attr name="showGrayBack" format="boolean" />
</declare-styleable>
</resources>

View File

@@ -81,6 +81,13 @@ public interface IMogoStatusManager extends IProvider {
*/
boolean isMainPageOnResume();
/**
* 主页是否在后台运行
*
* @return true-在后台false-不在后台
*/
boolean isMainPageIsBackground();
/**
* 小智语音是否准备完毕
*
@@ -208,6 +215,14 @@ public interface IMogoStatusManager extends IProvider {
*/
void setMainPageResumeStatus( String tag, boolean resume );
/**
* 主页 后台运行 状态
*
* @param tag 控制来源
* @param isBackground true-在后台运行false-不在后台运行(也可能是挂了)
*/
void setMainPageIsBackgroundStatus( String tag, boolean isBackground );
/**
* 设置小智语音状态
*

View File

@@ -55,6 +55,11 @@ public enum StatusDescriptor {
*/
MAIN_PAGE_RESUME,
/**
* 主页 isBackground 状态
*/
MAIN_PAGE_IS_BACKGROUND,
/**
* 小智语音状态
*/

View File

@@ -96,6 +96,11 @@ public class MogoStatusManager implements IMogoStatusManager {
return get_bool_val( StatusDescriptor.MAIN_PAGE_RESUME );
}
@Override
public boolean isMainPageIsBackground() {
return get_bool_val( StatusDescriptor.MAIN_PAGE_IS_BACKGROUND );
}
@Override
public boolean isAIAssistReady() {
return get_bool_val( StatusDescriptor.AI_ASSIST_READY );
@@ -199,6 +204,13 @@ public class MogoStatusManager implements IMogoStatusManager {
Logger.i( TAG, "setMainPageResumeStatus " + resume + " cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
@Override
public void setMainPageIsBackgroundStatus(String tag, boolean isBackground) {
final long start = System.currentTimeMillis();
doSetStatus( tag, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, isBackground );
Logger.i( TAG, "setMainPageIsBackgroundStatus " + isBackground + " cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
@Override
public void setAIAssistReady( String tag, boolean ready ) {
doSetStatus( tag, StatusDescriptor.AI_ASSIST_READY, ready );

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB