Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,11 @@ public class ServiceConst {
|
||||
*/
|
||||
public static final String PATH_REFRESH_STRATEGY = "/strategy/refresh";
|
||||
|
||||
/**
|
||||
* tts语音配置
|
||||
*/
|
||||
public static final String PATH_TTS_CONFIG = "/ttsserver/tts";
|
||||
|
||||
/**
|
||||
* 倒计时消息
|
||||
*/
|
||||
|
||||
@@ -34,10 +34,10 @@ public class RefreshModel {
|
||||
|
||||
private static final String TAG = "RefreshModel";
|
||||
|
||||
public static final String HOST_DEV = "http://dzt-test.zhidaohulian.com";
|
||||
public static final String HOST_TEST = "http://dzt-test.zhidaohulian.com";
|
||||
public static final String HOST_DEMO = "http://dzt-show.zhidaohulian.com";
|
||||
public static final String HOST_PRODUCT = "https://dzt.zhidaohulian.com";
|
||||
public static final String HOST_DEV = "http://dzt-test.zhidaozhixing.com";
|
||||
public static final String HOST_TEST = "http://dzt-test.zhidaozhixing.com";
|
||||
public static final String HOST_DEMO = "http://dzt-show.zhidaozhixing.com";
|
||||
public static final String HOST_PRODUCT = "http://dzt.zhidaozhixing.com";
|
||||
|
||||
private final Context mContext;
|
||||
private RefreshApiService mRefreshApiService;
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.module.service.network.bean;
|
||||
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
/**
|
||||
* @author :zhuangyan
|
||||
* @date : 2020/11/17 11:43
|
||||
* @desc :分体机tts播报信息返回
|
||||
*/
|
||||
public class TtsConfigEntity extends BaseData {
|
||||
private String ttsWord;
|
||||
|
||||
public String getTtsWord() {
|
||||
return ttsWord;
|
||||
}
|
||||
|
||||
public void setTtsWord(String ttsWord) {
|
||||
this.ttsWord = ttsWord;
|
||||
}
|
||||
}
|
||||
@@ -32,34 +32,34 @@ import java.util.List;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class OnlineCarPanelAdapter extends RecyclerView.Adapter< OnlineCarPanelAdapter.VH > {
|
||||
class OnlineCarPanelAdapter extends RecyclerView.Adapter<OnlineCarPanelAdapter.VH> {
|
||||
|
||||
private static final String TAG = "OnlineCarPanelAdapter";
|
||||
|
||||
private List< MarkerOnlineCar > mDatums;
|
||||
private List<MarkerOnlineCar> mDatums;
|
||||
private double mToLon;
|
||||
private double mToLat;
|
||||
|
||||
public OnlineCarPanelAdapter( List< MarkerOnlineCar > mDatums, double mToLon, double mToLat ) {
|
||||
public OnlineCarPanelAdapter(List<MarkerOnlineCar> mDatums, double mToLon, double mToLat) {
|
||||
this.mDatums = mDatums;
|
||||
this.mToLon = mToLon;
|
||||
this.mToLat = mToLat;
|
||||
}
|
||||
|
||||
public void setDatums( List< MarkerOnlineCar > mDatums ) {
|
||||
public void setDatums(List<MarkerOnlineCar> mDatums) {
|
||||
this.mDatums = mDatums;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public OnlineCarPanelAdapter.VH onCreateViewHolder( @NonNull ViewGroup parent, int viewType ) {
|
||||
return new VH( LayoutInflater.from( parent.getContext() ).inflate( R.layout.module_services_online_car_panel_item, null ) );
|
||||
public OnlineCarPanelAdapter.VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new VH(LayoutInflater.from(parent.getContext()).inflate(R.layout.module_services_online_car_panel_item, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder( @NonNull OnlineCarPanelAdapter.VH holder, int position ) {
|
||||
holder.bind( mDatums.get( position ), mToLon, mToLat );
|
||||
public void onBindViewHolder(@NonNull OnlineCarPanelAdapter.VH holder, int position) {
|
||||
holder.bind(mDatums.get(position), mToLon, mToLat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,32 +73,37 @@ class OnlineCarPanelAdapter extends RecyclerView.Adapter< OnlineCarPanelAdapter.
|
||||
private TextView nickname;
|
||||
private TextView distance;
|
||||
private TextView detail;
|
||||
private TextView call;
|
||||
|
||||
public VH( @NonNull View itemView ) {
|
||||
super( itemView );
|
||||
RecyclerView.LayoutParams params = new RecyclerView.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT );
|
||||
params.bottomMargin = ResourcesHelper.getDimensionPixelSize( itemView.getContext(), R.dimen.module_services_panel_item_marginBottom );
|
||||
itemView.setLayoutParams( params );
|
||||
avatar = itemView.findViewById( R.id.module_services_id_panel_item_avatar );
|
||||
nickname = itemView.findViewById( R.id.module_services_id_panel_item_nickname );
|
||||
distance = itemView.findViewById( R.id.module_services_id_panel_item_distance );
|
||||
detail = itemView.findViewById( R.id.module_services_id_panel_item_detail );
|
||||
public VH(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
RecyclerView.LayoutParams params = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
params.bottomMargin = ResourcesHelper.getDimensionPixelSize(itemView.getContext(), R.dimen.module_services_panel_item_marginBottom);
|
||||
itemView.setLayoutParams(params);
|
||||
avatar = itemView.findViewById(R.id.module_services_id_panel_item_avatar);
|
||||
nickname = itemView.findViewById(R.id.module_services_id_panel_item_nickname);
|
||||
distance = itemView.findViewById(R.id.module_services_id_panel_item_distance);
|
||||
detail = itemView.findViewById(R.id.module_services_id_panel_item_detail);
|
||||
call = itemView.findViewById(R.id.module_services_id_panel_item_call);
|
||||
}
|
||||
|
||||
public void bind( MarkerOnlineCar car, double lon, double lat ) {
|
||||
RequestOptions options = new RequestOptions().circleCrop().placeholder( R.drawable.module_common_default_user_head ).error( R.drawable.module_common_default_user_head );
|
||||
GlideApp.with( itemView.getContext() ).asBitmap().apply( options ).load( car.getUserInfo().getUserHead() ).into( new SkinAbleBitmapTarget( avatar, options ) );
|
||||
nickname.setText( car.getUserInfo().getUserName() );
|
||||
String content = getDistanceStr( car.getLocation(), lon, lat );
|
||||
distance.setText( content );
|
||||
detail.setOnClickListener( view -> {
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "Mogoer_List_click", null );
|
||||
public void bind(MarkerOnlineCar car, double lon, double lat) {
|
||||
RequestOptions options = new RequestOptions().circleCrop().placeholder(R.drawable.module_common_default_user_head).error(R.drawable.module_common_default_user_head);
|
||||
GlideApp.with(itemView.getContext()).asBitmap().apply(options).load(car.getUserInfo().getUserHead()).into(new SkinAbleBitmapTarget(avatar, options));
|
||||
nickname.setText(car.getUserInfo().getUserName());
|
||||
String content = getDistanceStr(car.getLocation(), lon, lat);
|
||||
distance.setText(content);
|
||||
detail.setOnClickListener(view -> {
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("Mogoer_List_click", null);
|
||||
try {
|
||||
CallChatApi.getInstance().showUserWindow( itemView.getContext(), car );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "detail.OnClick" );
|
||||
CallChatApi.getInstance().showUserWindow(itemView.getContext(), car);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "detail.OnClick");
|
||||
}
|
||||
} );
|
||||
});
|
||||
call.setOnClickListener(view -> {
|
||||
//TODO 拨打电话
|
||||
});
|
||||
}
|
||||
|
||||
private String getDistanceStr( MarkerLocation location, double lon, double lat ) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mogo.module.service.ttsConfig;
|
||||
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.module.service.network.bean.TtsConfigEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* @author :zhuangyan
|
||||
* @date : 2020/11/16 15:09
|
||||
* @desc :
|
||||
*/
|
||||
public interface TtsConfigApiService {
|
||||
/**
|
||||
* 查询语音Tts 的
|
||||
*
|
||||
*/
|
||||
@FormUrlEncoded
|
||||
@POST("/yycp-tmcServer/tmcServer/car/reportTraffic/v1")
|
||||
Observable<TtsConfigEntity> inquireForTts(@FieldMap Map<String, Object> parames);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.mogo.module.service.ttsConfig;
|
||||
|
||||
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.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
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.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;
|
||||
|
||||
import static com.mogo.commons.AbsMogoApplication.getApp;
|
||||
|
||||
/**
|
||||
* @author :zhuangyan
|
||||
* @date : 2020/11/16 15:04
|
||||
* @desc :
|
||||
*/
|
||||
public class TtsConfigModleData {
|
||||
private static final String TAG = "TrafficModelData";
|
||||
private final TtsConfigApiService mTtsConfigApiService;
|
||||
|
||||
|
||||
public 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
|
||||
*/
|
||||
public void playTts(RefreshCallback<TtsConfigEntity> ttsCallback) {
|
||||
|
||||
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)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new SubscribeImpl<TtsConfigEntity>(RequestOptions.create( getApp().getApplicationContext())) {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
|
||||
ttsCallback.onFail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(TtsConfigEntity o) {
|
||||
super.onSuccess(o);
|
||||
ttsCallback.onSuccess(o);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.mogo.module.service.ttsConfig;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
|
||||
/**
|
||||
* @author :zhuangyan
|
||||
* @date : 2020/11/16 15:01
|
||||
* @desc :进入页面的时候 根据配置 播放tts语音
|
||||
*/
|
||||
@Route( path = ServiceConst.PATH_TTS_CONFIG )
|
||||
public class TtsConfigProvider implements IProvider {
|
||||
private final String TAG = "TtsConfigProvider";
|
||||
|
||||
private TtsConfigModleData mTtsModleData;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Log.d(TAG, "TtsConfigProvider provider init……");
|
||||
if (mTtsModleData==null) {
|
||||
mTtsModleData=new TtsConfigModleData();
|
||||
}
|
||||
mTtsModleData.playTts(new RefreshCallback<TtsConfigEntity>() {
|
||||
@Override
|
||||
public void onSuccess(TtsConfigEntity o) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail() {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,14 @@ public class GlobalUnwakeConst {
|
||||
*/
|
||||
public static final String UNWAKE_UPLOAD_REAL_TIME_TRAFFIC = "command_upload_real_time_traffic";
|
||||
|
||||
/**
|
||||
* 唤醒词查询出行动态
|
||||
*/
|
||||
public static final String VOICE_QUERY_HISTORY_INDEX = "com.zhidao.query.trip.event";
|
||||
/**
|
||||
* 唤醒词查询周边事件
|
||||
*/
|
||||
public static final String VOICE_QUERY_SURROUNDING_INDEX = "com.zhidao.query.nearby.event";
|
||||
/**
|
||||
* 唤醒词查询热心指数
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,8 @@ import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_PUB_ROA
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_PUB_TROUBLE_HELP;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_CMD_SHARE_DIALOG_CLOSE;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_QUERY_HEART_INDEX;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_QUERY_HISTORY_INDEX;
|
||||
import static com.mogo.module.service.unwake.GlobalUnwakeConst.VOICE_QUERY_SURROUNDING_INDEX;
|
||||
|
||||
/**
|
||||
* 全局免唤醒管理
|
||||
@@ -48,6 +50,8 @@ public class GlobalUnwakeManager implements IProvider, IMogoIntentListener, IMog
|
||||
intentManager.registerIntentListener(VOICE_CMD_NO_REPLY_SHARE_DIALOG_CLOSE, this);
|
||||
intentManager.registerIntentListener(UNWAKE_UPLOAD_ROAD_CONDITION, this);
|
||||
intentManager.registerIntentListener(VOICE_QUERY_HEART_INDEX, this);
|
||||
intentManager.registerIntentListener(VOICE_QUERY_HISTORY_INDEX, this);
|
||||
intentManager.registerIntentListener(VOICE_QUERY_SURROUNDING_INDEX, this);
|
||||
|
||||
// 免唤醒词注册,全局免唤醒
|
||||
AIAssist.getInstance(context).registerUnWakeupCommand(UNWAKE_UPLOAD_REAL_TIME_TRAFFIC,
|
||||
|
||||
Reference in New Issue
Block a user