opt
This commit is contained in:
@@ -56,6 +56,7 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
|
||||
mAppIndicatorAdapter = new AppIndicatorAdapter( getContext(), NavigatorApps.getApps() );
|
||||
mAppIndicatorAdapter.setOnItemClickedListener( ( data, position ) -> {
|
||||
mLauncher.launch( getContext(), data );
|
||||
trackNavigatorClickEvent( data.getTrackType() );
|
||||
} );
|
||||
mNavigatorAppsList.setAdapter( mAppIndicatorAdapter );
|
||||
|
||||
@@ -64,7 +65,7 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
|
||||
mAnim.initAnim( mAIAssist );
|
||||
mAIAssist.setOnClickListener( view -> {
|
||||
AIAssist.startAssistant( getContext() );
|
||||
AppServiceHandler.getApis().getAnalyticsApi().track( "Launcher_xiaozhi_Click", null );
|
||||
trackNavigatorClickEvent( 5 );
|
||||
} );
|
||||
mAIAssistContainer.setOnClickListener( view -> {
|
||||
mAIAssist.performClick();
|
||||
|
||||
@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
@@ -33,9 +34,6 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
|
||||
private static final String TAG = "AppNavigatorPresenter";
|
||||
|
||||
IMogoIntentManager mIntentManager;
|
||||
IMogoStatusManager mMogoStatusManager;
|
||||
|
||||
public AppNavigatorPresenter( AppNavigatorView view ) {
|
||||
super( view );
|
||||
}
|
||||
@@ -43,11 +41,11 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
mIntentManager = AppServiceHandler.getApis().getIntentManagerApi();
|
||||
mMogoStatusManager = AppServiceHandler.getApis().getStatusManagerApi();
|
||||
AppServiceHandler.getApis().getRegisterCenterApi().registerMogoNaviListener( TAG, this );
|
||||
// 预加载应用列表,空间换时间
|
||||
AppsModel.getInstance( getContext() ).load( null );
|
||||
if ( DebugConfig.isLauncher() ) {
|
||||
// 预加载应用列表,空间换时间
|
||||
AppsModel.getInstance( getContext() ).load( null );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,13 +53,13 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
super.onResume( owner );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_UN_WAKE_OPEN_APP_LIST, AppsConst.CMD_UN_WAKE_WORDS_OPEN_APP_LIST, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_UN_WAKE_OPEN_CAR_SETTINGS, AppsConst.CMD_UN_WAKE_WORDS_OPEN_CAR_SETTINGS, this );
|
||||
mIntentManager.registerIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
AppServiceHandler.getApis().getIntentManagerApi().registerIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause( @NonNull LifecycleOwner owner ) {
|
||||
super.onPause( owner );
|
||||
mIntentManager.unregisterIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
AppServiceHandler.getApis().getIntentManagerApi().unregisterIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_UN_WAKE_OPEN_APP_LIST );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_UN_WAKE_OPEN_CAR_SETTINGS );
|
||||
}
|
||||
@@ -76,10 +74,14 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
String app = object.optString( "object" );
|
||||
String operation = object.optString( "operation" );
|
||||
|
||||
if( !AppsConst.OBJECT_ADAS.equals( app ) ){
|
||||
if ( !AppsConst.OBJECT_ADAS.equals( app ) ) {
|
||||
AppServiceHandler.getApis().getAdasControllerApi().closeADAS();
|
||||
}
|
||||
|
||||
if ( !DebugConfig.isLauncher() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( AppsConst.OBJECT_ALL_APPS.equals( app ) ) {
|
||||
if ( AppsConst.OPERATION_OPEN.equals( operation ) ) {
|
||||
mView.openAppsPanel();
|
||||
@@ -116,10 +118,8 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
|
||||
@Override
|
||||
public void onDestroy( @NonNull LifecycleOwner owner ) {
|
||||
if ( mIntentManager != null ) {
|
||||
mIntentManager.unregisterIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
}
|
||||
super.onDestroy( owner );
|
||||
AppServiceHandler.getApis().getIntentManagerApi().unregisterIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,14 +16,20 @@ public class AppInfo {
|
||||
private final int mVersionCode;
|
||||
private final Drawable mIcon;
|
||||
private final int mIconResId;
|
||||
private final int mTrackType; // 埋点类型
|
||||
|
||||
public AppInfo( String mName, String mPackageName, String mVersionName, int mVersionCode, Drawable mIcon, int mIconResId ) {
|
||||
public AppInfo( String mName, String mPackageName, String mVersionName, int mVersionCode, Drawable mIcon, int mIconResId, int mTrackType ) {
|
||||
this.mName = mName;
|
||||
this.mPackageName = mPackageName;
|
||||
this.mVersionName = mVersionName;
|
||||
this.mVersionCode = mVersionCode;
|
||||
this.mIcon = mIcon;
|
||||
this.mIconResId = mIconResId;
|
||||
this.mTrackType = mTrackType;
|
||||
}
|
||||
|
||||
public AppInfo( String mName, String mPackageName, String mVersionName, int mVersionCode, Drawable mIcon, int mIconResId ) {
|
||||
this(mName, mPackageName, mVersionName, mVersionCode, mIcon, mIconResId, 0);
|
||||
}
|
||||
|
||||
public int getIconResId() {
|
||||
@@ -50,6 +56,10 @@ public class AppInfo {
|
||||
return mIcon;
|
||||
}
|
||||
|
||||
public int getTrackType() {
|
||||
return mTrackType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AppInfo{" +
|
||||
|
||||
@@ -13,26 +13,26 @@ import java.util.List;
|
||||
*/
|
||||
public class NavigatorApps {
|
||||
|
||||
private static AppInfo app = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi );
|
||||
private static AppInfo app_ = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi_disable );
|
||||
private static AppInfo app2 = new AppInfo( "音乐", "com.pvetec.musics", "", 0, null, R.drawable.module_apps_ic_navigator_media );
|
||||
private static AppInfo app3 = new AppInfo( "个人中心", "com.zhidao.auto.personal", "", 0, null, R.drawable.module_apps_ic_navigator_personcenter );
|
||||
private static AppInfo app4 = new AppInfo( "全部应用", "com.mogo.launcher.applist", "", 0, null, R.drawable.module_apps_ic_navigator_applist );
|
||||
private static AppInfo app = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi, 1 );
|
||||
private static AppInfo app_ = new AppInfo( "导航", "com.mogo.launcher.navi.search", "", 0, null, R.drawable.module_apps_ic_navigator_navi_disable, 1 );
|
||||
private static AppInfo app2 = new AppInfo( "音乐", "com.pvetec.musics", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
|
||||
private static AppInfo app3 = new AppInfo( "个人中心", "com.zhidao.auto.personal", "", 0, null, R.drawable.module_apps_ic_navigator_personcenter, 3 );
|
||||
private static AppInfo app4 = new AppInfo( "全部应用", "com.mogo.launcher.applist", "", 0, null, R.drawable.module_apps_ic_navigator_applist, 4 );
|
||||
|
||||
public static List< AppInfo > getApps() {
|
||||
List< AppInfo > sApps = new ArrayList<>();
|
||||
sApps.add( app );
|
||||
sApps.add( app2 );
|
||||
sApps.add( app3 );
|
||||
// sApps.add( app3 );
|
||||
sApps.add( app4 );
|
||||
return sApps;
|
||||
}
|
||||
|
||||
public static List< AppInfo > getAppsWithoutNavigation() {
|
||||
List< AppInfo > sApps = new ArrayList<>();
|
||||
sApps.add( app_ );
|
||||
sApps.add( app );
|
||||
sApps.add( app2 );
|
||||
sApps.add( app3 );
|
||||
// sApps.add( app3 );
|
||||
sApps.add( app4 );
|
||||
return sApps;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user