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

This commit is contained in:
tongchenfei
2020-11-18 19:42:07 +08:00
17 changed files with 92 additions and 63 deletions

View File

@@ -178,7 +178,7 @@ class CosStatusController : CosStatusCallback {
latitude: Double,
speed: Float
) {
Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId")
Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId --- isCustom = ${entity?.isCustom}")
//开始上传
entity?.isCustom?.let {
mainServiceHttpModel.sendInformationMessage(

View File

@@ -1,5 +1,6 @@
package com.zhidao.roadcondition.util
import android.util.Log
import com.google.gson.JsonArray
import com.google.gson.JsonObject
import com.mogo.commons.AbsMogoApplication
@@ -51,6 +52,7 @@ fun getInformationBody(
INFO_TYPE_IMG
}
var infoType = if (isCustom) 1 else 0
Log.d("MainServiceController", "isCustom = $isCustom ---- infoType = $infoType")
return InformationBody(
jsonArray.toString(),
locationInfo.address,

View File

@@ -1060,6 +1060,6 @@
<dimen name="v2x_share_btn_width">281px</dimen>
<dimen name="v2x_share_btn_height">90px</dimen>
<dimen name="share_item_address">32px</dimen>
<dimen name="panel_list_item_title_size">28px</dimen>
<dimen name="panel_list_item_title_size">26px</dimen>
</resources>

View File

@@ -219,9 +219,11 @@ public class SchemeIntent implements IMogoStatusChangedListener {
mApis.getOnlineCarPanelApi().showPanel();
}
/*
* 语音打开事件面板
* */
private void handleShowSharePanel(int item) {
Logger.d(TAG, "handleShowSharePanel");
// todo 跳转到热心指数
Logger.d(TAG, "语音打开事件面板");
mApis.getEventPanelManager().showPanelWithSelectedItem(item);
}

View File

@@ -48,7 +48,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;
@@ -333,8 +332,9 @@ public class MogoServices implements IMogoMapListener,
}
mIsMainPageFirstResume = false;
LauncherCardRefresher.getInstance(mContext).stop();
playAppTts();
mTtsModle.playTts();
// playAppTts();
} else {
@@ -390,7 +390,7 @@ public class MogoServices implements IMogoMapListener,
if (DebugConfig.isLauncher()) {
return;
}
mTtsModle.playTts();
}
/**

View File

@@ -4,6 +4,7 @@ import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.service.network.RefreshModel;
@@ -41,9 +42,9 @@ public class TtsConfigModleData {
*/
public void playTts() {
Log.d("zytest", "playTts获取语音配置的网络请求");
if (DebugConfig.isLauncher()) {
return;
}
mTtsConfigApiService.inquireForTts()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
@@ -59,8 +60,8 @@ public class TtsConfigModleData {
public void onSuccess(TtsConfigEntity o) {
super.onSuccess(o);
Log.e("zytest", "播放语音了====" + o.getResult().getWord());
if (!TextUtils.isEmpty( o.getResult().getWord())) {
AIAssist.getInstance(getApp().getApplicationContext()).speakTTSVoice( o.getResult().getWord());
if (!TextUtils.isEmpty(o.getResult().getWord())) {
AIAssist.getInstance(getApp().getApplicationContext()).speakTTSVoice(o.getResult().getWord());
}
}
});

View File

@@ -29,6 +29,7 @@ public class TtsConfigProvider implements IProvider {
if (mTtsModleData == null) {
mTtsModleData = new TtsConfigModleData();
}
mTtsModleData.playTts();
}
}

View File

@@ -72,6 +72,16 @@ public class GlobalUnwakeManager implements IProvider, IMogoIntentListener, IMog
case UNWAKE_UPLOAD_ROAD_CONDITION:
MogoApisHandler.getInstance().getApis().getShareManager().onGlobalUnwake(intentStr, intent);
break;
case 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 );
case 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 );
case VOICE_QUERY_HEART_INDEX:
Intent start = new Intent( Intent.ACTION_VIEW );
start.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );

View File

@@ -112,7 +112,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
/**
* 距离策略上报
*
* 1. 过去3分钟行驶距离<1km
* 1. 过去3分钟行驶距离<1km大于30m
* 2. 前车距离<5m获取不到前车距离时默认此项满足
* 3. 当前车速<40km/h
*

View File

@@ -12,20 +12,17 @@ import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.tabs.TabLayoutMediator
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.module.v2x.R
import com.mogo.module.v2x.V2XConst.MODULE_NAME
import com.mogo.module.v2x.V2XServiceManager
import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
import com.mogo.module.v2x.presenter.EventPanelPresenter
import com.mogo.module.v2x.utils.TrackUtils
import com.mogo.module.v2x.utils.V2XUtils
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.utils.logger.Logger
import com.mogo.utils.storage.SharedPrefsMgr
/**
@@ -123,6 +120,12 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
mRbSurroundingEvent = mRootView.findViewById(R.id.rbSurroundingEvent)
mRbShareEvents = mRootView.findViewById(R.id.rbShareEvents)
// M1 不基于地图的版本直接展示事件面板,且不可关闭
if (!DebugConfig.isMapBased()) {
mClPanelContainer?.visibility = View.VISIBLE
mBtnHidePanels?.visibility = View.GONE
}
fragments = arrayOf(
mV2XScenarioHistoryFragment,
mV2XSurroundingFragment,
@@ -260,11 +263,13 @@ 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)
}
// 注册语音交互
V2XVoiceManager.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP, mCheckHistoryEventCb)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP, mCheckSurroundingCb)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP, mCheckShearEventCb)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP, mCloeEventCb)
try {
if (isFirstLoad) {
mV2XScenarioHistoryFragment.presenter.loadHistory()
@@ -278,13 +283,15 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
fun hidePanel() {
Logger.d(MODULE_NAME, "in fragment hide panel")
mClPanelContainer?.visibility = View.GONE
// 注册语音交互
V2XVoiceManager.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP)
if (DebugConfig.isMapBased()) {
Logger.d(MODULE_NAME, "in fragment hide panel")
mClPanelContainer?.visibility = View.GONE
// 注册语音交互
V2XVoiceManager.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP)
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP)
}
}
fun isPanelShow(): Boolean {

View File

@@ -17,7 +17,7 @@
android:alpha="0.8"
android:gravity="center"
android:paddingLeft="20px"
android:paddingTop="@dimen/dp_25"
android:paddingTop="@dimen/dp_26"
android:text="小窍门:分享路况,点赞其他车主,有助于提高热心指数"
android:textColor="@color/v2x_share_des_title_color"
android:textSize="@dimen/share_top_text_size">
@@ -27,7 +27,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12px">
android:paddingTop="14px">
<LinearLayout
android:layout_width="fill_parent"
@@ -49,7 +49,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center"
android:paddingBottom="22px"
android:paddingBottom="@dimen/des_text_margin_bottom"
android:text="分享次数"
android:textColor="#FFFFFF"
android:textSize="@dimen/share_index_des_size" />
@@ -83,7 +83,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal|top"
android:paddingBottom="22px"
android:paddingBottom="@dimen/des_text_margin_bottom"
android:text="车友认同次数"
android:textColor="#FFFFFF"
android:textSize="@dimen/share_index_des_size" />

View File

@@ -9,43 +9,28 @@
android:layout_marginBottom="@dimen/dp_14"
android:background="@drawable/bg_v2x_event_list_item">
<TextView
android:id="@+id/road_case_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_36"
android:layout_marginTop="@dimen/dp_24"
android:background="@drawable/bg_v2x_event_type_read"
android:gravity="center"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_3"
android:text="道路类型"
android:textColor="#FFFFFF"
android:textSize="@dimen/panel_list_item_title_size" />
<TextView
android:id="@+id/road_case_useless_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/road_case_style"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/dp_38"
android:paddingRight="@dimen/dp_28"
android:text="100"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/dp_26" />
android:textSize="@dimen/share_item_text_size" />
<ImageView
android:id="@+id/road_case_useless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/road_case_style"
android:src="@drawable/v2x_share_item_unlike"
android:layout_toLeftOf="@id/road_case_useless_num"
android:clickable="false"
android:gravity="center"
android:paddingRight="5px" />
android:paddingRight="5px"
android:src="@drawable/v2x_share_item_unlike" />
<TextView
android:id="@+id/road_case_useful_num"
@@ -57,33 +42,32 @@
android:paddingRight="@dimen/dp_28"
android:text="100"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/dp_26" />
android:textSize="@dimen/share_item_text_size" />
<ImageView
android:id="@+id/road_case_uselful"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/v2x_share_item_like"
android:layout_alignTop="@+id/road_case_style"
android:layout_toLeftOf="@id/road_case_useful_num"
android:clickable="false"
android:paddingRight="5px" />
android:paddingRight="5px"
android:src="@drawable/v2x_share_item_like" />
<TextView
android:id="@+id/road_case_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/road_case_style"
android:layout_alignLeft="@id/road_case_style"
android:layout_toLeftOf="@id/road_case_uselful"
android:layout_marginLeft="@dimen/dp_45"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_35"
android:ellipsize="end"
android:gravity="left"
android:layout_marginTop="@dimen/dp_12"
android:textStyle="bold"
android:lines="1"
android:text="东城区北三环附近维多欧美"
android:text="东城区北三环附近打卡"
android:textColor="@color/v2x_FFF_333"
android:textSize="@dimen/share_item_address" />
android:textSize="@dimen/share_item_address"
android:textStyle="bold" />
<TextView
android:id="@+id/road_case_share_time"
@@ -92,10 +76,28 @@
android:layout_below="@id/road_case_address"
android:layout_alignLeft="@id/road_case_style"
android:layout_marginTop="@dimen/dp_3"
android:layout_marginBottom="@dimen/dp_24"
android:alpha="0.5"
android:gravity="left"
android:text="时间:"
android:textColor="@color/v2x_FFF_666"
android:textSize="@dimen/share_item_text_size" />
<TextView
android:id="@+id/road_case_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/road_case_share_time"
android:layout_alignLeft="@+id/road_case_address"
android:layout_marginTop="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_36"
android:background="@drawable/bg_v2x_event_type_read"
android:gravity="center"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_3"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_3"
android:text="道路类型"
android:textColor="#FFFFFF"
android:textSize="@dimen/panel_list_item_title_size" />
</RelativeLayout>

View File

@@ -61,6 +61,7 @@
<dimen name="v2x_index_rating_top">17px</dimen>
<dimen name="share_top_text_size">14px</dimen>
<dimen name="share_des_num_size">36px</dimen>
<dimen name="des_text_margin_bottom">22px</dimen>
<dimen name="share_index_des_size">16px</dimen>
<dimen name="share_empty_btn_padding">20px</dimen>
<dimen name="shaer_refresh_padding">34px</dimen>

View File

@@ -62,6 +62,7 @@
<dimen name="v2x_index_rating_top">17px</dimen>
<dimen name="share_top_text_size">14px</dimen>
<dimen name="share_des_num_size">36px</dimen>
<dimen name="des_text_margin_bottom">22px</dimen>
<dimen name="share_index_des_size">16px</dimen>
<dimen name="share_empty_btn_padding">20px</dimen>
<dimen name="shaer_refresh_padding">34px</dimen>

View File

@@ -58,11 +58,12 @@
<dimen name="v2x_loading_ani_width">100px</dimen>
<dimen name="v2x_index_rating_top">28px</dimen>
<dimen name="share_top_text_size">26px</dimen>
<dimen name="share_des_num_size">67.5px</dimen>
<dimen name="share_index_des_size">30px</dimen>
<dimen name="share_des_num_size">64px</dimen>
<dimen name="des_text_margin_bottom">48px</dimen>
<dimen name="share_index_des_size">28px</dimen>
<dimen name="share_empty_btn_padding">40px</dimen>
<dimen name="shaer_refresh_padding">60px</dimen>
<dimen name="share_index_bottom_padding">31px</dimen>
<dimen name="share_index_bottom_padding">22px</dimen>
<dimen name="share_btn_middle_padding">54px</dimen>
<dimen name="v2x_panel_btn_translationY">-10px</dimen>
<dimen name="v2x_panel_btn_image_width">114px</dimen>

View File

@@ -56,6 +56,7 @@
<dimen name="v2x_index_rating_top">17px</dimen>
<dimen name="share_top_text_size">14px</dimen>
<dimen name="share_des_num_size">36px</dimen>
<dimen name="des_text_margin_bottom">22px</dimen>
<dimen name="share_index_des_size">16px</dimen>
<dimen name="share_empty_btn_padding">20px</dimen>
<dimen name="shaer_refresh_padding">34px</dimen>