new#Vr模式极端路况事件特效展示
This commit is contained in:
@@ -9,6 +9,7 @@ import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.commons.context.ContextHolderUtil;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -23,6 +24,7 @@ import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.module.main.service.MogoMainService;
|
||||
import com.mogo.module.main.utils.DisplayEffectsHelper;
|
||||
import com.mogo.module.main.windowview.FloatingViewHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
@@ -46,7 +48,7 @@ import java.util.List;
|
||||
* <p>
|
||||
* 描述:加载各个模块
|
||||
*/
|
||||
public class MainActivity extends MvpActivity< MainView, MainPresenter > implements MainView,
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMogoADASControlStatusChangedListener,
|
||||
FragmentStackTransactionListener {
|
||||
@@ -71,18 +73,20 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
protected ImageView mWarningRight;
|
||||
protected ImageView mWarningBottom;
|
||||
|
||||
protected ConstraintLayout clSpecialEffect;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
if ( !DebugConfig.isMapBased() ) {
|
||||
if (!DebugConfig.isMapBased()) {
|
||||
return R.layout.module_main_activity_main_no_map;
|
||||
}
|
||||
return R.layout.module_main_activity_main;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void beforeSetContentView( Bundle savedInstanceState ) {
|
||||
protected void beforeSetContentView(Bundle savedInstanceState) {
|
||||
init();
|
||||
installSkinManager( savedInstanceState );
|
||||
installSkinManager(savedInstanceState);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,135 +94,137 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
*
|
||||
* @param savedInstanceState
|
||||
*/
|
||||
private void installSkinManager( Bundle savedInstanceState ) {
|
||||
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().createMapViewInstance( this );
|
||||
mServiceApis.getSkinSupportInstallerApi().install( getApplication() );
|
||||
mServiceApis.getSkinSupportInstallerApi().onCompensateActivityCreated( this, savedInstanceState );
|
||||
private void installSkinManager(Bundle savedInstanceState) {
|
||||
mServiceApis.getMapServiceApi().getMapViewInstanceHandler().createMapViewInstance(this);
|
||||
mServiceApis.getSkinSupportInstallerApi().install(getApplication());
|
||||
mServiceApis.getSkinSupportInstallerApi().onCompensateActivityCreated(this, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
|
||||
getWindow().setBackgroundDrawable( null );
|
||||
getWindow().setBackgroundDrawable(null);
|
||||
|
||||
mApps = findViewById( R.id.module_main_id_apps_fragment_container );
|
||||
mEntrance = findViewById( R.id.module_main_id_entrance_fragment_container );
|
||||
mEventPanel = findViewById( R.id.module_main_id_event_panel_fragment_container );
|
||||
mFloatingLayout = findViewById( R.id.module_main_id_floating_view );
|
||||
mLeftShadowFrame = findViewById( R.id.module_main_id_map_left_shadow_frame );
|
||||
mCoverUpLayout = findViewById( R.id.module_main_id_cover_up );
|
||||
mLeftPanelLayout = findViewById( R.id.module_main_id_left_panel_fragment_container );
|
||||
mHistoryMessagePanel = findViewById( R.id.module_main_id_message_history_fragment_container );
|
||||
mApps = findViewById(R.id.module_main_id_apps_fragment_container);
|
||||
mEntrance = findViewById(R.id.module_main_id_entrance_fragment_container);
|
||||
mEventPanel = findViewById(R.id.module_main_id_event_panel_fragment_container);
|
||||
mFloatingLayout = findViewById(R.id.module_main_id_floating_view);
|
||||
mLeftShadowFrame = findViewById(R.id.module_main_id_map_left_shadow_frame);
|
||||
mCoverUpLayout = findViewById(R.id.module_main_id_cover_up);
|
||||
mLeftPanelLayout = findViewById(R.id.module_main_id_left_panel_fragment_container);
|
||||
mHistoryMessagePanel = findViewById(R.id.module_main_id_message_history_fragment_container);
|
||||
|
||||
mWarningTop = findViewById(R.id.warning_top);
|
||||
mWarningLeft = findViewById(R.id.warning_left);
|
||||
mWarningRight = findViewById(R.id.warning_right);
|
||||
mWarningBottom = findViewById(R.id.warning_bottom);
|
||||
|
||||
// 避免事件穿透导致地图被滑动
|
||||
mLeftShadowFrame.setOnClickListener( view -> {
|
||||
} );
|
||||
FloatingViewHandler.init( mFloatingLayout );
|
||||
clSpecialEffect = findViewById(R.id.cl_special_effect);
|
||||
|
||||
mServiceApis.getOnlineCarPanelApi().initContainer( R.id.module_main_id_message_history_fragment_container, this );
|
||||
if ( CallChatApi.getInstance().getApiProvider() != null ) {
|
||||
CallChatApi.getInstance().getApiProvider().initVehicleTeamContainer( "init", R.id.module_main_id_message_history_fragment_container, this );
|
||||
// 避免事件穿透导致地图被滑动
|
||||
mLeftShadowFrame.setOnClickListener(view -> {
|
||||
});
|
||||
FloatingViewHandler.init(mFloatingLayout);
|
||||
|
||||
mServiceApis.getOnlineCarPanelApi().initContainer(R.id.module_main_id_message_history_fragment_container, this);
|
||||
if (CallChatApi.getInstance().getApiProvider() != null) {
|
||||
CallChatApi.getInstance().getApiProvider().initVehicleTeamContainer("init", R.id.module_main_id_message_history_fragment_container, this);
|
||||
}
|
||||
}
|
||||
|
||||
// 隐藏布局
|
||||
protected void hideLayout() {
|
||||
mEntrance.setVisibility( View.GONE );
|
||||
mEventPanel.setVisibility( View.GONE );
|
||||
mFloatingLayout.setVisibility( View.GONE );
|
||||
mEntrance.setVisibility(View.GONE);
|
||||
mEventPanel.setVisibility(View.GONE);
|
||||
mFloatingLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 显示布局
|
||||
protected void showLayout() {
|
||||
mEntrance.setVisibility( View.VISIBLE );
|
||||
mEventPanel.setVisibility( View.VISIBLE );
|
||||
mFloatingLayout.setVisibility( View.VISIBLE );
|
||||
mEntrance.setVisibility(View.VISIBLE);
|
||||
mEventPanel.setVisibility(View.VISIBLE);
|
||||
mFloatingLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
ContextHolderUtil.holdContext( this );
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ContextHolderUtil.holdContext(this);
|
||||
mPresenter.postLoadModuleMsg();
|
||||
|
||||
NetworkUtils.listenNetStrength( this );
|
||||
NetworkUtils.listenNetStrength(this);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if ( mServiceApis == null ) {
|
||||
if (mServiceApis == null) {
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
}
|
||||
mServiceApis.getShareManager().resetContext( this );
|
||||
mServiceApis.getAuthManagerApi().showAuth( this );
|
||||
mServiceApis.getShareManager().resetContext(this);
|
||||
mServiceApis.getAuthManagerApi().showAuth(this);
|
||||
|
||||
mMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
|
||||
AutopilotServiceManage.getInstance().init( getContext() );
|
||||
mMogoStatusManager.setMainPageLaunchedStatus(TAG, true);
|
||||
AutopilotServiceManage.getInstance().init(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadModules() {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
MogoModulesManager.getInstance().init( this );
|
||||
MogoModulesManager.getInstance().init(this);
|
||||
loadSplash();
|
||||
|
||||
|
||||
if ( DebugConfig.isMapBased() ) {
|
||||
if ( mServiceApis.getMapServiceApi() != null ) {
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostMapListener( EventDispatchCenter.getInstance() );
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostNaviListener( EventDispatchCenter.getInstance() );
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostAimlessModeListener( EventDispatchCenter.getInstance() );
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerMarkerClickListener( EventDispatchCenter.getInstance() );
|
||||
if (DebugConfig.isMapBased()) {
|
||||
if (mServiceApis.getMapServiceApi() != null) {
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostMapListener(EventDispatchCenter.getInstance());
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostNaviListener(EventDispatchCenter.getInstance());
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerHostAimlessModeListener(EventDispatchCenter.getInstance());
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().registerMarkerClickListener(EventDispatchCenter.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
if ( DebugConfig.isSkinSupported() ) {
|
||||
if (DebugConfig.isSkinSupported()) {
|
||||
initAdasControlStatusListener();
|
||||
}
|
||||
|
||||
if ( DebugConfig.isMapBased() ) {
|
||||
EventDispatchCenter.getInstance().setMapLoadedCallback( () -> {
|
||||
Logger.d( TAG, "map loaded." + Thread.currentThread().getName() );
|
||||
if (DebugConfig.isMapBased()) {
|
||||
EventDispatchCenter.getInstance().setMapLoadedCallback(() -> {
|
||||
Logger.d(TAG, "map loaded." + Thread.currentThread().getName());
|
||||
resetMapCenterPoint();
|
||||
resetMapUiStyle();
|
||||
loadOthersModules();
|
||||
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
} );
|
||||
MogoModulesManager.getInstance().loadMapModule( R.id.module_main_id_map_fragment_container );
|
||||
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
});
|
||||
MogoModulesManager.getInstance().loadMapModule(R.id.module_main_id_map_fragment_container);
|
||||
} else {
|
||||
loadOthersModules();
|
||||
}
|
||||
|
||||
mMogoFragmentManager = mServiceApis.getFragmentManagerApi();
|
||||
mMogoFragmentManager.init( this, R.id.module_main_id_search_fragment );
|
||||
mMogoFragmentManager.initMessageHistoryContainerId( R.id.module_main_id_message_history_fragment_container );
|
||||
mMogoFragmentManager.registerMainFragmentStackTransactionListener( this );
|
||||
mMogoFragmentManager.init(this, R.id.module_main_id_search_fragment);
|
||||
mMogoFragmentManager.initMessageHistoryContainerId(R.id.module_main_id_message_history_fragment_container);
|
||||
mMogoFragmentManager.registerMainFragmentStackTransactionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransaction( int size ) {
|
||||
if ( size == 0 ) {
|
||||
public void onTransaction(int size) {
|
||||
if (size == 0) {
|
||||
showLayout();
|
||||
} else if ( size == 1 ) {
|
||||
} else if (size == 1) {
|
||||
hideLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private void resetMapUiStyle(){
|
||||
private void resetMapUiStyle() {
|
||||
final EnumMapUI mapUI = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getCurrentSkinMode();
|
||||
mServiceApis.getMapServiceApi().getMapUIController().changeMapMode( mapUI );
|
||||
mServiceApis.getMapServiceApi().getMapUIController().changeMapMode(mapUI);
|
||||
}
|
||||
|
||||
private void resetMapCenterPoint() {
|
||||
// 右移地图中心点
|
||||
MapCenterPointStrategy.init();
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mServiceApis.getMapServiceApi().getMapUIController(), Scene.AIMLESS );
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mServiceApis.getMapServiceApi().getMapUIController(), Scene.AIMLESS);
|
||||
}
|
||||
|
||||
protected void loadOthersModules() {
|
||||
@@ -233,60 +239,60 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
}
|
||||
|
||||
private void initAdasControlStatusListener() {
|
||||
mServiceApis.getRegisterCenterApi().registerADASControlStatusChangedListener( TAG, this );
|
||||
AdasConfigApiController.getInstance().registerAdasSettingUiListener( EventDispatchCenter.getInstance() );
|
||||
AdasConfigApiController.getInstance().registerAdasSettingSkinModelListener( EventDispatchCenter.getInstance() );
|
||||
AdasConfigApiController.getInstance().init( getApplicationContext() );
|
||||
LoggerController.setPrinterLog( DebugConfig.isDebug() );
|
||||
mServiceApis.getRegisterCenterApi().registerADASControlStatusChangedListener(TAG, this);
|
||||
AdasConfigApiController.getInstance().registerAdasSettingUiListener(EventDispatchCenter.getInstance());
|
||||
AdasConfigApiController.getInstance().registerAdasSettingSkinModelListener(EventDispatchCenter.getInstance());
|
||||
AdasConfigApiController.getInstance().init(getApplicationContext());
|
||||
LoggerController.setPrinterLog(DebugConfig.isDebug());
|
||||
}
|
||||
|
||||
private void startBaseService() {
|
||||
Intent intent = new Intent( this, MogoMainService.class );
|
||||
startService( intent );
|
||||
Intent intent = new Intent(this, MogoMainService.class);
|
||||
startService(intent);
|
||||
}
|
||||
|
||||
protected void loadContainerModules() {
|
||||
MogoModulesManager.getInstance().loadEntrancesModule( R.id.module_main_id_entrance_fragment_container );
|
||||
MogoModulesManager.getInstance().loadEventPanelModule( R.id.module_main_id_event_panel_fragment_container );
|
||||
MogoModulesManager.getInstance().loadLeftPanelModule( R.id.module_main_id_left_panel_fragment_container );
|
||||
MogoModulesManager.getInstance().loadEntrancesModule(R.id.module_main_id_entrance_fragment_container);
|
||||
MogoModulesManager.getInstance().loadEventPanelModule(R.id.module_main_id_event_panel_fragment_container);
|
||||
MogoModulesManager.getInstance().loadLeftPanelModule(R.id.module_main_id_left_panel_fragment_container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideCoverUpLayout() {
|
||||
getWindow().setBackgroundDrawable( null );
|
||||
mCoverUpLayout.setVisibility( View.GONE );
|
||||
getWindow().setBackgroundDrawable(null);
|
||||
mCoverUpLayout.setVisibility(View.GONE);
|
||||
mServiceApis.getAdasControllerApi().showADAS();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCardModules() {
|
||||
List< IMogoModuleProvider > providers = MogoModulesManager.getInstance().loadCardsModule();
|
||||
List<IMogoModuleProvider> providers = MogoModulesManager.getInstance().loadCardsModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadSplash() {
|
||||
MogoModulesManager.getInstance().loadSplashModule( R.id.module_main_id_splash_container );
|
||||
MogoModulesManager.getInstance().loadSplashModule(R.id.module_main_id_splash_container);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected MainPresenter createPresenter() {
|
||||
return new MainPresenter( this );
|
||||
return new MainPresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged( location );
|
||||
public void onLocationChanged(MogoLocation location) {
|
||||
EventDispatchCenter.getInstance().onLocationChanged(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapUiModeChanged( EnumMapUI mapUI ) {
|
||||
switch ( mapUI ) {
|
||||
public void onMapUiModeChanged(EnumMapUI mapUI) {
|
||||
switch (mapUI) {
|
||||
case Type_Night:
|
||||
mServiceApis.getSkinSupportInstallerApi().loadSkin( SkinMode.Night );
|
||||
mServiceApis.getSkinSupportInstallerApi().loadSkin(SkinMode.Night);
|
||||
break;
|
||||
case Type_Light:
|
||||
mServiceApis.getSkinSupportInstallerApi().loadSkin( SkinMode.Light );
|
||||
mServiceApis.getSkinSupportInstallerApi().loadSkin(SkinMode.Light);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -294,26 +300,26 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mMogoStatusManager.setMainPageResumeStatus( TAG, true );
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
|
||||
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
|
||||
mMogoStatusManager.setMainPageResumeStatus(TAG, true);
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false);
|
||||
if (mCoverUpLayout.getVisibility() != View.VISIBLE) {
|
||||
mServiceApis.getAdasControllerApi().showADAS();
|
||||
}
|
||||
if ( mServiceApis.getLauncherApi() != null ) {
|
||||
mServiceApis.getLauncherApi().setFloatButtonVisible( false );
|
||||
if (mServiceApis.getLauncherApi() != null) {
|
||||
mServiceApis.getLauncherApi().setFloatButtonVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
|
||||
mMogoStatusManager.setMainPageResumeStatus(TAG, false);
|
||||
mServiceApis.getAuthManagerApi().dismiss();
|
||||
if ( shouldCloseADASPanelWhenPause() ) {
|
||||
if (shouldCloseADASPanelWhenPause()) {
|
||||
mServiceApis.getAdasControllerApi().closeADAS();
|
||||
}
|
||||
if ( mServiceApis.getLauncherApi() != null ) {
|
||||
mServiceApis.getLauncherApi().setFloatButtonVisible( true );
|
||||
if (mServiceApis.getLauncherApi() != null) {
|
||||
mServiceApis.getLauncherApi().setFloatButtonVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,21 +333,21 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, true );
|
||||
if ( shouldCloseADASPanelWhenPause() ) {
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, true);
|
||||
if (shouldCloseADASPanelWhenPause()) {
|
||||
mServiceApis.getAdasControllerApi().closeADAS();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if ( mMogoFragmentManager == null
|
||||
|| mMogoFragmentManager.getStackSize() <= 0 ) {
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
if (mMogoFragmentManager == null
|
||||
|| mMogoFragmentManager.getStackSize() <= 0) {
|
||||
if (DebugConfig.isLauncher()) {
|
||||
doWhenBackPressed();
|
||||
return;
|
||||
} else {
|
||||
if ( doWhenBackPressed() ) {
|
||||
if (doWhenBackPressed()) {
|
||||
return;
|
||||
}
|
||||
super.onBackPressed();
|
||||
@@ -356,14 +362,14 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent( Intent intent ) {
|
||||
super.onNewIntent( intent );
|
||||
mPresenter.handleSchemeIntent( intent, true );
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
mPresenter.handleSchemeIntent(intent, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoServiceApis getApis() {
|
||||
if ( mServiceApis == null ) {
|
||||
if (mServiceApis == null) {
|
||||
mServiceApis = MogoApisHandler.getInstance().getApis();
|
||||
}
|
||||
return mServiceApis;
|
||||
@@ -376,9 +382,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostAimlessModeListener();
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostNaviListener();
|
||||
mServiceApis.getMapServiceApi().getHostListenerRegister().unregisterHostMapListener();
|
||||
mServiceApis.getRegisterCenterApi().unregisterADASControlStatusChangedListener( TAG );
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
|
||||
mServiceApis.getRegisterCenterApi().unregisterADASControlStatusChangedListener(TAG);
|
||||
mMogoStatusManager.setMainPageLaunchedStatus(TAG, false);
|
||||
mMogoStatusManager.setMainPageIsBackgroundStatus(TAG, false);
|
||||
mMogoFragmentManager.unregisterMainFragmentStackTransactionListener();
|
||||
mMogoFragmentManager.destroy();
|
||||
mMogoFragmentManager = null;
|
||||
@@ -386,7 +392,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mServiceApis.getMapServiceApi().getMapUIController().destroy();
|
||||
AdasConfigApiController.getInstance().release();
|
||||
mServiceApis.getAdasControllerApi().release();
|
||||
Logger.d( TAG, "destroy." );
|
||||
Logger.d(TAG, "destroy.");
|
||||
mServiceApis.getRefreshStrategyControllerApi().clearAllData();
|
||||
mServiceApis.getOnlineCarPanelApi().clear();
|
||||
ContextHolderUtil.releaseContext();
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.mogo.module.main.utils;
|
||||
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.module.main.R;
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/3/30 14:05
|
||||
* describe:
|
||||
*/
|
||||
public class DisplayEffectsHelper {
|
||||
private volatile static DisplayEffectsHelper instance = null;
|
||||
private AnimatorSet animatorSet;
|
||||
|
||||
public static DisplayEffectsHelper getInstance() {
|
||||
if (instance == null) {
|
||||
synchronized (DisplayEffectsHelper.class) {
|
||||
if (instance == null) {
|
||||
instance = new DisplayEffectsHelper();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void init(View rootView) {
|
||||
View view1 = rootView.findViewById(R.id.iv_wu1);
|
||||
View view2 = rootView.findViewById(R.id.iv_wu2);
|
||||
ObjectAnimator animator1 = ObjectAnimator.ofFloat(view1, "alpha", 0f, 1f, 0f);
|
||||
ObjectAnimator animator2 = ObjectAnimator.ofFloat(view1, "translationX", -500, 100f, 300f);
|
||||
ObjectAnimator animator3 = ObjectAnimator.ofFloat(view1, "scaleX", 1f, 1.5f, 2f);
|
||||
ObjectAnimator animator4 = ObjectAnimator.ofFloat(view1, "scaleY", 1f, 1.5f, 2f);
|
||||
ObjectAnimator animator5 = ObjectAnimator.ofFloat(view2, "alpha", 0f, 1f, 0f);
|
||||
ObjectAnimator animator6 = ObjectAnimator.ofFloat(view2, "translationX", 500, -100f, -300f);
|
||||
ObjectAnimator animator7 = ObjectAnimator.ofFloat(view2, "scaleX", 1f, 1.5f, 2f);
|
||||
ObjectAnimator animator8 = ObjectAnimator.ofFloat(view2, "scaleY", 1f, 1.5f, 2f);
|
||||
animatorSet = new AnimatorSet();
|
||||
animatorSet.playTogether(animator1, animator2, animator3, animator4, animator5, animator6, animator7, animator8);
|
||||
animatorSet.setDuration(5000);
|
||||
}
|
||||
|
||||
public void display() {
|
||||
animatorSet.start();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.module.main.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.v2x.DisplayEffectsInterface;
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/3/30 15:45
|
||||
* describe:
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_MAIN_DISPLAY_EFFECTS_MANAGER)
|
||||
public class DisplayEffectsManager implements DisplayEffectsInterface {
|
||||
private Context context;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayEffects(String type) {
|
||||
DisplayEffectsHelper.getInstance().display();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
modules/mogo-module-main/src/main/res/drawable-xhdpi/wu1.png
Normal file
BIN
modules/mogo-module-main/src/main/res/drawable-xhdpi/wu1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 729 KiB |
BIN
modules/mogo-module-main/src/main/res/drawable-xhdpi/wu2.png
Normal file
BIN
modules/mogo-module-main/src/main/res/drawable-xhdpi/wu2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 518 KiB |
@@ -3,6 +3,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/module_main_window_background_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
@@ -12,6 +13,30 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_special_effect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wu1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/wu1"
|
||||
android:alpha="0"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wu2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/wu2"
|
||||
android:alpha="0"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/warning_top"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user