bugfix: 在桌面发出唤醒指令“上报路况”,不生效

This commit is contained in:
tongchenfei
2020-09-15 23:31:21 +08:00
parent 79230f4396
commit 60cf80d004
3 changed files with 41 additions and 39 deletions

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -80,7 +80,7 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule( new MogoModule( TanluApiConst.MODULE_PATH, TanluApiConst.MODULE_NAME ) );
MogoModulePaths.addBaseModule( new MogoModule( TanluConstants.TAG, TanluConstants.MODEL_NAME ) );
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_SHARE, "ShareControl" ) );
MogoModulePaths.addModule( new MogoModule( LeftPanelConst.PATH_NAME, LeftPanelConst.MODULE_NAME ) );

View File

@@ -1086,7 +1086,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
if (!NetworkUtils.isConnected(getContext())) { //没有网络
TipToast.shortTip("分享失败,请检查网络",new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_fail)));
} else if(TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
} 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);
String poiType = event.type;
@@ -1095,49 +1095,51 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
Logger.d(TAG, "onMarkerInfo share poiType = " + poiType + " --isCumtom = " + isCumtom + " >> getMathRandom = " + getMathRandom() + " >>> bearing = " + bearing + ">>>fromType = " + fromType);
if (!fromType.equals("5")) {
if (isCumtom && !poiType.equals("0")) {
double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
Log.d(TAG, "onMarkerInfo lat = " + lat + " >>>> lon = " + lon);
String cityName = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityName();
String address = TanluServiceManager.getLocationClient().getLastKnowLocation().getAddress();
MarkerExploreWay markerExploreWay = new MarkerExploreWay();
markerExploreWay.setCityName(cityName);
markerExploreWay.setPoiType(poiType);
MarkerLocation markerLocation = new MarkerLocation();
markerLocation.setLat(lat);
markerLocation.setLon(lon);
markerLocation.setAddress(address);
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setBindObj(markerExploreWay);
markerShowEntity.setTextContent(address);
markerShowEntity.setMarkerType(TanluConstants.MODEL_NAME);
markerShowEntity.setMarkerLocation(markerLocation);
// 不管在不在前台,都要提示分享成功
AIAssist.getInstance(getContext()).speakTTSVoice((
String.format(voiceShareSuccessTts, getMathRandom())), null);
TipToast.shortTip("分享成功",new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_success)));
TipToast.shortTip("分享成功", new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_success)));
if(TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
Log.d(TAG, "onMarkerInfo lat = " + lat + " >>>> lon = " + lon);
String cityName = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityName();
String address = TanluServiceManager.getLocationClient().getLastKnowLocation().getAddress();
MarkerExploreWay markerExploreWay = new MarkerExploreWay();
markerExploreWay.setCityName(cityName);
markerExploreWay.setPoiType(poiType);
IMogoMarker mogoMarker = TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity);
mogoMarker.setClickable(false);
MarkerLocation markerLocation = new MarkerLocation();
markerLocation.setLat(lat);
markerLocation.setLon(lon);
markerLocation.setAddress(address);
//开启动画
mogoMarker.startScaleAnimationWithAlpha(0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() {
@Override
public void onAnimStart() {
Logger.d(TAG, " onAnimStart ---1----> ");
}
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
markerShowEntity.setBindObj(markerExploreWay);
markerShowEntity.setTextContent(address);
markerShowEntity.setMarkerType(TanluConstants.MODEL_NAME);
markerShowEntity.setMarkerLocation(markerLocation);
@Override
public void onAnimEnd() {
if (mogoMarker.isDestroyed()) {
return;
IMogoMarker mogoMarker = TanluServiceManager.getServiceApis().getMarkerService().drawMarker(markerShowEntity);
mogoMarker.setClickable(false);
//开启动画
mogoMarker.startScaleAnimationWithAlpha(0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() {
@Override
public void onAnimStart() {
Logger.d(TAG, " onAnimStart ---1----> ");
}
mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null);
}
});
@Override
public void onAnimEnd() {
if (mogoMarker.isDestroyed()) {
return;
}
mogoMarker.startScaleAnimation(1.2f, 1, 1.2f, 1, 100, new LinearInterpolator(), null);
}
});
}
} else {
Logger.e(TAG, "onMarkerInfo share onCompleted poiType = -1 --- else ---->");
}