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

# Conflicts:
#	modules/mogo-module-service/src/main/java/com/mogo/module/service/ttsConfig/TtsConfigProvider.java
This commit is contained in:
wangcongtao
2020-11-20 09:53:42 +08:00
589 changed files with 14439 additions and 504 deletions

View File

@@ -8,7 +8,6 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.navi.IMogoNavi;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.entity.MarkerShowEntity;
@@ -29,6 +28,7 @@ import com.mogo.service.module.IMogoRegisterCenter;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
import com.zhidao.carchattingprovider.ICarsChattingProvider;
/**
* author : donghongyu

View File

@@ -35,7 +35,6 @@ 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.carchattingprovider.ICarsChattingProvider;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
@@ -78,6 +77,7 @@ 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.ICarsChattingProvider;
import com.zhidao.smartv2x.common.utils.LoggerUtils;
import org.json.JSONObject;
@@ -336,8 +336,6 @@ public class MogoServices implements IMogoMapListener,
playAppTts();
//
} else {
unregisterInternalUnWakeupWords();
stopAutoRefreshStrategy();
@@ -391,20 +389,7 @@ public class MogoServices implements IMogoMapListener,
if (DebugConfig.isLauncher()) {
return;
}
mTtsModle.playTts(new RefreshCallback<TtsConfigEntity>() {
@Override
public void onSuccess(TtsConfigEntity o) {
if (!TextUtils.isEmpty(o.getTtsWord())) {
AIAssist.getInstance(mContext).speakTTSVoice(o.getTtsWord(), null);
}
}
@Override
public void onFail() {
Log.e(TAG, "获取Tts失败");
}
});
mTtsModle.playTts();
}
/**

View File

@@ -1,18 +1,19 @@
package com.mogo.module.service.marker;
import com.mogo.module.carchattingprovider.ICallProviderResponse;
import com.zhidao.carchattingprovider.ICallProviderResponse;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public
/**
* @author congtaowang
* @since 2020/9/28
*
* 描述
*/
abstract class CallProviderResponseImpl implements ICallProviderResponse {
public abstract class CallProviderResponseImpl implements ICallProviderResponse {
@Override
public void addFriend( boolean b ) {
@@ -24,11 +25,6 @@ abstract class CallProviderResponseImpl implements ICallProviderResponse {
}
@Override
public void callStatus( int i ) {
}
@Override
public void callWindowStatus( boolean b ) {

View File

@@ -194,19 +194,13 @@ public class UserDataMarkerInfoWindowAdapter implements IMogoInfoWindowAdapter {
params.put( CallChattingProviderConstant.CCPROVIDER_LON, location.getLon() + "" );
}
Logger.d( TAG, "call parameters: %s", params );
if ( MarkerServiceHandler.getApis().getStatusManagerApi().isV2XShow() ) {
MarkerServiceHandler.getCarChatting().callShowWindow( params );
} else {
MarkerServiceHandler.getCarChatting().call( params );
}
MarkerServiceHandler.getCarChatting().call( params );
}
protected void loadImageHeader( final MarkerShowEntity markerShowEntity ) {
if ( Looper.myLooper() != Looper.getMainLooper() ) {
UiThreadHandler.post( () -> {
runOnUiThread( markerShowEntity );
} );
UiThreadHandler.post( () -> runOnUiThread( markerShowEntity ));
} else {
runOnUiThread( markerShowEntity );
}

View File

@@ -8,13 +8,25 @@ import com.mogo.commons.data.BaseData;
* @desc :分体机tts播报信息返回
*/
public class TtsConfigEntity extends BaseData {
private String ttsWord;
public Result result;
public String getTtsWord() {
return ttsWord;
public Result getResult() {
return result;
}
public void setTtsWord(String ttsWord) {
this.ttsWord = ttsWord;
public void setResult(Result result) {
this.result = result;
}
public static class Result {
private String word;
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
}
}

View File

@@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.bumptech.glide.request.RequestOptions;
import com.mogo.map.location.MogoLocation;
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.api.CallChatApi;
import com.mogo.module.common.entity.MarkerLocation;
@@ -23,10 +22,10 @@ import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.module.service.Utils;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.WindowUtils;
import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
import com.zhidao.carchattingprovider.ICarsChattingProvider;
import java.util.HashMap;
import java.util.List;
@@ -67,7 +66,6 @@ class OnlineCarPanelAdapter extends RecyclerView.Adapter<OnlineCarPanelAdapter.V
public void onBindViewHolder(@NonNull OnlineCarPanelAdapter.VH holder, int position) {
holder.bind(mDatums.get(position), mToLon, mToLat);
holder.call.setOnClickListener(view -> {
//TODO 拨打电话
Map<String, String> params = new HashMap<>();
MarkerUserInfo userInfo = mDatums.get(position).getUserInfo();
params.put(CallChattingProviderConstant.CCPROVIDER_SN, userInfo.getSn());
@@ -123,11 +121,6 @@ class OnlineCarPanelAdapter extends RecyclerView.Adapter<OnlineCarPanelAdapter.V
Logger.e(TAG, e, "detail.OnClick");
}
});
// call.setOnClickListener(view -> {
// //TODO 拨打电话
//
//
// });
}
private String getDistanceStr(MarkerLocation location, double lon, double lat) {

View File

@@ -8,6 +8,7 @@ import java.util.Map;
import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
/**
@@ -20,7 +21,6 @@ public interface TtsConfigApiService {
* 查询语音Tts 的
*
*/
@FormUrlEncoded
@POST("/yycp-tmcServer/tmcServer/car/reportTraffic/v1")
Observable<TtsConfigEntity> inquireForTts(@FieldMap Map<String, Object> parames);
@GET("/yycp-carDataService/car/ttsWord/no/getTTSWord/v1")
Observable<TtsConfigEntity> inquireForTts();
}

View File

@@ -1,22 +1,18 @@
package com.mogo.module.service.ttsConfig;
import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.data.BaseData;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.module.service.network.RefreshCallback;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.service.network.RefreshModel;
import com.mogo.module.service.network.bean.TtsConfigEntity;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.network.IMogoNetwork;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.RequestOptions;
import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
@@ -36,34 +32,37 @@ public class TtsConfigModleData {
IMogoNetwork network = (IMogoNetwork) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_NETWORK).navigation(getApp().getApplicationContext());
mTtsConfigApiService = network.create(TtsConfigApiService.class, RefreshModel.getNetHost());
}
/**
* 独立app根据后台配置 播放tts
* @param
*
* @param
* @param
* @param
*/
public void playTts(RefreshCallback<TtsConfigEntity> ttsCallback) {
public void playTts() {
final ParamsProvider.Builder builder = new ParamsProvider.Builder( getApp().getApplicationContext());
Map<String, Object> parameters = builder.build();
parameters.put("sn", Utils.getSn());
Log.d("zytest","playTts获取语音配置的网络请求");
// parameters.put("data", GsonUtil.jsonFromObject(uploadTrafficEntity));
mTtsConfigApiService.inquireForTts(parameters)
if (DebugConfig.isLauncher()) {
return;
}
mTtsConfigApiService.inquireForTts()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SubscribeImpl<TtsConfigEntity>(RequestOptions.create( getApp().getApplicationContext())) {
.subscribe(new SubscribeImpl<TtsConfigEntity>(RequestOptions.create(getApp().getApplicationContext())) {
@Override
public void onError(Throwable e) {
super.onError(e);
Log.e("zytest", e.toString());
ttsCallback.onFail();
}
@Override
public void onSuccess(TtsConfigEntity o) {
super.onSuccess(o);
ttsCallback.onSuccess(o);
Log.e("zytest", "播放语音了====" + o.getResult().getWord());
if (!TextUtils.isEmpty(o.getResult().getWord())) {
AIAssist.getInstance(getApp().getApplicationContext()).speakTTSVoice(o.getResult().getWord());
}
}
});

View File

@@ -1,10 +1,12 @@
package com.mogo.module.service.ttsConfig;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.service.network.RefreshCallback;
import com.mogo.module.service.network.bean.TtsConfigEntity;
@@ -14,26 +16,20 @@ import com.mogo.module.service.network.bean.TtsConfigEntity;
* @date : 2020/11/16 15:01
* @desc :进入页面的时候 根据配置 播放tts语音
*/
@Route( path = ServiceConst.PATH_TTS_CONFIG )
@Route(path = ServiceConst.PATH_TTS_CONFIG)
public class TtsConfigProvider implements IProvider {
private final String TAG = "TtsConfigProvider";
private Context mContext;
private TtsConfigModleData mTtsModleData;
@Override
public void init(Context context) {
mContext = context;
Log.d(TAG, "TtsConfigProvider provider init……");
if (mTtsModleData==null) {
mTtsModleData=new TtsConfigModleData();
if (mTtsModleData == null) {
mTtsModleData = new TtsConfigModleData();
}
mTtsModleData.playTts(new RefreshCallback< TtsConfigEntity >() {
@Override
public void onSuccess(TtsConfigEntity o) {
}
@Override
public void onFail() {
}
});
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 );

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

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/service_car_pannel_call_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/service_car_pannel_call_nomal" android:state_pressed="false" />
<item android:drawable="@drawable/service_car_pannel_call_nomal" />
</selector>

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/service_car_pannel_call_pressed_light" android:state_pressed="true" />
<item android:drawable="@drawable/service_car_pannel_call_nomal_light" android:state_pressed="false" />
<item android:drawable="@drawable/service_car_pannel_call_nomal_light" />
</selector>

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/service_car_pannel_detials_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/service_car_pannel_detials_nomal" android:state_pressed="false" />
<item android:drawable="@drawable/service_car_pannel_detials_nomal" />
</selector>

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/service_car_pannel_detials_pressed_light" android:state_pressed="true" />
<item android:drawable="@drawable/service_car_pannel_detials_nomal_light" android:state_pressed="false" />
<item android:drawable="@drawable/service_car_pannel_detials_nomal_light" />
</selector>

View File

@@ -57,12 +57,11 @@
<TextView
android:id="@+id/module_services_id_panel_item_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:background="@drawable/module_services_panel_item_detail_bkg"
android:layout_width="@dimen/modle_car_panel_call"
android:layout_height="@dimen/modle_car_panel_call"
android:layout_marginEnd="@dimen/modle_car_panel_call_margin"
android:background="@drawable/selector_service_car_pannel_call"
android:padding="@dimen/module_services_panel_item_detail_padding"
android:text="@string/module_services_panel_item_call"
android:textColor="@color/module_services_panel_item_detail_textColor"
android:textSize="@dimen/module_services_panel_item_detail_textSize"
android:textStyle="bold"
@@ -74,14 +73,14 @@
<TextView
android:id="@+id/module_services_id_panel_item_detail"
android:layout_width="wrap_content"
android:background="@drawable/module_services_panel_item_detail_bkg"
android:layout_height="wrap_content"
android:layout_width="@dimen/modle_car_panel_call"
android:background="@drawable/selector_service_car_pannel_detials"
android:layout_height="@dimen/modle_car_panel_call"
android:padding="@dimen/module_services_panel_item_detail_padding"
android:text="@string/module_services_panel_item_detail_text"
android:textStyle="bold"
android:textColor="@color/module_services_panel_item_detail_textColor"
android:textSize="@dimen/module_services_panel_item_detail_textSize"
android:layout_marginEnd="@dimen/dp_46"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

View File

@@ -22,6 +22,13 @@
<dimen name="module_service_content_minWidth">64px</dimen>
<dimen name="module_service_id_marker_content_paddingRight">6.5px</dimen>
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">10px</dimen>
<dimen name="modle_car_panel_call">54px</dimen>
<dimen name="modle_car_panel_call_margin">20px</dimen>
<dimen name="modle_car_panel_call_margin_left">22px</dimen>
<dimen name="module_v2x_surrounding_list_margin_left">12px</dimen>
<dimen name="module_v2x_surrounding_item_margin_left">16px</dimen>
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>

View File

@@ -22,6 +22,12 @@
<dimen name="module_service_content_minWidth">64px</dimen>
<dimen name="module_service_id_marker_content_paddingRight">6.5px</dimen>
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">10px</dimen>
<dimen name="modle_car_panel_call">54px</dimen>
<dimen name="modle_car_panel_call_margin">20px</dimen>
<dimen name="modle_car_panel_call_margin_left">22px</dimen>
<dimen name="module_v2x_surrounding_list_margin_left">12px</dimen>
<dimen name="module_v2x_surrounding_item_margin_left">16px</dimen>
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>

View File

@@ -23,6 +23,11 @@
<dimen name="module_service_content_minWidth">120px</dimen>
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
<dimen name="modle_car_panel_call">98px</dimen>
<dimen name="modle_car_panel_call_margin">46px</dimen>
<dimen name="modle_car_panel_call_margin_left">40px</dimen>
<dimen name="module_services_online_car_panel_marginTop">20px</dimen>
<dimen name="module_services_online_car_panel_marginBottom">20px</dimen>
<dimen name="module_services_online_car_panel_marginRight">20px</dimen>

View File

@@ -29,6 +29,11 @@
<dimen name="module_services_online_car_panel_paddingLeft">50px</dimen>
<dimen name="module_services_online_car_panel_paddingBottom">28px</dimen>
<dimen name="modle_car_panel_call">98px</dimen>
<dimen name="modle_car_panel_call_margin">46px</dimen>
<dimen name="modle_car_panel_call_margin_left">40px</dimen>
<dimen name="module_services_online_car_panel_close_margin_top">36px</dimen>
<dimen name="module_services_online_car_panel_title_margin_top">50px</dimen>
<dimen name="module_services_online_car_panel_title_text_size">36px</dimen>

View File

@@ -23,6 +23,11 @@
<dimen name="module_service_content_minWidth">120px</dimen>
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
<dimen name="modle_car_panel_call">98px</dimen>
<dimen name="modle_car_panel_call_margin">46px</dimen>
<dimen name="modle_car_panel_call_margin_left">40px</dimen>
<dimen name="module_services_online_car_panel_marginTop">2px</dimen>
<dimen name="module_services_online_car_panel_marginBottom">2px</dimen>
<dimen name="module_services_online_car_panel_marginRight">0px</dimen>