merge
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.zhidao.mogo.module.main.launcher;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -12,6 +14,7 @@ import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.extensions.utils.ExtensionsConfig;
|
||||
import com.mogo.module.main.MainActivity;
|
||||
import com.mogo.module.main.cards.MogoModulesManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -19,7 +22,10 @@ import com.mogo.utils.logger.Logger;
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class MainLauncherActivity extends MainActivity {
|
||||
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener {
|
||||
|
||||
protected boolean mIsHomeKeyDown = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
@@ -58,4 +64,34 @@ public class MainLauncherActivity extends MainActivity {
|
||||
mApps.setVisibility( View.VISIBLE );
|
||||
mLeftShadowFrame.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
getApis().getIntentManagerApi().registerIntentListener( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
mIsHomeKeyDown = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
getApis().getIntentManagerApi().unregisterIntentListener( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived( String intentStr, Intent intent ) {
|
||||
if ( TextUtils.equals( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, intentStr ) ) {
|
||||
mIsHomeKeyDown = intent.getBooleanExtra( "isHomeKeyDown", true );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldCloseADASPanelWhenPause() {
|
||||
return !mIsHomeKeyDown;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user