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

This commit is contained in:
董宏宇
2020-11-16 11:01:39 +08:00
10 changed files with 100 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/module_ext_shadow_bkg" android:state_pressed="true" />
<item android:drawable="@drawable/module_ext_shadow_bkg" android:state_pressed="false" />
<item android:drawable="@drawable/module_ext_shadow_bkg" />
</selector>

View File

@@ -20,7 +20,7 @@
android:id="@+id/module_entrance_id_move2_current_location"
android:layout_width="@dimen/module_ext_operation_panel_width"
android:layout_height="@dimen/module_ext_operation_panel_move2_height"
android:background="@drawable/module_ext_shadow_bkg"
android:background="@drawable/module_ext_drawable_shadow_bg"
android:scaleType="centerInside"
android:src="@drawable/module_map_ic_move2_current_location"
app:layout_constraintBottom_toBottomOf="parent"

View File

@@ -34,6 +34,7 @@ import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.map.navi.MogoCongestionInfo;
import com.mogo.map.navi.MogoTraffic;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.common.entity.MarkerResponse;
@@ -53,6 +54,7 @@ import com.mogo.module.service.refresh.AutoRefreshStrategy;
import com.mogo.module.service.refresh.CustomRefreshStrategy;
import com.mogo.module.service.refresh.RefreshObject;
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.cardmanager.IMogoCardManager;
import com.mogo.service.connection.IMogoOnMessageListener;
@@ -74,6 +76,7 @@ import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import com.mogo.utils.network.utils.GsonUtil;
import com.zhidao.smartv2x.common.utils.LoggerUtils;
import org.json.JSONObject;
@@ -331,6 +334,7 @@ public class MogoServices implements IMogoMapListener,
} else {
unregisterInternalUnWakeupWords();
stopAutoRefreshStrategy();
closeAllPanel();
}
}
@@ -373,6 +377,16 @@ public class MogoServices implements IMogoMapListener,
}
};
/**
* 关闭所有模块的控制面板
*/
private void closeAllPanel() {
LoggerUtils.log("zy=======stop");
MogoApisHandler.getInstance().getApis().getShareManager().dismissShareDialog();
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().hidePanel();
MogoApisHandler.getInstance().getApis().getAdasControllerApi().closeADAS();
}
public void init( Context context ) {
mContext = context;

View File

@@ -24,8 +24,8 @@ import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener
import com.mogo.module.v2x.voice.V2XVoiceConstants
import com.mogo.module.v2x.voice.V2XVoiceManager
import com.mogo.service.eventpanel.IEventPanelProvider
import com.mogo.utils.logger.Logger
import com.mogo.utils.storage.SharedPrefsMgr
/**
@@ -52,6 +52,7 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
private var mRbScenarioHistory: RadioButton? = null
private var mRbSurroundingEvent: RadioButton? = null
private var mRbShareEvents: RadioButton? = null
private var todayFirstForShared: String? = ""
private val mV2XScenarioHistoryFragment = V2XScenarioHistoryFragment()
private val mV2XShareEventsFragment = V2XShareEventsFragment()

View File

@@ -11,6 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.common.entity.V2XHistoryScenarioData;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.SpacesItemDecoration;
@@ -21,6 +22,7 @@ import com.mogo.module.v2x.manager.V2XStatusDescriptor;
import com.mogo.module.v2x.presenter.ScenarioHistoryPresenter;
import com.mogo.module.v2x.utils.ThreadUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.module.v2x.view.V2XListEmptyView;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -126,10 +128,28 @@ public class V2XScenarioHistoryFragment
mClHistoryList.setVisibility(View.GONE);
}
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
ttsForHistoryFirstToday();
}
});
}
/*
* 出行动态 TTS播报
* */
private void ttsForHistoryFirstToday() {
boolean hasBroadTts = V2XUtils.isFirstTodayWithKey("TTS_FOR_HISTORY_SELECTED");
if (hasBroadTts == false) {
if (mV2XHistoryScenarioData.size() > 0) {
AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice("小智为您记录了今天的出行事件", null);
} else {
AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice("小智在这里为您记录今天的出行事件", null);
}
}
}
@Override
public void onResume() {
super.onResume();

View File

@@ -87,7 +87,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
animatioonAction(View.VISIBLE);
animationAction(View.VISIBLE);
}
});
@@ -144,7 +144,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
int shareNum = resultData.getResult().getEnthusiasmIndex().getShareNum();
int approveNum = resultData.getResult().getEnthusiasmIndex().getLikeNum();
double enthusiasm = resultData.getResult().getEnthusiasmIndex().getEnthusiasmIndex();
Log.d(TAG, String.valueOf(enthusiasm)+"TTS播报热心指数个数");
Log.d(TAG, String.valueOf(enthusiasm) + "TTS播报热心指数个数");
String ttsString = "";
if (enthusiasm <= 2) {
ttsString = "您目前已完成" + shareNum + "次分享,获得" + approveNum + "次车友认同,热心指数" + enthusiasm
@@ -164,7 +164,8 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
* 我的分享列表数据处理
* */
private void loadSuccessWithShareEventList(Object result) {
animatioonAction(View.GONE);
animationAction(View.GONE);
V2XShareEventItem resultData = (V2XShareEventItem) result;
V2XShareEventLoadMoreItem item = new V2XShareEventLoadMoreItem();
if (resultData != null && resultData.getResult() != null) {
@@ -211,7 +212,7 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
}
private void animatioonAction(int visible) {
private void animationAction(int visible) {
if (visible == View.VISIBLE) {
if (loadingView != null) {
loadingView.start();
@@ -227,13 +228,22 @@ public class V2XShareEventsFragment extends MvpFragment<V2XShareEventsFragment,
@Override
protected ShareEventsPresenter createPresenter() {
Log.d(TAG, "createPresenter");
ttsForSharedFirstToday();
return new ShareEventsPresenter(this);
}
private void ttsForSharedFirstToday() {
boolean hasBroadTts = V2XUtils.isFirstTodayWithKey("TTS_FOR_SHARED_SELECTED");
Log.d(TAG,"shouldBroadTts"+hasBroadTts);
if (hasBroadTts == false) {
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("您可以在这里查看历史的分享记录", null);
}
}
@Override
public void loadMoreShareEventList() {
Log.d(TAG, "page--" + pageNum);
animatioonAction(View.VISIBLE);
animationAction(View.VISIBLE);
pageNum += 1;
v2XShareNetworkModel.getShareEventList(pageNum, 10, new V2XRefreshCallback() {
@Override

View File

@@ -25,6 +25,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
@@ -38,6 +39,7 @@ 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.V2XUtils;
import com.mogo.module.v2x.view.SurroundingEventView;
import com.mogo.module.common.view.NetworkLoadingView;
import com.mogo.module.v2x.view.SurroundingMarginDecoration;
@@ -189,8 +191,22 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
mRecyclerView.setVisibility(View.GONE);
mEmptyLayout.setVisibility(View.VISIBLE);
}
ttsForSurroundingFirstToday();
}
/*
* 出行动态 TTS播报
* */
private void ttsForSurroundingFirstToday() {
boolean hasBroadTts = V2XUtils.isFirstTodayWithKey("TTS_FOR_SURROUNDING_SELECTED");
if (hasBroadTts == false) {
if (poiInfosList.size() > 0) {
AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice("发现周边" + poiInfosList.size() + "条交通信息", null);
} else {
}
}
}
private Map<String, SurroundingConstruction> getPoiTypeMap(List<MarkerExploreWay> list) {
Map<String, SurroundingConstruction> mPoiTypeMarkers = new HashMap<>();

View File

@@ -24,6 +24,7 @@ import androidx.core.content.FileProvider;
import androidx.fragment.app.FragmentActivity;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.storage.SharedPrefsMgr;
import java.io.BufferedReader;
import java.io.File;
@@ -31,11 +32,15 @@ import java.io.FileReader;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
@@ -315,6 +320,21 @@ public class V2XUtils {
}
}
/*
* 当天第一次
* */
public static boolean isFirstTodayWithKey(String key) {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd", Locale.US);
String formatString = format.format(new Date());
String value = SharedPrefsMgr.getInstance(V2XUtils.getApp()).getString(key);
if (value.equals(formatString)) {
return true;
} else {
SharedPrefsMgr.getInstance(V2XUtils.getApp()).putString(key, formatString);
return false;
}
}
///////////////////////////////////////////////////////////////////////////
// TransActivity
///////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/module_ext_shadow_bkg_light" android:state_pressed="true" />
<item android:drawable="@drawable/module_ext_shadow_bkg_light" android:state_pressed="false" />
<item android:drawable="@drawable/module_ext_shadow_bkg_light" />
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB