调整整体布局,增加vr模式界面调试入口

This commit is contained in:
tongchenfei
2020-12-09 20:07:45 +08:00
parent 770a86b379
commit de86548ce9
12 changed files with 116 additions and 130 deletions

View File

@@ -59,7 +59,7 @@ MAP_AUTONAVI_VERSION=2.0.7
MOGO_MAP_VERSION=2.0.7
MOGO_MAP_API_VERSION=2.0.7
MOGO_SERVICE_VERSION=2.0.7
MOGO_SERVICE_API_VERSION=2.0.7
MOGO_SERVICE_API_VERSION=2.0.8
MOGO_CONNECTION_VERSION=2.0.7
MOGO_MODULE_APPS_VERSION=2.0.7
MOGO_MODULE_NAVI_VERSION=2.0.7

View File

@@ -11,6 +11,7 @@ import androidx.annotation.Nullable;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.main.MainActivity;
import com.mogo.module.main.cards.MogoModulesManager;
import com.mogo.service.intent.IMogoIntentListener;
@@ -38,7 +39,11 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
protected void loadContainerModules() {
super.loadContainerModules();
// 显示左边遮罩
mLeftShadowFrame.setVisibility( View.VISIBLE );
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
mLeftShadowFrame.setVisibility(View.GONE);
}else {
mLeftShadowFrame.setVisibility(View.VISIBLE);
}
MogoModulesManager.getInstance().loadAppsListModule( com.mogo.module.main.R.id.module_main_id_apps_fragment_container );
}
@@ -120,14 +125,16 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() );
if (isTrue) {
FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() );
entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft_in_vr_mode );
mEntrance.setLayoutParams( entranceParams );
mLeftShadowFrame.setVisibility(View.GONE);
mApps.setVisibility(View.GONE);
}else{
FrameLayout.LayoutParams entranceParams = ( ( FrameLayout.LayoutParams ) mEntrance.getLayoutParams() );
entranceParams.leftMargin = getResources().getDimensionPixelSize( R.dimen.module_main_entrance_fragment_container_marginLeft_out_vr_mode );
mEntrance.setLayoutParams( entranceParams );
mLeftShadowFrame.setVisibility(View.VISIBLE);
mApps.setVisibility(View.VISIBLE);
}
mEntrance.setLayoutParams( entranceParams );
}
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >204px</dimen>
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
<dimen name="module_main_entrance_fragment_container_marginLeft_out_vr_mode" >800px</dimen>
</resources>

View File

@@ -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(){
}
}

View File

@@ -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();
}

View File

@@ -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;
}

View File

@@ -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) {
}
}

View File

@@ -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();
}
}

View File

@@ -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;
}
}

View File

@@ -187,7 +187,6 @@
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<LinearLayout
@@ -232,7 +231,6 @@
android:gravity="center"
android:text="VR"
android:textColor="#fff"
android:visibility="gone"
android:textSize="@dimen/module_ext_enter_vr_mode_text_size"
app:layout_constraintBottom_toTopOf="@+id/module_entrance_id_move2_current_location"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_move2_current_location" />
@@ -248,6 +246,7 @@
android:textSize="@dimen/module_ext_exit_vr_mode_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<FrameLayout

View File

@@ -88,6 +88,8 @@
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_top_view_width">1058px</dimen>
<dimen name="module_ext_top_view_width_in_vr_mode">760px</dimen>
<dimen name="module_ext_top_view_no_link_width_in_vr_mode">700px</dimen>
<dimen name="module_ext_navi_info_panel_width">544px</dimen>
<dimen name="module_ext_navi_info_panel_height">117px</dimen>
<dimen name="module_ext_navi_info_panel_small_height">80px</dimen>

121
upload.sh
View File

@@ -1,112 +1,11 @@
!/bin/bash
#!/bin/bash
./gradlew :foudations:mogo-utils:clean :foudations:mogo-utils:uploadArchives
if [ $? -ne 0 ];then exit; fi
./gradlew :skin:mogo-skin-support:clean :skin:mogo-skin-support:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :tts:tts-base:clean :tts:tts-base:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :foudations:mogo-commons:clean :foudations:mogo-commons:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :tts:tts-zhi:clean :tts:tts-zhi:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :tts:tts-di:clean :tts:tts-di:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :tts:tts-noop:clean :tts:tts-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :libraries:mogo-map-api:clean :libraries:mogo-map-api:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:skin-support:clean :skin:skin-support:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:skin-support-appcompat:clean :skin:skin-support-appcompat:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:skin-support-cardview:clean :skin:skin-support-cardview:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:skin-support-constraint-layout:clean :skin:skin-support-constraint-layout:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:skin-support-design:clean :skin:skin-support-design:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :services:mogo-service-api:clean :services:mogo-service-api:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :libraries:map-amap:clean :libraries:map-amap:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :libraries:map-autonavi:clean :libraries:map-autonavi:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :libraries:mogo-map:clean :libraries:mogo-map:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-common:clean :modules:mogo-module-common:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:mogo-skin-support-impl:clean :skin:mogo-skin-support-impl:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:mogo-skin-support-noop:clean :skin:mogo-skin-support-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :test:crashreport:clean :test:crashreport:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :test:crashreport-bugly:clean :test:crashreport-bugly:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :test:crashreport-noop:clean :test:crashreport-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :skin:mogo-skin-light:clean :skin:mogo-skin-light:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :services:mogo-service:clean :services:mogo-service:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-obu:clean :modules:mogo-module-obu:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-map:clean :modules:mogo-module-map:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-apps:clean :modules:mogo-module-apps:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-gps-simulator:clean :modules:mogo-module-gps-simulator:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-gps-simulator-debug:clean :modules:mogo-module-gps-simulator-debug:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-gps-simulator-noop:clean :modules:mogo-module-gps-simulator-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-service:clean :modules:mogo-module-service:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-authorize:clean :modules:mogo-module-authorize:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-share:clean :modules:mogo-module-share:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-extensions:clean :modules:mogo-module-extensions:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-search:clean :modules:mogo-module-search:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-media:clean :modules:mogo-module-media:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-v2x:clean :modules:mogo-module-v2x:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-back:clean :modules:mogo-module-back:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-main:clean :modules:mogo-module-main:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-guide:clean :modules:mogo-module-guide:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :main-extensions:mogo-module-main-independent:clean :main-extensions:mogo-module-main-independent:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :main-extensions:mogo-module-main-launcher:clean :main-extensions:mogo-module-main-launcher:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-left-panel:clean :modules:mogo-module-left-panel:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-left-panel-noop:clean :modules:mogo-module-left-panel-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :foudations:mogo-base-services-apk:clean :foudations:mogo-base-services-apk:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :foudations:mogo-base-services-sdk:clean :foudations:mogo-base-services-sdk:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-push-base:clean :modules:mogo-module-push-base:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-push-noop:clean :modules:mogo-module-push-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-push:clean :modules:mogo-module-push:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :libraries:tanlulib:clean :libraries:tanlulib:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-monitor:clean :modules:mogo-module-monitor:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-splash:clean :modules:mogo-module-splash:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-splash-noop:clean :modules:mogo-module-splash-noop:uploadArchives
if [ $? -ne 0 ]; then exit; fi
./gradlew :modules:mogo-module-widgets:clean :modules:mogo-module-widgets:uploadArchives
if [ $? -ne 0 ]; then exit; fi
function upload(){
./gradlew $1:clean $1:uploadArchives
if [ $? -ne 0 ];then exit; fi
}
for module in `cat modules.txt`;
do
upload $module
done