dev
This commit is contained in:
@@ -104,7 +104,7 @@ public class BackToLauncherModuleProvider implements IMogoModuleProvider, IMogoI
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
mIntentManager = mServiceApis.getIntentManagerApi();
|
||||
mIntentManager.registerIntentListener( COMMAND_BACK, this );
|
||||
BackToMainHomeManager.init( mServiceApis.getFragmentManagerApi() );
|
||||
BackToMainHomeManager.init( mServiceApis.getFragmentManagerApi(), mServiceApis.getStatusManagerApi() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.module.back;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.PixelFormat;
|
||||
@@ -12,31 +10,45 @@ import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.back.utils.Utils;
|
||||
import com.mogo.module.back.utils.WindowManagerViewHelper;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public class BackToMainHomeManager {
|
||||
|
||||
private static final String TAG = "BackToMainHomeManager";
|
||||
|
||||
private static View mBackView;
|
||||
|
||||
private static IMogoFragmentManager mFragmentManager;
|
||||
private static IMogoStatusManager mStatusManager;
|
||||
|
||||
public static void init( IMogoFragmentManager manager ) {
|
||||
public static void init( IMogoFragmentManager manager, IMogoStatusManager statusManager ) {
|
||||
mFragmentManager = manager;
|
||||
mStatusManager = statusManager;
|
||||
}
|
||||
|
||||
public static void backToLauncher(){
|
||||
public static void backToLauncher() {
|
||||
|
||||
if ( mFragmentManager != null ) {
|
||||
mFragmentManager.clearAll();
|
||||
}
|
||||
|
||||
if ( mStatusManager != null ) {
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Logger.d( TAG, "返回桌面" );
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setAction( Intent.ACTION_MAIN );
|
||||
intent.addCategory( Intent.CATEGORY_HOME );
|
||||
intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
|
||||
AbsMogoApplication.getApp().startActivity( intent );
|
||||
|
||||
if ( mFragmentManager != null ) {
|
||||
mFragmentManager.clearAll();
|
||||
}
|
||||
}
|
||||
|
||||
public static void addMainHomeView() {
|
||||
@@ -52,7 +64,7 @@ public class BackToMainHomeManager {
|
||||
return;
|
||||
}
|
||||
mBackView.setOnClickListener( view -> {
|
||||
backToLauncher();
|
||||
backToLauncher();
|
||||
} );
|
||||
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
|
||||
Reference in New Issue
Block a user