Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
This commit is contained in:
@@ -63,6 +63,8 @@ import com.mogo.module.tanlu.video.FullMediaActivity;
|
||||
import com.mogo.module.tanlu.video.SimpleCoverVideoPlayer;
|
||||
import com.mogo.module.tanlu.view.AutoZoomInImageView;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
import com.mogo.service.voice.IMogoVoiceListener;
|
||||
import com.mogo.service.voice.IMogoVoiceManager;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
@@ -84,7 +86,7 @@ import static com.mogo.module.tanlu.video.VideoInitKt.initVideo;
|
||||
* @description 探路卡片
|
||||
* @since 2020-01-02
|
||||
*/
|
||||
public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView > >
|
||||
public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
|
||||
implements IView,
|
||||
IMogoMarkerClickListener,
|
||||
IMogoModuleLifecycle,
|
||||
@@ -103,6 +105,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
private IMogoSocketManager mMogoSocketManager;
|
||||
private IMogoLocationClient mLocationClient;
|
||||
private IMogoCardManager iMogoCardManager;
|
||||
private IMogoVoiceManager mMogoVoiceManager;
|
||||
|
||||
//声音控制文字
|
||||
private String voiceGetInfoMationTts;
|
||||
@@ -125,11 +128,11 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
private TextView mDistanceTv;
|
||||
private TextView mTimeTv;
|
||||
|
||||
private List< MarkerExploreWay > markerExploreWayList = new ArrayList<>();
|
||||
private List<MarkerExploreWay> markerExploreWayList = new ArrayList<>();
|
||||
private int currentPosition = 0; //卡片媒体当前位置
|
||||
private Bitmap mMarkerIcon;
|
||||
private TanluModelData mTanluModelData;
|
||||
private List< MogoLatLng > passedByPoints;
|
||||
private List<MogoLatLng> passedByPoints;
|
||||
private IMogoRegisterCenter mMogoRegisterCenter;
|
||||
|
||||
|
||||
@@ -141,70 +144,74 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
@Override
|
||||
protected void initViews() {
|
||||
initVideo();
|
||||
simpleCoverVideoPlayer = findViewById( R.id.video_player_main );
|
||||
autoZoomInImageView = findViewById( R.id.tanlu_photo_imageView );
|
||||
mPreviousTv = findViewById( R.id.tv_previous_res );
|
||||
mNextTv = findViewById( R.id.tv_next_res );
|
||||
mRootLayout = findViewById( R.id.layout_data_show );
|
||||
mEmptyLayout = findViewById( R.id.layout_empty_data_show );
|
||||
mEmptyTv = findViewById( R.id.tv_main_empty );
|
||||
mAddressTv = findViewById( R.id.tv_information_media_content );
|
||||
mDistanceTv = findViewById( R.id.tv_distance_video );
|
||||
mTimeTv = findViewById( R.id.tv_information_media_time );
|
||||
simpleCoverVideoPlayer = findViewById(R.id.video_player_main);
|
||||
autoZoomInImageView = findViewById(R.id.tanlu_photo_imageView);
|
||||
mPreviousTv = findViewById(R.id.tv_previous_res);
|
||||
mNextTv = findViewById(R.id.tv_next_res);
|
||||
mRootLayout = findViewById(R.id.layout_data_show);
|
||||
mEmptyLayout = findViewById(R.id.layout_empty_data_show);
|
||||
mEmptyTv = findViewById(R.id.tv_main_empty);
|
||||
mAddressTv = findViewById(R.id.tv_information_media_content);
|
||||
mDistanceTv = findViewById(R.id.tv_distance_video);
|
||||
mTimeTv = findViewById(R.id.tv_information_media_time);
|
||||
|
||||
mPreviousTv.setOnClickListener( this );
|
||||
mNextTv.setOnClickListener( this );
|
||||
mEmptyTv.setOnClickListener( this );
|
||||
mPreviousTv.setOnClickListener(this);
|
||||
mNextTv.setOnClickListener(this);
|
||||
mEmptyTv.setOnClickListener(this);
|
||||
|
||||
simpleCoverVideoPlayer.setVisibility( View.VISIBLE );
|
||||
autoZoomInImageView.setVisibility( View.GONE );
|
||||
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
|
||||
autoZoomInImageView.setVisibility(View.GONE);
|
||||
|
||||
//视频配置 TODO 需要去掉
|
||||
// gsyVideoOptionBuilder.setUrl(mVideoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
// .build(simpleCoverVideoPlayer);
|
||||
simpleCoverVideoPlayer.getStartButton().setOnClickListener( new View.OnClickListener() {
|
||||
simpleCoverVideoPlayer.getStartButton().setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View view ) {
|
||||
Logger.d( TAG, "simpleCoverVideoPlayer onClick -------> " );
|
||||
FullMediaActivity.Companion.launch( getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime );
|
||||
public void onClick(View view) {
|
||||
Logger.d(TAG, "simpleCoverVideoPlayer onClick -------> ");
|
||||
FullMediaActivity.Companion.launch(getActivity(), mVideoUrl, mImageUrl, mTitle, mGenerateTime);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void initInterface() {
|
||||
//图片配置
|
||||
mogoImageloader = ( IMogoImageloader ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_IMAGE_LOADER ).navigation();
|
||||
mogoImageloader = (IMogoImageloader) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_IMAGE_LOADER).navigation();
|
||||
//地图marker
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getActivity() );
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getActivity());
|
||||
//切换卡片操作
|
||||
iMogoCardManager = ( IMogoCardManager ) ARouter.getInstance().build( MogoServicePaths.PATH_CARD_MANAGER ).navigation( getActivity() );
|
||||
iMogoCardManager = (IMogoCardManager) ARouter.getInstance().build(MogoServicePaths.PATH_CARD_MANAGER).navigation(getActivity());
|
||||
|
||||
mMogoRegisterCenter = ( IMogoRegisterCenter ) ARouter.getInstance().build( MogoServicePaths.PATH_REGISTER_CENTER ).navigation( getContext() );
|
||||
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
|
||||
|
||||
|
||||
mMogoRegisterCenter.registerMogoModuleLifecycle( TanluConstants.MODEL_NAME, this );
|
||||
mMogoRegisterCenter.registerMogoModuleLifecycle(TanluConstants.MODEL_NAME, this);
|
||||
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext());
|
||||
//语音操作
|
||||
mMogoVoiceManager = (IMogoVoiceManager) ARouter.getInstance().build(MogoServicePaths.PATH_VOICE_MANAGER).navigation(getContext());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
getViewLifecycleOwner().getLifecycle().addObserver( mPresenter );
|
||||
EventBus.getDefault().register( this );
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
getViewLifecycleOwner().getLifecycle().addObserver(mPresenter);
|
||||
EventBus.getDefault().register(this);
|
||||
initInterface();
|
||||
initModelData();
|
||||
handleRoadLineMessage();
|
||||
initMap();
|
||||
initStrings();
|
||||
initListener();
|
||||
|
||||
//TODO切换探路卡片
|
||||
// iMogoCardManager.switch2(TanluConstants.MODEL_NAME);
|
||||
}
|
||||
|
||||
private void initModelData() {
|
||||
if ( mTanluModelData == null ) {
|
||||
mTanluModelData = new TanluModelData( getContext() );
|
||||
if (mTanluModelData == null) {
|
||||
mTanluModelData = new TanluModelData(getContext());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +219,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
* 初始化导航 TODO
|
||||
*/
|
||||
private void initMap() {
|
||||
mMogoRegisterCenter.registerMogoNaviListener( TanluConstants.MODEL_NAME, new IMogoNaviListener() {
|
||||
mMogoRegisterCenter.registerMogoNaviListener(TanluConstants.MODEL_NAME, new IMogoNaviListener() {
|
||||
@Override
|
||||
public void onInitNaviFailure() {
|
||||
|
||||
@@ -224,7 +231,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
|
||||
}
|
||||
|
||||
@@ -248,47 +255,60 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
public void onoCalculateFailed() {
|
||||
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
//监听marker点击
|
||||
mMogoRegisterCenter.registerMogoMarkerClickListener( TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
|
||||
mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
//点击marker以后,确认他的位置?然后点击下一个操作 TODO
|
||||
MarkerExploreWay exploreWay = extractFromMarker(marker);
|
||||
if ( exploreWay == null ) {
|
||||
if (exploreWay == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( exploreWay.getFileType() == 0 ) { //图片
|
||||
refreshPhotoData( exploreWay );
|
||||
} else if ( exploreWay.getFileType() == 1 ) { //视频
|
||||
handleData( exploreWay );
|
||||
if (exploreWay.getFileType() == 0) { //图片
|
||||
refreshPhotoData(exploreWay);
|
||||
} else if (exploreWay.getFileType() == 1) { //视频
|
||||
handleData(exploreWay);
|
||||
}
|
||||
|
||||
//更新位置currentPosition
|
||||
for ( int i = 0; i < markerExploreWayList.size(); i++ ) {
|
||||
if ( markerExploreWayList.get( i ) == exploreWay ) {
|
||||
for (int i = 0; i < markerExploreWayList.size(); i++) {
|
||||
if (markerExploreWayList.get(i) == exploreWay) {
|
||||
currentPosition = i;
|
||||
break;
|
||||
}
|
||||
Logger.d( TAG, "onMarkerClicked currentPosition = " + currentPosition );
|
||||
Logger.d(TAG, "onMarkerClicked currentPosition = " + currentPosition);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
} );
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private MarkerExploreWay extractFromMarker( IMogoMarker marker ) {
|
||||
if ( marker == null ) {
|
||||
/**
|
||||
* 注册listener监听
|
||||
*/
|
||||
private void initListener() {
|
||||
//某某路堵不堵,某某地点堵不堵,附近堵不堵,播放路况
|
||||
//上报路况,上报拥堵
|
||||
mMogoVoiceManager.registerIntentListener("", new IMogoVoiceListener() {
|
||||
@Override
|
||||
public void onIntentReceived(String command, Intent intent) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MarkerExploreWay extractFromMarker(IMogoMarker marker) {
|
||||
if (marker == null) {
|
||||
return null;
|
||||
}
|
||||
if ( marker.getObject() instanceof MarkerShowEntity ) {
|
||||
MarkerShowEntity showEntity = ( ( MarkerShowEntity ) marker.getObject() );
|
||||
if ( showEntity.getBindObj() instanceof MarkerExploreWay ) {
|
||||
return ( ( MarkerExploreWay ) showEntity.getBindObj() );
|
||||
if (marker.getObject() instanceof MarkerShowEntity) {
|
||||
MarkerShowEntity showEntity = ((MarkerShowEntity) marker.getObject());
|
||||
if (showEntity.getBindObj() instanceof MarkerExploreWay) {
|
||||
return ((MarkerExploreWay) showEntity.getBindObj());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -323,9 +343,9 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
* @param view
|
||||
*/
|
||||
@Override
|
||||
public void onClick( View view ) {
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if ( id == R.id.tv_previous_res ) { //上一个
|
||||
if (id == R.id.tv_previous_res) { //上一个
|
||||
// 判断是图片还是视频,第一个时,上一个不可点击
|
||||
Logger.d(TAG, " tv_previous_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
|
||||
if (currentPosition < 0) {
|
||||
@@ -342,47 +362,47 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
// getNavigationLineData();
|
||||
// getNaviRoadLineInfo();
|
||||
|
||||
} else if ( id == R.id.tv_next_res ) { //下一个
|
||||
} else if (id == R.id.tv_next_res) { //下一个
|
||||
//判断是图片还是视频,最后一个时,下一个不可点击
|
||||
Logger.d( TAG, " tv_next_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size() );
|
||||
if ( currentPosition > markerExploreWayList.size() ) {
|
||||
Logger.d(TAG, " tv_next_res --1-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
|
||||
if (currentPosition > markerExploreWayList.size()) {
|
||||
return;
|
||||
}
|
||||
currentPosition++;
|
||||
Logger.d( TAG, " tv_next_res --2-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size() );
|
||||
if ( markerExploreWayList.size() > currentPosition ) {
|
||||
handleData( markerExploreWayList.get( currentPosition ) );
|
||||
Logger.d(TAG, " tv_next_res --2-> currentPosition =" + currentPosition + ">> size= " + markerExploreWayList.size());
|
||||
if (markerExploreWayList.size() > currentPosition) {
|
||||
handleData(markerExploreWayList.get(currentPosition));
|
||||
}
|
||||
|
||||
} else if ( id == R.id.tv_main_empty ) { //TODO上报路况,逻辑
|
||||
Logger.d( TAG, "tv_main_empty click -----> " );
|
||||
sendShareReceiver( "1" );
|
||||
} else if (id == R.id.tv_main_empty) { //TODO上报路况,逻辑
|
||||
Logger.d(TAG, "tv_main_empty click -----> ");
|
||||
sendShareReceiver("1");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送广播
|
||||
*/
|
||||
private void sendShareReceiver( String type ) {
|
||||
Logger.d( "liyz", "LaucherShareDialog sendShareReceiver ---->" );
|
||||
private void sendShareReceiver(String type) {
|
||||
Logger.d("liyz", "LaucherShareDialog sendShareReceiver ---->");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( "com.zhidao.roadcondition.share" );
|
||||
intent.putExtra( "type", type );
|
||||
getContext().sendBroadcast( intent );
|
||||
intent.setAction("com.zhidao.roadcondition.share");
|
||||
intent.putExtra("type", type);
|
||||
getContext().sendBroadcast(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行图片动画
|
||||
*/
|
||||
private void handleImageAnimation() {
|
||||
autoZoomInImageView.post( new Runnable() {
|
||||
autoZoomInImageView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//放大增量是0.3,放大时间是1000毫秒,放大开始时间是600毫秒以后
|
||||
autoZoomInImageView.init()
|
||||
.startZoomInByScaleDeltaAndDuration( 0.2f, 1000, 500 );
|
||||
.startZoomInByScaleDeltaAndDuration(0.2f, 1000, 500);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -392,7 +412,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -401,44 +421,44 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*
|
||||
* @param exploreWay
|
||||
*/
|
||||
private void handleData( MarkerExploreWay exploreWay ) {
|
||||
if ( exploreWay != null ) {
|
||||
if ( exploreWay.getFileType() == 0 ) { //图片
|
||||
refreshPhotoData( exploreWay );
|
||||
} else if ( exploreWay.getFileType() == 1 ) { //视频
|
||||
refreshVideoData( exploreWay );
|
||||
private void handleData(MarkerExploreWay exploreWay) {
|
||||
if (exploreWay != null) {
|
||||
if (exploreWay.getFileType() == 0) { //图片
|
||||
refreshPhotoData(exploreWay);
|
||||
} else if (exploreWay.getFileType() == 1) { //视频
|
||||
refreshVideoData(exploreWay);
|
||||
}
|
||||
} else {
|
||||
Logger.e( TAG, "handleData exploreWay == null " );
|
||||
Logger.e(TAG, "handleData exploreWay == null ");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新单个视频数据,更新位置positon
|
||||
*/
|
||||
private void refreshVideoData( MarkerExploreWay markerExploreWay ) {
|
||||
if ( markerExploreWay.getItems() == null ) {
|
||||
private void refreshVideoData(MarkerExploreWay markerExploreWay) {
|
||||
if (markerExploreWay.getItems() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( markerExploreWay.getItems().size() == 0 ) {
|
||||
if (markerExploreWay.getItems().size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
String videoUrl = markerExploreWay.getItems().get( 0 ).getUrl();
|
||||
mImageUrl = markerExploreWay.getItems().get( 0 ).getThumbnail();
|
||||
String videoUrl = markerExploreWay.getItems().get(0).getUrl();
|
||||
mImageUrl = markerExploreWay.getItems().get(0).getThumbnail();
|
||||
mGenerateTime = markerExploreWay.getGenerateTime();
|
||||
mTitle = markerExploreWay.getAddr();
|
||||
mAddressTv.setText( markerExploreWay.getAddr() );
|
||||
mDistanceTv.setText( handleDistance( markerExploreWay.getDistance() ) );
|
||||
mTimeTv.setText( formatDate( markerExploreWay.getGenerateTime() ) );
|
||||
mAddressTv.setText(markerExploreWay.getAddr());
|
||||
mDistanceTv.setText(handleDistance(markerExploreWay.getDistance()));
|
||||
mTimeTv.setText(formatDate(markerExploreWay.getGenerateTime()));
|
||||
//判断是图片还是视频,第一个时,上一个不可点击
|
||||
simpleCoverVideoPlayer.setVisibility( View.VISIBLE );
|
||||
simpleCoverVideoPlayer.setVisibility(View.VISIBLE);
|
||||
//视频配置
|
||||
mVideoUrl = videoUrl;
|
||||
gsyVideoOptionBuilder.setUrl( videoUrl ).setCacheWithPlay( false ).setPlayTag( TAG )
|
||||
.build( simpleCoverVideoPlayer );
|
||||
if ( mImageUrl == null ) {
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
.build(simpleCoverVideoPlayer);
|
||||
if (mImageUrl == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -446,45 +466,45 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
/**
|
||||
* 刷新单个图片数据
|
||||
*/
|
||||
private void refreshPhotoData( MarkerExploreWay markerExploreWay ) {
|
||||
if ( markerExploreWay.getItems() == null ) {
|
||||
private void refreshPhotoData(MarkerExploreWay markerExploreWay) {
|
||||
if (markerExploreWay.getItems() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( markerExploreWay.getItems().size() == 0 ) {
|
||||
if (markerExploreWay.getItems().size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
mAddressTv.setText( markerExploreWay.getAddr() );
|
||||
mDistanceTv.setText( handleDistance( markerExploreWay.getDistance() ) );
|
||||
mTimeTv.setText( formatDate( markerExploreWay.getGenerateTime() ) );
|
||||
String thumbnailUrl = markerExploreWay.getItems().get( 0 ).getUrl();
|
||||
Logger.d( TAG, "refreshPhotoData thumbnailUrl ------>" + thumbnailUrl );
|
||||
autoZoomInImageView.setVisibility( View.VISIBLE );
|
||||
simpleCoverVideoPlayer.setVisibility( View.GONE );
|
||||
mogoImageloader.downloadImage( getActivity(), thumbnailUrl, new IMogoImageLoaderListener() {
|
||||
mAddressTv.setText(markerExploreWay.getAddr());
|
||||
mDistanceTv.setText(handleDistance(markerExploreWay.getDistance()));
|
||||
mTimeTv.setText(formatDate(markerExploreWay.getGenerateTime()));
|
||||
String thumbnailUrl = markerExploreWay.getItems().get(0).getUrl();
|
||||
Logger.d(TAG, "refreshPhotoData thumbnailUrl ------>" + thumbnailUrl);
|
||||
autoZoomInImageView.setVisibility(View.VISIBLE);
|
||||
simpleCoverVideoPlayer.setVisibility(View.GONE);
|
||||
mogoImageloader.downloadImage(getActivity(), thumbnailUrl, new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted( Bitmap bitmap ) {
|
||||
autoZoomInImageView.setImageBitmap( bitmap );
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
autoZoomInImageView.setImageBitmap(bitmap);
|
||||
//动画
|
||||
// handleImageAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( Exception e ) {
|
||||
Logger.e( TAG, "onFailure ------>" + e );
|
||||
public void onFailure(Exception e) {
|
||||
Logger.e(TAG, "onFailure ------>" + e);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected Presenter createPresenter() {
|
||||
return new Presenter( this ) {
|
||||
return new Presenter(this) {
|
||||
};
|
||||
}
|
||||
|
||||
@@ -494,42 +514,42 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*/
|
||||
@Override
|
||||
public void onPerform() {
|
||||
Logger.d( TAG, "tanlu卡片 有效 ---->" );
|
||||
mMarkerManager = mMogoMapService.getMarkerManager( getActivity() );
|
||||
List< IMogoMarker > markers = mMarkerManager.getMarkers( TanluConstants.MODEL_NAME );
|
||||
if ( markers != null && markers.size() > 0 ) {
|
||||
mEmptyLayout.setVisibility( View.GONE );
|
||||
mRootLayout.setVisibility( View.VISIBLE );
|
||||
Logger.d( TAG, "onPerform markers.size() =" + markers.size() );
|
||||
for ( int i = 0; i < markers.size(); i++ ) {
|
||||
MarkerExploreWay exploreWay = extractFromMarker(markers.get( i ));
|
||||
if ( exploreWay == null ) {
|
||||
Logger.d(TAG, "tanlu卡片 有效 ---->");
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getActivity());
|
||||
List<IMogoMarker> markers = mMarkerManager.getMarkers(TanluConstants.MODEL_NAME);
|
||||
if (markers != null && markers.size() > 0) {
|
||||
mEmptyLayout.setVisibility(View.GONE);
|
||||
mRootLayout.setVisibility(View.VISIBLE);
|
||||
Logger.d(TAG, "onPerform markers.size() =" + markers.size());
|
||||
for (int i = 0; i < markers.size(); i++) {
|
||||
MarkerExploreWay exploreWay = extractFromMarker(markers.get(i));
|
||||
if (exploreWay == null) {
|
||||
break;
|
||||
}
|
||||
markerExploreWayList.add(exploreWay );
|
||||
markerExploreWayList.add(exploreWay);
|
||||
}
|
||||
|
||||
if ( markers.size() == 1 ) {
|
||||
mPreviousTv.setVisibility( View.GONE );
|
||||
mNextTv.setVisibility( View.GONE );
|
||||
if (markers.size() == 1) {
|
||||
mPreviousTv.setVisibility(View.GONE);
|
||||
mNextTv.setVisibility(View.GONE);
|
||||
} else {
|
||||
mPreviousTv.setVisibility( View.VISIBLE );
|
||||
mNextTv.setVisibility( View.VISIBLE );
|
||||
mPreviousTv.setVisibility(View.VISIBLE);
|
||||
mNextTv.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
//展示第一个数据
|
||||
MarkerExploreWay markerExploreWay = markerExploreWayList.get( 0 );
|
||||
if ( markerExploreWay != null ) {
|
||||
if ( markerExploreWay.getFileType() == 0 ) { //图片
|
||||
refreshPhotoData( markerExploreWay );
|
||||
} else if ( markerExploreWay.getFileType() == 1 ) { //视频
|
||||
refreshVideoData( markerExploreWay );
|
||||
MarkerExploreWay markerExploreWay = markerExploreWayList.get(0);
|
||||
if (markerExploreWay != null) {
|
||||
if (markerExploreWay.getFileType() == 0) { //图片
|
||||
refreshPhotoData(markerExploreWay);
|
||||
} else if (markerExploreWay.getFileType() == 1) { //视频
|
||||
refreshVideoData(markerExploreWay);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mEmptyLayout.setVisibility( View.VISIBLE );
|
||||
mRootLayout.setVisibility( View.GONE );
|
||||
mEmptyTv.setText( Html.fromHtml( getContext().getString( R.string.main_empty_content ) ) );
|
||||
mEmptyLayout.setVisibility(View.VISIBLE);
|
||||
mRootLayout.setVisibility(View.GONE);
|
||||
mEmptyTv.setText(Html.fromHtml(getContext().getString(R.string.main_empty_content)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,7 +558,7 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*/
|
||||
@Override
|
||||
public void onDisable() {
|
||||
Logger.d( TAG, "tanlu卡片 无效 ----->" );
|
||||
Logger.d(TAG, "tanlu卡片 无效 ----->");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -552,32 +572,32 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch( MotionEvent motionEvent ) {
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
// Logger.d( TAG, "地图触摸事件" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick( MogoPoi poi ) {
|
||||
if ( poi != null ) {
|
||||
TipToast.shortTip( poi.getName() );
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
if (poi != null) {
|
||||
TipToast.shortTip(poi.getName());
|
||||
}
|
||||
TanluServiceHandler.getPoiSearch().searchPOIIdAsyn( poi.getPoiId() );
|
||||
TanluServiceHandler.getPoiSearch().searchPOIIdAsyn(poi.getPoiId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiSearched( MogoPoiResult result, int errorCode ) {
|
||||
public void onPoiSearched(MogoPoiResult result, int errorCode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched( MogoPoiItem item, int errorCode ) {
|
||||
if ( item == null ) {
|
||||
public void onPoiItemSearched(MogoPoiItem item, int errorCode) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
// if (location.getErrCode() == 0) {
|
||||
// Logger.d(TAG, "onLocationChanged 当前位置 -->" + location.getAddress());
|
||||
// } else {
|
||||
@@ -586,32 +606,32 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick( MogoLatLng latLng ) {
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
public void onLockMap(boolean isLock) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
Logger.d( TAG, ui.name() );
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
Logger.d(TAG, ui.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged( MogoLatLng location, float zoom, float tilt, float bearing ) {
|
||||
public void onMapChanged(MogoLatLng location, float zoom, float tilt, float bearing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
EventBus.getDefault().unregister( this );
|
||||
getViewLifecycleOwner().getLifecycle().removeObserver( mPresenter );
|
||||
TanluServiceHandler.getLocationClient().removeLocationListener( this );
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener( TanluConstants.MODEL_NAME );
|
||||
EventBus.getDefault().unregister(this);
|
||||
getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter);
|
||||
TanluServiceHandler.getLocationClient().removeLocationListener(this);
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -619,35 +639,35 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Subscribe( threadMode = ThreadMode.MAIN )
|
||||
public void onMarkerInfo( final MarkerInfo event ) {
|
||||
Logger.d( TAG, "onMarkerInfo ------>" );
|
||||
mMarkerIcon = BitmapFactory.decodeResource( getResources(), R.drawable.ic_search_poi_location );
|
||||
mogoImageloader.downloadImage( getActivity(), event.imageUrl, new IMogoImageLoaderListener() {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMarkerInfo(final MarkerInfo event) {
|
||||
Logger.d(TAG, "onMarkerInfo ------>");
|
||||
mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_search_poi_location);
|
||||
mogoImageloader.downloadImage(getActivity(), event.imageUrl, new IMogoImageLoaderListener() {
|
||||
@Override
|
||||
public void onStart() {
|
||||
Logger.d( TAG, "onMarkerInfo onStart ------>" );
|
||||
Logger.d(TAG, "onMarkerInfo onStart ------>");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted( Bitmap bitmap ) {
|
||||
Logger.d( TAG, "onMarkerInfo onCompleted ------>" );
|
||||
public void onCompleted(Bitmap bitmap) {
|
||||
Logger.d(TAG, "onMarkerInfo onCompleted ------>");
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.icon( mMarkerIcon )
|
||||
.latitude( event.lat )
|
||||
.owner( TanluConstants.MODEL_NAME )
|
||||
.longitude( event.lon );
|
||||
.icon(mMarkerIcon)
|
||||
.latitude(event.lat)
|
||||
.owner(TanluConstants.MODEL_NAME)
|
||||
.longitude(event.lon);
|
||||
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
|
||||
mMarkerManager = mMogoMapService.getMarkerManager( getContext() );
|
||||
IMogoMarker marker = mMarkerManager.addMarker( TanluConstants.MODEL_NAME, options );
|
||||
mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getContext());
|
||||
mMarkerManager = mMogoMapService.getMarkerManager(getContext());
|
||||
IMogoMarker marker = mMarkerManager.addMarker(TanluConstants.MODEL_NAME, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure( Exception e ) {
|
||||
Logger.e( TAG, "onMarkerInfo onFailure -----e =" + e );
|
||||
public void onFailure(Exception e) {
|
||||
Logger.e(TAG, "onMarkerInfo onFailure -----e =" + e);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -656,107 +676,107 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
public void getNavigationLineData() {
|
||||
Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
Double lon = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
Logger.e( TAG, "getNavigationLineData lon = " + lon + ">>>>> lat= " + lat );
|
||||
mTanluModelData.getNavigationLineData( lon, lat, new AlongTheWayCallback() {
|
||||
Logger.e(TAG, "getNavigationLineData lon = " + lon + ">>>>> lat= " + lat);
|
||||
mTanluModelData.getNavigationLineData(lon, lat, new AlongTheWayCallback() {
|
||||
@Override
|
||||
public void onSuccess( InformationAndLiveCarResult data ) {
|
||||
Logger.d( TAG, "getNavigationLineData onSuccess " );
|
||||
public void onSuccess(InformationAndLiveCarResult data) {
|
||||
Logger.d(TAG, "getNavigationLineData onSuccess ");
|
||||
//不做任何处理,直接出发推送,重新请求接口,划线
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.e( TAG, "getNavigationLineData onFail message = " + message + ">>>code= " + code );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.e(TAG, "getNavigationLineData onFail message = " + message + ">>>code= " + code);
|
||||
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通勤族 事件,监听消息自己请求路线数据
|
||||
*/
|
||||
public void getRoadLineData() {
|
||||
mTanluModelData.getRoadLineData( new RoadLineCallback() {
|
||||
mTanluModelData.getRoadLineData(new RoadLineCallback() {
|
||||
@Override
|
||||
public void onSuccess( PathLineResult o ) {
|
||||
public void onSuccess(PathLineResult o) {
|
||||
//绘制线路线
|
||||
if ( o != null && o.getPointList() != null && o.getPointList().size() > 0 ) {
|
||||
drawMapLine( o.getPointList() );
|
||||
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
|
||||
drawMapLine(o.getPointList());
|
||||
} else {
|
||||
Logger.e( TAG, "getRoadLineData onSuccess o.getPointList() == null" );
|
||||
Logger.e(TAG, "getRoadLineData onSuccess o.getPointList() == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.d( TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.d(TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航路线,监听消息自己请求路线数据
|
||||
*/
|
||||
public void getNaviRoadLineInfo() {
|
||||
mTanluModelData.getNaviRoadLineInfo( new RoadLineCallback() {
|
||||
mTanluModelData.getNaviRoadLineInfo(new RoadLineCallback() {
|
||||
@Override
|
||||
public void onSuccess( PathLineResult o ) {
|
||||
public void onSuccess(PathLineResult o) {
|
||||
//绘制线路线
|
||||
if ( o != null && o.getPointList() != null && o.getPointList().size() > 0 ) {
|
||||
drawMapLine( o.getPointList() );
|
||||
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
|
||||
drawMapLine(o.getPointList());
|
||||
} else {
|
||||
Logger.e( TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null" );
|
||||
Logger.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.d( TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.d(TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制线路
|
||||
*/
|
||||
private void drawMapLine( List< Center > pointList ) {
|
||||
int intervalNum = Utils.getIntervalValue( pointList.size() );
|
||||
Logger.d( TAG, "drawMapLine intervalNum = $intervalNum -- pointList.size = ${pointList.size}" );
|
||||
private void drawMapLine(List<Center> pointList) {
|
||||
int intervalNum = Utils.getIntervalValue(pointList.size());
|
||||
Logger.d(TAG, "drawMapLine intervalNum = $intervalNum -- pointList.size = ${pointList.size}");
|
||||
int listSize = pointList.size();
|
||||
|
||||
//沿途最多15个点
|
||||
for ( int i = 0; i < listSize; i += intervalNum ) {
|
||||
passedByPoints.add( new MogoLatLng( pointList.get( i ).getLat(), ( pointList.get( i ).getLon() ) ) );
|
||||
for (int i = 0; i < listSize; i += intervalNum) {
|
||||
passedByPoints.add(new MogoLatLng(pointList.get(i).getLat(), (pointList.get(i).getLon())));
|
||||
}
|
||||
|
||||
Logger.d( TAG, "drawMapLine passedByPoints.size() ----> " + passedByPoints.size() );
|
||||
MogoLatLng startLatLng = new MogoLatLng( pointList.get( 0 ).getLat(), pointList.get( 0 ).getLon() );
|
||||
MogoLatLng endLatLng = new MogoLatLng( pointList.get( listSize - 1 ).getLat(), pointList.get( listSize - 1 ).getLon() );
|
||||
mMarkerManager.addRouteWay( getContext(), startLatLng, endLatLng, passedByPoints );
|
||||
Logger.d(TAG, "drawMapLine passedByPoints.size() ----> " + passedByPoints.size());
|
||||
MogoLatLng startLatLng = new MogoLatLng(pointList.get(0).getLat(), pointList.get(0).getLon());
|
||||
MogoLatLng endLatLng = new MogoLatLng(pointList.get(listSize - 1).getLat(), pointList.get(listSize - 1).getLon());
|
||||
mMarkerManager.addRouteWay(getContext(), startLatLng, endLatLng, passedByPoints);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 声音控制道路数据
|
||||
*/
|
||||
public void getVoiceControlRoadData( String keywords ) {
|
||||
public void getVoiceControlRoadData(String keywords) {
|
||||
Double lat = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLatitude();
|
||||
Double lon = TanluServiceHandler.getLocationClient().getLastKnowLocation().getLongitude();
|
||||
String cityCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getCityCode();
|
||||
String adCode = TanluServiceHandler.getLocationClient().getLastKnowLocation().getAdCode();
|
||||
Logger.d( TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode=" + cityCode + ">>>adCode =" + adCode );
|
||||
mTanluModelData.getVoiceControlRoadData( keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() {
|
||||
Logger.d(TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode=" + cityCode + ">>>adCode =" + adCode);
|
||||
mTanluModelData.getVoiceControlRoadData(keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() {
|
||||
@Override
|
||||
public void onSuccess( VoiceSearchResult o ) {
|
||||
public void onSuccess(VoiceSearchResult o) {
|
||||
String discription = o.getDescription();
|
||||
Logger.d( TAG, "getVoiceControlRoadData discription = " + discription );
|
||||
if ( o.getInformations() != null && o.getInformations().size() > 0 ) {
|
||||
speakSuccessVoice( o.getInformations(), discription == null ? "" : discription );
|
||||
Logger.d(TAG, "getVoiceControlRoadData discription = " + discription);
|
||||
if (o.getInformations() != null && o.getInformations().size() > 0) {
|
||||
speakSuccessVoice(o.getInformations(), discription == null ? "" : discription);
|
||||
} else {
|
||||
if ( !TextUtils.isEmpty( discription ) ) {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( discription, null );
|
||||
if (!TextUtils.isEmpty(discription)) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(discription, null);
|
||||
} else {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "未找到其他车主分享的路况信息", null );
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice("未找到其他车主分享的路况信息", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,70 +788,70 @@ public class TanluCardViewFragment extends MvpFragment< IView, Presenter< IView
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail( String message, int code ) {
|
||||
Logger.e( TAG, "getVoiceControlRoadData onFail message = " + message + ">>>code= " + code );
|
||||
speakFailVoice( searchfaileVoiceStrings[2] );
|
||||
public void onFail(String message, int code) {
|
||||
Logger.e(TAG, "getVoiceControlRoadData onFail message = " + message + ">>>code= " + code);
|
||||
speakFailVoice(searchfaileVoiceStrings[2]);
|
||||
}
|
||||
} );
|
||||
});
|
||||
}
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
private void speakSuccessVoice( List< Information > informations, String trafficStatus ) {
|
||||
switch ( informations.size() ) {
|
||||
private void speakSuccessVoice(List<Information> informations, String trafficStatus) {
|
||||
switch (informations.size()) {
|
||||
case 0:
|
||||
Logger.d( TAG, "speakSuccessVoice ----> " + random.nextInt( 3 ) );
|
||||
speakFailVoice( searchfaileVoiceStrings[random.nextInt( 3 )] );
|
||||
Logger.d(TAG, "speakSuccessVoice ----> " + random.nextInt(3));
|
||||
speakFailVoice(searchfaileVoiceStrings[random.nextInt(3)]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
String.format( voiceGetInfoMationTts, "1" ) + trafficStatus ), null );
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(voiceGetInfoMationTts, "1") + trafficStatus), null);
|
||||
|
||||
case 2:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"2"
|
||||
) + trafficStatus ), null );
|
||||
) + trafficStatus), null);
|
||||
|
||||
|
||||
case 3:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"3"
|
||||
) + trafficStatus ), null );
|
||||
) + trafficStatus), null);
|
||||
|
||||
default:
|
||||
trackVoiceSearch( 1 );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( (
|
||||
trackVoiceSearch(1);
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice((
|
||||
String.format(
|
||||
voiceGetInfoMationTts,
|
||||
"多"
|
||||
) + trafficStatus ), null );
|
||||
) + trafficStatus), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initStrings() {
|
||||
voiceGetInfoMationTts =
|
||||
getContext().getResources().getString( R.string.voice_get_informations_tts );
|
||||
getContext().getResources().getString(R.string.voice_get_informations_tts);
|
||||
searchingVoiceStrings =
|
||||
getContext().getResources().getStringArray( R.array.searching_voice_string_array );
|
||||
getContext().getResources().getStringArray(R.array.searching_voice_string_array);
|
||||
searchfaileVoiceStrings =
|
||||
getContext().getResources().getStringArray( R.array.search_fail_voice_array );
|
||||
getContext().getResources().getStringArray(R.array.search_fail_voice_array);
|
||||
}
|
||||
|
||||
private void speakFailVoice( String string ) {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( string, null );
|
||||
private void speakFailVoice(String string) {
|
||||
AIAssist.getInstance(getContext()).speakTTSVoice(string, null);
|
||||
}
|
||||
|
||||
//上报语音搜索
|
||||
private void trackVoiceSearch( int type ) {
|
||||
private void trackVoiceSearch(int type) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user