opt
This commit is contained in:
@@ -99,13 +99,15 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
public void onPageSelected( int position ) {
|
||||
try {
|
||||
IMogoModuleProvider provider = mCardModulesAdapter.getProvider( mCurrentPosition );
|
||||
trackLastCardShowEvent( provider );
|
||||
|
||||
mCurrentPosition = position;
|
||||
final IMogoModuleProvider provider = mCardModulesAdapter.getProvider( position );
|
||||
provider = mCardModulesAdapter.getProvider( mCurrentPosition );
|
||||
mMogoModuleHandler.setEnable( provider.getModuleName() );
|
||||
if ( !isClickMarker ) {
|
||||
mMogoCardManager.invoke( position, mMogoModuleHandler.getCurrentModuleName() );
|
||||
}
|
||||
trackCardSelectedEvent( provider );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -129,7 +131,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
* 卡片展示时长埋点
|
||||
* @param provider
|
||||
*/
|
||||
private void trackCardSelectedEvent( IMogoModuleProvider provider ) {
|
||||
private void trackLastCardShowEvent( IMogoModuleProvider provider ) {
|
||||
if ( provider == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
@@ -462,6 +463,24 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic( MogoTraffic traffic ) {
|
||||
Iterator< IMogoNaviListener > iterator = MogoRegisterCenterHandler.getInstance().getNaviListeners();
|
||||
if ( iterator == null ) {
|
||||
return;
|
||||
}
|
||||
while ( iterator.hasNext() ) {
|
||||
IMogoNaviListener listener = iterator.next();
|
||||
if ( listener != null ) {
|
||||
try {
|
||||
listener.onUpdateTraffic(traffic);
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( MogoLocation location ) {
|
||||
Iterator< IMogoLocationListener > iterator = MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.mogo.module.main.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.text.TextUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-02
|
||||
* <p>
|
||||
* 广播接收者
|
||||
* <p>
|
||||
* {@link Intent#ACTION_POWER_CONNECTED}
|
||||
* {@link Intent#ACTION_POWER_DISCONNECTED}
|
||||
*/
|
||||
public class MogoReceiver extends BroadcastReceiver {
|
||||
|
||||
public static void register( Context context ) {
|
||||
if ( context == null ) {
|
||||
return;
|
||||
}
|
||||
IntentFilter inputFilter = new IntentFilter();
|
||||
inputFilter.addAction( Intent.ACTION_POWER_CONNECTED );
|
||||
inputFilter.addAction( Intent.ACTION_POWER_DISCONNECTED );
|
||||
context.getApplicationContext().registerReceiver( new MogoReceiver(), inputFilter );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent ) {
|
||||
final String action = intent.getAction();
|
||||
if ( TextUtils.equals( action, Intent.ACTION_POWER_CONNECTED ) ) {
|
||||
|
||||
}
|
||||
if ( TextUtils.equals( action, Intent.ACTION_POWER_DISCONNECTED ) ) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user