Merge branch 'qa' into dev_custom_map
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -4,7 +4,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="SuppressionsComponent">
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.utils;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.text.TextUtils;
|
||||
@@ -46,4 +47,14 @@ public class AppUtils {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getApplicationLabel( Context context, String pkgName ) {
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
ApplicationInfo appInfo = pm.getApplicationInfo( pkgName, PackageManager.GET_META_DATA );
|
||||
return pm.getApplicationLabel( appInfo ).toString();
|
||||
} catch ( Exception e ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
|
||||
# 在线车辆F
|
||||
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.2
|
||||
# v2x
|
||||
MOGO_MODULE_V2X_VERSION=1.1.49
|
||||
MOGO_MODULE_V2X_VERSION=1.1.53
|
||||
# 推送
|
||||
MOGO_MODULE_PUSH_VERSION=1.0.1
|
||||
# 广告资源位
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.apps;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
@@ -9,16 +10,17 @@ import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.commons.device.Devices;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.apps.adapter.AppIndicatorAdapter;
|
||||
import com.mogo.module.apps.anim.AnimWrapper;
|
||||
import com.mogo.module.apps.applaunch.AppLauncher;
|
||||
import com.mogo.module.apps.applaunch.BaseAppLauncher;
|
||||
import com.mogo.module.apps.applaunch.InternalFunctionLauncher;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.module.apps.model.NavigatorApps;
|
||||
import com.mogo.module.apps.view.OnAiAssistClickListener;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -58,7 +60,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() );
|
||||
trackNavigatorClickEvent( data );
|
||||
} );
|
||||
mNavigatorAppsList.setAdapter( mAppIndicatorAdapter );
|
||||
|
||||
@@ -118,9 +120,18 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
|
||||
AppsListActivity.start( getActivity() );
|
||||
}
|
||||
|
||||
private void trackNavigatorClickEvent( int type ) {
|
||||
private void trackNavigatorClickEvent( AppInfo app ) {
|
||||
final Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "type", type );
|
||||
String appLabel = AppUtils.getApplicationLabel( getContext(), app.getPackageName() );
|
||||
properties.put( "appname", app.getName() );
|
||||
if ( !TextUtils.isEmpty( appLabel ) ) {
|
||||
properties.put( "appname", appLabel );
|
||||
}
|
||||
if ( !TextUtils.equals( "全部应用", app.getName() ) ) {
|
||||
properties.put( "appversion", CommonUtils.getVersionName( getContext(), app.getPackageName() ) );
|
||||
} else {
|
||||
properties.put( "appversion", CommonUtils.getVersionName( getContext() ) );
|
||||
}
|
||||
AppServiceHandler.getMogoAnalytics().track( "Launcher_APP_Icon", properties );
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class InternalFunctionLauncher extends BaseAppLauncher {
|
||||
@Override
|
||||
public void launch( Context context, AppInfo appInfo ) {
|
||||
switch ( appInfo.getPackageName() ) {
|
||||
case "com.mogo.launcher.navi.search":
|
||||
case "com.autonavi.amapauto":
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
try {
|
||||
LaunchUtils.launchByPkg( context, "com.autonavi.amapauto" );
|
||||
|
||||
@@ -13,10 +13,10 @@ 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, 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 app = new AppInfo( "高德地图", "com.autonavi.amapauto", "", 0, null, R.drawable.module_apps_ic_navigator_navi, 1 );
|
||||
private static AppInfo app_ = new AppInfo( "高德地图", "com.autonavi.amapauto", "", 0, null, R.drawable.module_apps_ic_navigator_navi_disable, 1 );
|
||||
// private static AppInfo app2 = new AppInfo( "音乐", "com.tencent.wecarflow", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
|
||||
private static AppInfo app2 = new AppInfo( "音乐", "cn.kuwo.kwmusiccar", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
|
||||
private static AppInfo app2 = new AppInfo( "酷我音乐", "cn.kuwo.kwmusiccar", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
|
||||
private static AppInfo app3 = new AppInfo( "车聊聊", "com.zhidao.imdemo", "", 0, null, R.drawable.module_apps_ic_navigator_im, 6 );
|
||||
private static AppInfo app4 = new AppInfo( "全部应用", "com.mogo.launcher.applist", "", 0, null, R.drawable.module_apps_ic_navigator_applist, 4 );
|
||||
|
||||
|
||||
@@ -5,12 +5,8 @@ import android.view.View;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.device.Devices;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.module.apps.AppServiceHandler;
|
||||
import com.mogo.utils.TipToast;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -32,11 +28,9 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
||||
public void onClick( View v ) {
|
||||
if ( Devices.isBind() || !DebugConfig.isActiveAIAssistFlag() ) {
|
||||
AIAssist.startAssistant( v.getContext() );
|
||||
trackNavigatorClickEvent( 5 );
|
||||
} else {
|
||||
if ( mDebugModeOpen ) {
|
||||
AIAssist.startAssistant( v.getContext(), 1 );
|
||||
trackNavigatorClickEvent( 5 );
|
||||
return;
|
||||
}
|
||||
if ( mClickCounter == 0 ) {
|
||||
@@ -60,10 +54,4 @@ class OnAiAssistClickListener implements View.OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void trackNavigatorClickEvent( int type ) {
|
||||
final Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "type", type );
|
||||
AppServiceHandler.getMogoAnalytics().track( "Launcher_APP_Icon", properties );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 9.9 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.png
Executable file → Normal file
BIN
modules/mogo-module-apps/src/main/res/drawable-xhdpi/module_apps_ic_car_setting.png
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 27 KiB |
@@ -1,6 +1,8 @@
|
||||
package com.mogo.module.map;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
@@ -35,10 +37,12 @@ import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.module.IMogoSettingManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -147,6 +151,11 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
onChoosePath( intent, key_type );
|
||||
} else if ( key_type == 10021 ) {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
if ( isForeground( getContext() ) && !hasOthersActivity() && !mStatusManager.isMainPageOnResume() ) {
|
||||
mLauncher.backToLauncher( getContext() );
|
||||
}
|
||||
}, 500L );
|
||||
return;
|
||||
}
|
||||
onStopNaviInternal();
|
||||
@@ -181,6 +190,27 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
getContext().registerReceiver( broadcastReceiver, inputFilter );
|
||||
}
|
||||
|
||||
private boolean isForeground( Context context ) {
|
||||
if ( context != null ) {
|
||||
ActivityManager activityManager = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningAppProcessInfo > processes = activityManager.getRunningAppProcesses();
|
||||
for ( ActivityManager.RunningAppProcessInfo processInfo : processes ) {
|
||||
if ( processInfo.processName.equals( context.getPackageName() ) ) {
|
||||
if ( processInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean hasOthersActivity() {
|
||||
ActivityManager am = ( ActivityManager ) getContext().getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningTaskInfo > list = am.getRunningTasks( 2 );
|
||||
return list != null && list.size() > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换交通态势模式
|
||||
*
|
||||
@@ -295,7 +325,7 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
private void zoomMap( boolean zoomIn ) {
|
||||
boolean isLocked = mMogoMapService.getMapUIController().isCarLocked();
|
||||
MapControlResult result = mView.getUIController().changeZoom( zoomIn );
|
||||
if (! CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
if ( !CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
if ( result == MapControlResult.TARGET ) {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
if ( zoomIn ) {
|
||||
|
||||
@@ -35,6 +35,9 @@ public class AppOperationIntentHandler implements IntentHandler {
|
||||
String app = object.optString( "object" );
|
||||
String operation = object.optString( "operation" );
|
||||
if ( TextUtils.equals( "打开", operation ) ) {
|
||||
if ( TextUtils.isEmpty( sAppPackages.get( app ) ) ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
LaunchUtils.launchByPkg( context, sAppPackages.get( app ) );
|
||||
} catch ( Exception e ) {
|
||||
|
||||
Reference in New Issue
Block a user