Merge remote-tracking branch 'origin/dev_merge_shunyi_vr_map' into dev_merge_shunyi_vr_map

This commit is contained in:
tongchenfei
2020-12-17 20:04:08 +08:00
36 changed files with 432 additions and 117 deletions

View File

@@ -3,9 +3,18 @@
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" withSubpackages="false" static="false" />
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
<package name="io.ktor" withSubpackages="true" static="false" />
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>

5
.idea/misc.xml generated
View File

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

View File

@@ -0,0 +1,141 @@
package com.mogo.module.common.animation;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.PointF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import androidx.core.content.ContextCompat;
import com.mogo.module.common.R;
import java.util.Random;
public class BezierAnimationView extends RelativeLayout implements View.OnClickListener {
private String TAG = "BezierAnimationView";
private Context context;
private int[] animation_drawable = {
R.drawable.icon_common_heart_animation_vr00,
R.drawable.icon_heart_unchoose_other,
R.drawable.icon_map_marker_living};
private Random random = new Random();
private int width = 500, height = 210;
private int drawableWidth, drawableHeight;
public BezierAnimationView(Context context) {
this(context, null);
}
public BezierAnimationView(Context context, AttributeSet attributes) {
this(context, attributes, 0);
}
public BezierAnimationView(Context context, AttributeSet attributes, int defStyleAttr) {
super(context, attributes, defStyleAttr);
this.context = context;
//3、设置点击事件
setOnClickListener(this);
//4、获取点赞图片的宽高
Drawable drawable = ContextCompat.getDrawable(context, R.drawable.icon_common_heart_animation_vr02);
drawableWidth = drawable.getIntrinsicWidth();
drawableHeight = drawable.getIntrinsicHeight();
}
@Override
public void onClick(View view) {
Log.d("执行点赞动画", "ppp");
bezierAnimation();
}
private void bezierAnimation() {
final ImageView imageView = new ImageView(context);
imageView.setBackgroundResource(animation_drawable[random.nextInt(animation_drawable.length - 1)]);
RelativeLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.addRule(ALIGN_BOTTOM);
params.addRule(CENTER_HORIZONTAL);
imageView.setLayoutParams(params);
addView(imageView);
/*
* 开始执行点赞效果
* */
AnimatorSet animatorSet = getAnimatorSet(imageView);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
//3、动画执行后移除View
removeView(imageView);
}
});
animatorSet.start();
}
private AnimatorSet getAnimatorSet(ImageView imageView) {
AnimatorSet enter = new AnimatorSet();
/*
* 缩放动画
* */
AnimatorSet scaleAnimator = new AnimatorSet();
ObjectAnimator alpha = ObjectAnimator.ofFloat(imageView, "alpha", 0.8f, 1f);
ObjectAnimator scaleX = ObjectAnimator.ofFloat(imageView, "scaleX", 0.8f, 1f);
ObjectAnimator scaleY = ObjectAnimator.ofFloat(imageView, "scaleY", 0.8f, 1f);
scaleAnimator.setDuration(500);
scaleAnimator.playTogether(alpha, scaleX, scaleY);
/*
* 贝塞尔动画
* */
ValueAnimator bezierAnimator = getBezierValueAnimator(imageView);
/*
* 两个动画按顺序播放
* */
enter.playSequentially(scaleAnimator, bezierAnimator);
return enter;
}
/**
* 获取贝塞尔曲线动画
*
* @param target
* @return
*/
private ValueAnimator getBezierValueAnimator(View target) {
//初始化一个BezierEvaluator
BezierEvaluator evaluator = new BezierEvaluator(getPointF(1), getPointF(1));
// 起点固定,终点随机
ValueAnimator animator = ValueAnimator.ofObject(evaluator, new PointF((width - 40) / 2, height - 80),
new PointF(random.nextInt(getWidth()), 0));
animator.addUpdateListener(new BezierListener(target));
animator.setTarget(target);
animator.setDuration(3000);
return animator;
}
/**
* 获取一条路径的两个控制点
*
* @param scale
*/
private PointF getPointF(int scale) {
PointF pointF = new PointF();
//减去100 是为了控制 x轴活动范围
pointF.x = random.nextInt((width));
//再Y轴上 为了确保第二个控制点 在第一个点之上,我把Y分成了上下两半
pointF.y = random.nextInt((height)) / scale;
return pointF;
}
}

View File

@@ -0,0 +1,45 @@
package com.mogo.module.common.animation;
import android.animation.TypeEvaluator;
import android.graphics.PointF;
/**
* 贝塞尔曲线估值器:计算动画的执行轨迹
*
* @params 传入贝塞尔曲线需要的四个点
* @return 通过计算返回贝塞尔曲线的坐标
*/
public class BezierEvaluator implements TypeEvaluator<PointF> {
private PointF pointF1;
private PointF pointF2;
public BezierEvaluator(PointF point1, PointF point2) {
this.pointF1 = point1;
this.pointF2 = point2;
}
@Override
public PointF evaluate(float time, PointF startValue, PointF endValue) {
float timeLeft = 1.0f - time;
//结果
PointF point = new PointF();
PointF point0 = (PointF)startValue;//起点
PointF point3 = (PointF)endValue;//终点
// 贝塞尔公式
point.x = timeLeft * timeLeft * timeLeft * (point0.x)
+ 3 * timeLeft * timeLeft * time * (pointF1.x)
+ 3 * timeLeft * time * time * (pointF2.x)
+ time * time * time * (point3.x);
point.y = timeLeft * timeLeft * timeLeft * (point0.y)
+ 3 * timeLeft * timeLeft * time * (pointF1.y)
+ 3 * timeLeft * time * time * (pointF2.y)
+ time * time * time * (point3.y);
return point;
}
}

View File

@@ -0,0 +1,24 @@
package com.mogo.module.common.animation;
import android.animation.ValueAnimator;
import android.graphics.PointF;
import android.view.View;
public class BezierListener implements ValueAnimator.AnimatorUpdateListener {
private View target;
public BezierListener(View target) {
this.target = target;
}
@Override
public void onAnimationUpdate(ValueAnimator animation) {
//这里获取到贝塞尔曲线计算出来的的x y值 赋值给view 这样就能让爱心随着曲线走啦
PointF pointF = (PointF) animation.getAnimatedValue();
target.setX(pointF.x);
target.setY(pointF.y);
// 这里偷个懒,顺便做一个alpha动画,这样alpha渐变也完成啦
target.setAlpha(1 - animation.getAnimatedFraction());
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.module.common.drawer.marker;
import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;

View File

@@ -3,6 +3,8 @@ package com.mogo.module.common.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
@@ -19,11 +21,10 @@ import com.mogo.skin.support.helper.MogoSkinCompatBackgroundHelperDelegate;
* desc :
* version: 1.0
*/
public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSupportable {
public class RoundLayout extends RelativeLayout {
private float roundLayoutRadius = 14f;
private Path roundPath;
private RectF rectF;
private MogoSkinCompatBackgroundHelperDelegate mBackgroundTintHelper;
public RoundLayout(Context context) {
this(context, null);
@@ -41,9 +42,6 @@ public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSuppor
typedArray.recycle();
init();
mBackgroundTintHelper = new MogoSkinCompatBackgroundHelperDelegate(this);
mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);
}
@@ -75,16 +73,10 @@ public class RoundLayout extends RelativeLayout implements IMogoSkinCompatSuppor
@Override
public void draw(Canvas canvas) {
if (roundLayoutRadius > 0f) {
canvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG));
canvas.clipPath(roundPath);
}
super.draw(canvas);
}
@Override
public void applySkin() {
if (mBackgroundTintHelper != null) {
mBackgroundTintHelper.applySkin();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -15,8 +15,4 @@
android:layout_height="wrap_content"
android:src="@drawable/module_camera_real_time_traffic" />
<TextView
android:layout_width="1px"
android:layout_height="1px"/>
</LinearLayout>

View File

@@ -113,7 +113,7 @@ public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkin
private void playLiveVideo(String liveUrl) {
try {
if (mLivePlayer != null) {
mLivePlayer.startPlay(liveUrl, TXLivePlayer.PLAY_TYPE_LIVE_RTMP);
mLivePlayer.startPlay(liveUrl, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
mLivePlayer.setPlayListener(new ITXLivePlayListener() {
@Override
public void onPlayEvent(int event, Bundle bundle) {

View File

@@ -34,7 +34,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
private Context mContext;
private static IMogoMarker mMogoMarker;
private CloudRoadData mCloudRoadData;
private boolean isFirst;
public void init(Context context) {
Logger.d(TAG, "init ======= ");
@@ -60,20 +60,28 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
}
});
UiThreadHandler.postDelayed(() -> {
mCloudRoadData = new CloudRoadData();
mCloudRoadData.setRtmpUrl("rtmp://58.200.131.2:1935/livetv/hunantv");
mCloudRoadData.setLat(40.200353);
mCloudRoadData.setLon(116.745467);
// CameraLiveManager.getInstance().init(mCloudRoadData);
addCameraMarker(mCloudRoadData);
}, 2_000);
// if (!isFirst) {
// isFirst = true;
// UiThreadHandler.postDelayed(() -> {
// mCloudRoadData = new CloudRoadData();
//// mCloudRoadData.setRtmpUrl("rtmp://58.200.131.2:1935/livetv/hunantv");
// mCloudRoadData.setRtmpUrl("http://video.zhidaozhixing.com/live/rec_12_22.flv");
//
// mCloudRoadData.setLat(39.969089);
// mCloudRoadData.setLon(116.418009);
//
//// CameraLiveManager.getInstance().init(mCloudRoadData);
// addCameraMarker(mCloudRoadData);
// }, 2_000);
// }
}
public void exitVrMode() {
Logger.d(TAG, "退出vr模式===");
// removeCameraMarker();
// isFirst = false;
MogoApisHandler.getInstance().getApis().getWebSocketManagerApi(mContext).unregisterOnWebSocketMessageListener(this);
}
@@ -90,15 +98,13 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
.longitude(roadData.getLon());
options.anchor(0.5f, 0.5f);
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.module_camera_real_time_traffic, null);
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.icon_space, null);
options.icon(bitmap);
mMogoMarker = ExtensionServiceManager.getMapService().getMarkerManager(mContext)
.addMarker(PushDataType.TYPE_PUSH_CAMERA_DATA, options);
mMogoMarker.setInfoWindowAdapter(new CameraWindow3DAdapter(AbsMogoApplication.getApp(), mMogoMarker.getMogoMarkerOptions()));
mMogoMarker.showInfoWindow();
if (mMogoMarker != null) {
mMogoMarker.setInfoWindowAdapter(new CameraWindow3DAdapter(AbsMogoApplication.getApp(), mMogoMarker.getMogoMarkerOptions()));
mMogoMarker.showInfoWindow();
mMogoMarker.setOwner(PushDataType.TYPE_PUSH_CAMERA_DATA);
}
}
@@ -127,13 +133,12 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
*/
@Override
public void onMsgReceived(MogoSnapshotSetData obj) {
Logger.d(TAG, "onMsgReceived cameralive : " + obj);
// Logger.d(TAG, "onMsgReceived cameralive : " + obj);
if (obj != null) { //如果多个点,如何处理,点击的时候
mCloudRoadData = obj.getCamera();
if (mCloudRoadData != null) {
Log.d(TAG, "onMsgReceived getRtmpUrl = " + mCloudRoadData.getRtmpUrl());
Log.d(TAG, "mCurrentlat = " + mCurrentlat + "--mCurrentlon = " + mCurrentlon);
Log.d(TAG, "mCloudRoadData.getLat() = " + mCloudRoadData.getLat() + "--mCloudRoadData.getLon() = " + mCloudRoadData.getLon());
Log.d(TAG, "mCurrentlat = " + mCurrentlat + "--mCurrentlon = " + mCurrentlon + "---mCloudRoadData.getLat() = " + mCloudRoadData.getLat() + "--mCloudRoadData.getLon() = " + mCloudRoadData.getLon());
if (mCurrentlat == mCloudRoadData.getLat() && mCurrentlon == mCloudRoadData.getLon()) {
//TODO
} else {

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

View File

@@ -1,6 +1,7 @@
package com.mogo.module.media.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
@@ -9,6 +10,7 @@ import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import com.mogo.module.media.R;
import com.mogo.module.media.utils.Utils;
/**
@@ -24,10 +26,12 @@ public class CircleNumberProgress extends View {
private int paintTextSize = 20;
/** 未完成进度条的颜色 */
private int paintUndoneColor = 0xffaaaaaa;
// private int paintUndoneColor = 0xffaaaaaa;
private int paintUndoneColor;
/** 已完成进度条的颜色 */
private int paintDoneColor = 0xff67aae4;
// private int paintDoneColor = 0xff67aae4;
private int paintDoneColor;
/** 百分比文字的颜色 */
private int paintTextColor = 0xffff0077;
@@ -70,6 +74,12 @@ public class CircleNumberProgress extends View {
public CircleNumberProgress(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.PercentageRing);
//中间圆的背景颜色 默认为浅紫色
paintUndoneColor = typedArray.getColor(R.styleable.PercentageRing_circleBackground, 0xffafb4db);
//外圆环的颜色 默认为深紫色
paintDoneColor = typedArray.getColor(R.styleable.PercentageRing_ringColor, 0xff6950a1);
// 构造器中初始化数据
initData();
}

View File

@@ -314,16 +314,9 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
// GlideApp.with(mContext).applyDefaultRequestOptions(options).load(mMediaInfoData.getMediaImg()).into(new SkinAbleBitmapTarget(mCircleImg, options));
}else{
Logger.e(TAG, "mMediaInfoData == null ");
// mAnimCircleImageView.setImageResource(R.drawable.module_media_default_music_img);
int size =
mContext.getResources().getDimensionPixelSize(R.dimen.module_media_pop_window_anim_img_size_new);
com.bumptech.glide.request.RequestOptions options =
new com.bumptech.glide.request.RequestOptions()
.placeholder(R.drawable.module_media_default_music_img).error(R.drawable.module_media_default_music_img).override(size, size);
GlideApp.with(mContext).asBitmap().apply(options).load("").into(new SkinAbleBitmapTarget(mAnimCircleImageView, options));
mAnimCircleImageView.setImageResource(R.drawable.module_media_default_music_img);
}
}
} else {
if (mScrollText != null) {
mScrollText.setText(mMediaInfoData.getMediaName());

View File

@@ -11,6 +11,8 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:circleBackground="@color/modules_media_music_bg_color"
app:ringColor="@color/modules_media_music_circle_color"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -3,5 +3,5 @@
<color name="modules_media_music_title_text_color">#fff</color>
<color name="modules_media_music_time_text_color">#7affffff</color>
<color name="modules_media_music_bg_color">#444E6E</color>
<color name="modules_media_music_circle_color">#B63737</color>
<color name="modules_media_music_circle_color">#80ffffff</color>
</resources>

View File

@@ -11,6 +11,7 @@ import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.module.common.entity.CloudLocationInfo;
@@ -121,7 +122,11 @@ public class MogoRTKLocation {
cloudLocationInfo.setSpeed(location.getSpeed());
cloudLocationInfo.setSatelliteTime(location.getTime());
cloudLocationInfo.setSystemTime(System.currentTimeMillis());
// Log.e("liyz", "lat = " + location.getLatitude() + ">>>>long = " + location.getLongitude());
cacheList.add(cloudLocationInfo);
} else {
Logger.e(TAG, "location == null");
}
}

View File

@@ -38,6 +38,9 @@ dependencies {
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.arouter
implementation rootProject.ext.dependencies.amapnavi3dmap
annotationProcessor rootProject.ext.dependencies.aroutercompiler
if (Boolean.valueOf(RELEASE)) {
api rootProject.ext.dependencies.mogomap

View File

@@ -6,6 +6,6 @@
<service
android:name=".SmallMapService"
android:exported="false"
android:process=":smallMap" />
/>
</application>
</manifest>

View File

@@ -8,9 +8,21 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.amap.api.maps.AMap;
import com.amap.api.maps.CameraUpdate;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.TextureMapView;
import com.amap.api.maps.UiSettings;
import com.amap.api.maps.model.BitmapDescriptor;
import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.CustomMapStyleOptions;
import com.amap.api.maps.model.MyLocationStyle;
import com.mogo.module.common.view.RoundLayout;
import com.mogo.module.small.map.animation.DirectionRotateAnimation;
import java.io.InputStream;
import java.net.URL;
/**
* 小地图的方向View
*
@@ -20,6 +32,12 @@ import com.mogo.module.small.map.animation.DirectionRotateAnimation;
public class SmallMapDirectionView extends RoundLayout {
private ImageView mIvMapBorder;
private TextureMapView mTextureMapView;
private AMap mAMap;
private UiSettings mUiSettings;
private CameraUpdate mCameraUpdate;
private MyLocationStyle myLocationStyle;
private DirectionRotateAnimation mRotateAnimation;
private int lastAngle = 0;
@@ -37,9 +55,46 @@ public class SmallMapDirectionView extends RoundLayout {
}
private void initView(Context context) {
mRotateAnimation = new DirectionRotateAnimation(context, null);
LayoutInflater.from(context).inflate(R.layout.module_small_map_view, this);
mIvMapBorder = findViewById(R.id.ivMapBorder);
mRotateAnimation = new DirectionRotateAnimation(context, null);
mTextureMapView = findViewById(R.id.textureMapView);
mTextureMapView.onCreate(null);
mAMap = mTextureMapView.getMap();
mAMap.setMapType(AMap.MAP_TYPE_NIGHT);//夜景地图aMap是地图控制器对象。
URL small_map_style = getClass().getResource("/assets/small_map_style.data");
URL small_map_style_extra = getClass().getResource("/assets/small_map_style_extra.data");
mAMap.setCustomMapStyle(new CustomMapStyleOptions()
.setEnable(true)
.setStyleDataPath(small_map_style.getPath())
.setStyleExtraPath(small_map_style_extra.getPath())
);
myLocationStyle = new MyLocationStyle();//初始化定位蓝点样式类myLocationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE);//连续定位、且将视角移动到地图中心点定位点依照设备方向旋转并且会跟随设备移动。1秒1次定位如果不设置myLocationType默认也会执行此种模式。
myLocationStyle.interval(2000); //设置连续定位模式下的定位间隔,只在连续定位模式下生效,单次定位模式下不会生效。单位为毫秒。
BitmapDescriptor location = BitmapDescriptorFactory.fromResource(R.drawable.module_small_map_view_my_location_logo);
myLocationStyle.myLocationIcon(location);
mAMap.setMyLocationStyle(myLocationStyle);//设置定位蓝点的Style
mAMap.setMyLocationEnabled(true);// 设置为true表示启动显示定位蓝点false表示隐藏定位蓝点并不进行定位默认是false。
//设置希望展示的地图缩放级别
mCameraUpdate = CameraUpdateFactory.zoomTo(12);
mAMap.moveCamera(mCameraUpdate);
mUiSettings = mAMap.getUiSettings();
mUiSettings.setZoomControlsEnabled(false);// 地图缩放级别的交换按钮
// mUiSettings.setZoomGesturesEnabled(false);// 缩放手势
// mUiSettings.setScrollGesturesEnabled(false);// 滑动手势
// mUiSettings.setRotateGesturesEnabled(false);// 旋转手势
// mUiSettings.setTiltGesturesEnabled(false);// 倾斜手势
mUiSettings.setAllGesturesEnabled(false);// 所有手势
mUiSettings.setMyLocationButtonEnabled(false); // 显示默认的定位按钮
mUiSettings.setLogoBottomMargin(-150); //设置Logo下边界距离屏幕底部的边距,设置为负值即可
}

View File

@@ -32,7 +32,7 @@ public class SmallMapService extends Service {
public void onCreate() {
super.onCreate();
Logger.d(TAG, "onCreate");
addMachineVisionMapView();
addSmallMapView();
}
@Nullable
@@ -46,7 +46,7 @@ public class SmallMapService extends Service {
@Override
public void onRebind(Intent intent) {
super.onRebind(intent);
addMachineVisionMapView();
addSmallMapView();
Logger.d(TAG, "onRebind");
}
@@ -69,8 +69,8 @@ public class SmallMapService extends Service {
}
}
private void addMachineVisionMapView() {
Logger.d(TAG, "addMachineVisionMapView");
private void addSmallMapView() {
Logger.d(TAG, "addSmallMapView");
mWindowManagerView = new WindowManagerView.Builder(getApplicationContext())
.contentView(R.layout.module_small_map_direction_view)
@@ -79,8 +79,8 @@ public class SmallMapService extends Service {
WindowManager.LayoutParams.WRAP_CONTENT
)
.position(
getResources().getDimensionPixelOffset(R.dimen.module_mvision_view_x),
getResources().getDimensionPixelOffset(R.dimen.module_mvision_view_y)
getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_x),
getResources().getDimensionPixelOffset(R.dimen.module_small_map_view_y)
)
.gravity(Gravity.TOP | Gravity.LEFT)
.showInWindowManager();

View File

@@ -1,35 +0,0 @@
package com.mogo.module.small.map;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.Nullable;
import com.mogo.map.MogoBaseMapView;
import com.mogo.utils.logger.Logger;
/**
* @author donghongyu
* @date 12/10/20 1:35 PM
*/
public class SmallMapView extends MogoBaseMapView {
private static final String TAG = "SmallMapView";
public SmallMapView(Context context) {
this(context, null);
}
public SmallMapView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public SmallMapView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void addMapView(Context context) {
Logger.d(TAG, "addMapView");
}
}

View File

@@ -73,15 +73,15 @@ public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusCh
@Override
public void showPanel() {
Log.d(TAG, "小地图模块触发展示……");
mSmallMapServiceIntent = new Intent(mContext, SmallMapService.class);
mContext.startService(mSmallMapServiceIntent);
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
mSmallMapServiceIntent = new Intent(mContext, SmallMapService.class);
mContext.startService(mSmallMapServiceIntent);
}
}
@Override
public void hidePanel() {
Log.d(TAG, "小地图模块触发隐藏……");
if (mSmallMapServiceIntent != null) {
AbsMogoApplication.getApp().stopService(mSmallMapServiceIntent);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!---->
<item>
<shape android:shape="rectangle">
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
<corners android:radius="720px" />
<gradient
android:angle="180"
android:endColor="#7997ff"
android:startColor="#284190"
android:type="linear"
android:useLevel="true" />
</shape>
</item>
<!-- 中心背景 -->
<item>
<shape android:shape="rectangle">
<solid android:color="#3F51B5" />
<corners android:radius="720px" />
</shape>
</item>
</layer-list>

View File

@@ -1,16 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.module.common.view.RoundLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rlSmallMapBorder"
android:layout_width="@dimen/module_mvision_view_width"
android:layout_height="@dimen/module_mvision_view_height"
android:layout_width="@dimen/module_small_map_border_view_width"
android:layout_height="@dimen/module_small_map_border_view_width"
app:roundLayoutRadius="360dp">
<View
android:layout_width="@dimen/module_small_map_view_border_width"
android:layout_height="@dimen/module_small_map_view_border_height"
android:layout_centerInParent="true"
android:background="@drawable/bg_module_small_map_view_border" />
<com.mogo.module.common.view.RoundLayout
android:id="@+id/rlSmallMapBorder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:roundLayoutRadius="360dp">
<com.amap.api.maps.TextureMapView
android:id="@+id/textureMapView"
android:layout_width="@dimen/module_small_map_view_width"
android:layout_height="@dimen/module_small_map_view_width" />
</com.mogo.module.common.view.RoundLayout>
<ImageView
android:id="@+id/ivMapBorder"
android:layout_width="@dimen/module_mvision_view_width"
android:layout_height="@dimen/module_mvision_view_height"
android:layout_width="@dimen/module_small_map_border_view_width"
android:layout_height="@dimen/module_small_map_border_view_width"
android:layout_centerInParent="true"
android:src="@drawable/module_small_map_view_border" />
</com.mogo.module.common.view.RoundLayout>
</RelativeLayout>

View File

@@ -1,12 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_mvision_view_width">400px</dimen>
<dimen name="module_mvision_view_height">400px</dimen>
<dimen name="module_mvision_view_x">1490px</dimen>
<dimen name="module_mvision_view_y">650px</dimen>
<dimen name="module_small_map_border_view_width">400px</dimen>
<dimen name="module_small_map_border_view_height">400px</dimen>
<dimen name="module_mvision_big_view_x">0px</dimen>
<dimen name="module_mvision_big_view_y">0px</dimen>
<dimen name="module_mvision_big_view_width">1920px</dimen>
<dimen name="module_mvision_big_view_height">1080px</dimen>
<dimen name="module_small_map_view_border_width">260px</dimen>
<dimen name="module_small_map_view_border_height">260px</dimen>
<dimen name="module_small_map_view_width">250px</dimen>
<dimen name="module_small_map_view_height">250px</dimen>
<dimen name="module_small_map_view_x">1490px</dimen>
<dimen name="module_small_map_view_y">650px</dimen>
<dimen name="module_small_map_big_view_x">0px</dimen>
<dimen name="module_small_map_big_view_y">0px</dimen>
<dimen name="module_small_map_big_view_width">1920px</dimen>
<dimen name="module_small_map_big_view_height">1080px</dimen>
</resources>

View File

@@ -4,14 +4,17 @@ import android.content.Context;
import android.graphics.Bitmap;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.map.MogoLatLng;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.drawer.MarkerDrawer;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.drawer.marker.RoadConditionInfoWindow3DAdapter;
import com.mogo.module.common.entity.MarkerCardResult;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
@@ -532,6 +535,13 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
.longitude(roadEventEntity.getLocation().getLon());
optionsRipple.anchor(0.5f, 0.5f);
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
MarkerExploreWay markerExploreWay = roadEventEntity.getNoveltyInfo();
markerShowEntity.setBindObj(markerExploreWay);
markerShowEntity.setMarkerLocation(markerExploreWay.getLocation());
markerShowEntity.setMarkerType(markerExploreWay.getPoiType());
markerShowEntity.setTextContent(markerExploreWay.getPoiType());
// 由于性能问题D车机不使用事件扩散动画
if (!CarSeries.isF8xxSeries()) {
optionsRipple.icon(V2XMarkerAdapter.getV2XRoadEventViewPng(context, roadEventEntity));
@@ -539,8 +549,13 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
optionsRipple.icons(V2XMarkerAdapter.getV2XRoadEventViewGif(context, roadEventEntity));
optionsRipple.period(1);
}
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
mAlarmInfoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl(markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, clickListener);
mAlarmInfoMarker.setInfoWindowAdapter(new RoadConditionInfoWindow3DAdapter(markerShowEntity, AbsMogoApplication.getApp(), mAlarmInfoMarker.getMogoMarkerOptions()));
mAlarmInfoMarker.showInfoWindow();
} else {
mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple);
}
// 当前Marker设置为最上面
mAlarmInfoMarker.setToTop();
// 绘制连接线

View File

@@ -106,6 +106,9 @@ public class V2XAnimationWindow extends ConstraintLayout implements IV2XWindow<V
});
vvCarAnimation.start();
Logger.w(MODULE_NAME, "开始播放动画。。。。。");
if (mV2XWindowStatusListener != null) {
mV2XWindowStatusListener.onViewShow();
}
}
if (tts != null) {
AIAssist.getInstance(V2XServiceManager.getContext()).speakTTSVoice(tts);