Merge remote-tracking branch 'origin/dev_merge_shunyi_vr_map' into dev_merge_shunyi_vr_map
# Conflicts: # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -84,6 +84,7 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -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" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="SuppressionsComponent">
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.launcher;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Process;
|
||||
@@ -22,7 +21,7 @@ import com.mogo.module.main.service.MogoMainService;
|
||||
import com.mogo.module.push.base.PushUIConstants;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.share.constant.ShareConstants;
|
||||
import com.mogo.module.small.map.IMogoSmallMapProvider;
|
||||
import com.mogo.service.map.IMogoSmallMapProvider;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.utils.ObuConfig;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
@@ -96,7 +95,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
// MogoModulePaths.addModule( new MogoModule( IMogoMachineVisionProvider.path, "IMogoMachineVisionProvider" ) );
|
||||
|
||||
// 小地图模块
|
||||
MogoModulePaths.addModule( new MogoModule( IMogoSmallMapProvider.path, "IMogoSmallMapProvider" ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoServicePaths.PATH_SMALL_MAP, "IMogoSmallMapProvider" ) );
|
||||
|
||||
MogoModulePaths.addBaseModule( new MogoModule( MogoServicePaths.PATH_GLOBAL_UNWAKE, "GlobalUnwake" ) );
|
||||
|
||||
|
||||
@@ -183,7 +183,6 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin
|
||||
WebSocketData webSocketData = GsonUtil.objectFromJson(message, WebSocketData.class);
|
||||
int msgType = webSocketData.getMsgType();
|
||||
Logger.d(TAG, "websocket received msg type = " + msgType);
|
||||
|
||||
//服务端下发数据返回,上传数据回执默认不返回
|
||||
if (msgType == MSG_TYPE_DOWNLINK_CAR_DATA.getMsgType()) {
|
||||
List<IMogoOnWebSocketMessageListener> listeners = mListeners.get(msgType);
|
||||
|
||||
@@ -30,6 +30,8 @@ import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.navi.IMogoAimlessModeListener;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
@@ -43,13 +45,11 @@ import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.common.glide.SkinAbleBitmapTarget;
|
||||
import com.mogo.module.common.map.CustomNaviInterrupter;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.MyLocationUtil;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.navi.AnimNavInfoView;
|
||||
import com.mogo.module.extensions.navi.BaseNaviInfoView;
|
||||
import com.mogo.module.extensions.navi.NaviInfoView;
|
||||
import com.mogo.module.extensions.navi.VrModeNavInfoView;
|
||||
import com.mogo.module.extensions.userinfo.UserInfo;
|
||||
import com.mogo.module.extensions.utils.AdasNoticeHelper;
|
||||
@@ -58,7 +58,6 @@ import com.mogo.module.extensions.utils.EntranceViewHolder;
|
||||
import com.mogo.module.extensions.utils.NoMapTopViewShaderHelper;
|
||||
import com.mogo.module.extensions.utils.TopViewAnimHelper;
|
||||
import com.mogo.module.extensions.utils.TopViewNoLinkageAnimHelper;
|
||||
import com.mogo.module.extensions.utils.TrafficLightPanelManager;
|
||||
import com.mogo.module.share.manager.ServiceApisManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
@@ -114,7 +113,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
IMogoMapListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoIntentListener {
|
||||
IMogoIntentListener,
|
||||
IMogoLocationListener {
|
||||
|
||||
private static final String TAG = "EntranceFragment";
|
||||
|
||||
@@ -126,6 +126,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
|
||||
private BaseNaviInfoView mNaviInfo;
|
||||
private TextView mExitNavi;
|
||||
private AnimNavInfoView animNavInfoView;
|
||||
private VrModeNavInfoView vrModeNavInfoView;
|
||||
|
||||
|
||||
private View mDisplayOverview;
|
||||
@@ -222,7 +224,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mApis = MogoApisHandler.getInstance().getApis();
|
||||
|
||||
adasNoticeHelper.init(getContext());
|
||||
adasNoticeHelper.initView(getView());
|
||||
mCameraLiveNoticeHelper.init(getContext());
|
||||
|
||||
mEntrancePresenter = new EntrancePresenter(getContext(), this);
|
||||
@@ -379,18 +380,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
R.dimen.module_map_display_overview_bottom_margin)
|
||||
);
|
||||
|
||||
mNaviInfo = new NaviInfoView(rootView);
|
||||
animNavInfoView = findViewById(R.id.module_ext_id_anim_nav_info);
|
||||
vrModeNavInfoView = findViewById(R.id.module_ext_id_vr_nav_info);
|
||||
mNaviInfo = animNavInfoView;
|
||||
|
||||
findViewById(R.id.module_map_id_navi_bg).setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
try {
|
||||
LaunchUtils.launchByPkg(getContext(), "com.autonavi.amapauto");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
adasNoticeHelper.initView(vrModeNavInfoView);
|
||||
|
||||
mWeatherContainer = findViewById(R.id.module_ext_id_weather_container);
|
||||
mWeatherIcon = findViewById(R.id.module_ext_id_weather_icon);
|
||||
@@ -435,16 +429,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload,
|
||||
mStatusManager);
|
||||
|
||||
mOnlineCarEntrance = findViewById(R.id.module_ext_id_destination_online_car);
|
||||
mOnlineCarEntrance.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().showPanel();
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", 1);
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("APP_Find_Mogoer", properties);
|
||||
}
|
||||
} );
|
||||
tvEnterVrMode = findViewById(R.id.module_ext_enter_vr_mode);
|
||||
tvEnterVrMode.setOnClickListener((v)->{
|
||||
// 进入vr模式
|
||||
@@ -492,7 +476,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
}
|
||||
});
|
||||
|
||||
TrafficLightPanelManager.getInstance().initPanel(mRootView);
|
||||
}
|
||||
|
||||
private EditText etTimes;
|
||||
@@ -509,11 +492,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
tvExitVrMode.setVisibility(View.VISIBLE);
|
||||
TopViewAnimHelper.getInstance().enterVrMode();
|
||||
TopViewNoLinkageAnimHelper.getInstance().enterVrMode();
|
||||
showVrModeNaviView();
|
||||
mNaviInfo = new VrModeNavInfoView(mRootView);
|
||||
mNaviInfo = vrModeNavInfoView;
|
||||
adasNoticeHelper.enterVrMode();
|
||||
mCameraLiveNoticeHelper.enterVrMode();
|
||||
TrafficLightPanelManager.getInstance().showNavPanel();
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoLocationListener(TAG,this);
|
||||
|
||||
mMApUIController.changeMapMode( EnumMapUI.Type_VR );
|
||||
}
|
||||
@@ -530,11 +513,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
tvExitVrMode.setVisibility(View.GONE);
|
||||
TopViewAnimHelper.getInstance().exitVrMode();
|
||||
TopViewNoLinkageAnimHelper.getInstance().exitVrMode();
|
||||
hideVrModeNaviView();
|
||||
mNaviInfo = new NaviInfoView(mRootView);
|
||||
mNaviInfo = animNavInfoView;
|
||||
adasNoticeHelper.exitVrMode();
|
||||
mCameraLiveNoticeHelper.exitVrMode();
|
||||
TrafficLightPanelManager.getInstance().hideNavPanel();
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoLocationListener(TAG);
|
||||
|
||||
mMApUIController.changeMapMode( EnumMapUI.CarUp_2D );
|
||||
}
|
||||
@@ -1053,20 +1036,20 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
|
||||
private void debugTopView() {
|
||||
findViewById(R.id.btnDebugCtrlNaviView).setOnClickListener(view -> {
|
||||
SharedPrefsMgr.getInstance(getContext()).putString("MY_LOCATION_CONFIG", "https" +
|
||||
"://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705236512" +
|
||||
"&di=50620661ded7035fb84899a408f9f27e&imgtype=0&src=http%3A%2F%2Fb-ssl" +
|
||||
".duitang.com%2Fuploads%2Fitem%2F201409%2F11%2F20140911211243_3rT4u.jpeg");
|
||||
MyLocationUtil.setMyLocationIconUrl(getContext(), "https" +
|
||||
"://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705236512" +
|
||||
"&di=50620661ded7035fb84899a408f9f27e&imgtype=0&src=http%3A%2F%2Fb-ssl" +
|
||||
".duitang.com%2Fuploads%2Fitem%2F201409%2F11%2F20140911211243_3rT4u.jpeg");
|
||||
// if (!toggle) {
|
||||
// TopViewAnimHelper.getInstance().showNaviView();
|
||||
// } else {
|
||||
// TopViewAnimHelper.getInstance().hideNaviView();
|
||||
// }
|
||||
// toggle = !toggle;
|
||||
// SharedPrefsMgr.getInstance(getContext()).putString("MY_LOCATION_CONFIG", "https" +
|
||||
// "://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705236512" +
|
||||
// "&di=50620661ded7035fb84899a408f9f27e&imgtype=0&src=http%3A%2F%2Fb-ssl" +
|
||||
// ".duitang.com%2Fuploads%2Fitem%2F201409%2F11%2F20140911211243_3rT4u.jpeg");
|
||||
// MyLocationUtil.setMyLocationIconUrl(getContext(), "https" +
|
||||
// "://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705236512" +
|
||||
// "&di=50620661ded7035fb84899a408f9f27e&imgtype=0&src=http%3A%2F%2Fb-ssl" +
|
||||
// ".duitang.com%2Fuploads%2Fitem%2F201409%2F11%2F20140911211243_3rT4u.jpeg");
|
||||
if (!toggle) {
|
||||
TopViewAnimHelper.getInstance().showNaviView();
|
||||
} else {
|
||||
TopViewAnimHelper.getInstance().hideNaviView();
|
||||
}
|
||||
toggle = !toggle;
|
||||
});
|
||||
|
||||
findViewById(R.id.btnDebugCtrlSubView).setOnClickListener(view -> {
|
||||
@@ -1186,12 +1169,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
// }
|
||||
}
|
||||
|
||||
private static int SEEK_HELP_NOTICE_NUM_MSG_TYPE = 401015;
|
||||
private static final int SEEK_HELP_NOTICE_NUM_MSG_TYPE = 401015;
|
||||
|
||||
private IMogoOnMessageListener<String> seekHelpNoticeListener =
|
||||
private final IMogoOnMessageListener<String> seekHelpNoticeListener =
|
||||
new IMogoOnMessageListener<String>() {
|
||||
@Override
|
||||
public Class target() {
|
||||
public Class<String> target() {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@@ -1209,7 +1192,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
}
|
||||
};
|
||||
|
||||
private Handler handler = new Handler();
|
||||
private final Handler handler = new Handler();
|
||||
|
||||
private void listenSeekNumber() {
|
||||
mApis.getSocketManagerApi(getContext()).registerOnMessageListener(SEEK_HELP_NOTICE_NUM_MSG_TYPE, seekHelpNoticeListener);
|
||||
@@ -1238,14 +1221,10 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mApis.getSocketManagerApi(getContext()).unregisterOnMessageListener(SEEK_HELP_NOTICE_NUM_MSG_TYPE, seekHelpNoticeListener);
|
||||
}
|
||||
|
||||
TrafficLightPanelManager.getInstance().release();
|
||||
}
|
||||
|
||||
private void showVrModeNaviView(){
|
||||
|
||||
}
|
||||
|
||||
private void hideVrModeNaviView(){
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
vrModeNavInfoView.refreshCurrentSpeed((int) (location.getSpeed() * 3.6F));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ public class EntranceProvider implements IMogoModuleProvider {
|
||||
public Fragment createFragment( Context context, Bundle data ) {
|
||||
mFragment = new EntranceFragment();
|
||||
mFragment.setArguments( data );
|
||||
Log.d("liyz", " createFragment ------> ");
|
||||
ExtensionServiceManager.init(context);
|
||||
return mFragment;
|
||||
}
|
||||
@@ -77,7 +76,6 @@ public class EntranceProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
Log.d("liyz", " EntranceProvider init ------> ");
|
||||
ExtensionServiceManager.init(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.tencent.rtmp.ui.TXCloudVideoView;
|
||||
* V2XLiveGSYVideoView
|
||||
*/
|
||||
public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkinCompatSupportable {
|
||||
private static final String TAG = "CameraLiveGSYVideoView";
|
||||
private static final String TAG = "liyz";
|
||||
|
||||
private TXCloudVideoView mTxcVideoView;
|
||||
private ProgressBar mLoading;
|
||||
@@ -150,6 +150,7 @@ public class CameraLiveGSYVideoView extends LiveRoundLayout implements IMogoSkin
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Logger.w(TAG, "播放器:onNetStatus e = " + e);
|
||||
mLoading.setVisibility(GONE);
|
||||
mClLoadError.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
@@ -17,28 +17,28 @@ import com.mogo.utils.logger.Logger;
|
||||
* 路边摄像头直播控制 V2XPushLiveCarScenario
|
||||
*/
|
||||
public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implements IMogoTopViewStatusListener {
|
||||
private static final String TAG = "CameraLiveManager";
|
||||
private static CameraLiveManager mCameraLiveCarScenario;
|
||||
private static final String TAG = "liyz";
|
||||
private static CameraLiveManager mCameraLiveManager;
|
||||
private boolean isShowWindow;
|
||||
|
||||
private CameraLiveManager() {
|
||||
}
|
||||
|
||||
public static CameraLiveManager getInstance() {
|
||||
if (mCameraLiveCarScenario == null) {
|
||||
if (mCameraLiveManager == null) {
|
||||
synchronized (CameraLiveManager.class) {
|
||||
if (mCameraLiveCarScenario == null) {
|
||||
mCameraLiveCarScenario = new CameraLiveManager();
|
||||
mCameraLiveCarScenario.setV2XWindow(new PushCameraLiveWindow());
|
||||
if (mCameraLiveManager == null) {
|
||||
mCameraLiveManager = new CameraLiveManager();
|
||||
mCameraLiveManager.setV2XWindow(new PushCameraLiveWindow());
|
||||
}
|
||||
}
|
||||
}
|
||||
return mCameraLiveCarScenario;
|
||||
return mCameraLiveManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(@Nullable CloudRoadData cloudRoadData) {
|
||||
Log.d(TAG, "CameraLiveManager init -----> ");
|
||||
Log.d(TAG, "CameraLiveManager init -----> isShowWindow = " + isShowWindow);
|
||||
if (isShowWindow) {
|
||||
close();
|
||||
}
|
||||
@@ -54,11 +54,10 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
|
||||
|
||||
@Override
|
||||
public void showWindow() {
|
||||
Log.d(TAG, "CameraLiveManager showWindow --------");
|
||||
Log.d(TAG, "CameraLiveManager showWindow getV2XWindow = " + getV2XWindow());
|
||||
if (getV2XWindow() != null) {
|
||||
ViewGroup.LayoutParams layoutParams =
|
||||
new ViewGroup.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(int) AbsMogoApplication.getApp().getResources()
|
||||
.getDimension(R.dimen.module_video_window_height_content));
|
||||
|
||||
@@ -67,7 +66,6 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
|
||||
.addViewNoLinkage(getV2XWindow().getView(), layoutParams, this);
|
||||
getV2XWindow().show(getmCloudRoadData());
|
||||
isShowWindow = true;
|
||||
// ExtensionServiceManager.getMoGoV2XStatusManager().setRoadLiveCarWindowShow(TAG, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +75,6 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
|
||||
getV2XWindow().close();
|
||||
}
|
||||
isShowWindow = false;
|
||||
// ExtensionServiceManager.getMoGoV2XStatusManager().setRoadLiveCarWindowShow(TAG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,7 +77,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo
|
||||
Logger.w(TAG, "更新直播信息 show entity = " + entity);
|
||||
if (!TextUtils.isEmpty(entity.getRtmpUrl())) {
|
||||
Logger.w(TAG, "entity.getRtmpUrl() = " + entity.getRtmpUrl());
|
||||
mIvReportHead.setVisibility(VISIBLE);
|
||||
mIvReportHead.setVisibility(INVISIBLE);
|
||||
ExtensionServiceManager.getImageLoader()
|
||||
.displayImage(entity.getRtmpUrl(), mIvReportHead);
|
||||
mLiveGSYVideoView.startLive(entity.getRtmpUrl());
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
package com.mogo.module.extensions.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.transition.TransitionManager;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.view.OnPreventFastClickListener;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.utils.LaunchUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 带动画的导航框
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class AnimNavInfoView extends BaseNaviInfoView {
|
||||
private final ImageView turnIcon;
|
||||
private final TextView distance;
|
||||
private final TextView distanceUnit;
|
||||
private final TextView nextRoad;
|
||||
|
||||
private final TextView remainingDistance;
|
||||
private final TextView remainingDistanceUnit;
|
||||
private final TextView remainingTime;
|
||||
private final TextView remainingTimeUnit;
|
||||
private final TextView arriveTime;
|
||||
|
||||
private final View naviBg;
|
||||
|
||||
private final TextView tvDestinationOnlineCar;
|
||||
|
||||
private final Group remainTimeGroup, remainDistanceGroup, arriveTimeGroup;
|
||||
|
||||
private final ConstraintSet constraintSet = new ConstraintSet();
|
||||
|
||||
public AnimNavInfoView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public AnimNavInfoView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public AnimNavInfoView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
LayoutInflater.from(context).inflate(R.layout.include_navi_info_panle, this);
|
||||
|
||||
naviBg = findViewById(R.id.module_map_id_navi_bg);
|
||||
|
||||
turnIcon = findViewById(R.id.module_map_id_navi_next_info_road_turn_icon);
|
||||
distance = findViewById(R.id.module_map_id_navi_next_info_distance);
|
||||
distanceUnit = findViewById(R.id.module_map_id_navi_next_info_distance_unit);
|
||||
nextRoad = findViewById(R.id.module_map_id_navi_next_info_road);
|
||||
|
||||
remainingDistance = findViewById(R.id.module_map_id_remaining_distance);
|
||||
remainingDistanceUnit = findViewById(R.id.module_map_id_remaining_distance_unit);
|
||||
remainingTime = findViewById(R.id.module_map_id_remaining_time);
|
||||
remainingTimeUnit = findViewById(R.id.module_map_id_remaining_time_unit);
|
||||
arriveTime = findViewById(R.id.module_map_id_arrive_time);
|
||||
|
||||
remainTimeGroup = findViewById(R.id.remainTimeGroup);
|
||||
remainDistanceGroup = findViewById(R.id.remainDistanceGroup);
|
||||
arriveTimeGroup = findViewById(R.id.arriveTimeGroup);
|
||||
|
||||
tvDestinationOnlineCar = findViewById(R.id.module_ext_id_destination_online_car);
|
||||
|
||||
tvDestinationOnlineCar.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().showPanel();
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", 1);
|
||||
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("APP_Find_Mogoer", properties);
|
||||
}
|
||||
});
|
||||
|
||||
naviBg.setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
public void onClickImpl(View v) {
|
||||
try {
|
||||
LaunchUtils.launchByPkg(getContext(), "com.autonavi.amapauto");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void notifyChanged(MogoNaviInfo naviInfo) {
|
||||
if (naviInfo == null) {
|
||||
return;
|
||||
}
|
||||
fillNextCrossDistance(distance, distanceUnit, naviInfo.getCurStepRetainDistance());
|
||||
fillNextCrossIconType(turnIcon, naviInfo.getIconResId());
|
||||
nextRoad.setText(naviInfo.getNextRoadName());
|
||||
|
||||
remainingDistance.setText(getFormatSurplusDistance(naviInfo.getPathRetainDistance()));
|
||||
remainingDistanceUnit.setText(getFormatSurplusDistanceUnit());
|
||||
|
||||
remainingTime.setText(getFormatSurplusTime(naviInfo.getPathRetainTime()));
|
||||
remainingTimeUnit.setText(getFormatSurplusTimeUnit());
|
||||
|
||||
arriveTime.setText(getArriveTime(naviInfo.getPathRetainTime()));
|
||||
}
|
||||
|
||||
public void exchangeToSmall(boolean smooth) {
|
||||
if (!isVisible()) {
|
||||
return;
|
||||
}
|
||||
if (smooth) {
|
||||
TransitionManager.beginDelayedTransition(this);
|
||||
}
|
||||
remainDistanceGroup.setVisibility(View.GONE);
|
||||
remainTimeGroup.setVisibility(View.GONE);
|
||||
arriveTimeGroup.setVisibility(View.GONE);
|
||||
distance.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize_small));
|
||||
distanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize_small));
|
||||
|
||||
// 调整约束
|
||||
constraintSet.clone(this);
|
||||
constraintSet.connect(distance.getId(), ConstraintSet.BOTTOM,
|
||||
turnIcon.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(turnIcon.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_turn_icon_small_marginLeft));
|
||||
constraintSet.connect(nextRoad.getId(), ConstraintSet.BOTTOM,
|
||||
distance.getId(), ConstraintSet.BOTTOM,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_map_id_navi_next_info_road_marginBottom_small));
|
||||
constraintSet.connect(nextRoad.getId(), ConstraintSet.LEFT,
|
||||
R.id.module_map_id_navi_next_info_turn_info, ConstraintSet.RIGHT,
|
||||
getResources().getDimensionPixelSize(R.dimen.dp_46));
|
||||
constraintSet.clear(turnIcon.getId(), ConstraintSet.TOP);
|
||||
constraintSet.connect(turnIcon.getId(), ConstraintSet.BOTTOM,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_turn_icon_margin_bottom));
|
||||
|
||||
// 目的地车友
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(), ConstraintSet.LEFT);
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(), ConstraintSet.TOP);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(),
|
||||
ConstraintSet.BOTTOM, naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_small_margin_bottom));
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(),
|
||||
ConstraintSet.RIGHT, naviBg.getId(), ConstraintSet.RIGHT,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_small_margin_right));
|
||||
|
||||
constraintSet.applyTo(this);
|
||||
|
||||
turnIcon.getLayoutParams().height =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_turn_icon_small_height);
|
||||
turnIcon.getLayoutParams().width =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_turn_icon_small_width);
|
||||
naviBg.getLayoutParams().height =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_small_height);
|
||||
|
||||
tvDestinationOnlineCar.getLayoutParams().height =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_button_height_small);
|
||||
|
||||
tvDestinationOnlineCar.setBackgroundResource(R.drawable.module_ext_dw_navi_info_panel_small_bkg);
|
||||
|
||||
}
|
||||
|
||||
public void exchangeToBig(boolean smooth) {
|
||||
if (!isVisible()) {
|
||||
return;
|
||||
}
|
||||
if (smooth) {
|
||||
TransitionManager.beginDelayedTransition(this);
|
||||
}
|
||||
|
||||
remainDistanceGroup.setVisibility(View.VISIBLE);
|
||||
remainTimeGroup.setVisibility(View.VISIBLE);
|
||||
arriveTimeGroup.setVisibility(View.VISIBLE);
|
||||
distance.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize));
|
||||
distanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize));
|
||||
|
||||
// 调整约束
|
||||
constraintSet.clone(this);
|
||||
constraintSet.clear(distance.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(turnIcon.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_turn_icon_marginLeft));
|
||||
constraintSet.connect(nextRoad.getId(), ConstraintSet.BOTTOM, turnIcon.getId(),
|
||||
ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(nextRoad.getId(), ConstraintSet.LEFT,
|
||||
distance.getId(), ConstraintSet.LEFT,
|
||||
0);
|
||||
constraintSet.connect(turnIcon.getId(), ConstraintSet.TOP, naviBg.getId(),
|
||||
ConstraintSet.TOP, 0);
|
||||
constraintSet.connect(turnIcon.getId(), ConstraintSet.BOTTOM,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM, 0);
|
||||
|
||||
// 目的地车友
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(), ConstraintSet.RIGHT);
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(), ConstraintSet.TOP,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_camera_button_marginTop));
|
||||
constraintSet.applyTo(this);
|
||||
|
||||
turnIcon.getLayoutParams().height =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_turn_icon_height);
|
||||
turnIcon.getLayoutParams().width =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_turn_icon_width);
|
||||
naviBg.getLayoutParams().height =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_navi_info_panel_height);
|
||||
tvDestinationOnlineCar.getLayoutParams().height =
|
||||
getResources().getDimensionPixelSize(R.dimen.module_ext_button_height);
|
||||
tvDestinationOnlineCar.setBackgroundResource(R.drawable.module_ext_dw_navi_info_panel_bkg);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.mogo.module.extensions.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -15,13 +19,20 @@ import java.util.Calendar;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public abstract class BaseNaviInfoView {
|
||||
|
||||
public BaseNaviInfoView(View view) {
|
||||
|
||||
public abstract class BaseNaviInfoView extends ConstraintLayout {
|
||||
public BaseNaviInfoView(Context context) {
|
||||
this(context,null);
|
||||
}
|
||||
|
||||
public abstract void notifyChanged( MogoNaviInfo naviInfo );
|
||||
public BaseNaviInfoView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public BaseNaviInfoView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public abstract void notifyChanged(MogoNaviInfo naviInfo );
|
||||
|
||||
protected void fillNextCrossIconType( ImageView target, int iconId ) {
|
||||
if ( iconId > 0 ) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.module.extensions.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -12,7 +14,10 @@ import com.mogo.module.extensions.R;
|
||||
* @since 2019-09-29
|
||||
* <p>
|
||||
* 导航信息
|
||||
*
|
||||
* @deprecated 已经废弃
|
||||
*/
|
||||
@Deprecated
|
||||
public class NaviInfoView extends BaseNaviInfoView {
|
||||
|
||||
private ImageView turnIcon;
|
||||
@@ -26,20 +31,32 @@ public class NaviInfoView extends BaseNaviInfoView {
|
||||
private TextView remainingTimeUnit;
|
||||
private TextView arriveTime;
|
||||
|
||||
public NaviInfoView(View view) {
|
||||
super(view);
|
||||
turnIcon = view.findViewById( R.id.module_map_id_navi_next_info_road_turn_icon );
|
||||
distance = view.findViewById( R.id.module_map_id_navi_next_info_distance );
|
||||
distanceUnit = view.findViewById( R.id.module_map_id_navi_next_info_distance_unit );
|
||||
nextRoad = view.findViewById( R.id.module_map_id_navi_next_info_road );
|
||||
|
||||
remainingDistance = view.findViewById( R.id.module_map_id_remaining_distance );
|
||||
remainingDistanceUnit = view.findViewById( R.id.module_map_id_remaining_distance_unit );
|
||||
remainingTime = view.findViewById( R.id.module_map_id_remaining_time );
|
||||
remainingTimeUnit = view.findViewById( R.id.module_map_id_remaining_time_unit );
|
||||
arriveTime = view.findViewById( R.id.module_map_id_arrive_time );
|
||||
public NaviInfoView(Context context) {
|
||||
this(context,null);
|
||||
}
|
||||
|
||||
public NaviInfoView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs,0);
|
||||
}
|
||||
|
||||
public NaviInfoView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
// public NaviInfoView(View view) {
|
||||
// super(view);
|
||||
// turnIcon = view.findViewById( R.id.module_map_id_navi_next_info_road_turn_icon );
|
||||
// distance = view.findViewById( R.id.module_map_id_navi_next_info_distance );
|
||||
// distanceUnit = view.findViewById( R.id.module_map_id_navi_next_info_distance_unit );
|
||||
// nextRoad = view.findViewById( R.id.module_map_id_navi_next_info_road );
|
||||
//
|
||||
// remainingDistance = view.findViewById( R.id.module_map_id_remaining_distance );
|
||||
// remainingDistanceUnit = view.findViewById( R.id.module_map_id_remaining_distance_unit );
|
||||
// remainingTime = view.findViewById( R.id.module_map_id_remaining_time );
|
||||
// remainingTimeUnit = view.findViewById( R.id.module_map_id_remaining_time_unit );
|
||||
// arriveTime = view.findViewById( R.id.module_map_id_arrive_time );
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return turnIcon != null && turnIcon.getVisibility() == View.VISIBLE;
|
||||
|
||||
@@ -1,25 +1,137 @@
|
||||
package com.mogo.module.extensions.navi;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.view.VerticalTrafficLightView;
|
||||
|
||||
/**
|
||||
* vr模式下导航信息封装
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class VrModeNavInfoView extends BaseNaviInfoView {
|
||||
public VrModeNavInfoView(View view) {
|
||||
super(view);
|
||||
public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callback {
|
||||
|
||||
private final Group speedGroup, navGroup;
|
||||
private final TextView tvLimitSpeed;
|
||||
private final VerticalTrafficLightView turnAroundLight, turnLeftLight, straightLight, turnRightLight;
|
||||
|
||||
private final ImageView ivTurnIcon;
|
||||
private final TextView tvDistance,tvDistanceUnit, tvNextRoad;
|
||||
|
||||
private final TextView tvCurrentSpeed;
|
||||
|
||||
private final Handler handler = new Handler(this);
|
||||
|
||||
public VrModeNavInfoView(Context context) {
|
||||
this(context,null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return true;
|
||||
public VrModeNavInfoView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public VrModeNavInfoView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
LayoutInflater.from(context).inflate(R.layout.include_navi_in_vr, this);
|
||||
speedGroup = findViewById(R.id.module_ext_id_group_navi_in_vr_speed);
|
||||
navGroup = findViewById(R.id.module_ext_id_group_navi_in_vr_nav_info);
|
||||
tvLimitSpeed = findViewById(R.id.module_ext_id_tv_limit_speed);
|
||||
turnAroundLight = findViewById(R.id.module_ext_id_traffic_light_turn_around);
|
||||
turnLeftLight = findViewById(R.id.module_ext_id_traffic_light_turn_left);
|
||||
straightLight = findViewById(R.id.module_ext_id_traffic_light_straight);
|
||||
turnRightLight = findViewById(R.id.module_ext_id_traffic_light_turn_right);
|
||||
|
||||
tvCurrentSpeed = findViewById(R.id.module_ext_id_tv_speed);
|
||||
|
||||
ivTurnIcon = findViewById(R.id.module_map_id_navi_next_info_road_turn_icon_in_vr_mode);
|
||||
tvDistance = findViewById(R.id.module_map_id_navi_next_info_distance_in_vr_mode);
|
||||
tvDistanceUnit = findViewById(R.id.module_map_id_navi_next_info_distance_unit_in_vr_mode);
|
||||
tvNextRoad = findViewById(R.id.module_map_id_navi_next_info_road_in_vr_mode);
|
||||
}
|
||||
|
||||
public void startNav() {
|
||||
navGroup.setVisibility(View.VISIBLE);
|
||||
speedGroup.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void stopNav() {
|
||||
speedGroup.setVisibility(View.VISIBLE);
|
||||
navGroup.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void refreshLimitSpeed(int limitSpeed) {
|
||||
if(getVisibility() != View.VISIBLE){
|
||||
return;
|
||||
}
|
||||
handler.removeMessages(MSG_HIDE_LIMIT_SPEED);
|
||||
tvLimitSpeed.setVisibility(View.VISIBLE);
|
||||
tvLimitSpeed.setText(String.valueOf(limitSpeed));
|
||||
handler.sendEmptyMessageDelayed(MSG_HIDE_LIMIT_SPEED, HIDE_LIMIT_SPEED_DELAY);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void refreshCurrentSpeed(int speed) {
|
||||
if (speedGroup.getVisibility() == View.VISIBLE) {
|
||||
tvCurrentSpeed.setText(Integer.toString(speed));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新红绿灯显示状态
|
||||
*
|
||||
* @param laneLight 固定数组长度为4的车道类型灯,从0-3依次代表 掉头,左转,执行,右转
|
||||
* @param surplusTime 固定数组长度为4的剩余时长数组,从0-3依次代表 掉头,左转,执行,右转
|
||||
*/
|
||||
public void refreshTrafficLightStatus(int[] laneLight, String[] surplusTime) {
|
||||
turnAroundLight.setTrafficLightStatus(laneLight[0], surplusTime[0]);
|
||||
turnLeftLight.setTrafficLightStatus(laneLight[1], surplusTime[1]);
|
||||
straightLight.setTrafficLightStatus(laneLight[2], surplusTime[2]);
|
||||
turnRightLight.setTrafficLightStatus(laneLight[3], surplusTime[3]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyChanged(MogoNaviInfo naviInfo) {
|
||||
if (naviInfo == null) {
|
||||
return;
|
||||
}
|
||||
fillNextCrossDistance(tvDistance, tvDistanceUnit, naviInfo.getCurStepRetainDistance());
|
||||
fillNextCrossIconType(ivTurnIcon, naviInfo.getIconResId());
|
||||
tvNextRoad.setText(naviInfo.getNextRoadName());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
handler.removeMessages(MSG_HIDE_LIMIT_SPEED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return navGroup.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
private static final int MSG_HIDE_LIMIT_SPEED = 1001;
|
||||
private static final long HIDE_LIMIT_SPEED_DELAY = 5000;
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if (!isAttachedToWindow()||getVisibility() != View.VISIBLE) {
|
||||
return false;
|
||||
}
|
||||
if (msg.what == MSG_HIDE_LIMIT_SPEED) {
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.CloudRoadData;
|
||||
import com.mogo.module.common.entity.MogoSnapshotSetData;
|
||||
import com.mogo.module.extensions.navi.VrModeNavInfoView;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.MogoADASWarnType;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
@@ -50,6 +51,8 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
private String lightStatus = "G";
|
||||
private String surplusTime;
|
||||
|
||||
private VrModeNavInfoView vrModeNavInfoView;
|
||||
|
||||
private Handler handler = new Handler(this);
|
||||
|
||||
private boolean isObuLightData = false;
|
||||
@@ -64,9 +67,10 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
Logger.d(TAG, "init====");
|
||||
}
|
||||
|
||||
public void initView(View root) {
|
||||
public void initView(VrModeNavInfoView vrModeNavInfoView) {
|
||||
if (lightCenter) {
|
||||
}
|
||||
this.vrModeNavInfoView = vrModeNavInfoView;
|
||||
}
|
||||
|
||||
public void enterVrMode() {
|
||||
@@ -116,6 +120,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
}
|
||||
|
||||
private void drawLimitSpeed() {
|
||||
vrModeNavInfoView.refreshLimitSpeed(limitSpeed);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,13 +3,12 @@ package com.mogo.module.extensions.utils;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.entity.CloudRoadData;
|
||||
import com.mogo.module.common.entity.MogoSnapshotSetData;
|
||||
import com.mogo.module.extensions.R;
|
||||
@@ -18,6 +17,7 @@ import com.mogo.module.extensions.live.ExtensionServiceManager;
|
||||
import com.mogo.module.extensions.live.PushDataType;
|
||||
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
|
||||
import com.mogo.service.connection.WebSocketMsgType;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
@@ -26,20 +26,35 @@ import com.mogo.utils.logger.Logger;
|
||||
*
|
||||
*/
|
||||
public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<MogoSnapshotSetData> {
|
||||
private static final String TAG = "CameraLiveNoticeHelper";
|
||||
private static final String TAG = "liyz";
|
||||
private Context mContext;
|
||||
private static IMogoMarker mMogoMarker;
|
||||
private CloudRoadData mCloudRoadData;
|
||||
|
||||
|
||||
public void init(Context context) {
|
||||
Logger.d(TAG, "init====");
|
||||
Logger.d(TAG, "init ======= ");
|
||||
mContext = context;
|
||||
|
||||
//test
|
||||
// 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 );
|
||||
}
|
||||
|
||||
public void enterVrMode() {
|
||||
Logger.d(TAG, "enterVrMode===");
|
||||
MogoApisHandler.getInstance().getApis().getWebSocketManagerApi(mContext).registerOnWebSocketMessageListener(this);
|
||||
ExtensionServiceManager
|
||||
.getMogoRegisterCenter().registerMogoMarkerClickListener(PushDataType.TYPE_PUSH_CAMERA_DATA, new IMogoMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
//点击的marker的具体数据 TODO
|
||||
//点击的marker的具体数据
|
||||
if (mCloudRoadData != null) {
|
||||
CameraLiveManager.getInstance().init(mCloudRoadData);
|
||||
} else {
|
||||
@@ -51,10 +66,6 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
});
|
||||
}
|
||||
|
||||
public void enterVrMode() {
|
||||
Logger.d(TAG, "enterVrMode===");
|
||||
MogoApisHandler.getInstance().getApis().getWebSocketManagerApi(mContext).registerOnWebSocketMessageListener(this);
|
||||
}
|
||||
|
||||
public void exitVrMode() {
|
||||
Logger.d(TAG, "退出vr模式===");
|
||||
@@ -66,7 +77,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addCameraMarker(CloudRoadData roadData) {
|
||||
Logger.d(TAG, "addCameraMarker ------ ");
|
||||
Logger.d(TAG, "addCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon());
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(roadData)
|
||||
.latitude(roadData.getLat())
|
||||
@@ -75,14 +86,10 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
|
||||
Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.module_camera_real_time_traffic, null);
|
||||
options.icon(bitmap);
|
||||
mMogoMarker = MogoApisHandler
|
||||
.getInstance()
|
||||
.getApis()
|
||||
.getMapServiceApi()
|
||||
.getMarkerManager(AbsMogoApplication.getApp())
|
||||
.addMarker(DataTypes.TYPE_MARKER_PUSH_DATA, options);
|
||||
mMogoMarker = ExtensionServiceManager.getMapService().getMarkerManager(mContext)
|
||||
.addMarker(PushDataType.TYPE_PUSH_CAMERA_DATA, options);
|
||||
|
||||
ExtensionServiceManager.getMapService().getMarkerManager(mContext).addMarker(PushDataType.TYPE_PUSH_CAMERA_DATA, options);
|
||||
mMogoMarker.setOwner(PushDataType.TYPE_PUSH_CAMERA_DATA);
|
||||
}
|
||||
|
||||
private void removeCameraMarker() {
|
||||
@@ -91,7 +98,6 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WebSocketMsgType getDownLinkType() {
|
||||
return WebSocketMsgType.MSG_TYPE_DOWNLINK_CAR_DATA;
|
||||
@@ -102,19 +108,39 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
return MogoSnapshotSetData.class;
|
||||
}
|
||||
|
||||
private double mCurrentlat;
|
||||
private double mCurrentlon;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param obj
|
||||
*/
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData obj) {
|
||||
Logger.d(TAG, "onMsgReceived cameralive : " + obj);
|
||||
mCloudRoadData = obj.getTrafficLight();
|
||||
if (mCloudRoadData != null) {
|
||||
Logger.d(TAG, "onMsgReceived cameralive : ");
|
||||
//添加marker TODO
|
||||
addCameraMarker(mCloudRoadData);
|
||||
|
||||
// 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());
|
||||
if (mCurrentlat == mCloudRoadData.getLat() && mCurrentlon == mCloudRoadData.getLon()) {
|
||||
//TODO
|
||||
} else {
|
||||
removeCameraMarker();
|
||||
addCameraMarker(mCloudRoadData);
|
||||
mCurrentlat = mCloudRoadData.getLat();
|
||||
mCurrentlon = mCloudRoadData.getLon();
|
||||
}
|
||||
} else {
|
||||
//删除marker
|
||||
Logger.e(TAG, "onMsgReceived mCloudRoadData == null " );
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
removeCameraMarker();
|
||||
}, 1_000 );
|
||||
}
|
||||
} else {
|
||||
//删除marker TODO
|
||||
removeCameraMarker();
|
||||
|
||||
Log.e(TAG, "onMsgReceived obj == null ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,29 +2,23 @@ package com.mogo.module.extensions.utils;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.os.Handler;
|
||||
import android.transition.AutoTransition;
|
||||
import android.transition.Transition;
|
||||
import android.transition.TransitionManager;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.navi.AnimNavInfoView;
|
||||
import com.mogo.module.extensions.navi.TopView;
|
||||
import com.mogo.module.extensions.navi.VrModeNavInfoView;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -42,21 +36,11 @@ public class TopViewAnimHelper {
|
||||
private static final String TAG = "TopViewAnimHelper";
|
||||
|
||||
private ConstraintLayout topMotionLayout;
|
||||
private Group remainTimeGroup, remainDistanceGroup, arriveTimeGroup;
|
||||
private View naviBg;
|
||||
|
||||
private ImageView ivTurnIcon;
|
||||
private TextView tvNextDistance;
|
||||
private TextView tvNextRoad;
|
||||
private TextView tvNextDistanceUnit;
|
||||
private TextView tvTurnInfo;
|
||||
private TopView topContainer;
|
||||
|
||||
private TextView tvDestinationOnlineCar;
|
||||
|
||||
private ConstraintSet constraintSet;
|
||||
private Transition transition;
|
||||
private TextView cameraMode;
|
||||
private AnimNavInfoView animNavInfoView;
|
||||
private VrModeNavInfoView vrModeNavInfoView;
|
||||
|
||||
private float topHeight = 0f;
|
||||
|
||||
@@ -89,80 +73,13 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
public void init(ConstraintLayout rootView, OnTopViewAnimSimpleListener listener) {
|
||||
|
||||
constraintSet = new ConstraintSet();
|
||||
transition = new AutoTransition();
|
||||
|
||||
topMotionLayout = rootView;
|
||||
naviBg = rootView.findViewById(R.id.module_map_id_navi_bg);
|
||||
remainTimeGroup = rootView.findViewById(R.id.remainTimeGroup);
|
||||
remainDistanceGroup = rootView.findViewById(R.id.remainDistanceGroup);
|
||||
arriveTimeGroup = rootView.findViewById(R.id.arriveTimeGroup);
|
||||
topContainer = rootView.findViewById(R.id.module_entrance_id_top_container);
|
||||
tvNextDistanceUnit = rootView.findViewById(R.id.module_map_id_navi_next_info_distance_unit);
|
||||
tvTurnInfo = rootView.findViewById(R.id.module_map_id_navi_next_info_turn_info);
|
||||
tvDestinationOnlineCar = rootView.findViewById(R.id.module_ext_id_destination_online_car);
|
||||
animNavInfoView = rootView.findViewById(R.id.module_ext_id_anim_nav_info);
|
||||
vrModeNavInfoView = rootView.findViewById(R.id.module_ext_id_vr_nav_info);
|
||||
|
||||
topContainer.setSlideListener(this::startLatestTopOutAnim);
|
||||
|
||||
ivTurnIcon = rootView.findViewById(R.id.module_map_id_navi_next_info_road_turn_icon);
|
||||
tvNextDistance = rootView.findViewById(R.id.module_map_id_navi_next_info_distance);
|
||||
tvNextRoad = rootView.findViewById(R.id.module_map_id_navi_next_info_road);
|
||||
transition.setDuration(200);
|
||||
|
||||
transition.addListener(new Transition.TransitionListener() {
|
||||
@Override
|
||||
public void onTransitionStart(Transition transition) {
|
||||
if (listener != null) {
|
||||
listener.onAnimStart();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionEnd(Transition transition) {
|
||||
// if (isTopViewOut) {
|
||||
// topContainer.removeAllViews();
|
||||
// }
|
||||
if (listener != null) {
|
||||
listener.onAnimEnd();
|
||||
}
|
||||
Logger.d(TAG, "onTransitionEnd: " + currentAnimatingView);
|
||||
IMogoTopViewStatusListener listener;
|
||||
if (isTopViewOut) {
|
||||
int lastCount = topContainer.getChildCount();
|
||||
for (int i = 0; i < lastCount; i++) {
|
||||
View child = topContainer.getChildAt(i);
|
||||
viewCaches.remove(child);
|
||||
listener = statusListenerMap.remove(child);
|
||||
if (listener != null) {
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
topContainer.removeAllViews();
|
||||
} else {
|
||||
listener = statusListenerMap.get(currentAnimatingView);
|
||||
if (listener != null) {
|
||||
listener.onViewAdded(currentAnimatingView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionCancel(Transition transition) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionPause(Transition transition) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionResume(Transition transition) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
cameraMode = rootView.findViewById(R.id.module_ext_id_north);
|
||||
// 初始化默认隐藏导航
|
||||
hideNaviView();
|
||||
@@ -284,6 +201,7 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
if (!viewCaches.contains(view)) {
|
||||
// 判断此view是否已经增加到了顶部view,如果增加过就不增加了
|
||||
currentAnimatingView = view;
|
||||
view.setTranslationY(0);
|
||||
statusListenerMap.put(view, statusListener);
|
||||
Logger.d(TAG, "开始执行");
|
||||
@@ -313,14 +231,11 @@ public class TopViewAnimHelper {
|
||||
// 如果高度变化,生硬的变化一下高度
|
||||
Logger.d(TAG, "container.height: " + topContainer.getHeight());
|
||||
if (topContainer.getHeight() != params.height) {
|
||||
constraintSet.clone(topMotionLayout);
|
||||
// 改变topContainer的translationY
|
||||
topContainer.setTranslationY(params.height);
|
||||
LayoutParams p = topContainer.getLayoutParams();
|
||||
p.height = params.height;
|
||||
topContainer.setLayoutParams(p);
|
||||
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
|
||||
computeNaviMarginTop(params.height));
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
Logger.d(TAG, "改变container的高度===");
|
||||
}
|
||||
|
||||
@@ -331,6 +246,9 @@ public class TopViewAnimHelper {
|
||||
if (statusListenerMap.get(view) != null) {
|
||||
statusListenerMap.get(view).beforeViewAddAnim(view);
|
||||
}
|
||||
if (animNavInfoView.isVisible()) {
|
||||
animNavInfoView.animate().translationY(computeNaviMarginTop(params.height)).start();
|
||||
}
|
||||
view.animate().translationY(0).setDuration(500).setListener(new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
@@ -358,11 +276,7 @@ public class TopViewAnimHelper {
|
||||
}).start();
|
||||
} else {
|
||||
// 顶部view还没有内容,需要整体下移
|
||||
currentAnimatingView = view;
|
||||
viewCaches.add(view);
|
||||
// if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
// tvNextRoad.setTextSize(getDimen(R.dimen.dp_34));
|
||||
// }
|
||||
topContainer.addView(view, params);
|
||||
Logger.d(TAG, "整体进入==== view.visibility: " + view.getVisibility() + " view" +
|
||||
".position: (" + view.getX() + ", " + view.getY() + ") params.width: " + params.width + " params.height: " + params.height);
|
||||
@@ -372,85 +286,18 @@ public class TopViewAnimHelper {
|
||||
topContainer.setChildAddedListener(child -> {
|
||||
try {
|
||||
topContainer.setChildAddedListener(null);
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
remainDistanceGroup.setVisibility(View.GONE);
|
||||
remainTimeGroup.setVisibility(View.GONE);
|
||||
arriveTimeGroup.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
NoMapTopViewShaderHelper.getInstance().showShader();
|
||||
|
||||
constraintSet.clone(topMotionLayout);
|
||||
|
||||
constraintSet.clear(R.id.module_entrance_id_top_container,
|
||||
ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(R.id.module_entrance_id_top_container,
|
||||
ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
|
||||
// if (CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X) {
|
||||
TransitionManager.beginDelayedTransition(topMotionLayout, transition);
|
||||
// }
|
||||
checkCameraModePosition(false);
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
// 约束设置需要在applyTo()方法之前执行,visiable设置需要在applyTo()
|
||||
// 方法之后执行才能生效,所以分开了两个判断,至于为什么这么做才能生效,不得而知
|
||||
constraintSet.connect(tvNextDistance.getId(), ConstraintSet.BOTTOM,
|
||||
ivTurnIcon.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT,
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_marginLeft));
|
||||
// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM,
|
||||
tvNextDistance.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_map_id_navi_next_info_road_marginBottom_small));
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
|
||||
R.id.module_map_id_navi_next_info_turn_info,
|
||||
ConstraintSet.RIGHT,
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_46));
|
||||
|
||||
constraintSet.clear(ivTurnIcon.getId(), ConstraintSet.TOP);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_turn_icon_margin_bottom));
|
||||
|
||||
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
|
||||
computeNaviMarginTop(params.height));
|
||||
|
||||
// 动态改变相关字体大小
|
||||
tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize_small));
|
||||
tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
||||
getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize_small));
|
||||
|
||||
// 改变目的地车友的约束
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.LEFT);
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.TOP);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(),
|
||||
ConstraintSet.BOTTOM, naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_navi_small_margin_bottom));
|
||||
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(),
|
||||
ConstraintSet.RIGHT, naviBg.getId(), ConstraintSet.RIGHT,
|
||||
(int) getDimen(R.dimen.module_ext_navi_small_margin_right));
|
||||
}
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
ivTurnIcon.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_height);
|
||||
ivTurnIcon.getLayoutParams().width =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_width);
|
||||
naviBg.getLayoutParams().height =
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.module_ext_navi_info_panel_small_height);
|
||||
|
||||
tvDestinationOnlineCar.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_button_height_small);
|
||||
tvDestinationOnlineCar.setBackgroundResource(R.drawable.module_ext_dw_navi_info_panel_small_bkg);
|
||||
int scene = 0;
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
if (animNavInfoView.isVisible()) {
|
||||
scene = Scene.NAVI_WITH_ROAD_EVENT;
|
||||
animNavInfoView.animate().translationY(computeNaviMarginTop(child.getHeight())).start();
|
||||
animNavInfoView.exchangeToSmall(true);
|
||||
} else {
|
||||
scene = Scene.AIMLESS_WITH_ROAD_EVENT;
|
||||
}
|
||||
topContainer.animate().translationY(child.getHeight()).setListener(mainAnimListener).start();
|
||||
Logger.d(TAG, "show top setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
} catch (Exception e) {
|
||||
@@ -462,6 +309,10 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, true);
|
||||
// vr模式下与TopView互斥
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
TopViewNoLinkageAnimHelper.getInstance().removeAllView();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -487,68 +338,17 @@ public class TopViewAnimHelper {
|
||||
statusListenerMap.get(view).beforeViewRemoveAnim(view);
|
||||
}
|
||||
isTopViewOut = true;
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
remainDistanceGroup.setVisibility(View.VISIBLE);
|
||||
remainTimeGroup.setVisibility(View.VISIBLE);
|
||||
arriveTimeGroup.setVisibility(View.VISIBLE);
|
||||
tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize));
|
||||
tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize));
|
||||
}
|
||||
|
||||
NoMapTopViewShaderHelper.getInstance().hideShader();
|
||||
|
||||
constraintSet.clone(topMotionLayout);
|
||||
topContainer.animate().translationY(-topContainer.getTranslationY()).setListener(mainAnimListener).start();
|
||||
|
||||
constraintSet.clear(R.id.module_entrance_id_top_container, ConstraintSet.TOP);
|
||||
constraintSet.connect(R.id.module_entrance_id_top_container, ConstraintSet.BOTTOM,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
|
||||
TransitionManager.beginDelayedTransition(topMotionLayout, transition);
|
||||
checkCameraModePosition(false);
|
||||
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
// 约束设置需要在applyTo()方法之前执行,visiable设置需要在applyTo()
|
||||
// 方法之后执行才能生效,所以分开了两个判断,至于为什么这么做才能生效,不得而知
|
||||
constraintSet.clear(tvNextDistance.getId(), ConstraintSet.BOTTOM);
|
||||
// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BASELINE);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT,
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_marginLeft));
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM,
|
||||
ivTurnIcon.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_map_id_navi_next_info_road_marginBottom));
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
|
||||
tvNextDistance.getId(), ConstraintSet.LEFT,
|
||||
0);
|
||||
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
|
||||
(int) getDimen(R.dimen.module_common_shadow_width_pos));
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.TOP, naviBg.getId(),
|
||||
ConstraintSet.TOP, 0);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM, 0);
|
||||
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.RIGHT);
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(), ConstraintSet.TOP,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_camera_button_marginTop));
|
||||
}
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
|
||||
ivTurnIcon.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_height);
|
||||
ivTurnIcon.getLayoutParams().width =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_width);
|
||||
naviBg.getLayoutParams().height =
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.module_ext_navi_info_panel_height);
|
||||
|
||||
tvDestinationOnlineCar.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_button_height);
|
||||
tvDestinationOnlineCar.setBackgroundResource(R.drawable.module_ext_dw_navi_info_panel_bkg);
|
||||
int scene = 0;
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
if (animNavInfoView.isVisible()) {
|
||||
animNavInfoView.animate().translationY(0).start();
|
||||
animNavInfoView.exchangeToBig(true);
|
||||
scene = Scene.NAVI;
|
||||
} else {
|
||||
scene = Scene.AIMLESS;
|
||||
@@ -560,107 +360,23 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
public void showNaviView() {
|
||||
|
||||
if (topMotionLayout == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d("TopViewAnimHelper", "showNaviView=====");
|
||||
setNaviVisibility(View.VISIBLE);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
vrModeNavInfoView.startNav();
|
||||
} else {
|
||||
animNavInfoView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
int scene = 0;
|
||||
if (isTopViewOut) {
|
||||
remainDistanceGroup.setVisibility(View.VISIBLE);
|
||||
remainTimeGroup.setVisibility(View.VISIBLE);
|
||||
arriveTimeGroup.setVisibility(View.VISIBLE);
|
||||
tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize));
|
||||
tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize));
|
||||
|
||||
tvDestinationOnlineCar.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_button_height);
|
||||
tvDestinationOnlineCar.setBackgroundResource(R.drawable.module_ext_dw_navi_info_panel_bkg);
|
||||
|
||||
// 调整约束
|
||||
constraintSet.clone(topMotionLayout);
|
||||
constraintSet.clear(tvNextDistance.getId(), ConstraintSet.BOTTOM);
|
||||
// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BASELINE);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT,
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_marginLeft));
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM, ivTurnIcon.getId(),
|
||||
ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
|
||||
tvNextDistance.getId(), ConstraintSet.LEFT,
|
||||
0);
|
||||
// ivTurnIcon.getLayoutParams().height =
|
||||
// (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_height);
|
||||
// ivTurnIcon.getLayoutParams().width =
|
||||
// (int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_width);
|
||||
// naviBg.getLayoutParams().height =
|
||||
// (int) topMotionLayout.getContext().getResources().getDimension(R.dimen
|
||||
// .module_ext_navi_info_panel_height);
|
||||
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
|
||||
(int) getDimen(R.dimen.module_common_shadow_width_pos));
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.TOP, naviBg.getId(),
|
||||
ConstraintSet.TOP, 0);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM, 0);
|
||||
|
||||
// 目的地车友
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.RIGHT);
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(), ConstraintSet.TOP,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_camera_button_marginTop));
|
||||
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
scene = Scene.NAVI_WITH_ROAD_EVENT;
|
||||
animNavInfoView.exchangeToBig(false);
|
||||
} else {
|
||||
remainDistanceGroup.setVisibility(View.GONE);
|
||||
remainTimeGroup.setVisibility(View.GONE);
|
||||
arriveTimeGroup.setVisibility(View.GONE);
|
||||
tvNextDistance.setTextSize(TypedValue.COMPLEX_UNIT_PX,getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_textSize_small));
|
||||
tvNextDistanceUnit.setTextSize(TypedValue.COMPLEX_UNIT_PX,getDimen(R.dimen.module_ext_navi_info_panel_next_info_distance_unit_textSize_small));
|
||||
|
||||
tvDestinationOnlineCar.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_button_height_small);
|
||||
tvDestinationOnlineCar.setBackgroundResource(R.drawable.module_ext_dw_navi_info_panel_small_bkg);
|
||||
// 调整约束
|
||||
constraintSet.clone(topMotionLayout);
|
||||
constraintSet.connect(tvNextDistance.getId(), ConstraintSet.BOTTOM,
|
||||
ivTurnIcon.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.LEFT,
|
||||
naviBg.getId(), ConstraintSet.LEFT,
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_marginLeft));
|
||||
// constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BOTTOM,
|
||||
tvNextDistance.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_map_id_navi_next_info_road_marginBottom_small));
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
|
||||
R.id.module_map_id_navi_next_info_turn_info, ConstraintSet.RIGHT,
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_46));
|
||||
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
|
||||
computeNaviMarginTop(topContainer.getHeight()));
|
||||
constraintSet.clear(ivTurnIcon.getId(), ConstraintSet.TOP);
|
||||
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
|
||||
naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_turn_icon_margin_bottom));
|
||||
|
||||
// 目的地车友
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.LEFT);
|
||||
constraintSet.clear(tvDestinationOnlineCar.getId(),ConstraintSet.TOP);
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(),
|
||||
ConstraintSet.BOTTOM, naviBg.getId(), ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_navi_small_margin_bottom));
|
||||
constraintSet.connect(tvDestinationOnlineCar.getId(),
|
||||
ConstraintSet.RIGHT, naviBg.getId(), ConstraintSet.RIGHT,
|
||||
(int) getDimen(R.dimen.module_ext_navi_small_margin_right));
|
||||
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
scene = Scene.NAVI;
|
||||
animNavInfoView.exchangeToSmall(false);
|
||||
}
|
||||
Logger.d(TAG, "navi show setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
@@ -668,16 +384,13 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
public void hideNaviView() {
|
||||
|
||||
if (topMotionLayout == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d("TopViewAnimHelper", "hideNaviView=====");
|
||||
setNaviVisibility(View.GONE);
|
||||
remainDistanceGroup.setVisibility(View.GONE);
|
||||
remainTimeGroup.setVisibility(View.GONE);
|
||||
arriveTimeGroup.setVisibility(View.GONE);
|
||||
animNavInfoView.setVisibility(View.GONE);
|
||||
vrModeNavInfoView.stopNav();
|
||||
int scene = 0;
|
||||
if (isTopViewOut) {
|
||||
scene = Scene.AIMLESS;
|
||||
@@ -690,27 +403,6 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
private void checkCameraModePosition(boolean isNeedClone) {
|
||||
if (isNeedClone) {
|
||||
constraintSet.clone(topMotionLayout);
|
||||
}
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP, naviBg.getId(),
|
||||
ConstraintSet.BOTTOM, (int) getDimen(R.dimen.dp_30));
|
||||
} else {
|
||||
if (isTopViewOut) {
|
||||
constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP, naviBg.getId(),
|
||||
ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_north_goneMarginTop));
|
||||
} else {
|
||||
constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_container,
|
||||
ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.dp_30));
|
||||
}
|
||||
}
|
||||
if (isNeedClone) {
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
}
|
||||
}
|
||||
|
||||
private float getDimen(int resId) {
|
||||
@@ -718,7 +410,7 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
private int computeNaviMarginTop(int height) {
|
||||
int result = (int) (height - (getDimen(R.dimen.module_ext_top_over_navi_height))-getDimen(R.dimen.module_common_shadow_width_pos));
|
||||
int result = (int) (height - (getDimen(R.dimen.module_ext_top_over_navi_height)) - getDimen(R.dimen.module_common_shadow_width_pos));
|
||||
Logger.d(TAG, "computeNaviMarginTop: " + height + " result: " + result);
|
||||
return result;
|
||||
}
|
||||
@@ -733,24 +425,11 @@ public class TopViewAnimHelper {
|
||||
return viewCaches.contains(view);
|
||||
}
|
||||
|
||||
private void setNaviVisibility(int visibility) {
|
||||
ivTurnIcon.setVisibility(visibility);
|
||||
tvNextRoad.setVisibility(visibility);
|
||||
tvNextDistance.setVisibility(visibility);
|
||||
remainTimeGroup.setVisibility(visibility);
|
||||
remainDistanceGroup.setVisibility(visibility);
|
||||
arriveTimeGroup.setVisibility(visibility);
|
||||
naviBg.setVisibility(visibility);
|
||||
tvNextDistanceUnit.setVisibility(visibility);
|
||||
tvTurnInfo.setVisibility(visibility);
|
||||
if(DebugConfig.isSupportedSearchDestinationOnlineCarList()) {
|
||||
tvDestinationOnlineCar.setVisibility(visibility);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void removeAllView(){
|
||||
Logger.d(TAG, "remove all view");
|
||||
/**
|
||||
* 用于和{@link TopViewNoLinkageAnimHelper}互斥显示
|
||||
*/
|
||||
public void removeAllViewExceptVrNav() {
|
||||
Logger.d(TAG, "remove all view except vr nav");
|
||||
isTopViewOut = true;
|
||||
int lastCount = topContainer.getChildCount();
|
||||
for (int i = 0; i < lastCount; i++) {
|
||||
@@ -765,35 +444,76 @@ public class TopViewAnimHelper {
|
||||
topContainer.removeAllViews();
|
||||
hideNaviView();
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS);
|
||||
|
||||
}
|
||||
|
||||
public void clear(){
|
||||
public void removeAllView() {
|
||||
Logger.d(TAG, "remove all view");
|
||||
removeAllViewExceptVrNav();
|
||||
vrModeNavInfoView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
topMotionLayout = null;
|
||||
remainTimeGroup = null;
|
||||
remainDistanceGroup = null;
|
||||
arriveTimeGroup = null;
|
||||
naviBg = null;
|
||||
ivTurnIcon = null;
|
||||
tvNextDistance = null;
|
||||
tvNextRoad = null;
|
||||
tvNextDistanceUnit = null;
|
||||
tvTurnInfo = null;
|
||||
topContainer = null;
|
||||
cameraMode = null;
|
||||
transition = null;
|
||||
}
|
||||
|
||||
public void enterVrMode(){
|
||||
public void enterVrMode() {
|
||||
removeAllView();
|
||||
topContainer.getLayoutParams().width = (int) getDimen(R.dimen.module_ext_top_view_width_in_vr_mode);
|
||||
vrModeNavInfoView.setVisibility(View.VISIBLE);
|
||||
// topContainer.requestLayout();
|
||||
// topMotionLayout.requestLayout();
|
||||
}
|
||||
|
||||
public void exitVrMode(){
|
||||
public void exitVrMode() {
|
||||
removeAllView();
|
||||
topContainer.getLayoutParams().width = (int) getDimen(R.dimen.module_ext_top_view_width);
|
||||
// topContainer.requestLayout();
|
||||
// topMotionLayout.requestLayout();
|
||||
}
|
||||
|
||||
private final Animator.AnimatorListener mainAnimListener = new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
Logger.d(TAG, "onMainAnimEnd: " + currentAnimatingView);
|
||||
IMogoTopViewStatusListener listener;
|
||||
if (isTopViewOut) {
|
||||
int lastCount = topContainer.getChildCount();
|
||||
for (int i = 0; i < lastCount; i++) {
|
||||
View child = topContainer.getChildAt(i);
|
||||
viewCaches.remove(child);
|
||||
listener = statusListenerMap.remove(child);
|
||||
if (listener != null) {
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
topContainer.removeAllViews();
|
||||
currentAnimatingView = null;
|
||||
} else {
|
||||
listener = statusListenerMap.get(currentAnimatingView);
|
||||
if (listener != null) {
|
||||
listener.onViewAdded(currentAnimatingView);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,20 +2,14 @@ package com.mogo.module.extensions.utils;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.os.Handler;
|
||||
import android.transition.AutoTransition;
|
||||
import android.transition.Transition;
|
||||
import android.transition.TransitionManager;
|
||||
import android.util.ArrayMap;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
@@ -40,20 +34,8 @@ public class TopViewNoLinkageAnimHelper {
|
||||
private static final String TAG = "TopViewNoLinkageAnimHelper";
|
||||
|
||||
private ConstraintLayout topMotionLayout;
|
||||
private Group remainTimeGroup, remainDistanceGroup, arriveTimeGroup;
|
||||
private View naviBg;
|
||||
|
||||
private ImageView ivTurnIcon;
|
||||
private TextView tvNextDistance;
|
||||
private TextView tvNextRoad;
|
||||
private TextView tvNextDistanceUnit;
|
||||
private TextView tvTurnInfo;
|
||||
private TopView topContainerNoLinkage;
|
||||
|
||||
private ConstraintSet constraintSet;
|
||||
private Transition transition;
|
||||
private TextView cameraMode;
|
||||
|
||||
private float topHeight = 0f;
|
||||
|
||||
private Handler handler = new Handler();
|
||||
@@ -85,82 +67,10 @@ public class TopViewNoLinkageAnimHelper {
|
||||
}
|
||||
|
||||
public void init(ConstraintLayout rootView, OnTopViewAnimSimpleListener listener) {
|
||||
|
||||
constraintSet = new ConstraintSet();
|
||||
transition = new AutoTransition();
|
||||
|
||||
topMotionLayout = rootView;
|
||||
naviBg = rootView.findViewById(R.id.module_map_id_navi_bg);
|
||||
remainTimeGroup = rootView.findViewById(R.id.remainTimeGroup);
|
||||
remainDistanceGroup = rootView.findViewById(R.id.remainDistanceGroup);
|
||||
arriveTimeGroup = rootView.findViewById(R.id.arriveTimeGroup);
|
||||
topContainerNoLinkage = rootView.findViewById(R.id.module_entrance_id_top_container_no_linkage);
|
||||
tvNextDistanceUnit = rootView.findViewById(R.id.module_map_id_navi_next_info_distance_unit);
|
||||
tvTurnInfo = rootView.findViewById(R.id.module_map_id_navi_next_info_turn_info);
|
||||
|
||||
topContainerNoLinkage.setSlideListener(this::startLatestTopOutAnim);
|
||||
|
||||
ivTurnIcon = rootView.findViewById(R.id.module_map_id_navi_next_info_road_turn_icon);
|
||||
tvNextDistance = rootView.findViewById(R.id.module_map_id_navi_next_info_distance);
|
||||
tvNextRoad = rootView.findViewById(R.id.module_map_id_navi_next_info_road);
|
||||
transition.setDuration(200);
|
||||
|
||||
transition.addListener(new Transition.TransitionListener() {
|
||||
@Override
|
||||
public void onTransitionStart(Transition transition) {
|
||||
if (listener != null) {
|
||||
listener.onAnimStart();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionEnd(Transition transition) {
|
||||
// if (isTopViewOut) {
|
||||
// topContainer.removeAllViews();
|
||||
// }
|
||||
if (listener != null) {
|
||||
listener.onAnimEnd();
|
||||
}
|
||||
Logger.d(TAG, "onTransitionEnd: " + currentAnimatingView);
|
||||
IMogoTopViewStatusListener listener;
|
||||
if (isTopViewOut) {
|
||||
int lastCount = topContainerNoLinkage.getChildCount();
|
||||
for (int i = 0; i < lastCount; i++) {
|
||||
View child = topContainerNoLinkage.getChildAt(i);
|
||||
viewCaches.remove(child);
|
||||
listener = statusListenerMap.remove(child);
|
||||
if (listener != null) {
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
topContainerNoLinkage.removeAllViews();
|
||||
} else {
|
||||
listener = statusListenerMap.get(currentAnimatingView);
|
||||
if (listener != null) {
|
||||
listener.onViewAdded(currentAnimatingView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionCancel(Transition transition) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionPause(Transition transition) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionResume(Transition transition) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
cameraMode = rootView.findViewById(R.id.module_ext_id_north);
|
||||
// 初始化默认隐藏导航
|
||||
hideNaviView();
|
||||
}
|
||||
|
||||
private volatile boolean isTopViewOut = true;
|
||||
@@ -169,100 +79,6 @@ public class TopViewNoLinkageAnimHelper {
|
||||
|
||||
private View currentAnimatingView = null;
|
||||
|
||||
public void addSubView(View subView, LayoutParams params,
|
||||
IMogoTopViewStatusListener statusListener) {
|
||||
if (isTopViewOut || topContainerNoLinkage.getChildCount() == 0) {
|
||||
throw new IllegalStateException("no base view in top view");
|
||||
}
|
||||
if (subView == null) {
|
||||
throw new IllegalArgumentException("method addTopView params view is null");
|
||||
}
|
||||
if (params == null) {
|
||||
throw new IllegalArgumentException("method addTopView params LayoutParams is null");
|
||||
}
|
||||
|
||||
// 是在已经添加过view之后,才能添加sub view,所以直接走增加小view的逻辑就行
|
||||
if (!viewCaches.contains(subView)) {
|
||||
viewCaches.add(subView);
|
||||
statusListenerMap.put(subView, statusListener);
|
||||
subView.setTranslationY(0);
|
||||
subView.setTranslationY(-(params.height));
|
||||
topContainerNoLinkage.addView(subView, params);
|
||||
Logger.d(TAG, "添加subView: " + subView.getTranslationY() + " height:" +
|
||||
" " + subView.getHeight() + " paramsHeight: " + params.height);
|
||||
if (statusListenerMap.get(subView) != null) {
|
||||
statusListenerMap.get(subView).beforeViewAddAnim(subView);
|
||||
}
|
||||
subView.animate().translationY(0).setDuration(500).setListener(new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
IMogoTopViewStatusListener listener = statusListenerMap.get(subView);
|
||||
if (listener != null) {
|
||||
listener.onViewAdded(subView);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void removeSubView(View subView) {
|
||||
if (topContainerNoLinkage.getChildCount() < 2) {
|
||||
throw new IllegalStateException("view count not enough");
|
||||
}
|
||||
Logger.d(TAG,
|
||||
"小view退出: " + subView.getTranslationY() + " height: " + subView.getHeight());
|
||||
if (statusListenerMap.get(subView) != null) {
|
||||
statusListenerMap.get(subView).beforeViewRemoveAnim(subView);
|
||||
}
|
||||
subView.animate().translationY(-(subView.getHeight())).setDuration(500).setListener(new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
Logger.d(TAG, "onAnimationEnd: " + subView);
|
||||
viewCaches.remove(subView);
|
||||
topContainerNoLinkage.removeView(subView);
|
||||
IMogoTopViewStatusListener listener = statusListenerMap.remove(subView);
|
||||
if (listener != null) {
|
||||
listener.onViewRemoved(subView);
|
||||
} else {
|
||||
Logger.d(TAG, "listener is null");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
viewCaches.remove(subView);
|
||||
topContainerNoLinkage.removeView(subView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void startTopInAnim(View view, LayoutParams params,
|
||||
IMogoTopViewStatusListener statusListener) {
|
||||
|
||||
@@ -308,14 +124,10 @@ public class TopViewNoLinkageAnimHelper {
|
||||
// 如果高度变化,生硬的变化一下高度
|
||||
Logger.d(TAG, "container.height: " + topContainerNoLinkage.getHeight());
|
||||
if (topContainerNoLinkage.getHeight() != params.height) {
|
||||
constraintSet.clone(topMotionLayout);
|
||||
LayoutParams p = topContainerNoLinkage.getLayoutParams();
|
||||
p.height = params.height;
|
||||
topContainerNoLinkage.setLayoutParams(p);
|
||||
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
|
||||
computeNaviMarginTop(params.height));
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
topContainerNoLinkage.setTranslationY(params.height);
|
||||
Logger.d(TAG, "改变container的高度===");
|
||||
}
|
||||
|
||||
@@ -363,19 +175,8 @@ public class TopViewNoLinkageAnimHelper {
|
||||
}
|
||||
topContainerNoLinkage.setChildAddedListener(child -> {
|
||||
topContainerNoLinkage.setChildAddedListener(null);
|
||||
|
||||
NoMapTopViewShaderHelper.getInstance().showShader();
|
||||
|
||||
constraintSet.clone(topMotionLayout);
|
||||
|
||||
constraintSet.clear(R.id.module_entrance_id_top_container_no_linkage,
|
||||
ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(R.id.module_entrance_id_top_container_no_linkage, ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
|
||||
TransitionManager.beginDelayedTransition(topMotionLayout, transition);
|
||||
checkCameraModePosition(false);
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
|
||||
topContainerNoLinkage.animate().translationY(child.getHeight()).setListener(mainAnimListener).start();
|
||||
int scene = Scene.AIMLESS_WITH_ROAD_EVENT;
|
||||
Logger.d(TAG, "show top setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
@@ -387,7 +188,7 @@ public class TopViewNoLinkageAnimHelper {
|
||||
|
||||
// vr模式下与TopView互斥
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
TopViewAnimHelper.getInstance().removeAllView();
|
||||
TopViewAnimHelper.getInstance().removeAllViewExceptVrNav();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,9 +196,7 @@ public class TopViewNoLinkageAnimHelper {
|
||||
* 退出最新的(也就是最上面的)view
|
||||
*/
|
||||
private void startLatestTopOutAnim() {
|
||||
if (topContainerNoLinkage.getChildCount() > 1) {
|
||||
removeSubView(topContainerNoLinkage.getChildAt(topContainerNoLinkage.getChildCount() - 1));
|
||||
} else if (topContainerNoLinkage.getChildCount() > 0) {
|
||||
if (topContainerNoLinkage.getChildCount() > 0) {
|
||||
startTopOutAnim(topContainerNoLinkage.getChildAt(topContainerNoLinkage.getChildCount() - 1));
|
||||
}
|
||||
}
|
||||
@@ -414,16 +213,7 @@ public class TopViewNoLinkageAnimHelper {
|
||||
}
|
||||
isTopViewOut = true;
|
||||
NoMapTopViewShaderHelper.getInstance().hideShader();
|
||||
constraintSet.clone(topMotionLayout);
|
||||
|
||||
constraintSet.clear(R.id.module_entrance_id_top_container_no_linkage, ConstraintSet.TOP);
|
||||
constraintSet.connect(R.id.module_entrance_id_top_container_no_linkage, ConstraintSet.BOTTOM,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
|
||||
TransitionManager.beginDelayedTransition(topMotionLayout, transition);
|
||||
checkCameraModePosition(false);
|
||||
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
|
||||
topContainerNoLinkage.animate().translationY(-topContainerNoLinkage.getTranslationY()).setListener(mainAnimListener).start();
|
||||
int scene = Scene.AIMLESS;
|
||||
Logger.d(TAG, "hide top setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
@@ -431,61 +221,10 @@ public class TopViewNoLinkageAnimHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public void hideNaviView() {
|
||||
if (topMotionLayout == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d(TAG, "hideNaviView=====");
|
||||
setNaviVisibility(View.GONE);
|
||||
remainDistanceGroup.setVisibility(View.GONE);
|
||||
remainTimeGroup.setVisibility(View.GONE);
|
||||
arriveTimeGroup.setVisibility(View.GONE);
|
||||
int scene = 0;
|
||||
if (isTopViewOut) {
|
||||
scene = Scene.AIMLESS;
|
||||
} else {
|
||||
scene = Scene.AIMLESS_WITH_ROAD_EVENT;
|
||||
}
|
||||
Logger.d(TAG, "hide navi setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
checkCameraModePosition(true);
|
||||
}
|
||||
|
||||
private void checkCameraModePosition(boolean isNeedClone) {
|
||||
if (isNeedClone) {
|
||||
constraintSet.clone(topMotionLayout);
|
||||
}
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP, naviBg.getId(),
|
||||
ConstraintSet.BOTTOM, (int) getDimen(R.dimen.dp_30));
|
||||
} else {
|
||||
if (isTopViewOut) {
|
||||
constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP, naviBg.getId(),
|
||||
ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.module_ext_north_goneMarginTop));
|
||||
} else {
|
||||
constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_container_no_linkage,
|
||||
ConstraintSet.BOTTOM,
|
||||
(int) getDimen(R.dimen.dp_30));
|
||||
}
|
||||
}
|
||||
if (isNeedClone) {
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
}
|
||||
}
|
||||
|
||||
private float getDimen(int resId) {
|
||||
return (int) topMotionLayout.getContext().getResources().getDimensionPixelSize(resId);
|
||||
}
|
||||
|
||||
private int computeNaviMarginTop(int height) {
|
||||
int result = (int) (height - (getDimen(R.dimen.module_ext_top_over_navi_height)) - getDimen(R.dimen.module_common_shadow_width_pos));
|
||||
Logger.d(TAG, "computeNaviMarginTop: " + height + " result: " + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
interface OnTopViewAnimSimpleListener {
|
||||
void onAnimStart();
|
||||
|
||||
@@ -496,17 +235,6 @@ public class TopViewNoLinkageAnimHelper {
|
||||
return viewCaches.contains(view);
|
||||
}
|
||||
|
||||
private void setNaviVisibility(int visibility) {
|
||||
ivTurnIcon.setVisibility(visibility);
|
||||
tvNextRoad.setVisibility(visibility);
|
||||
tvNextDistance.setVisibility(visibility);
|
||||
remainTimeGroup.setVisibility(visibility);
|
||||
remainDistanceGroup.setVisibility(visibility);
|
||||
arriveTimeGroup.setVisibility(visibility);
|
||||
naviBg.setVisibility(visibility);
|
||||
tvNextDistanceUnit.setVisibility(visibility);
|
||||
tvTurnInfo.setVisibility(visibility);
|
||||
}
|
||||
|
||||
public void removeAllView() {
|
||||
Logger.d(TAG, "remove all view");
|
||||
@@ -522,24 +250,12 @@ public class TopViewNoLinkageAnimHelper {
|
||||
}
|
||||
}
|
||||
topContainerNoLinkage.removeAllViews();
|
||||
hideNaviView();
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
topMotionLayout = null;
|
||||
remainTimeGroup = null;
|
||||
remainDistanceGroup = null;
|
||||
arriveTimeGroup = null;
|
||||
naviBg = null;
|
||||
ivTurnIcon = null;
|
||||
tvNextDistance = null;
|
||||
tvNextRoad = null;
|
||||
tvNextDistanceUnit = null;
|
||||
tvTurnInfo = null;
|
||||
topContainerNoLinkage = null;
|
||||
cameraMode = null;
|
||||
transition = null;
|
||||
}
|
||||
|
||||
public void enterVrMode(){
|
||||
@@ -551,4 +267,46 @@ public class TopViewNoLinkageAnimHelper {
|
||||
removeAllView();
|
||||
topContainerNoLinkage.getLayoutParams().width = LayoutParams.MATCH_PARENT;
|
||||
}
|
||||
|
||||
private final Animator.AnimatorListener mainAnimListener = new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
Logger.d(TAG, "onMainAnimEnd: " + currentAnimatingView);
|
||||
IMogoTopViewStatusListener listener;
|
||||
if (isTopViewOut) {
|
||||
int lastCount = topContainerNoLinkage.getChildCount();
|
||||
for (int i = 0; i < lastCount; i++) {
|
||||
View child = topContainerNoLinkage.getChildAt(i);
|
||||
viewCaches.remove(child);
|
||||
listener = statusListenerMap.remove(child);
|
||||
if (listener != null) {
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
topContainerNoLinkage.removeAllViews();
|
||||
currentAnimatingView = null;
|
||||
} else {
|
||||
listener = statusListenerMap.get(currentAnimatingView);
|
||||
if (listener != null) {
|
||||
listener.onViewAdded(currentAnimatingView);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
package com.mogo.module.extensions.utils;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.view.VerticalTrafficLightView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 红绿灯面板管理类,控制各部分显示隐藏,同时控制限速、车速、红绿灯信息展示
|
||||
* <p>
|
||||
* 导航信息内容通过{@link com.mogo.module.extensions.navi.VrModeNavInfoView} 在{@link com.mogo.module.extensions.entrance.EntranceFragment}进行控制
|
||||
* 此处仅控制导航信息的显示与隐藏
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class TrafficLightPanelManager implements Handler.Callback, View.OnClickListener {
|
||||
private static final String TAG = "TrafficLightPanelManager";
|
||||
|
||||
private TrafficLightPanelManager() {
|
||||
}
|
||||
|
||||
private final static TrafficLightPanelManager INSTANCE = new TrafficLightPanelManager();
|
||||
|
||||
public static TrafficLightPanelManager getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private Group speedGroup, navGroup, extraGroup;
|
||||
private TextView tvLimitSpeed;
|
||||
private VerticalTrafficLightView turnAroundLight, turnLeftLight, straightLight, turnRightLight;
|
||||
|
||||
private Handler handler = new Handler(this);
|
||||
|
||||
private boolean isInit = false;
|
||||
|
||||
public void initPanel(View root) {
|
||||
speedGroup = root.findViewById(R.id.module_ext_id_group_navi_in_vr_speed);
|
||||
navGroup = root.findViewById(R.id.module_ext_id_group_navi_in_vr_nav_info);
|
||||
extraGroup = root.findViewById(R.id.module_ext_id_group_traffic_light_panel_extra);
|
||||
tvLimitSpeed = root.findViewById(R.id.module_ext_id_tv_limit_speed);
|
||||
turnAroundLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_around);
|
||||
turnLeftLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_left);
|
||||
straightLight = root.findViewById(R.id.module_ext_id_traffic_light_straight);
|
||||
turnRightLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_right);
|
||||
isInit = true;
|
||||
|
||||
// debug
|
||||
root.findViewById(R.id.module_ext_id_navi_in_vr_speed_bg).setOnClickListener(this);
|
||||
root.findViewById(R.id.module_ext_id_navi_in_vr_traffic_bg).setOnClickListener(this);
|
||||
}
|
||||
|
||||
public void showNavPanel() {
|
||||
if (!isInit) {
|
||||
Logger.e(TAG, "nav panel 未初始化");
|
||||
return;
|
||||
}
|
||||
extraGroup.setVisibility(View.VISIBLE);
|
||||
if (isNav) {
|
||||
navGroup.setVisibility(View.VISIBLE);
|
||||
speedGroup.setVisibility(View.GONE);
|
||||
} else {
|
||||
speedGroup.setVisibility(View.VISIBLE);
|
||||
navGroup.setVisibility(View.GONE);
|
||||
}
|
||||
tvLimitSpeed.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void hideNavPanel() {
|
||||
if (!isInit) {
|
||||
Logger.e(TAG, "nav panel 未初始化");
|
||||
return;
|
||||
}
|
||||
extraGroup.setVisibility(View.GONE);
|
||||
speedGroup.setVisibility(View.GONE);
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
private boolean isNav = false;
|
||||
|
||||
public void startNav() {
|
||||
isNav = true;
|
||||
navGroup.setVisibility(View.VISIBLE);
|
||||
speedGroup.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void stopNav() {
|
||||
isNav = false;
|
||||
speedGroup.setVisibility(View.VISIBLE);
|
||||
navGroup.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void refreshLimitSpeed(int limitSpeed) {
|
||||
handler.removeMessages(MSG_HIDE_LIMIT_SPEED);
|
||||
tvLimitSpeed.setVisibility(View.VISIBLE);
|
||||
tvLimitSpeed.setText(String.valueOf(limitSpeed));
|
||||
handler.sendEmptyMessageDelayed(MSG_HIDE_LIMIT_SPEED, HIDE_LIMIT_SPEED_DELAY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新红绿灯显示状态
|
||||
*
|
||||
* @param laneLight 固定数组长度为4的车道类型灯,从0-3依次代表 掉头,左转,执行,右转
|
||||
* @param surplusTime 固定数组长度为4的剩余时长数组,从0-3依次代表 掉头,左转,执行,右转
|
||||
*/
|
||||
public void refreshTrafficLightStatus(int[] laneLight, String[] surplusTime) {
|
||||
turnAroundLight.setTrafficLightStatus(laneLight[0], surplusTime[0]);
|
||||
turnLeftLight.setTrafficLightStatus(laneLight[1], surplusTime[1]);
|
||||
straightLight.setTrafficLightStatus(laneLight[2], surplusTime[2]);
|
||||
turnRightLight.setTrafficLightStatus(laneLight[3], surplusTime[3]);
|
||||
}
|
||||
|
||||
public void release() {
|
||||
isInit = false;
|
||||
speedGroup = null;
|
||||
navGroup = null;
|
||||
extraGroup = null;
|
||||
tvLimitSpeed = null;
|
||||
turnAroundLight = null;
|
||||
turnLeftLight = null;
|
||||
straightLight = null;
|
||||
turnRightLight = null;
|
||||
}
|
||||
|
||||
private static final int MSG_HIDE_LIMIT_SPEED = 1001;
|
||||
private static final long HIDE_LIMIT_SPEED_DELAY = 5000;
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if (!isInit) {
|
||||
return false;
|
||||
}
|
||||
if (msg.what == MSG_HIDE_LIMIT_SPEED) {
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.module_ext_id_navi_in_vr_speed_bg) {
|
||||
boolean s = new Random().nextBoolean();
|
||||
boolean b = new Random().nextBoolean();
|
||||
if (s) {
|
||||
if (b) {
|
||||
startNav();
|
||||
} else {
|
||||
stopNav();
|
||||
}
|
||||
} else {
|
||||
refreshLimitSpeed(90);
|
||||
}
|
||||
} else {
|
||||
int[] color = new int[4];
|
||||
String[] time = new String[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int s = new Random().nextInt(4);
|
||||
boolean b = new Random().nextBoolean();
|
||||
color[i] = s;
|
||||
time[i] = b ? "12" : "";
|
||||
}
|
||||
refreshTrafficLightStatus(color, time);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,9 @@
|
||||
<com.mogo.module.extensions.live.CameraLiveGSYVideoView
|
||||
android:id="@+id/videoPlayer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/v2x_video_window_height_content"
|
||||
android:layout_height="@dimen/module_video_window_height_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:roundLayoutRadius="@dimen/dp_30" />
|
||||
|
||||
@@ -32,6 +31,6 @@
|
||||
app:miv_placeHolder="@drawable/icon_default_user_head"
|
||||
app:miv_shape="circle"
|
||||
app:miv_shapeBorderWidth="@dimen/dp_4"
|
||||
tools:visibility="visible" />
|
||||
tools:visibility="invisible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/rlRoadEventDetail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/v2x_video_window_height_content"
|
||||
android:layout_height="@dimen/module_video_window_height_content"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<include
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
android:gravity="center"
|
||||
android:text="80"
|
||||
android:textColor="#FF9CA8D8"
|
||||
android:visibility="gone"
|
||||
android:textSize="@dimen/module_ext_navi_in_vr_limit_speed_text_size"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg"
|
||||
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg"
|
||||
@@ -169,7 +170,7 @@
|
||||
android:id="@+id/module_ext_id_group_traffic_light_panel_extra"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
app:constraint_referenced_ids="module_ext_id_navi_in_vr_bg,module_ext_id_navi_in_vr_speed_bg,module_ext_id_navi_in_vr_traffic_bg,module_ext_id_traffic_light_turn_left,module_ext_id_traffic_light_turn_around,module_ext_id_traffic_light_straight,module_ext_id_traffic_light_turn_right"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginRight="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginTop="@dimen/module_common_shadow_width_pos"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_entrance_id_top_container"
|
||||
app:layout_constraintTop_toTopOf="@id/module_entrance_id_top_motion_layout" />
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_map_id_navi_next_info_road_turn_icon"
|
||||
@@ -218,4 +218,26 @@
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_arrive_time"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_map_id_arrive_time" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_destination_online_car"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/module_ext_button_height"
|
||||
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginTop="@dimen/module_ext_camera_button_marginTop"
|
||||
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
|
||||
android:drawableLeft="@drawable/module_ext_destination_online_car_dw"
|
||||
android:drawablePadding="@dimen/module_ext_destination_online_car_drawablePadding"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/module_ext_destination_online_car_paddingLeft"
|
||||
android:paddingRight="@dimen/module_ext_destination_online_car_paddingRight"
|
||||
android:text="@string/module_ext_destination_online_car_text"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_north_textSize"
|
||||
android:textStyle="bold"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop"
|
||||
tools:visibility="visible" />
|
||||
</merge>
|
||||
@@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout"
|
||||
>
|
||||
<View
|
||||
android:id="@+id/module_map_id_navi_bg"
|
||||
style="@style/NaviViewStyle"
|
||||
android:layout_height="@dimen/module_ext_navi_info_panel_height"
|
||||
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginRight="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginTop="@dimen/module_common_shadow_width_pos"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_map_id_navi_next_info_road_turn_icon"
|
||||
android:layout_width="@dimen/module_ext_navi_info_panel_turn_icon_width"
|
||||
android:layout_height="@dimen/module_ext_navi_info_panel_turn_icon_height"
|
||||
android:layout_marginStart="@dimen/module_ext_navi_info_panel_turn_icon_marginLeft"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_11"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_map_id_navi_bg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_navi_next_info_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_map_id_navi_next_info_distance_marginStart"
|
||||
android:layout_marginTop="@dimen/module_map_id_navi_next_info_distance_marginTop"
|
||||
android:text="53"
|
||||
android:textColor="#F1F1F1"
|
||||
android:textSize="@dimen/module_ext_navi_info_panel_next_info_distance_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_map_id_navi_next_info_road_turn_icon"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_map_id_navi_next_info_road_turn_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_navi_next_info_distance_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_ext_navi_info_panel_next_info_distance_unit_marginLeft"
|
||||
android:layout_marginBottom="@dimen/module_ext_navi_info_panel_next_info_distance_unit_marginBottom"
|
||||
android:text="米"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/module_ext_navi_info_panel_next_info_distance_unit_textSize"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/module_map_id_navi_next_info_distance"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_map_id_navi_next_info_distance" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_navi_next_info_turn_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/module_ext_navi_info_panel_next_info_distance_unit_marginLeft"
|
||||
android:layout_marginBottom="@dimen/module_ext_navi_info_panel_next_info_distance_unit_marginBottom"
|
||||
android:textColor="#7FF1F1F1"
|
||||
android:textSize="@dimen/module_ext_navi_info_panel_next_info_distance_next_step_textSize"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/module_map_id_navi_next_info_distance_unit"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_map_id_navi_next_info_distance_unit" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_navi_next_info_road"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_next_info_road_marginTop"
|
||||
android:layout_marginBottom="@dimen/module_map_id_navi_next_info_road_marginBottom"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="北三环东路辅路"
|
||||
android:textColor="#F1F1F1"
|
||||
android:textSize="@dimen/module_ext_navi_info_panel_next_info_road_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_next_info_road_turn_icon"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_navi_next_info_distance" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/remainDistanceGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="module_map_id_remaining_distance_icon,module_map_id_remaining_distance,module_map_id_remaining_distance_unit,module_map_id_remaining_distance_notice" />
|
||||
<!--remain distance-->
|
||||
<ImageView
|
||||
android:id="@+id/module_map_id_remaining_distance_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_117"
|
||||
android:src="@drawable/module_ext_ic_navi_info1"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_map_id_remaining_distance"
|
||||
app:layout_constraintRight_toLeftOf="@id/module_map_id_remaining_time_icon"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_remaining_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3599"
|
||||
android:textColor="#F1F1F1"
|
||||
android:textSize="@dimen/module_ext_remaining_distance_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/module_map_id_remaining_distance_notice"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_remaining_distance_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_map_id_remaining_distance_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_remaining_distance_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="km"
|
||||
android:textColor="#F1F1F1"
|
||||
android:textSize="@dimen/module_ext_remaining_distance_unit_textSize"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/module_map_id_remaining_distance"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_map_id_remaining_distance" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_remaining_distance_notice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="剩余"
|
||||
android:textColor="#7FFFFFFF"
|
||||
android:textSize="@dimen/module_ext_remaining_distance_unit_textSize"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_remaining_distance"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_map_id_remaining_distance" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/remainTimeGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="module_map_id_remaining_time_icon,module_map_id_remaining_time,module_map_id_remaining_time_unit,module_map_id_remaining_time_notice" />
|
||||
<!--remain time-->
|
||||
<ImageView
|
||||
android:id="@+id/module_map_id_remaining_time_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_117"
|
||||
android:src="@drawable/module_ext_ic_navi_info2"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_map_id_remaining_time"
|
||||
app:layout_constraintRight_toLeftOf="@id/module_map_id_arrive_time_icon"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_remaining_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3599"
|
||||
android:textColor="#F1F1F1"
|
||||
android:textSize="@dimen/module_ext_remaining_time_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_map_id_remaining_time_notice"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_remaining_time_icon"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_map_id_remaining_time_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_remaining_time_unit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="km"
|
||||
android:textColor="#F1F1F1"
|
||||
android:textSize="@dimen/module_ext_remaining_time_unit_textSize"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/module_map_id_remaining_time"
|
||||
app:layout_constraintLeft_toRightOf="@id/module_map_id_remaining_time" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_remaining_time_notice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="时间"
|
||||
android:textColor="#7FFFFFFF"
|
||||
android:textSize="@dimen/module_ext_remaining_distance_unit_textSize"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_remaining_time"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_map_id_remaining_time" />
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/arriveTimeGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="module_map_id_arrive_time_icon,module_map_id_arrive_time,module_map_id_arrive_time_notice" />
|
||||
<!--arrive time-->
|
||||
<ImageView
|
||||
android:id="@+id/module_map_id_arrive_time_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/module_ext_navi_extra_info_margin_right"
|
||||
android:src="@drawable/module_ext_ic_navi_info3"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_map_id_arrive_time"
|
||||
app:layout_constraintRight_toRightOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintTop_toTopOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_arrive_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="3599"
|
||||
android:textColor="#F1F1F1"
|
||||
android:textSize="@dimen/module_ext_arrive_time_textSize"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_map_id_arrive_time_notice"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_arrive_time_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_map_id_arrive_time_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_map_id_arrive_time_notice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="到达"
|
||||
android:textColor="#7FFFFFFF"
|
||||
android:textSize="@dimen/module_ext_remaining_distance_unit_textSize"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_map_id_arrive_time"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_map_id_arrive_time" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_destination_online_car"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/module_ext_button_height"
|
||||
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginTop="@dimen/module_ext_camera_button_marginTop"
|
||||
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
|
||||
android:drawableLeft="@drawable/module_ext_destination_online_car_dw"
|
||||
android:drawablePadding="@dimen/module_ext_destination_online_car_drawablePadding"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/module_ext_destination_online_car_paddingLeft"
|
||||
android:paddingRight="@dimen/module_ext_destination_online_car_paddingRight"
|
||||
android:text="@string/module_ext_destination_online_car_text"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_north_textSize"
|
||||
android:textStyle="bold"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop"
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -16,10 +16,13 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<include
|
||||
layout="@layout/include_navi_in_vr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.mogo.module.extensions.navi.VrModeNavInfoView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/module_ext_id_vr_nav_info"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/module_entrance_id_move2_current_location"
|
||||
@@ -127,10 +130,14 @@
|
||||
android:background="#7f000000"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
layout="@layout/include_navi_info_panle"
|
||||
<com.mogo.module.extensions.navi.AnimNavInfoView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/module_ext_id_anim_nav_info"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_north"
|
||||
@@ -151,28 +158,6 @@
|
||||
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_destination_online_car"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/module_ext_button_height"
|
||||
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
|
||||
android:layout_marginTop="@dimen/module_ext_camera_button_marginTop"
|
||||
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
|
||||
android:drawableLeft="@drawable/module_ext_destination_online_car_dw"
|
||||
android:drawablePadding="@dimen/module_ext_destination_online_car_drawablePadding"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/module_ext_destination_online_car_paddingLeft"
|
||||
android:paddingRight="@dimen/module_ext_destination_online_car_paddingRight"
|
||||
android:text="@string/module_ext_destination_online_car_text"
|
||||
android:textColor="@color/module_ext_color_voice_text"
|
||||
android:textSize="@dimen/module_ext_north_textSize"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_map_id_navi_bg"
|
||||
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop"
|
||||
tools:visibility="visible" />
|
||||
<!--关联别的控件的头部容器-->
|
||||
<com.mogo.module.extensions.navi.TopView
|
||||
android:id="@+id/module_entrance_id_top_container"
|
||||
|
||||
@@ -123,10 +123,13 @@
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<include
|
||||
layout="@layout/include_navi_info_panle"
|
||||
<com.mogo.module.extensions.navi.AnimNavInfoView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/module_ext_id_anim_nav_info"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_north"
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
<dimen name="module_common_btn_bottom">0px</dimen>
|
||||
<dimen name="module_entrance_id_button_marginLeft">-6px</dimen>
|
||||
<dimen name="module_event_live_error_text_size">20px</dimen>
|
||||
<dimen name="module_video_window_height_content">370px</dimen>
|
||||
<dimen name="module_video_window_height_content">300px</dimen>
|
||||
<dimen name="module_video_window_width_content">400px</dimen>
|
||||
</resources>
|
||||
@@ -14,6 +14,6 @@
|
||||
<dimen name="module_ext_navi_width">-1</dimen>
|
||||
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
|
||||
<dimen name="module_event_live_error_text_size">20px</dimen>
|
||||
<dimen name="module_video_window_height_content">370px</dimen>
|
||||
|
||||
<dimen name="module_video_window_height_content">300px</dimen>
|
||||
<dimen name="module_video_window_width_content">400px</dimen>
|
||||
</resources>
|
||||
@@ -161,5 +161,6 @@
|
||||
<dimen name="module_ext_bottom_btn_margin_bottom">0px</dimen>
|
||||
|
||||
<dimen name="module_event_live_error_text_size">36px</dimen>
|
||||
<dimen name="module_video_window_height_content">664px</dimen>
|
||||
<dimen name="module_video_window_height_content">393px</dimen>
|
||||
<dimen name="module_video_window_width_content">700px</dimen>
|
||||
</resources>
|
||||
@@ -178,6 +178,7 @@
|
||||
<dimen name="module_ext_navi_small_margin_right">20px</dimen>
|
||||
|
||||
<dimen name="module_event_live_error_text_size">36px</dimen>
|
||||
<dimen name="module_video_window_height_content">664px</dimen>
|
||||
<dimen name="module_video_window_height_content">393px</dimen>
|
||||
<dimen name="module_video_window_width_content">700px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -238,7 +238,8 @@
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_txt_size">36px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_unit_size">21px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_no_time_margin_top">21px</dimen>
|
||||
<dimen name="module_video_window_width_content">400px</dimen>
|
||||
<dimen name="module_video_window_height_content">300px</dimen>
|
||||
|
||||
<dimen name="module_video_window_height_content">370px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -122,6 +122,10 @@ public class MediaWindow2 implements IMusicView , IMogoStatusChangedListener {
|
||||
}
|
||||
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (mWindowView == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ServiceMediaHandler.getMogoWindowManager().removeView(mWindowView);
|
||||
mHasAddWindow = false;
|
||||
addWindowView();
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.mogo.module.small.map;
|
||||
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:36 PM
|
||||
*/
|
||||
public interface IMogoSmallMapProvider extends IMogoModuleProvider {
|
||||
String path = "/small_map/api";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
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.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.module.common.view.RoundLayout;
|
||||
|
||||
/**
|
||||
* 小地图的方向View
|
||||
*
|
||||
* @author donghongyu
|
||||
* @date 12/14/20 4:40 PM
|
||||
*/
|
||||
public class SmallMapDirectionView extends RoundLayout {
|
||||
|
||||
private ImageView mIvMapBorder;
|
||||
|
||||
public SmallMapDirectionView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public SmallMapDirectionView(Context context, @Nullable AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public SmallMapDirectionView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
LayoutInflater.from(context).inflate(R.layout.module_small_map_view, this);
|
||||
mIvMapBorder = findViewById(R.id.ivMapBorder);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改角度
|
||||
*
|
||||
* @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);
|
||||
//设置线性插值,可以解决旋转一圈后卡顿问题
|
||||
mRotateAnimation.setInterpolator(new DecelerateInterpolator());
|
||||
//设置旋转一圈时间
|
||||
mRotateAnimation.setDuration(1000);
|
||||
//控件动画结束时是否保持动画最后的状态
|
||||
mRotateAnimation.setFillAfter(true);
|
||||
|
||||
mIvMapBorder.startAnimation(mRotateAnimation);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class SmallMapService extends Service {
|
||||
private IBinder mBinder;
|
||||
|
||||
private WindowManagerView mWindowManagerView;
|
||||
private SmallMapView mMapView;
|
||||
private SmallMapDirectionView mSmallMapDirectionView;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
@@ -69,20 +69,30 @@ public class SmallMapService extends Service {
|
||||
|
||||
private void addMachineVisionMapView() {
|
||||
Logger.d(TAG, "addMachineVisionMapView");
|
||||
|
||||
mWindowManagerView = new WindowManagerView.Builder(getApplicationContext())
|
||||
.contentView(R.layout.module_small_map_view)
|
||||
.contentView(R.layout.module_small_map_direction_view)
|
||||
.size(
|
||||
WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
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_mvision_view_x),
|
||||
getResources().getDimensionPixelOffset(R.dimen.module_mvision_view_y)
|
||||
)
|
||||
.gravity(Gravity.TOP | Gravity.LEFT)
|
||||
.showInWindowManager();
|
||||
mWindowManagerView.show();
|
||||
|
||||
mSmallMapDirectionView = mWindowManagerView.findViewById(R.id.smallMapDirectionView);
|
||||
|
||||
|
||||
mSmallMapDirectionView.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mSmallMapDirectionView.changeAngle(-60);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,17 +11,23 @@ import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoSmallMapProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:34 PM
|
||||
*/
|
||||
@Route(path = IMogoSmallMapProvider.path)
|
||||
public class SmallVisionProvider implements IMogoSmallMapProvider {
|
||||
@Route(path = MogoServicePaths.PATH_SMALL_MAP)
|
||||
public class SmallVisionProvider implements IMogoSmallMapProvider, IMogoStatusChangedListener {
|
||||
private final String TAG = "SmallVisionProvider";
|
||||
|
||||
private Intent mSmallMapServiceIntent;
|
||||
private Context mContext;
|
||||
|
||||
@Override
|
||||
public Fragment createFragment(Context context, Bundle data) {
|
||||
@@ -47,15 +53,55 @@ public class SmallVisionProvider implements IMogoSmallMapProvider {
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Log.d(TAG, "小地图模块初始化……");
|
||||
mSmallMapServiceIntent = new Intent(context, SmallMapService.class);
|
||||
context.startService(mSmallMapServiceIntent);
|
||||
mContext = context;
|
||||
|
||||
MogoApisHandler.getInstance()
|
||||
.getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener(
|
||||
MogoServicePaths.PATH_SMALL_MAP,
|
||||
StatusDescriptor.VR_MODE,
|
||||
this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
Log.d(TAG, "小地图模块销毁……");
|
||||
hidePanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPanel() {
|
||||
Log.d(TAG, "小地图模块触发展示……");
|
||||
|
||||
mSmallMapServiceIntent = new Intent(mContext, SmallMapService.class);
|
||||
mContext.startService(mSmallMapServiceIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hidePanel() {
|
||||
Log.d(TAG, "小地图模块触发隐藏……");
|
||||
|
||||
if (mSmallMapServiceIntent != null) {
|
||||
AbsMogoApplication.getApp().stopService(mSmallMapServiceIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeAngle(double angle) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
Log.d(TAG, "onStatusChanged……descriptor=" + descriptor + ",isTrue=" + isTrue);
|
||||
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
showPanel();
|
||||
} else {
|
||||
hidePanel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.module.small.map.SmallMapDirectionView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/smallMapDirectionView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
@@ -1,17 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.module.common.view.RoundLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/module_small_map_view_border"
|
||||
android:gravity="center"
|
||||
android:id="@+id/rlSmallMapBorder"
|
||||
android:layout_width="@dimen/module_mvision_view_width"
|
||||
android:layout_height="@dimen/module_mvision_view_height"
|
||||
app:roundLayoutRadius="360dp">
|
||||
|
||||
<com.mogo.module.small.map.SmallMapView
|
||||
android:id="@+id/tv"
|
||||
<ImageView
|
||||
android:id="@+id/ivMapBorder"
|
||||
android:layout_width="@dimen/module_mvision_view_width"
|
||||
android:layout_height="@dimen/module_mvision_view_height"
|
||||
android:gravity="center"/>
|
||||
android:src="@drawable/module_small_map_view_border" />
|
||||
|
||||
|
||||
</com.mogo.module.common.view.RoundLayout>
|
||||
@@ -76,55 +76,60 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
try {
|
||||
|
||||
if (holder instanceof shareDescriptionViewHolder) {
|
||||
//分享次数,车友认同次数,热心指数
|
||||
if (dataArrayList.size() > position) {
|
||||
V2XShareEventDescription.ResultBean.EnthusiasmIndexBean data = (V2XShareEventDescription.ResultBean.EnthusiasmIndexBean) dataArrayList.get(position);
|
||||
if (data != null) {
|
||||
String shareNum = String.valueOf(data.getShareNum());
|
||||
String likeNum = String.valueOf(data.getLikeNum());
|
||||
double enthusiasmIndex = data.getEnthusiasmIndex() <= 5 ? data.getEnthusiasmIndex() : 5;
|
||||
if (shareNum != null) {
|
||||
((shareDescriptionViewHolder) holder).shareNumTextView.setText(shareNum);
|
||||
}
|
||||
if (likeNum != null) {
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(likeNum);
|
||||
}
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating((float) enthusiasmIndex);
|
||||
}
|
||||
}
|
||||
} else if (holder instanceof shareItemViewHolder) {
|
||||
//分享列表
|
||||
if (dataArrayList.size() > position) {
|
||||
V2XShareEventItem.ResultBean.PageBean.ContentBean data = (V2XShareEventItem.ResultBean.PageBean.ContentBean) dataArrayList.get(position);
|
||||
if (data != null) {
|
||||
String poitype = data.getPoiType();
|
||||
String address = data.getUploadAddress();
|
||||
String time = DateTimeUtils.getTimeText(data.getUploadTimestamp(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm);
|
||||
String likeNum = String.valueOf(data.getLikeNum());
|
||||
String notLikeNum = String.valueOf(data.getNotlikeNum());
|
||||
|
||||
if (poitype != null) {
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setText(EventTypeUtils.getPoiTypeStr(poitype));
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(EventTypeUtils.getPoiTypeBgForShareItem(poitype));
|
||||
|
||||
}
|
||||
if (address != null) {
|
||||
((shareItemViewHolder) holder).caseAddressTextView.setText(address);
|
||||
}
|
||||
if (time != null) {
|
||||
((shareItemViewHolder) holder).caseTimeTextView.setText(time);
|
||||
}
|
||||
if (likeNum != null) {
|
||||
((shareItemViewHolder) holder).caseUsefulTextView.setText(likeNum);
|
||||
}
|
||||
if (notLikeNum != null) {
|
||||
((shareItemViewHolder) holder).caseUselessTextView.setText(notLikeNum);
|
||||
if (holder instanceof shareDescriptionViewHolder) {
|
||||
//分享次数,车友认同次数,热心指数
|
||||
if (dataArrayList.size() > position) {
|
||||
V2XShareEventDescription.ResultBean.EnthusiasmIndexBean data = (V2XShareEventDescription.ResultBean.EnthusiasmIndexBean) dataArrayList.get(position);
|
||||
if (data != null) {
|
||||
String shareNum = String.valueOf(data.getShareNum());
|
||||
String likeNum = String.valueOf(data.getLikeNum());
|
||||
double enthusiasmIndex = data.getEnthusiasmIndex() <= 5 ? data.getEnthusiasmIndex() : 5;
|
||||
if (shareNum != null) {
|
||||
((shareDescriptionViewHolder) holder).shareNumTextView.setText(shareNum);
|
||||
}
|
||||
if (likeNum != null) {
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(likeNum);
|
||||
}
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating((float) enthusiasmIndex);
|
||||
}
|
||||
}
|
||||
} else if (holder instanceof shareItemViewHolder) {
|
||||
//分享列表
|
||||
if (dataArrayList.size() > position) {
|
||||
V2XShareEventItem.ResultBean.PageBean.ContentBean data = (V2XShareEventItem.ResultBean.PageBean.ContentBean) dataArrayList.get(position);
|
||||
if (data != null) {
|
||||
String poitype = data.getPoiType();
|
||||
String address = data.getUploadAddress();
|
||||
String time = DateTimeUtils.getTimeText(data.getUploadTimestamp(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm);
|
||||
String likeNum = String.valueOf(data.getLikeNum());
|
||||
String notLikeNum = String.valueOf(data.getNotlikeNum());
|
||||
|
||||
if (poitype != null) {
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setText(EventTypeUtils.getPoiTypeStr(poitype));
|
||||
((shareItemViewHolder) holder).caseStyleTextView.setBackgroundResource(EventTypeUtils.getPoiTypeBgForShareItem(poitype));
|
||||
|
||||
}
|
||||
if (address != null) {
|
||||
((shareItemViewHolder) holder).caseAddressTextView.setText(address);
|
||||
}
|
||||
if (time != null) {
|
||||
((shareItemViewHolder) holder).caseTimeTextView.setText(time);
|
||||
}
|
||||
if (likeNum != null) {
|
||||
((shareItemViewHolder) holder).caseUsefulTextView.setText(likeNum);
|
||||
}
|
||||
if (notLikeNum != null) {
|
||||
((shareItemViewHolder) holder).caseUselessTextView.setText(notLikeNum);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +148,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
} else if (item instanceof V2XShareEventLoadMoreItem) {
|
||||
return ((V2XShareEventLoadMoreItem) dataArrayList.get(position)).getViewType();
|
||||
}
|
||||
return V2XShareEventItemEnum.ITEM_TYPE_SHARE_LIST;
|
||||
return V2XShareEventItemEnum.ITEM_TYPE_OTHER;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -26,6 +26,9 @@ import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
|
||||
/**
|
||||
@@ -129,7 +132,11 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
mExploreWay.getPoiType(),
|
||||
2);
|
||||
}
|
||||
delayedCloseWindow();
|
||||
if (!V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
delayedCloseWindow();
|
||||
} else {
|
||||
mIlIllegalParkingLike.setClickable(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,6 +149,10 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
mExploreWay.getPoiType(),
|
||||
3);
|
||||
}
|
||||
delayedCloseWindow();
|
||||
if (!V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
delayedCloseWindow();
|
||||
} else {
|
||||
mIIllegalParkingUnLike.setClickable(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,6 @@ public interface V2XShareEventItemEnum {
|
||||
int ITEM_TYPE_SHARE_EMPTY = 2;
|
||||
int ITEM_TYPE_LOAD_MORE_STATUS = 3;
|
||||
int ITEM_TYPE_NO_MORE = 4;
|
||||
int ITEM_TYPE_OTHER = 5;
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,9 @@ class OptimalSpeedMarker implements IV2XMarker<MogoLatLng> {
|
||||
.latitude(entity.getLat())
|
||||
.longitude(entity.getLon()).anchor(0.5f,0.9f).icon( ViewUtils.fromView(new OptimalSpeedMarkerView(V2XServiceManager.getContext())));
|
||||
optimalMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_OPTIMAL_SPEED_MARKER, optionsRipple);
|
||||
optimalMarker.setClickable(false);
|
||||
if (optimalMarker != null) {
|
||||
optimalMarker.setClickable(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.v2x.scenario.scene.test;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@@ -257,6 +258,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
});
|
||||
|
||||
mBtnTriggerParkEvent.setOnClickListener(v -> {
|
||||
Log.d("触发违章停车事件", "00");
|
||||
V2XMessageEntity<List<MarkerExploreWay>> v2XMessageEntity =
|
||||
TestOnLineCarUtils.getV2XIllegalParkData();
|
||||
|
||||
|
||||
@@ -5,7 +5,10 @@ import android.animation.AnimatorInflater;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
@@ -26,6 +29,7 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi
|
||||
private AnimatorSet mAnimatorSet;
|
||||
private OnClickCallListener mOnClickCallListener;
|
||||
private boolean isAnimator = false;
|
||||
private ImageView animationImageView;
|
||||
|
||||
public HeartUnLikeView(Context context) {
|
||||
this(context, null);
|
||||
@@ -39,7 +43,7 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi
|
||||
super(context, attrs, defStyleAttr);
|
||||
inflate(context, V2XServiceManager.getMoGoStatusManager().isVrMode() ? R.layout.view_heart_unlike_vr : R.layout.view_heart_unlike, this);
|
||||
mIllegalParkingUnLike = findViewById(R.id.ivIllegalParkingUnLike);
|
||||
|
||||
animationImageView = findViewById(R.id.animationImage);
|
||||
setOnClickListener(v -> {
|
||||
if (!isAnimator) {
|
||||
isAnimator = true;
|
||||
@@ -53,6 +57,12 @@ public class HeartUnLikeView extends LinearLayout implements Animator.AnimatorLi
|
||||
}
|
||||
mAnimatorSet.start();
|
||||
}
|
||||
if (V2XServiceManager.getMoGoStatusManager().isVrMode()) {
|
||||
animationImageView.setVisibility(View.VISIBLE);
|
||||
Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.v2x_unlike_heart_scale_ani_vr);
|
||||
animationImageView.startAnimation(animation);
|
||||
animationImageView.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="2000">
|
||||
<scale
|
||||
android:fromXScale="1.0"
|
||||
android:fromYScale="1.0"
|
||||
android:pivotX="50%"
|
||||
android:pivotY="50%"
|
||||
android:repeatCount="0"
|
||||
android:toXScale="4"
|
||||
android:toYScale="4"></scale>
|
||||
<alpha
|
||||
android:fromAlpha="1.4"
|
||||
android:repeatCount="0"
|
||||
android:toAlpha="0.0"></alpha>
|
||||
|
||||
</set>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -6,16 +6,17 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:background="@drawable/v2x_bg_pop_up"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:paddingEnd="@dimen/dp_62">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/leftImageView"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:id="@+id/leftImageView"
|
||||
android:src="@drawable/bg_v2x_red_two_round_vr"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/bg_v2x_red_two_round_vr"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIconP"
|
||||
@@ -23,9 +24,9 @@
|
||||
android:layout_height="@dimen/module_v2x_event_icon_size_vr"
|
||||
android:src="@drawable/icon_illegal_parking"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/leftImageView"
|
||||
app:layout_constraintEnd_toEndOf="@+id/leftImageView"
|
||||
app:layout_constraintStart_toStartOf="@+id/leftImageView"
|
||||
app:layout_constraintTop_toTopOf="@+id/leftImageView"
|
||||
app:layout_constraintEnd_toEndOf="@+id/leftImageView"/>
|
||||
app:layout_constraintTop_toTopOf="@+id/leftImageView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tagEventType"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/llIllegalParkingUnLike"
|
||||
android:layout_width="@dimen/module_v2x_event_button_size"
|
||||
android:layout_height="@dimen/module_v2x_event_button_size"
|
||||
@@ -10,5 +10,20 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/module_common_unlike_vr" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/animationImage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignStart="@+id/ivIllegalParkingUnpaLike"
|
||||
android:layout_alignTop="@+id/ivIllegalParkingUnLike"
|
||||
android:layout_alignEnd="@+id/ivIllegalParkingUnLike"
|
||||
android:layout_alignBottom="@+id/ivIllegalParkingUnLike"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="9dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:visibility="invisible"
|
||||
android:src="@drawable/v2x_icon_unlike_animation_vr" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_8">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvRoadEventList"
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.mogo.service.launcher.IMogoLauncher;
|
||||
import com.mogo.service.locationinfo.IMogoLocationInfoService;
|
||||
import com.mogo.service.map.IMogoMapFrameController;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.map.IMogoSmallMapProvider;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoAddressManager;
|
||||
import com.mogo.service.module.IMogoMarkerService;
|
||||
@@ -306,4 +307,11 @@ public interface IMogoServiceApis extends IProvider {
|
||||
* @return
|
||||
*/
|
||||
IMogoMapFrameController getMapFrameControllerApi();
|
||||
|
||||
/**
|
||||
* 地图图层控制接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoSmallMapProvider getSmallMapProviderApi();
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public class MogoServicePaths {
|
||||
* 授权服务
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String PATH_AGREEMENT = "/agreement/showFragment";
|
||||
public static final String PATH_AGREEMENT = "/agreement/showFragment";
|
||||
|
||||
/**
|
||||
* 日志上传
|
||||
@@ -299,4 +299,9 @@ public class MogoServicePaths {
|
||||
* 自研地图和高德地图切换
|
||||
*/
|
||||
public static final String PATH_MAP_FRAME_CONTROLLER = "/mapframe/controller";
|
||||
|
||||
/**
|
||||
* 小地图控件
|
||||
*/
|
||||
public static final String PATH_SMALL_MAP = "/small_map/api";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.service.map;
|
||||
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
* @date 12/10/20 1:36 PM
|
||||
*/
|
||||
public interface IMogoSmallMapProvider extends IMogoModuleProvider {
|
||||
|
||||
|
||||
/**
|
||||
* 显示面板
|
||||
*/
|
||||
void showPanel();
|
||||
|
||||
/**
|
||||
* 隐藏面板
|
||||
*/
|
||||
void hidePanel();
|
||||
|
||||
/**
|
||||
* 修改轮盘角度
|
||||
* @param angle 角度值 0-359
|
||||
*/
|
||||
void changeAngle(double angle);
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import com.mogo.service.launcher.IMogoLauncher;
|
||||
import com.mogo.service.locationinfo.IMogoLocationInfoService;
|
||||
import com.mogo.service.map.IMogoMapFrameController;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.map.IMogoSmallMapProvider;
|
||||
import com.mogo.service.module.IMogoActionManager;
|
||||
import com.mogo.service.module.IMogoAddressManager;
|
||||
import com.mogo.service.module.IMogoMarkerService;
|
||||
@@ -251,6 +252,11 @@ public class MogoServiceApis implements IMogoServiceApis {
|
||||
return getApiInstance( IMogoMapFrameController.class, MogoServicePaths.PATH_MAP_FRAME_CONTROLLER );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoSmallMapProvider getSmallMapProviderApi() {
|
||||
return getApiInstance( IMogoSmallMapProvider.class, MogoServicePaths.PATH_SMALL_MAP );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoTrafficUploadProvider getTrafficUploadApi() {
|
||||
return getApiInstance(IMogoTrafficUploadProvider.class, MogoServicePaths.PATH_TRAFFIC_UPLOAD);
|
||||
|
||||
Reference in New Issue
Block a user