opt
This commit is contained in:
@@ -513,7 +513,9 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
doFrameAnimOnUploadButton();
|
||||
} else {
|
||||
mCurrentUploadFrame = 0;
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
if ( mUploadFrameAnimHandler != null ) {
|
||||
mUploadFrameAnimHandler.removeMessages( MSG_FRAME_ANIM );
|
||||
}
|
||||
mUploading.setVisibility( View.GONE );
|
||||
mUpload.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
|
||||
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
|
||||
|
||||
mMogoModuleHandler = new MogoModulesManager( this );
|
||||
mMogoModuleHandler = new MogoModulesManager( this, getApis() );
|
||||
mMogoMapService = mServiceApis.getMapServiceApi();
|
||||
if ( mMogoMapService != null ) {
|
||||
mMogoMapService.getHostListenerRegister().registerHostMapListener( mMogoModuleHandler );
|
||||
|
||||
@@ -4,7 +4,9 @@ import android.content.Context;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.VoicePreemptType;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
@@ -32,6 +34,7 @@ public class CardIntroduceConfigs {
|
||||
|
||||
public static Map< String, CardIntroduceConfig > sConfigs = new HashMap<>();
|
||||
private static IMogoStatusManager sStatusManager;
|
||||
private static IMogoNavi sNaiv;
|
||||
|
||||
static {
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_BUSINESS_OPERATION, new CardIntroduceConfig( ModuleNames.CARD_TYPE_BUSINESS_OPERATION, "", 3 ) );
|
||||
@@ -42,8 +45,9 @@ public class CardIntroduceConfigs {
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_NOVELTY, new CardIntroduceConfig( ModuleNames.CARD_TYPE_NOVELTY, "新鲜事,邀你给同城车友分享沿途封路、拥堵消息", 0 ) );
|
||||
}
|
||||
|
||||
public static void init( Context context, IMogoStatusManager manager ) {
|
||||
sStatusManager = manager;
|
||||
public static void init( Context context, IMogoServiceApis apis ) {
|
||||
sStatusManager = apis.getStatusManagerApi();
|
||||
sNaiv = apis.getMapServiceApi().getNavi( context );
|
||||
WorkThreadHandler.getInstance().post( () -> {
|
||||
sBroadcastConfigKey = KEY_VOICE_BROADCAST_CONFIG + CommonUtils.getVersionCode( context );
|
||||
String configsStr = SharedPrefsMgr.getInstance( context ).getString( sBroadcastConfigKey );
|
||||
@@ -78,6 +82,11 @@ public class CardIntroduceConfigs {
|
||||
}
|
||||
}
|
||||
|
||||
if ( sNaiv.isNaviing() ) {
|
||||
Logger.d( TAG, "do not broadcastCardIntroduce cause naving" );
|
||||
return;
|
||||
}
|
||||
|
||||
CardIntroduceConfig config = sConfigs.get( type );
|
||||
config.broadcastAmount++;
|
||||
|
||||
|
||||
@@ -89,17 +89,16 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
|
||||
private IMogoIntentManager mMogoIntentManager;
|
||||
|
||||
public MogoModulesManager( MainActivity activity ) {
|
||||
public MogoModulesManager( MainActivity activity , IMogoServiceApis apis) {
|
||||
if ( activity == null ) {
|
||||
throw new NullPointerException( "activity can't be null." );
|
||||
}
|
||||
this.mActivity = activity;
|
||||
IMogoServiceApis apis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
mTrackManager = apis.getAnalyticsApi();
|
||||
mMogoIntentManager = apis.getIntentManagerApi();
|
||||
|
||||
registerReceiver();
|
||||
CardIntroduceConfigs.init( getContext(), apis.getStatusManagerApi() );
|
||||
CardIntroduceConfigs.init( getContext(), apis );
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
|
||||
Reference in New Issue
Block a user