修改topview在vr模式下的位置

This commit is contained in:
tongchenfei
2020-10-23 18:49:43 +08:00
parent c944d8245f
commit e05e9aa542
10 changed files with 144 additions and 14 deletions

View File

@@ -79,6 +79,7 @@ import java.util.Random;
import static com.mogo.module.common.utils.SPConst.getSPGuideRecord;
import static com.mogo.module.common.utils.SPConst.getSpGuide;
import static com.mogo.module.extensions.ExtensionsModuleConst.TYPE_ENTRANCE;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_BUTTON;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_TIME;
import static com.mogo.module.share.constant.ShareConstants.KEY_SERVER_SHOW_DAY_COUNT;
@@ -170,6 +171,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private boolean toggle = false;
private View mOnlineCarEntrance;
private TextView tvEnterVrMode;
private TextView tvExitVrMode;
private Runnable mLockCarRunnable = new Runnable() {
@Override
@@ -387,6 +390,17 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "APP_Find_Mogoer", properties );
}
} );
tvEnterVrMode = findViewById(R.id.module_ext_enter_vr_mode);
tvEnterVrMode.setOnClickListener((v)->{
// 进入vr模式
enterVrMode();
});
tvExitVrMode = findViewById(R.id.module_ext_exit_vr_mode);
tvExitVrMode.setOnClickListener((v)->{
// 退出vr模式
exitVrMode();
});
dealWeatherContainer();
@@ -394,6 +408,28 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
debugCrashWarn();
}
private void enterVrMode(){
mApis.getStatusManagerApi().setVrMode(TYPE_ENTRANCE, true);
tvEnterVrMode.setVisibility(View.GONE);
mMove2CurrentLocation.setVisibility(View.GONE);
mUploadRoadCondition.setVisibility(View.GONE);
mWeatherContainer.setVisibility(View.GONE);
mMsgContainer.setVisibility(View.GONE);
tvExitVrMode.setVisibility(View.VISIBLE);
}
private void exitVrMode(){
mApis.getStatusManagerApi().setVrMode(TYPE_ENTRANCE, false);
tvEnterVrMode.setVisibility(View.VISIBLE);
mMove2CurrentLocation.setVisibility(View.VISIBLE);
mUploadRoadCondition.setVisibility(View.VISIBLE);
// mWeatherContainer.setVisibility(View.VISIBLE);
// mMsgContainer.setVisibility(View.VISIBLE);
tvExitVrMode.setVisibility(View.GONE);
}
private void debugCrashWarn(){
thresholdSetContainer = findViewById(R.id.thresholdSetContainer);
topEditC = findViewById(R.id.etTopC);
@@ -649,8 +685,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mMogoNavi = mService.getNavi(getContext());
mAnalytics = mApis.getAnalyticsApi();
mMogoRegisterCenter.registerMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoNaviListener(TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoMapListener(TYPE_ENTRANCE, this);
mMogoRegisterCenter.registerMogoAimlessModeListener(TAG, this);
mMogoMarkerManager = mService.getMarkerManager(getContext());
@@ -817,6 +853,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
@Override
public void renderWeatherInfo(String temp, String desc, int iconId) {
if(mApis.getStatusManagerApi().isVrMode()){
return;
}
boolean hidden = false;
if (iconId != 0) {
mWeatherIcon.setImageResource(iconId);
@@ -833,6 +872,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
@Override
public void renderMsgInfo(boolean hasMsg, int amount) {
if (mApis.getStatusManagerApi().isVrMode()) {
return;
}
mMsgContainer.setVisibility(hasMsg ? View.VISIBLE : View.GONE);
mMsgCounter.setText(amount > MAX_DISPLAY_MSG_AMOUNT ?
getString(R.string.module_ext_str_dots) : String.valueOf(amount));
@@ -954,8 +996,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
public void onDestroy() {
super.onDestroy();
if (mMogoRegisterCenter != null) {
mMogoRegisterCenter.unregisterMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoNaviListener(TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoMapListener(TYPE_ENTRANCE);
mMogoRegisterCenter.unregisterMogoAimlessModeListener(TAG);
}
if (mStatusManager != null) {

View File

@@ -5,7 +5,7 @@
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<View
android:id="@+id/module_map_id_navi_bg"
android:layout_width="match_parent"
android:layout_width="@dimen/module_ext_navi_info_panel_width"
android:layout_height="@dimen/module_ext_navi_info_panel_height"
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
android:focusable="true"

View File

@@ -61,13 +61,12 @@
<com.mogo.module.extensions.navi.TopView
android:id="@+id/module_entrance_id_top_container"
android:layout_width="match_parent"
android:layout_width="@dimen/module_ext_top_view_width"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
app:layout_constraintLeft_toLeftOf="parent" />
<LinearLayout
android:id="@+id/module_ext_id_display_overview"
@@ -101,6 +100,20 @@
android:textStyle="bold" />
</LinearLayout>
<TextView
android:id="@+id/module_ext_enter_vr_mode"
android:layout_marginRight="@dimen/module_common_shadow_width_pos"
android:layout_width="@dimen/module_ext_operation_panel_share_width"
android:layout_height="@dimen/module_ext_operation_panel_share_height"
android:background="@drawable/module_ext_dw_upload_road_condition_bkg"
android:text="VR"
android:textSize="@dimen/module_ext_enter_vr_mode_text_size"
android:textColor="#fff"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_move2_current_location"
app:layout_constraintBottom_toTopOf="@+id/module_entrance_id_move2_current_location"
android:layout_marginBottom="@dimen/module_ext_enter_vr_mode_margin_bottom"
android:gravity="center"/>
<ImageButton
android:id="@+id/module_entrance_id_move2_current_location"
android:layout_width="@dimen/module_ext_operation_panel_width"
@@ -111,6 +124,20 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<TextView
android:id="@+id/module_ext_exit_vr_mode"
android:layout_width="@dimen/module_ext_operation_panel_width"
android:layout_height="@dimen/module_ext_operation_panel_move2_height"
android:text="退出"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
android:background="@drawable/module_ext_shadow_bkg"
android:textSize="@dimen/module_ext_exit_vr_mode_text_size"
android:textColor="#fff"
android:gravity="center" />
<FrameLayout
android:id="@+id/module_entrance_id_upload_road_condition"
android:layout_width="@dimen/module_ext_operation_panel_share_width"
@@ -268,6 +295,7 @@
android:visibility="gone"
app:constraint_referenced_ids="btnShowDrawableTipNoSize,btnShowDrawableTip,btnShowTextTip,btnDebugCtrlNaviView,btnDebugCtrlSubView,btnDebugCtrlTopView,btnDebugAddBottomLayerView" />
<include layout="@layout/module_ext_layout_crash_threshold_set" />
<include layout="@layout/module_ext_layout_crash_threshold_set"
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -78,7 +78,8 @@
<dimen name="module_ext_user_img_height">103px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">1058px</dimen>
<dimen name="module_ext_top_view_width">1058px</dimen>
<dimen name="module_ext_navi_info_panel_width">1038px</dimen>
<dimen name="module_ext_navi_info_panel_height">210px</dimen>
<dimen name="module_ext_navi_info_panel_small_height">144px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_width">159px</dimen>

View File

@@ -83,6 +83,7 @@
<dimen name="module_ext_user_img_height">56px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_top_view_width">1058px</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>
@@ -162,4 +163,8 @@
<dimen name="module_ext_destination_online_car_paddingRight">14px</dimen>
<dimen name="module_common_shadow_width_pos">8px</dimen>
<dimen name="module_ext_enter_vr_mode_text_size">44px</dimen>
<dimen name="module_ext_exit_vr_mode_text_size">30px</dimen>
<dimen name="module_ext_exit_vr_mode_width">120px</dimen>
<dimen name="module_ext_enter_vr_mode_margin_bottom">170px</dimen>
</resources>