merge
This commit is contained in:
@@ -1,18 +1,27 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.SystemClock;
|
||||
import android.os.Trace;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.AMapUtils;
|
||||
@@ -32,7 +41,9 @@ import com.amap.api.navi.AMapNaviViewListener;
|
||||
import com.amap.api.navi.AMapNaviViewOptions;
|
||||
import com.amap.api.navi.enums.AMapNaviViewShowMode;
|
||||
import com.amap.api.navi.model.NaviInfo;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -51,8 +62,11 @@ import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.glide.GlideApp;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -73,7 +87,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
AMapNaviViewListener,
|
||||
AMapMessageListener,
|
||||
AMap.OnCameraChangeListener,
|
||||
AMap.OnMyLocationChangeListener {
|
||||
AMap.OnMyLocationChangeListener,
|
||||
Handler.Callback{
|
||||
|
||||
private static final String TAG = "AMapNaviViewWrapper";
|
||||
|
||||
@@ -122,6 +137,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
|
||||
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
|
||||
// 设置自车的图片对象
|
||||
checkDefaultOption();
|
||||
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) );
|
||||
// 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
|
||||
options.setCompassEnabled( false );
|
||||
@@ -525,9 +541,12 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isVisible = false;
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
Logger.d( TAG, "showMyLocation1 %s", visible );
|
||||
isVisible = visible;
|
||||
if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
@@ -543,14 +562,23 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
} else {
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW );
|
||||
}
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
if ( visible ) {
|
||||
// 强制刷新一遍车标
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
|
||||
setCarCursorOption(null);
|
||||
// style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
|
||||
}
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isInEmphasizeAnim = false;
|
||||
|
||||
@Override
|
||||
public void emphasizeMyLocation() {
|
||||
isInEmphasizeAnim = true;
|
||||
setCarCursorOption(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( View view ) {
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
@@ -874,7 +902,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
} else {
|
||||
if ( ( int ) location.getBearing() == 0
|
||||
&& mLastDriveLocationShadow != null ) {
|
||||
if ( mMyLocationMarker == null ) {
|
||||
if ( mMyLocationMarker == null || mMyLocationMarker.isRemoved() ) {
|
||||
initMyLocationMarker();
|
||||
}
|
||||
if ( mMyLocationMarker != null ) {
|
||||
@@ -911,18 +939,41 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
return mIsCarLocked;
|
||||
}
|
||||
|
||||
private String myLocationConfigCache = null;
|
||||
private boolean isUseDefaultOption = false;
|
||||
|
||||
private void checkDefaultOption(){
|
||||
String myLocationConfig = SharedPrefsMgr.getInstance(getContext()).getString(
|
||||
"MY_LOCATION_CONFIG", "");
|
||||
if (myLocationConfigCache == null || !myLocationConfigCache.equals(myLocationConfig)) {
|
||||
// 内存缓存的地址为空,或者内存缓存的地址和sp保存的config不一致,那得重新获取bitmap
|
||||
loadMyLocationIcon(myLocationConfig);
|
||||
} else if (isInEmphasizeAnim) {
|
||||
DEFAULT_OPTION.setCarCursorBmp(inflateMyLocation(myLocationBitmap));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption( CarCursorOption option ) {
|
||||
if (!isVisible) {
|
||||
// 当前自车图标没有显示,所以先不走下面的流程
|
||||
return;
|
||||
}
|
||||
if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) {
|
||||
mCarCursorOption.destroy();
|
||||
}
|
||||
checkDefaultOption();
|
||||
if ( option != null ) {
|
||||
try {
|
||||
isUseDefaultOption = false;
|
||||
mCarCursorOption = option.clone();
|
||||
} catch ( Exception e ) {
|
||||
isUseDefaultOption = true;
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
} else {
|
||||
isUseDefaultOption = true;
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
if ( !checkAMapView() ) {
|
||||
@@ -981,4 +1032,96 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
mMapView.getMap().moveCamera( CameraUpdateFactory.changeBearing( bearing ) );
|
||||
}
|
||||
}
|
||||
|
||||
protected void loadMyLocationIcon(String url) {
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( ()-> loadMyLocationIconInUiThread(url));
|
||||
} else {
|
||||
loadMyLocationIconInUiThread(url);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadMyLocationIconInUiThread(String url) {
|
||||
|
||||
if (!url.isEmpty()) {
|
||||
RequestOptions options = new RequestOptions()
|
||||
.placeholder( DEFAULT_OPTION.getCarCursorRes() )
|
||||
.error( DEFAULT_OPTION.getCarCursorRes() )
|
||||
.dontAnimate();
|
||||
GlideApp.with( getContext() )
|
||||
.asBitmap()
|
||||
.load( url )
|
||||
.apply( options )
|
||||
.into( new SimpleTarget< Bitmap >() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition< ? super Bitmap > transition ) {
|
||||
if (isUseDefaultOption) {
|
||||
myLocationConfigCache = url;
|
||||
myLocationBitmap = resource;
|
||||
DEFAULT_OPTION.setCarCursorBmp(inflateMyLocation(resource));
|
||||
setCarCursorOption(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadStarted( @Nullable Drawable placeholder ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared( @Nullable Drawable placeholder ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed( @Nullable Drawable errorDrawable ) {
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
private float emphasizeAnimOffset = 1f;
|
||||
|
||||
private Bitmap inflateMyLocation(Bitmap res) {
|
||||
if (res == null) {
|
||||
throw new IllegalArgumentException("inflate myLocation bitmap can not be null!");
|
||||
}
|
||||
View root =
|
||||
LayoutInflater.from(getContext()).inflate(R.layout.module_map_amap_my_location, null, false);
|
||||
ImageView iv = root.findViewById(R.id.module_map_amap_my_location_iv);
|
||||
iv.setImageBitmap(res);
|
||||
if (isInEmphasizeAnim) {
|
||||
iv.setScaleX(emphasizeAnimOffset);
|
||||
iv.setScaleY(emphasizeAnimOffset);
|
||||
handler.sendEmptyMessageDelayed(MSG_CONTINUE_EMPHASIZE_ANIM, EMPHASIZE_ANIM_DELAY);
|
||||
}
|
||||
return BitmapDescriptorFactory.fromView(root).getBitmap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 目前仅用于强调动画
|
||||
*/
|
||||
private Handler handler = new Handler(this);
|
||||
private static final int MSG_CONTINUE_EMPHASIZE_ANIM = 1001;
|
||||
private static final long EMPHASIZE_ANIM_DELAY = 80;
|
||||
private int emphasizeAnimProgress = 0;
|
||||
private Bitmap myLocationBitmap;
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if (msg.what == MSG_CONTINUE_EMPHASIZE_ANIM) {
|
||||
if (emphasizeAnimProgress < 5) {
|
||||
emphasizeAnimOffset += 0.1;
|
||||
emphasizeAnimProgress++;
|
||||
}else if(emphasizeAnimProgress<10){
|
||||
emphasizeAnimOffset -= 0.1;
|
||||
emphasizeAnimProgress++;
|
||||
} else if (emphasizeAnimProgress == 10) {
|
||||
isInEmphasizeAnim = false;
|
||||
emphasizeAnimProgress = 0;
|
||||
emphasizeAnimOffset = 1;
|
||||
}
|
||||
setCarCursorOption(null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,6 +426,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void emphasizeMyLocation() {
|
||||
// 空实现
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( View view ) {
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
|
||||
@@ -99,6 +99,13 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void emphasizeMyLocation() {
|
||||
if ( mClient != null ) {
|
||||
mClient.emphasizeMyLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( View view ) {
|
||||
if ( mClient != null ) {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/module_map_amap_my_location_bg_iv"
|
||||
android:layout_width="@dimen/module_map_amap_my_location_bg_size"
|
||||
android:layout_height="@dimen/module_map_amap_my_location_bg_size"
|
||||
android:src="@drawable/map_api_ic_current_location2"/>
|
||||
<ImageView
|
||||
android:id="@+id/module_map_amap_my_location_iv"
|
||||
android:layout_width="@dimen/module_map_amap_my_location_icon_width"
|
||||
android:layout_height="@dimen/module_map_amap_my_location_icon_height"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/module_map_amap_my_location_icon"/>
|
||||
</FrameLayout>
|
||||
6
libraries/map-amap/src/main/res/values-xhdpi/dimens.xml
Normal file
6
libraries/map-amap/src/main/res/values-xhdpi/dimens.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_map_amap_my_location_bg_size">370px</dimen>
|
||||
<dimen name="module_map_amap_my_location_icon_width">78px</dimen>
|
||||
<dimen name="module_map_amap_my_location_icon_height">120px</dimen>
|
||||
</resources>
|
||||
@@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="path_width">60px</dimen>
|
||||
<dimen name="module_map_amap_my_location_icon_width">78px</dimen>
|
||||
<dimen name="module_map_amap_my_location_icon_height">120px</dimen>
|
||||
<dimen name="module_map_amap_my_location_bg_size">146px</dimen>
|
||||
</resources>
|
||||
@@ -58,7 +58,6 @@ public class AutoNaviReceiver extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
Logger.d( TAG, "receive: keyType = %d", keyType );
|
||||
switch ( keyType ) {
|
||||
case 10001:
|
||||
handleAutoNaviInfo( context, intent );
|
||||
|
||||
@@ -71,6 +71,11 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
void showMyLocation( View view );
|
||||
|
||||
/**
|
||||
* 强调自车位置,加个动画突显一下自车位置
|
||||
*/
|
||||
void emphasizeMyLocation();
|
||||
|
||||
/**
|
||||
* 以外部定位的方式改变当前位置
|
||||
*
|
||||
|
||||
@@ -92,6 +92,13 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void emphasizeMyLocation() {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.emphasizeMyLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( View view ) {
|
||||
if ( mDelegate != null ) {
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
package com.zhidao.mogo.tanlu.api;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final boolean DEBUG = false;
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.zhidao.mogo.tanlu.api";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.zhidao.mogo.tanlu.api";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String BUILD_TYPE = "release";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "2.0.0";
|
||||
public static final String VERSION_NAME = "2.0.1";
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.0","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
@@ -2,7 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.tanlu.api"
|
||||
android:versionCode="1"
|
||||
android:versionName="2.0.0" >
|
||||
android:versionName="2.0.1" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.1","enabled":true,"outputFile":"mogo-tanlu-api-release.aar","fullName":"release","baseName":"release"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/jniLibs"/></dataSet></merger>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/shaders"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\jniLibs"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\jniLibs"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\shaders"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\shaders"/></dataSet></merger>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/assets"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/assets"/></dataSet></merger>
|
||||
@@ -1 +0,0 @@
|
||||
#Fri Nov 13 11:02:48 CST 2020
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/res"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/rs/debug"/><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/debug/res"/></dataSet><mergedItems/></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\assets"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\intermediates\shader_assets\release\compileReleaseShaders\out"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\assets"/></dataSet></merger>
|
||||
@@ -0,0 +1 @@
|
||||
#Wed Nov 18 18:46:15 CST 2020
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\res"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\rs\release"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\res"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\rs\release"/><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release" generated-set="release$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="F:\Station\Launcher\libraries\mogo-tanlu-api\src\release\res"/></dataSet><mergedItems/></merger>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.tanlu.api"
|
||||
android:versionCode="1"
|
||||
android:versionName="2.0.0" >
|
||||
android:versionName="2.0.1" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
@@ -2,13 +2,13 @@
|
||||
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
3 package="com.zhidao.mogo.tanlu.api"
|
||||
4 android:versionCode="1"
|
||||
5 android:versionName="2.0.0" >
|
||||
5 android:versionName="2.0.1" >
|
||||
6
|
||||
7 <uses-sdk
|
||||
8 android:minSdkVersion="19"
|
||||
8-->/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
8-->F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
9 android:targetSdkVersion="22" />
|
||||
9-->/Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
9-->F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
10 /
|
||||
11
|
||||
12</manifest>
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.0","enabled":true,"outputFile":"mogo-tanlu-api-debug.aar","fullName":"debug","baseName":"debug"},"path":"../../library_manifest/debug/AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"2.0.1","enabled":true,"outputFile":"mogo-tanlu-api-release.aar","fullName":"release","baseName":"release"},"path":"..\\..\\library_manifest\\release\\AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.tanlu.api","split":""}}]
|
||||
@@ -618,6 +618,7 @@ dimen compat_button_padding_vertical_material
|
||||
dimen compat_control_corner_material
|
||||
dimen compat_notification_large_icon_max_height
|
||||
dimen compat_notification_large_icon_max_width
|
||||
dimen corner_radius_cancel
|
||||
dimen disabled_alpha_material_dark
|
||||
dimen disabled_alpha_material_light
|
||||
dimen dp_0
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,37 +0,0 @@
|
||||
-- Merging decision tree log ---
|
||||
manifest
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
package
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:2:5-40
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:versionName
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:versionCode
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
xmlns:android
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml:1:11-69
|
||||
uses-sdk
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml reason: use-sdk injection requested
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:targetSdkVersion
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
android:minSdkVersion
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/admin/Android/ADAS/Launcher/libraries/mogo-tanlu-api/src/main/AndroidManifest.xml
|
||||
@@ -0,0 +1,37 @@
|
||||
-- Merging decision tree log ---
|
||||
manifest
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
package
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:2:5-40
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:versionName
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:versionCode
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:1-5:12
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
xmlns:android
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml:1:11-69
|
||||
uses-sdk
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml reason: use-sdk injection requested
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:targetSdkVersion
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
android:minSdkVersion
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
ADDED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
INJECTED from F:\Station\Launcher\libraries\mogo-tanlu-api\src\main\AndroidManifest.xml
|
||||
@@ -7,9 +7,9 @@ class HttpConstants {
|
||||
|
||||
companion object {
|
||||
|
||||
const val DEV_BASE_URL_OWNER = "http://dzt-test.zhidaohulian.com/"
|
||||
const val DEV_BASE_URL_OWNER = "http://dzt-test.zhidaozhixing.com/"
|
||||
const val RELEASE_BASE_URL_OWNER = "http://dzt.zhidaohulian.com/"
|
||||
const val SHOW_BASE_URL_OWNER = "http://dzt-show.zhidaohulian.com/"
|
||||
const val SHOW_BASE_URL_OWNER = "http://dzt-show.zhidaozhixing.com/"
|
||||
|
||||
fun getBaseUrl(): String {
|
||||
return when (DebugConfig.getNetMode()) {
|
||||
|
||||
@@ -22,5 +22,6 @@ data class InformationBody(
|
||||
val direction: Float,
|
||||
val poiType: String, //类型分类
|
||||
val mainInfoId: Long, //事件id
|
||||
val speed: Float //车速
|
||||
val speed: Float, //车速
|
||||
val fromType: String //上报触发来源
|
||||
)
|
||||
@@ -105,7 +105,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
latitude: Double,
|
||||
speed: Float
|
||||
) {
|
||||
Log.d(TAG, "takeVideo -------- isCustom = $isCustom ---mFromType = $mFromType ---type = $type ---speed = $speed" )
|
||||
Log.d(TAG, "takeVideo -------- isCustom = $isCustom ---mFromType = $mFromType ---type = $type ---speed = $speed")
|
||||
this.mType = type
|
||||
this.mainInfoId = mainInfoId
|
||||
this.mFromType = fromType
|
||||
@@ -114,7 +114,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
this.mSpeed = speed
|
||||
if (DebugConfig.getCarMachineType() == 0) { //自研车机
|
||||
outputVideoPath = getCompressVideoPath()
|
||||
CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id,fromType))
|
||||
CustomStatusHandler.offerVideoStatus(TakeEntity(isCustom, id, fromType))
|
||||
zdCarCoderController.takeVideo(cameraId, duration)
|
||||
trackGetVideo(1)
|
||||
} else { //比亚迪
|
||||
@@ -123,7 +123,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
// TipToast.shortTip("分享失败,请检查网络")
|
||||
// } else {
|
||||
//失败了,传空地址,发起请求
|
||||
val entity = TakeEntity(isCustom, id,fromType)
|
||||
val entity = TakeEntity(isCustom, id, fromType)
|
||||
videoAndThumbMap["video"] = ""
|
||||
videoAndThumbMap["thumb"] = ""
|
||||
|
||||
@@ -165,42 +165,20 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
val isCustom = CustomStatusHandler.pollPhotoStatus()
|
||||
val entity = TakeEntity(isCustom, 0L)
|
||||
Log.e(TAG, "onTakePhotoFail -----mType = $mType --- isCustom = $isCustom")
|
||||
//语音播报 1:上报路况,2:交通检查,3:封路 默认 mType 应该为null
|
||||
// if (mType.equals(TANLU_ROAD_CONGESTION) || mType.equals(TANLU_TRAFFIC_CHECK) || mType.equals(
|
||||
// TANLU_ROAD_CLOSURE
|
||||
// )
|
||||
// || mType.equals(TANLU_ROAD_CURRENT) || mType.equals(TANLU_ROAD_PONDING) || mType.equals(
|
||||
// TANLU_ROAD_ICING
|
||||
// )
|
||||
// || mType.equals(TANLU_ROAD_HEAVY_FOG) || mType.equals(TANLU_ROAD_ACCIDENT) || mType.equals(
|
||||
// TANLU_ROAD_WORK
|
||||
// )
|
||||
// ) {
|
||||
// taskAsync(1_500) {
|
||||
// try {
|
||||
// VoiceController.speakVoice("上报失败")
|
||||
// if (isCustom) {
|
||||
// sendGetInfoFailedReceiver(mType)
|
||||
// }
|
||||
// } catch (e: java.lang.Exception) {
|
||||
// e.printStackTrace()
|
||||
// }
|
||||
// }
|
||||
//获取图片失败也上报,图片不打点
|
||||
if (isCustom) {
|
||||
CosStatusController().sendInformationDirectly(
|
||||
INFO_TYPE_IMG,
|
||||
mutableMapOf("pic" to ""),
|
||||
mType,
|
||||
entity,
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
)
|
||||
}
|
||||
|
||||
//获取图片失败也上报,图片不打点
|
||||
if (isCustom) {
|
||||
CosStatusController().sendInformationDirectly(
|
||||
INFO_TYPE_IMG,
|
||||
mutableMapOf("pic" to ""),
|
||||
mType,
|
||||
entity,
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
)
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
//拍照成功回调返回图片本地路径
|
||||
@@ -314,7 +292,7 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
entity?.let {
|
||||
if (it.isCustom) {
|
||||
compressVideo(videoPath, thumbnailPath, it)
|
||||
}else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) {
|
||||
} else if (entity.fromType in STRATEGY_UPLOAD_TYPE_ARRAY) {
|
||||
// 属于策略上报
|
||||
compressVideo(videoPath, thumbnailPath, it)
|
||||
} else {
|
||||
@@ -433,6 +411,22 @@ object CarCorderController : TakePhotoCallback, TakeVideoCallback {
|
||||
|
||||
override fun onTakeVideoCancel(camera: Int) {
|
||||
Log.d(TAG, "onTakeVideoCancel -----camera = $camera")
|
||||
val entity = CustomStatusHandler.pollVideoStatus()
|
||||
//失败了,传空地址,发起请求
|
||||
videoAndThumbMap["video"] = ""
|
||||
videoAndThumbMap["thumb"] = ""
|
||||
|
||||
CosStatusController().sendInformationDirectly(
|
||||
INFO_TYPE_VIDEO,
|
||||
videoAndThumbMap,
|
||||
mType,
|
||||
entity,
|
||||
mainInfoId,
|
||||
mLongitude,
|
||||
mLatitude,
|
||||
mSpeed
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
//获取图片
|
||||
|
||||
@@ -85,23 +85,6 @@ class CosStatusController : CosStatusCallback {
|
||||
Log.d(TAG, "uploadCosFailed = $localPath")
|
||||
trackUploadCos(2)
|
||||
//语音播报 1:上报路况,2:交通检查,3:封路 默认 mType 应该为null
|
||||
if (CarCorderController.mType.equals(TANLU_ROAD_CONGESTION) || CarCorderController.mType.equals(
|
||||
TANLU_TRAFFIC_CHECK
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_CLOSURE)
|
||||
|| CarCorderController.mType.equals(TANLU_ROAD_CURRENT) || CarCorderController.mType.equals(
|
||||
TANLU_ROAD_PONDING
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_ICING)
|
||||
|| CarCorderController.mType.equals(TANLU_ROAD_HEAVY_FOG) || CarCorderController.mType.equals(
|
||||
TANLU_ROAD_ACCIDENT
|
||||
) || CarCorderController.mType.equals(TANLU_ROAD_WORK)
|
||||
) {
|
||||
// VoiceController.speakVoice("cos上报失败")
|
||||
Log.d(TAG, "uploadCosFailed mType = $mType")
|
||||
// if (entity?.isCustom && mFromType != UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO) {
|
||||
// sendGetInfoFailedReceiver("100")
|
||||
// }
|
||||
}
|
||||
|
||||
if (!isRetry) {
|
||||
isRetry = true
|
||||
// taskAsync(30_000) { //去掉重试
|
||||
@@ -153,7 +136,7 @@ class CosStatusController : CosStatusCallback {
|
||||
trackUploadCos(5)
|
||||
}
|
||||
} else {
|
||||
//上传图片成功, 如果是上报路况,直接上传,TODO
|
||||
//上传图片成功, 如果是上报路况,直接上传
|
||||
Log.d(TAG, "uploadCosCompleted 分享成功 ---- mType = $mType")
|
||||
sendInformationDirectly(
|
||||
INFO_TYPE_IMG,
|
||||
@@ -195,7 +178,7 @@ class CosStatusController : CosStatusCallback {
|
||||
latitude: Double,
|
||||
speed: Float
|
||||
) {
|
||||
Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId")
|
||||
Log.d(TAG, "sendInformationDirectly poiType= $poiType ---- mainInfoId= $mainInfoId --- isCustom = ${entity?.isCustom}")
|
||||
//开始上传
|
||||
entity?.isCustom?.let {
|
||||
mainServiceHttpModel.sendInformationMessage(
|
||||
@@ -213,7 +196,7 @@ class CosStatusController : CosStatusCallback {
|
||||
// CosCallbackMapController.mainService?.let {
|
||||
// CosCallbackMapController.mainService?.sendCustomResult(success)
|
||||
// }
|
||||
Log.d(TAG, "type = $type ----success = $success")
|
||||
Log.d(TAG, "type = $type ----success = $success ----fromType = $mFromType ----poiType = $poiType")
|
||||
if (success) {
|
||||
//分享成功,并打点,如果是上报拥堵,需要takeVideo
|
||||
if (type == INFO_TYPE_VIDEO) {
|
||||
|
||||
@@ -128,8 +128,8 @@ class MainServiceController {
|
||||
|
||||
//上传情报数据
|
||||
fun sendInformationMessage(
|
||||
type: Int,
|
||||
fromType: String,
|
||||
type: Int,
|
||||
url: Map<String, String>,
|
||||
isCustom: Boolean = false,
|
||||
trafficInfoType:String = "",
|
||||
@@ -145,7 +145,6 @@ class MainServiceController {
|
||||
mFromType = fromType
|
||||
mPoiType = poiType
|
||||
|
||||
//删除测试数据
|
||||
var locationInfo = LocationUtil.getInstance().getLocationInfo()
|
||||
if (locationInfo.address.isNullOrEmpty()) {
|
||||
Log.d(TAG, " sendInformationMessage locationInfo.address = $locationInfo.address")
|
||||
@@ -153,7 +152,7 @@ class MainServiceController {
|
||||
geoLocation(type, url, locationInfo, isCustom,trafficInfoType, isShare, customSend,poiType,mainInfoId,speed, longitude,latitude)
|
||||
} else {
|
||||
postInformationMessage(
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType,mainInfoId,longitude,latitude, speed),
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare,poiType,mainInfoId,longitude,latitude, speed, mFromType),
|
||||
customSend
|
||||
)
|
||||
}
|
||||
@@ -179,7 +178,7 @@ class MainServiceController {
|
||||
.geoCodeLocation(locationInfo.toLatLngPoint(), {
|
||||
Log.d(TAG, "geoLocation -------start -->")
|
||||
postInformationMessage(
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude, speed),
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude, speed, mFromType),
|
||||
customSend
|
||||
)
|
||||
}, {
|
||||
@@ -192,10 +191,9 @@ class MainServiceController {
|
||||
//如果两次都失败,直接上报服务端
|
||||
Log.d(TAG, "geoLocation ---- postInformationMessage ---false-->")
|
||||
postInformationMessage(
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude,speed),
|
||||
getInformationBody(type, url, locationInfo, isCustom, trafficInfoType, isShare, poiType,mainInfoId,longitude,latitude,speed, mFromType),
|
||||
customSend
|
||||
)
|
||||
|
||||
false
|
||||
}
|
||||
})
|
||||
@@ -214,31 +212,26 @@ class MainServiceController {
|
||||
onSuccess {
|
||||
if (it.result != null) {
|
||||
Log.i(TAG, "upload success id = " + it.result.id)
|
||||
Log.i(TAG, "upload success mFromType = $mFromType")
|
||||
if (mFromType == "6") {
|
||||
sendUgcStatusReceiver(it.result.id, mPoiType, mFromType)
|
||||
}
|
||||
}
|
||||
|
||||
trackUploadServer(1)
|
||||
// CosStatusController().videoAndThumbMap.clear()
|
||||
customSend?.invoke(true)
|
||||
}
|
||||
onError {
|
||||
Log.i(TAG, "$it upload message ${it.message}")
|
||||
trackUploadServer(2)
|
||||
Log.i(TAG, "upload onError mFromType = $mFromType")
|
||||
if (mFromType == "6") {
|
||||
sendUgcStatusReceiver(0, mPoiType, mFromType)
|
||||
}
|
||||
// CosStatusController().videoAndThumbMap.clear()
|
||||
customSend?.invoke(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun sendUgcStatusReceiver(id: Long, type: String?, fromType: String?) {
|
||||
Log.d(TAG, "sendUgcStatusReceiver ----> id = $id ---type = $type --fromType = $fromType ")
|
||||
Log.d(TAG, "sendUgcStatusReceiver id = $id ---type = $type --fromType = $fromType ")
|
||||
var intent = Intent()
|
||||
intent.action = "com.v2x.ugc.upload.status"
|
||||
intent.putExtra("id", id)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zhidao.roadcondition.util
|
||||
|
||||
import android.util.Log
|
||||
import com.google.gson.JsonArray
|
||||
import com.google.gson.JsonObject
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
@@ -33,7 +34,8 @@ fun getInformationBody(
|
||||
mainInfoId: Long,
|
||||
longitude: Double,
|
||||
latitude: Double,
|
||||
speed: Float
|
||||
speed: Float,
|
||||
fromType: String
|
||||
): InformationBody {
|
||||
var jsonArray = JsonArray()
|
||||
var type: Int
|
||||
@@ -50,6 +52,7 @@ fun getInformationBody(
|
||||
INFO_TYPE_IMG
|
||||
}
|
||||
var infoType = if (isCustom) 1 else 0
|
||||
Log.d("MainServiceController", "isCustom = $isCustom ---- infoType = $infoType")
|
||||
return InformationBody(
|
||||
jsonArray.toString(),
|
||||
locationInfo.address,
|
||||
@@ -72,7 +75,8 @@ fun getInformationBody(
|
||||
locationInfo.direction,
|
||||
poiType,
|
||||
mainInfoId,
|
||||
speed
|
||||
speed,
|
||||
fromType
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user