Merge branch 'dev_merge_shunyi_vr_map' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into dev_merge_shunyi_vr_map

This commit is contained in:
unknown
2020-12-15 10:24:17 +08:00
10 changed files with 101 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ public class WebSocketConstant {
private static final String HOST_DEMO = "ws://62.234.196.121";
private static final String HOST_RELEASE = "ws://62.234.196.121";
// private static final String PORT = ":14001/ws";
public static final String PORT = ":4003/ws";
public static final String PORT = ":4004/ws";
public static final String PROTOCOL = "ws://";
private static final String DOMAIN_DEV = "dzt-city.zhidaozhixing.com";

View File

@@ -91,7 +91,7 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder {
@Override
public IMogoMapView getMapView( Context context ) {
NavAutoApi.INSTANCE.init( context, MapParams.Companion.init()
.setDebugMode( true )
.setDebugMode( false )
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
.setZoom( 16 )

View File

@@ -1,5 +1,7 @@
package com.mogo.module.common.map;
import android.util.Log;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.module.common.MogoApisHandler;
@@ -243,9 +245,9 @@ public class MapCenterPointStrategy {
// V2X场景视图右边
Map< String, MapCenterPoint > categoryV2XEvent = new HashMap<>();
MapCenterPoint point1 = new MapCenterPoint( 0.5, 0.7D );
categoryV2XEvent.put( "d80x",point1 );
categoryV2XEvent.put( "em4",point1 );
categoryV2XEvent.put( "e8xx",point1 );
categoryV2XEvent.put( "d80x", point1 );
categoryV2XEvent.put( "em4", point1 );
categoryV2XEvent.put( "e8xx", point1 );
MapCenterPoint point2 = new MapCenterPoint( 0.5, 0.65D );
categoryV2XEvent.put( "f80x", point2 );
categoryV2XEvent.put( "f8xx", point2 );
@@ -254,8 +256,8 @@ public class MapCenterPointStrategy {
}
}
public static void resetByChangeMode(){
setMapCenterPointByScene( MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController(), Scene.AIMLESS);
public static void resetByChangeMode() {
setMapCenterPointByScene( MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController(), Scene.AIMLESS );
}
/**
@@ -268,7 +270,8 @@ public class MapCenterPointStrategy {
if ( controller == null ) {
return;
}
Map<Integer, Map<String, MapCenterPoint>> strategies = sCommonStrategies;
Logger.e( TAG, "scene"+scene );
Map< Integer, Map< String, MapCenterPoint > > strategies = sCommonStrategies;
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
strategies = sVrStrategies;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -80,7 +80,7 @@
android:layout_height="match_parent"
android:background="@drawable/main_bitmap_splash_bg"
android:scaleType="centerCrop"
android:visibility="gone" />
android:visibility="visible" />
<FrameLayout
android:id="@+id/module_main_id_splash_container"

View File

@@ -3,14 +3,13 @@ package com.mogo.module.small.map;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.RotateAnimation;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mogo.module.common.view.RoundLayout;
import com.mogo.module.small.map.animation.DirectionRotateAnimation;
/**
* 小地图的方向View
@@ -21,6 +20,8 @@ import com.mogo.module.common.view.RoundLayout;
public class SmallMapDirectionView extends RoundLayout {
private ImageView mIvMapBorder;
private DirectionRotateAnimation mRotateAnimation;
private int lastAngle = 0;
public SmallMapDirectionView(Context context) {
this(context, null);
@@ -38,6 +39,7 @@ public class SmallMapDirectionView extends RoundLayout {
private void initView(Context context) {
LayoutInflater.from(context).inflate(R.layout.module_small_map_view, this);
mIvMapBorder = findViewById(R.id.ivMapBorder);
mRotateAnimation = new DirectionRotateAnimation(context, null);
}
@@ -47,18 +49,25 @@ public class SmallMapDirectionView extends RoundLayout {
* @param angle 角度 0 - 359度旋转,相对于自身中心位置
*/
public void changeAngle(int angle) {
Animation mRotateAnimation = new RotateAnimation(
0, angle,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
int tempAngle = angle;
if (angle <= 180) {
tempAngle = angle;
} else {
tempAngle = -(360 - tempAngle);
}
mRotateAnimation.setFromDegrees(lastAngle);
mRotateAnimation.setToDegrees(tempAngle);
//设置线性插值,可以解决旋转一圈后卡顿问题
mRotateAnimation.setInterpolator(new DecelerateInterpolator());
mRotateAnimation.setInterpolator(new LinearInterpolator());
//设置旋转一圈时间
mRotateAnimation.setDuration(1000);
mRotateAnimation.setDuration(300);
//控件动画结束时是否保持动画最后的状态
mRotateAnimation.setFillAfter(true);
mIvMapBorder.startAnimation(mRotateAnimation);
// 刷新最后一次角度
lastAngle = tempAngle;
}
}

View File

@@ -15,6 +15,8 @@ import com.mogo.module.common.machinevision.IMachineVisionInterface;
import com.mogo.module.common.wm.WindowManagerView;
import com.mogo.utils.logger.Logger;
import java.util.Random;
/**
* @author donghongyu
* @date 12/10/20 1:35 PM
@@ -90,7 +92,8 @@ public class SmallMapService extends Service {
mSmallMapDirectionView.postDelayed(new Runnable() {
@Override
public void run() {
mSmallMapDirectionView.changeAngle(-60);
Random random = new Random();
mSmallMapDirectionView.changeAngle(random.nextInt(360));
}
}, 1000);

View File

@@ -0,0 +1,66 @@
package com.mogo.module.small.map.animation;
import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.Animation;
import android.view.animation.Transformation;
/**
* 方向罗盘旋转动画
* @author donghongyu
* @date 12/14/20 7:46 PM
*/
public class DirectionRotateAnimation extends Animation {
private float mFromDegrees;
private float mToDegrees;
private int mPivotXType = Animation.RELATIVE_TO_SELF;
private int mPivotYType = Animation.RELATIVE_TO_SELF;
private float mPivotXValue = 0.5f;
private float mPivotYValue = 0.5f;
private float mPivotX;
private float mPivotY;
public DirectionRotateAnimation(Context context, AttributeSet attrs) {
super(context, attrs);
initializePivotPoint();
}
public void setFromDegrees(float fromDegrees) {
mFromDegrees = fromDegrees;
}
public void setToDegrees(float toDegrees) {
mToDegrees = toDegrees;
}
private void initializePivotPoint() {
if (mPivotXType == ABSOLUTE) {
mPivotX = mPivotXValue;
}
if (mPivotYType == ABSOLUTE) {
mPivotY = mPivotYValue;
}
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float degrees = mFromDegrees + ((mToDegrees - mFromDegrees) * interpolatedTime);
float scale = getScaleFactor();
if (mPivotX == 0.0f && mPivotY == 0.0f) {
t.getMatrix().setRotate(degrees);
} else {
t.getMatrix().setRotate(degrees, mPivotX * scale, mPivotY * scale);
}
}
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
mPivotX = resolveSize(mPivotXType, mPivotXValue, width, parentWidth);
mPivotY = resolveSize(mPivotYType, mPivotYValue, height, parentHeight);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 46 KiB