调整整体布局,增加vr模式界面调试入口
This commit is contained in:
@@ -48,7 +48,9 @@ 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.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;
|
||||
import com.mogo.module.extensions.utils.EntranceViewHolder;
|
||||
@@ -120,7 +122,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
|
||||
private ImageButton mMove2CurrentLocation;
|
||||
|
||||
private NaviInfoView mNaviInfo;
|
||||
private BaseNaviInfoView mNaviInfo;
|
||||
private TextView mExitNavi;
|
||||
|
||||
|
||||
@@ -369,8 +371,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
R.dimen.module_map_display_overview_bottom_margin)
|
||||
);
|
||||
|
||||
mNaviInfo = new NaviInfoView();
|
||||
mNaviInfo.inflate(rootView);
|
||||
mNaviInfo = new NaviInfoView(rootView);
|
||||
|
||||
findViewById(R.id.module_map_id_navi_bg).setOnClickListener(new OnPreventFastClickListener() {
|
||||
@Override
|
||||
@@ -440,14 +441,16 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
tvEnterVrMode.setOnClickListener((v)->{
|
||||
// 进入vr模式
|
||||
enterVrMode();
|
||||
mApis.getMapFrameControllerApi().changeToVRMode();
|
||||
mApis.getStatusManagerApi().setVrMode(TAG, true);
|
||||
// mApis.getMapFrameControllerApi().changeToVRMode();
|
||||
});
|
||||
|
||||
tvExitVrMode = findViewById(R.id.module_ext_exit_vr_mode);
|
||||
tvExitVrMode.setOnClickListener((v)->{
|
||||
// 退出vr模式
|
||||
exitVrMode();
|
||||
mApis.getMapFrameControllerApi().changeTo2dMode();
|
||||
mApis.getStatusManagerApi().setVrMode(TAG, false);
|
||||
// mApis.getMapFrameControllerApi().changeTo2dMode();
|
||||
});
|
||||
|
||||
dealWeatherContainer();
|
||||
@@ -493,8 +496,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mMsgContainer.setVisibility(View.GONE);
|
||||
|
||||
tvExitVrMode.setVisibility(View.VISIBLE);
|
||||
|
||||
TopViewAnimHelper.getInstance().enterVrMode();
|
||||
TopViewNoLinkageAnimHelper.getInstance().enterVrMode();
|
||||
showVrModeNaviView();
|
||||
mNaviInfo = new VrModeNavInfoView(mRootView);
|
||||
adasNoticeHelper.enterVrMode();
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().closeADAS();
|
||||
}
|
||||
|
||||
private void exitVrMode(){
|
||||
@@ -506,8 +513,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
// mMsgContainer.setVisibility(View.VISIBLE);
|
||||
|
||||
tvExitVrMode.setVisibility(View.GONE);
|
||||
|
||||
TopViewAnimHelper.getInstance().exitVrMode();
|
||||
TopViewNoLinkageAnimHelper.getInstance().exitVrMode();
|
||||
hideVrModeNaviView();
|
||||
mNaviInfo = new NaviInfoView(mRootView);
|
||||
adasNoticeHelper.exitVrMode();
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().showADAS();
|
||||
|
||||
}
|
||||
|
||||
@@ -1210,4 +1221,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mApis.getSocketManagerApi(getContext()).unregisterOnMessageListener(SEEK_HELP_NOTICE_NUM_MSG_TYPE, seekHelpNoticeListener);
|
||||
}
|
||||
}
|
||||
|
||||
private void showVrModeNaviView(){
|
||||
|
||||
}
|
||||
|
||||
private void hideVrModeNaviView(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.extensions.navi;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -17,10 +18,12 @@ import java.util.Calendar;
|
||||
*/
|
||||
public abstract class BaseNaviInfoView {
|
||||
|
||||
public void notifyChanged( MogoNaviInfo naviInfo ) {
|
||||
public BaseNaviInfoView(View view) {
|
||||
|
||||
}
|
||||
|
||||
public abstract void notifyChanged( MogoNaviInfo naviInfo );
|
||||
|
||||
protected void fillNextCrossTurning( TextView target, int nextIconType ) {
|
||||
target.setText( "后" + IconTypeUtils.getNameByIconType( nextIconType ) );
|
||||
}
|
||||
@@ -148,4 +151,6 @@ public abstract class BaseNaviInfoView {
|
||||
}
|
||||
builder.append( "到达" );
|
||||
}
|
||||
|
||||
public abstract boolean isVisible();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@ public class NaviInfoView extends BaseNaviInfoView {
|
||||
private TextView remainingTimeUnit;
|
||||
private TextView arriveTime;
|
||||
|
||||
public void inflate( View view ) {
|
||||
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 );
|
||||
@@ -39,6 +40,7 @@ public class NaviInfoView extends BaseNaviInfoView {
|
||||
arriveTime = view.findViewById( R.id.module_map_id_arrive_time );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return turnIcon != null && turnIcon.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
@@ -46,7 +48,6 @@ public class NaviInfoView extends BaseNaviInfoView {
|
||||
|
||||
@Override
|
||||
public void notifyChanged( MogoNaviInfo naviInfo ) {
|
||||
super.notifyChanged( naviInfo );
|
||||
if ( naviInfo == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.module.extensions.navi;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
|
||||
/**
|
||||
* vr模式下导航信息封装
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class VrModeNavInfoView extends BaseNaviInfoView {
|
||||
public VrModeNavInfoView(View view) {
|
||||
super(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyChanged(MogoNaviInfo naviInfo) {
|
||||
}
|
||||
}
|
||||
@@ -782,4 +782,18 @@ public class TopViewAnimHelper {
|
||||
cameraMode = null;
|
||||
transition = null;
|
||||
}
|
||||
|
||||
public void enterVrMode(){
|
||||
removeAllView();
|
||||
topContainer.getLayoutParams().width = (int) getDimen(R.dimen.module_ext_top_view_width_in_vr_mode);
|
||||
// topContainer.requestLayout();
|
||||
// topMotionLayout.requestLayout();
|
||||
}
|
||||
|
||||
public void exitVrMode(){
|
||||
removeAllView();
|
||||
topContainer.getLayoutParams().width = (int) getDimen(R.dimen.module_ext_top_view_width);
|
||||
// topContainer.requestLayout();
|
||||
// topMotionLayout.requestLayout();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,6 +384,11 @@ public class TopViewNoLinkageAnimHelper {
|
||||
}
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, true);
|
||||
|
||||
// vr模式下与TopView互斥
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
TopViewAnimHelper.getInstance().removeAllView();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -536,4 +541,14 @@ public class TopViewNoLinkageAnimHelper {
|
||||
cameraMode = null;
|
||||
transition = null;
|
||||
}
|
||||
|
||||
public void enterVrMode(){
|
||||
removeAllView();
|
||||
topContainerNoLinkage.getLayoutParams().width = (int) getDimen(R.dimen.module_ext_top_view_no_link_width_in_vr_mode);
|
||||
}
|
||||
|
||||
public void exitVrMode(){
|
||||
removeAllView();
|
||||
topContainerNoLinkage.getLayoutParams().width = LayoutParams.MATCH_PARENT;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user