Merge branch 'dev' into demo/shunyi_v2v_merge
# Conflicts: # app/src/main/java/com/mogo/launcher/MogoApplication.java # config.gradle # foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java # modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml # modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml # modules/mogo-module-extensions/src/main/res/values/dimens.xml # modules/mogo-module-media/src/main/java/com/mogo/module/media/window/MediaWindow2.java # modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help.xml # modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml # modules/mogo-module-v2x/src/main/res/values/dimens.xml # services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java # services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java # upload.sh
This commit is contained in:
@@ -5,7 +5,7 @@ import com.mogo.commons.data.BaseData;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 上报分享
|
||||
* @description 上报分享 废弃
|
||||
* @since 2020-01-09
|
||||
*/
|
||||
public interface UploadShareCallback {
|
||||
|
||||
@@ -110,6 +110,4 @@ public class TanluConstants {
|
||||
//视频播放
|
||||
public static final String CARNET_USER_VIDEO_PLAY = "CarNet_user_video_play";
|
||||
|
||||
public static final String LAUNCHER_MARKER_ICON_CLICK = "Launcher_Icon_Click";
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,34 +2,21 @@ package com.mogo.module.tanlu.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.tanlu.callback.DataSetChangedAdapter;
|
||||
import com.mogo.module.tanlu.model.event.MarkerInfo;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.service.tanlu.IMogoTanluUiProvider;
|
||||
import com.mogo.service.share.IMogoTanluUiProvider;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import io.reactivex.Single;
|
||||
import io.reactivex.SingleEmitter;
|
||||
import io.reactivex.SingleOnSubscribe;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Rect;
|
||||
import android.location.LocationManager;
|
||||
import android.net.Uri;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
@@ -20,6 +21,7 @@ import android.view.animation.LinearInterpolator;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.PagerSnapHelper;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@@ -29,6 +31,7 @@ import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
@@ -53,6 +56,9 @@ import com.mogo.module.common.entity.MarkerExploreWayItem;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.MarkerUserInfo;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.utils.Const;
|
||||
import com.mogo.module.tanlu.R;
|
||||
import com.mogo.module.tanlu.callback.DataSetChangedAdapter;
|
||||
import com.mogo.module.tanlu.callback.NaviCallback;
|
||||
@@ -76,6 +82,7 @@ import com.mogo.module.tanlu.model.event.MarkerInfo;
|
||||
import com.mogo.module.tanlu.model.event.PushTypeInfo;
|
||||
import com.mogo.module.tanlu.model.event.StartPlayInfo;
|
||||
import com.mogo.module.tanlu.model.event.VoiceControlUpInfo;
|
||||
import com.mogo.module.tanlu.util.LocationUtils;
|
||||
import com.mogo.module.tanlu.util.Utils;
|
||||
import com.mogo.module.tanlu.view.NetErrorDialog;
|
||||
import com.mogo.module.tanlu.view.UploadFailedDialog;
|
||||
@@ -162,6 +169,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
private List<MogoLatLng> passedByPoints;
|
||||
private IMogoRegisterCenter mMogoRegisterCenter;
|
||||
private String mKeywords;
|
||||
private String mCity;
|
||||
|
||||
//新修改
|
||||
private RecyclerView mLoopRecyclerView;
|
||||
@@ -424,7 +432,6 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private CountDownTimer mHideWindowTimer;
|
||||
|
||||
private void hideWindowTimerStart() {
|
||||
@@ -481,7 +488,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
if (mogoIntentManager != null) {
|
||||
// 同行者 xxx堵不堵唤醒词语音注册
|
||||
Logger.d(TAG, "initListener====");
|
||||
mogoIntentManager.registerIntentListener(TXZ_SPECIFIEDROAD_SEARCH,mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(TXZ_SPECIFIEDROAD_SEARCH, mogoIntentListener);
|
||||
// 通用唤醒词语音注册
|
||||
mogoIntentManager.registerIntentListener(SPECIFIEDROAD_SEARCH, mogoIntentListener);
|
||||
mogoIntentManager.registerIntentListener(PLAY_VIDEO_AWAKEN, mogoIntentListener);
|
||||
@@ -508,7 +515,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
// 直接执行相关查询操作
|
||||
Logger.d(TAG, "智慧出行在前台,可直接分享--->");
|
||||
realShare(intentStr, intent);
|
||||
}else{
|
||||
} else {
|
||||
// 需要打开智慧驾驶,然后执行操作
|
||||
Logger.d(TAG, "智慧出行没在前台,需要打开 --->");
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
@@ -522,7 +529,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
}
|
||||
};
|
||||
|
||||
public void realShare(String intentStr, Intent intent){
|
||||
public void realShare(String intentStr, Intent intent) {
|
||||
String data = intent.getStringExtra("data");
|
||||
Logger.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
|
||||
VoiceCmdData voiceData = null;
|
||||
@@ -545,6 +552,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
Logger.d(TAG, "拥堵和路况");
|
||||
voiceData = Utils.parseTOVoiceCmdData(data);
|
||||
voiceData.setObj(TYPE_NAME_BLOCK);
|
||||
mKeywords = voiceData.getLocation();
|
||||
break;
|
||||
case VOICE_COMMAND_NOVELTY_QUERY:
|
||||
Logger.d(TAG, "其他");
|
||||
@@ -557,6 +565,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
case TXZ_SPECIFIEDROAD_SEARCH:
|
||||
Logger.d(TAG, "同行者--xx堵不堵--唤醒--->");
|
||||
String keyWords = intent.getStringExtra("keywords");
|
||||
mKeywords = keyWords;
|
||||
String city = intent.getStringExtra("city");
|
||||
voiceData = new VoiceCmdData("", city + keyWords, TYPE_NAME_BLOCK);
|
||||
break;
|
||||
@@ -575,6 +584,10 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
}
|
||||
Logger.d(TAG, "onQueryRoadInfoSuccess roadInfoList.size() = " + roadInfoList.size()
|
||||
+ " >>currentLat = " + currentLat + " -->currentLon = " + currentLon);
|
||||
MogoLocation location = TanluServiceManager.getLocationClient().getLastKnowLocation();
|
||||
if (location != null) {
|
||||
mCity = location.getCityName();
|
||||
}
|
||||
initData(null, (List<MarkerExploreWay>) roadInfoList);
|
||||
addMarkersAction((List<MarkerExploreWay>) roadInfoList, currentLat, currentLon);
|
||||
}
|
||||
@@ -667,7 +680,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
marker.startScaleAnimation(0, 1.2f, 0, 1.2f, 300, new AccelerateInterpolator(), new OnMarkerAnimationListener() {
|
||||
@Override
|
||||
public void onAnimStart() {
|
||||
Logger.d(TAG, " onAnimStart ---1----> ");
|
||||
// Logger.d(TAG, " onAnimStart ---1----> ");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -974,29 +987,29 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onGetInfoFailed(final GetInfoError error) {
|
||||
mMogoStatusManager.setUploadingStatus(TanluConstants.MODEL_NAME, false);
|
||||
float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度
|
||||
Logger.d(TAG, "onGetInfoFailed bearing = " + bearing + " >>>type = " + error.type);
|
||||
//失败提示框
|
||||
if (error.type == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mErrorType = error.type;
|
||||
if (error.type.equals("100")) {
|
||||
//网络弹框
|
||||
if (errorDialog != null && errorDialog.isShowing()) {
|
||||
//TODO
|
||||
} else {
|
||||
showNetErrorDialog();
|
||||
}
|
||||
} else {
|
||||
if (customDialog != null && customDialog.isShowing()) {
|
||||
//TODO
|
||||
} else {
|
||||
showNormalDialog(error.type);
|
||||
}
|
||||
}
|
||||
// mMogoStatusManager.setUploadingStatus(TanluConstants.MODEL_NAME, false);
|
||||
// float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度
|
||||
// Logger.d(TAG, "onGetInfoFailed bearing = " + bearing + " >>>type = " + error.type);
|
||||
// //失败提示框
|
||||
// if (error.type == null) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// mErrorType = error.type;
|
||||
// if (error.type.equals("100")) {
|
||||
// //网络弹框
|
||||
// if (errorDialog != null && errorDialog.isShowing()) {
|
||||
// //TODO
|
||||
// } else {
|
||||
// showNetErrorDialog();
|
||||
// }
|
||||
// } else {
|
||||
// if (customDialog != null && customDialog.isShowing()) {
|
||||
// //TODO
|
||||
// } else {
|
||||
// showNormalDialog(error.type);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private UploadFailedDialog customDialog;
|
||||
@@ -1085,7 +1098,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
}
|
||||
|
||||
if (!NetworkUtils.isConnected(getContext())) { //没有网络
|
||||
TipToast.shortTip("分享失败,请检查网络",new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_fail)));
|
||||
TipToast.shortTip("分享失败,请检查网络", new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_fail)));
|
||||
} else {
|
||||
float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度
|
||||
Logger.d(TAG, "onMarkerInfo event.type = " + event.type + " >>event.lat = " + event.lat + " >>event.lon = " + event.lon + " >>event.imageUrl =" + event.imageUrl);
|
||||
@@ -1100,7 +1113,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
String.format(voiceShareSuccessTts, getMathRandom())), null);
|
||||
TipToast.shortTip("分享成功", new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_success)));
|
||||
|
||||
if(TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
|
||||
if (TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
|
||||
double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
Log.d(TAG, "onMarkerInfo lat = " + lat + " >>>> lon = " + lon);
|
||||
@@ -1526,16 +1539,14 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
|
||||
|
||||
//上报语音搜索
|
||||
private void trackVoiceSearch(int type) {
|
||||
Log.e(TAG, "type = " + type + "-- mCity =" + mCity + "-- mKeywords =" + mKeywords);
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
properties.put("searchtext", mKeywords);
|
||||
properties.put("inputlon", inputlon);
|
||||
properties.put("inputlat", inputlat);
|
||||
properties.put("datalon", datalon);
|
||||
properties.put("datalat", datalat);
|
||||
properties.put("searcharea", mKeywords);
|
||||
properties.put("city", mCity);
|
||||
mAnalytics.track(TanluConstants.CARNET_VOICE_SEARCH, properties);
|
||||
}
|
||||
|
||||
|
||||
private String getMathRandom() {
|
||||
Random random = new Random();
|
||||
int temp = random.nextInt(50) + 10;
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
* 持有服务接口实例
|
||||
*/
|
||||
public class TanluServiceManager {
|
||||
private static String TAG = "TanluServiceManager";
|
||||
private static IMogoMapService mMapService;
|
||||
private static IMogoPoiSearch mPoiSearch;
|
||||
private static IMogoLocationClient mLocationClient;
|
||||
|
||||
@@ -16,10 +16,12 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.carchattingprovider.ICarsChattingProvider;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.tanlu.R;
|
||||
@@ -42,6 +44,8 @@ import com.mogo.skin.support.SkinMode;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
import com.zhidao.carchattingprovider.CallChattingProviderConstant;
|
||||
import com.zhidao.carchattingprovider.MogoDriverInfo;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -81,6 +85,7 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
|
||||
private IMogoImageloader mogoImageloader;
|
||||
private ImageView mCloseImage;
|
||||
private RoundLayout mRoundLayout;
|
||||
private ICarsChattingProvider mCarsChattingProvider;
|
||||
|
||||
//media
|
||||
private GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
|
||||
@@ -100,7 +105,8 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
|
||||
this.mAnalytics = analytics;
|
||||
this.mTanluModelData = tanluModelData;
|
||||
this.mogoImageloader = mogoImageloader;
|
||||
mogoRegisterCenter.registerADASControlStatusChangedListener( TAG, this );
|
||||
mCarsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
|
||||
mogoRegisterCenter.registerADASControlStatusChangedListener(TAG, this);
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
}
|
||||
@@ -153,6 +159,14 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
|
||||
mTypeTv.setBackgroundResource(R.drawable.tanlu_event_type_red_bg);
|
||||
}
|
||||
|
||||
mHeadImage.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
clickHead(markerExploreWay);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//自研车机
|
||||
if (DebugConfig.getCarMachineType() == 0) {
|
||||
if (markerExploreWay.getUserInfo() != null) {
|
||||
@@ -256,6 +270,22 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void clickHead(MarkerExploreWay exploreWay) {
|
||||
MogoDriverInfo mogoDriverInfo = new MogoDriverInfo();
|
||||
int ageNumber = exploreWay.getUserInfo().getAgeNumber();
|
||||
mogoDriverInfo.setAge(ageNumber);
|
||||
String gender = exploreWay.getUserInfo().getGender();
|
||||
mogoDriverInfo.setGender(gender != null ? gender : null);
|
||||
String sn = exploreWay.getUserInfo().getSn();
|
||||
mogoDriverInfo.setSn(sn != null ? sn : "");
|
||||
String name = exploreWay.getUserInfo().getUserName();
|
||||
mogoDriverInfo.setUserName(name != null ? name : "");
|
||||
mogoDriverInfo.setUserHead(exploreWay.getUserInfo().getUserHead());
|
||||
mCarsChattingProvider.showUserWindow(TanluConstants.MODEL_NAME, mogoDriverInfo, mContext);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return markerExploreWayList == null ? 0 : markerExploreWayList.size();
|
||||
@@ -509,6 +539,9 @@ public class TanluSlideAdapterNew extends RecyclerView.Adapter<TanluSlideViewHol
|
||||
|
||||
@Override
|
||||
public void onMapUiModeChanged(EnumMapUI mapUI) {
|
||||
if ( mRoundLayout == null ) {
|
||||
return;
|
||||
}
|
||||
switch ( mapUI ) {
|
||||
case Type_Night:
|
||||
Log.d("liyz", "Type_Night ---------> ");
|
||||
|
||||
@@ -13,17 +13,15 @@ import org.greenrobot.eventbus.EventBus
|
||||
*/
|
||||
class MarkerInfoReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == "com.zhidao.roadcondition.marker.info"){
|
||||
var type = intent.getStringExtra("type")
|
||||
var fromType = intent.getStringExtra("fromType")
|
||||
var imageUrl = intent.getStringExtra("imageUrl")
|
||||
var lat = intent.getDoubleExtra("lat",0.0)
|
||||
var lon = intent.getDoubleExtra("lon",0.0) //经度
|
||||
var custom = intent.getBooleanExtra("custom", false)
|
||||
Log.d("MarkerInfoReceiver", "type =" + type + "---->lat =" + lat + "----lon =" + lon + " --custom = " + custom + "---imageUrl =" + imageUrl)
|
||||
if(DebugConfig.isLauncher()) {
|
||||
EventBus.getDefault().post(MarkerInfo(type, imageUrl, lon, lat, custom, fromType))
|
||||
}
|
||||
}
|
||||
// if (intent.action == "com.zhidao.roadcondition.marker.info"){
|
||||
// var type = intent.getStringExtra("type")
|
||||
// var fromType = intent.getStringExtra("fromType")
|
||||
// var imageUrl = intent.getStringExtra("imageUrl")
|
||||
// var lat = intent.getDoubleExtra("lat",0.0)
|
||||
// var lon = intent.getDoubleExtra("lon",0.0) //经度
|
||||
// var custom = intent.getBooleanExtra("custom", false)
|
||||
// Log.d("MarkerInfoReceiver", "type =" + type + "---->lat =" + lat + "----lon =" + lon + " --custom = " + custom + "---imageUrl =" + imageUrl)
|
||||
// EventBus.getDefault().post(MarkerInfo(type, imageUrl, lon, lat, custom, fromType))
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget
|
||||
import com.mogo.module.tanlu.R
|
||||
import com.mogo.utils.logger.Logger
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
|
||||
@@ -22,6 +23,11 @@ class SimpleCoverVideoPlayer : StandardGSYVideoPlayer {
|
||||
private lateinit var start: ImageView
|
||||
private lateinit var fullscreen: ImageView
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val TAG: String = "SimpleCoverVideoPlayer.kt"
|
||||
}
|
||||
|
||||
constructor(context: Context?) : super(context)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
|
||||
constructor(context: Context?, fullFlag: Boolean?) : super(context, fullFlag)
|
||||
@@ -131,6 +137,13 @@ class SimpleCoverVideoPlayer : StandardGSYVideoPlayer {
|
||||
super.onDetachedFromWindow()
|
||||
mProgressBar.progress = 0
|
||||
mFullPauseBitmap = null
|
||||
if (mAudioManager != null) {
|
||||
try {
|
||||
mAudioManager.abandonAudioFocus(onAudioFocusChangeListener)
|
||||
} catch (e: Exception) {
|
||||
Logger.e(TAG, e, "onDetachedFromWindow - abandonAudioFocus")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.mogo.module.tanlu.voice
|
||||
|
||||
import com.zhidao.auto.platform.voice.VoiceClient
|
||||
|
||||
/**
|
||||
* @description 声音控制类
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @since 2019-11-01
|
||||
*/
|
||||
object VoiceController {
|
||||
private lateinit var voiceClient: VoiceClient
|
||||
|
||||
// fun initVoice() {
|
||||
// voiceClient = VoiceClient.getInstance(BaseApplication.getAppContext())
|
||||
// }
|
||||
|
||||
/**
|
||||
* 设置语音命令回调接口
|
||||
* @param callBack
|
||||
*/
|
||||
fun setCallBack(callBack: VoiceClient.VoiceCmdCallBack) {
|
||||
voiceClient.setCallBack(callBack)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param speakText 语音播报内容
|
||||
*/
|
||||
fun speakVoice(speakText: String) {
|
||||
voiceClient.speakDefault(speakText)
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册免唤醒命令
|
||||
* @param customType 命令
|
||||
* @param customWakeupCmd 命令对应的唤醒词集合
|
||||
*/
|
||||
fun registerCustomWakeupCmd(customType: String, customWakeupCmd: Array<String>) {
|
||||
voiceClient.registerCustomWakeupCmd(customType, customWakeupCmd)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消免唤醒命令
|
||||
* @param customType 命令
|
||||
*/
|
||||
fun unRegisterCustomWakeupCmd(customType: String) {
|
||||
voiceClient.unRegisterCustomWakeupCmd(customType)
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放资源(界面销毁的时候调用)
|
||||
*/
|
||||
fun release() {
|
||||
voiceClient.release()
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 3.6 KiB |
Reference in New Issue
Block a user