Merge remote-tracking branch 'origin/feature/v1.0.3' into feature/v1.0.3

This commit is contained in:
zhangyuanzhen
2020-04-02 13:03:22 +08:00
16 changed files with 159 additions and 63 deletions

View File

@@ -40,6 +40,8 @@ public class MogoApplication extends AbsMogoApplication {
@Override
public void onCreate() {
DebugConfig.setNetMode(BuildConfig.NET_ENV);
DebugConfig.setDebug(BuildConfig.DEBUG);
super.onCreate();
// Crash 日志收集
final long start = System.currentTimeMillis();
@@ -77,7 +79,5 @@ public class MogoApplication extends AbsMogoApplication {
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
DebugConfig.setNetMode(BuildConfig.NET_ENV);
DebugConfig.setDebug(BuildConfig.DEBUG);
}
}

View File

@@ -27,24 +27,24 @@ PASSWORD=xintai2018
RELEASE=false
# 模块版本
## 工程内模块
MOGO_MODULE_SHARE_VERSION=1.0.3-SNAPSHOT
MOGO_COMMONS_VERSION=1.0.3-SNAPSHOT
MOGO_UTILS_VERSION=1.0.3-SNAPSHOT
MAP_AMAP_VERSION=1.0.3-SNAPSHOT
MOGO_MAP_VERSION=1.0.3-SNAPSHOT
MOGO_MAP_API_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_COMMON_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_MAIN_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_MAP_VERSION=1.0.3-SNAPSHOT
MOGO_SERVICE_VERSION=1.0.3-SNAPSHOT
MOGO_SERVICE_API_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_APPS_VERSION=1.0.3-SNAPSHOT
MOGO_CONNECTION_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_NAVI_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_SERVICE_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_EXTENSIONS_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_SEARCH_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_BACK_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_SHARE_VERSION=1.0.3.1-SNAPSHOT
MOGO_COMMONS_VERSION=1.0.3.1-SNAPSHOT
MOGO_UTILS_VERSION=1.0.3.1-SNAPSHOT
MAP_AMAP_VERSION=1.0.3.1-SNAPSHOT
MOGO_MAP_VERSION=1.0.3.1-SNAPSHOT
MOGO_MAP_API_VERSION=1.0.3.1.1-SNAPSHOT
MOGO_MODULE_COMMON_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_MAIN_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_MAP_VERSION=1.0.3.1-SNAPSHOT
MOGO_SERVICE_VERSION=1.0.3.1-SNAPSHOT
MOGO_SERVICE_API_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_APPS_VERSION=1.0.3.1-SNAPSHOT
MOGO_CONNECTION_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_NAVI_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_SERVICE_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_EXTENSIONS_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_SEARCH_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_BACK_VERSION=1.0.3.1-SNAPSHOT
MOGO_MODULE_AUTHORIZE_VERSION=1.0.0-SNAPSHOT
MOGO_MODULE_GUIDE_VERSION=1.0.0-SNAPSHOT
@@ -60,7 +60,7 @@ MOGO_MODULE_GUIDESHOW_VERSION=1.0.2-SNAPSHOT
# 视频引导接口
MOGO_MODULE_GUIDESHOW_PROVIDER_VERSION=1.0.2-SNAPSHOT
# 在线车辆F
MOGO_MODULE_ONLINECAR_VERSION=1.0.3-SNAPSHOT
MOGO_MODULE_ONLINECAR_VERSION=1.0.3.1-SNAPSHOT
# v2x
MOGO_MODULE_V2X_VERSION=1.0.3-SNAPSHOT
# 媒体卡片

View File

@@ -41,6 +41,7 @@ public class NaviClient implements IMogoNavi {
/**
* 导航策略配置
*/
private MogoNaviConfig mMogoNaviConfig = new MogoNaviConfig();
private static volatile NaviClient sInstance;

View File

@@ -158,6 +158,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
@Override
public void onStartNavi( int type ) {
Logger.d( TAG, "onStartNavi type = %s", type );
// 巡航
if ( type != NaviType.CRUISE ) {
setStopped( false );
@@ -223,13 +224,9 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
super.onCalculateRouteSuccess( aMapCalcRouteResult );
Logger.i( TAG, "导航规划成功" );
setStopped( false );
WorkThreadHandler.getInstance().post( ()->{
mNaviOverlayHelper.showCalculatedPaths(()->{
UiThreadHandler.post( ()->{
MogoNaviListenerHandler.getInstance().onCalculateSuccess();
AMapMessageManager.getInstance().postCalculateSuccess();
} );
});
mNaviOverlayHelper.showCalculatedPaths( () -> {
AMapMessageManager.getInstance().postCalculateSuccess();
MogoNaviListenerHandler.getInstance().onCalculateSuccess();
} );
}

View File

@@ -170,6 +170,7 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
}
public void showBounds() {
Logger.d( TAG, "showBounds" );
showPathsBound( getBounds(), null );
}
@@ -187,11 +188,9 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
mBoundRect.right,
mBoundRect.top,
mBoundRect.bottom ));
UiThreadHandler.postDelayed( ()->{
if ( after != null ) {
after.run();
}
}, 2000 );
if ( after != null ) {
after.run();
}
}
private void checkAMapInstance() {
@@ -218,6 +217,7 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
//wrapper.setStartBitmap( R.drawable.ic_navi_start )
// .setEndBitmap( R.drawable.ic_navi_target );
mAMapNavi.selectRouteId( item.getId() );
Logger.d( TAG, "renderPathOverlay set default path" );
}
wrapper.addToMap();
wrapper.setTransparency( i == 0 ? AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED : AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED );

View File

@@ -1,5 +1,7 @@
package com.mogo.module.apps;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.lifecycle.LifecycleOwner;
@@ -11,6 +13,8 @@ import com.mogo.module.apps.applaunch.CardAppLauncher;
import com.mogo.module.apps.applaunch.GuideShowLauncher;
import com.mogo.module.apps.model.AppInfo;
import com.mogo.module.apps.model.AppsModel;
import com.mogo.module.apps.model.UnScannedApps;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.cardmanager.IMogoCardManager;
@@ -20,7 +24,6 @@ import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -40,14 +43,17 @@ public class AppsPresenter extends Presenter<AppsView> {
private IMogoAnalytics mAnalytics;
private AppLaunchFilter mLauncher;
private IMogoServiceApis mApis;
private IMogoCardManager mCardManager;
private IMogoStatusManager mMogoStatusManager;
public AppsPresenter(AppsView view) {
super(view);
mCardManager = (IMogoCardManager) ARouter.getInstance().build(MogoServicePaths.PATH_CARD_MANAGER).navigation(getContext());
mApis = (IMogoServiceApis)ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation(getContext());
mCardManager = mApis.getCardManagerApi();
CardAppLauncher cardAppLauncher = new CardAppLauncher(this, mCardManager);
GuideShowLauncher guideShowLauncher = new GuideShowLauncher();
GuideShowLauncher guideShowLauncher = new GuideShowLauncher(mApis.getMapServiceApi().getNavi( getContext() ));
cardAppLauncher.setNext(guideShowLauncher);
guideShowLauncher.setNext(new AppLauncher());
mLauncher = cardAppLauncher;
@@ -63,8 +69,8 @@ public class AppsPresenter extends Presenter<AppsView> {
}
});
mAnalytics = (IMogoAnalytics) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation(getContext());
mMogoStatusManager = (IMogoStatusManager) ARouter.getInstance().build(MogoServicePaths.PATH_STATUS_MANAGER).navigation();
mAnalytics = mApis.getAnalyticsApi();
mMogoStatusManager = mApis.getStatusManagerApi();
mMogoStatusManager.setAppListUIShow(TAG, true);
}
@@ -73,9 +79,10 @@ public class AppsPresenter extends Presenter<AppsView> {
AppsModel.getInstance(getContext()).load(appInfoList -> {
Logger.d(TAG, "apps: %s", appInfoList);
final Map<Integer, List<AppInfo>> result = addOthersEntrances( appInfoList );
UiThreadHandler.post(() -> {
if (mView != null) {
mView.renderApps(addGuideAppEntrance(appInfoList));
mView.renderApps( result );
}
});
});
@@ -83,7 +90,12 @@ public class AppsPresenter extends Presenter<AppsView> {
});
}
private Map<Integer, List<AppInfo>> addGuideAppEntrance(Map<Integer, List<AppInfo>> appInfoMap) {
/**
* 新增入口
* @param appInfoMap
* @return
*/
private Map<Integer, List<AppInfo>> addOthersEntrances( Map<Integer, List<AppInfo>> appInfoMap) {
Map<Integer, List<AppInfo>> result = new HashMap<>();
if ( appInfoMap != null && !appInfoMap.isEmpty() ) {
@@ -99,18 +111,60 @@ public class AppsPresenter extends Presenter<AppsView> {
}
}
if (result.isEmpty()) {
result.put(0, new ArrayList<>());
} else if (result.get(result.size() - 1) == null) {
result.put(result.size() - 1, new ArrayList<>());
} else if (result.get(result.size() - 1).size() == AppsConst.TOTAL_SIZE_EACH_PAGE) {
result.put(result.size(), new ArrayList<>());
// 手动添加无法识别到的app
List<AppInfo> apps = UnScannedApps.getUnScannedApps();
if ( apps != null && !apps.isEmpty() ) {
for ( AppInfo app : apps ) {
if ( app == null ) {
continue;
}
Set<Integer> keys = result.keySet();
boolean addFlag = true;
for ( Integer key : keys ) {
List<AppInfo> val = result.get( key );
// 无法扫描到蓝牙电话app这里手动添加
for ( AppInfo appInfo : val ) {
if ( appInfo == null ) {
continue;
}
if ( TextUtils.equals( appInfo.getPackageName(), app.getPackageName() ) ) {
addFlag = false;
break;
}
}
if ( !addFlag ) {
break;
}
}
if ( addFlag ) {
growthCapacity(result);
result.get(result.size() - 1).add(app);
}
}
}
// 添加逻辑
growthCapacity(result);
// 添加介绍入口
result.get(result.size() - 1).add(new AppInfo(GuideShowLauncher.APP_INFO_NAME_GUIDE_SHOW, getContext().getPackageName(), null, 0, null, R.drawable.module_apps_ic_guide_show));
return result;
}
/**
* 扩容
* @param target
*/
private void growthCapacity( Map<Integer, List<AppInfo>> target ){
if ( target == null ) {
return;
}
if (target.isEmpty()) {
target.put(0, new ArrayList<>());
} else if (target.get(target.size() - 1) == null) {
target.put(target.size() - 1, new ArrayList<>());
} else if (target.get(target.size() - 1).size() == AppsConst.TOTAL_SIZE_EACH_PAGE) {
target.put(target.size(), new ArrayList<>());
}
}
public void launch(AppInfo appInfo) {
if (appInfo == null) {
return;

View File

@@ -4,7 +4,7 @@ import android.app.Activity;
import android.content.Context;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.impl.amap.navi.NaviClient;
import com.mogo.map.navi.IMogoNavi;
import com.mogo.module.apps.AppServiceHandler;
import com.mogo.module.apps.R;
import com.mogo.module.apps.model.AppInfo;
@@ -17,10 +17,16 @@ public class GuideShowLauncher extends BaseAppLauncher {
public static final String TAG = "GuideShowLauncher";
public static final String APP_INFO_NAME_GUIDE_SHOW = "新手引导";
private IMogoNavi mNavi;
public GuideShowLauncher( IMogoNavi navi ) {
this.mNavi = navi;
}
@Override
public void launch(Context context, AppInfo appInfo) {
if (appInfo != null && APP_INFO_NAME_GUIDE_SHOW.equals(appInfo.getName())) {
if (!NaviClient.getInstance(context).isNaviing()) {
if ( mNavi != null && !mNavi.isNaviing()) {
AppServiceHandler.getMogoGuideShow().playGuideVideo((Activity) context, (s) -> {
Logger.d(TAG, s);
return Unit.INSTANCE;

View File

@@ -65,7 +65,7 @@ public enum AppEnum {
AUX( "AUX", "com.nwd.auxin", R.drawable.module_apps_ic_aux ),
//FM
FM( "FM", "com.nwd.radio", R.drawable.module_apps_ic_fm ),
FM( "FM收音机", "com.nwd.radio", R.drawable.module_apps_ic_fm ),
// 新鲜事
FreshThings( "新鲜事", "com.zhidao.fresh.things", R.drawable.module_apps_ic_fresh_things ),
@@ -77,7 +77,10 @@ public enum AppEnum {
LocalVideo( "本地视频", "com.zhidao.video", R.drawable.module_apps_ic_local_video ),
// 车辆信息
CanBus( "车辆信息", "com.zd.canbus", R.drawable.module_apps_ic_canbus ),
CanBus( "车辆信息", "com.nwd.can.setting", R.drawable.module_apps_ic_canbus ),
// 蓝牙电话
BT_PHONE( "蓝牙电话", "com.nwd.android.phone", R.drawable.module_apps_ic_bt_phone ),
;
private String mName;

View File

@@ -122,7 +122,7 @@ public class AppsModel {
private String getApplicationName( PackageManager packageManager, PackageInfo packageInfo ) {
String name = packageManager.getApplicationLabel( packageInfo.applicationInfo ).toString();
if ( name.startsWith( "com." ) || name.split( "." ).length > 3 ) {
if ( AppEnumHelper.isCustomizedApp( packageInfo.packageName ) ) {
return AppEnumHelper.getTargetName( packageInfo.packageName );
}
return name;

View File

@@ -0,0 +1,24 @@
package com.mogo.module.apps.model;
import java.util.ArrayList;
import java.util.List;
/**
* @author congtaowang
* @since 2020-04-02
* <p>
* 扫描不到的app
*/
public class UnScannedApps {
private static List< AppInfo > sUnScannedApps = new ArrayList<>();
static {
sUnScannedApps.add( new AppInfo( AppEnum.BT_PHONE.getName(), AppEnum.BT_PHONE.getPkg(), null, 0, null, AppEnum.BT_PHONE.getIconResId() ) );
sUnScannedApps.add( new AppInfo( AppEnum.CanBus.getName(), AppEnum.CanBus.getPkg(), null, 0, null, AppEnum.CanBus.getIconResId() ) );
}
public static List< AppInfo > getUnScannedApps() {
return sUnScannedApps;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -18,13 +18,14 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
private val baseController: IMogoAuthorizeController by lazy { IMogoAuthorizeController() }
override fun needAuthorize(tag: String): Boolean {
return if (isDeviceOfD()) {
Logger.d(TAG, "needAuthorize update agreement in background")
baseController.updateAgreementVersion(tag.toAuthorizeType())
needAuthorization(tag.toAuthorizeType())
} else {
false
}
// return if (isDeviceOfD()) {
// Logger.d(TAG, "needAuthorize update agreement in background")
// baseController.updateAgreementVersion(tag.toAuthorizeType())
// needAuthorization(tag.toAuthorizeType())
// } else {
// false
// }
return false
}
override fun invokeAuthorizeContent(tag: String) {

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000">
android:background="#CC000000">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clLoadingAuthorizeContainer"

View File

@@ -86,11 +86,21 @@ public class MarkerCarInfo implements Serializable {
@Override
public String toString() {
return "CarLive{" +
return "CarLiveInfo{" +
"videoUrl='" + videoUrl + '\'' +
", videoChannel='" + videoChannel + '\'' +
", videoSn='" + videoSn + '\'' +
'}';
}
}
@Override
public String toString() {
return "MarkerCarInfo{" +
"carBrandLogoUrl='" + carBrandLogoUrl + '\'' +
", carTypeName='" + carTypeName + '\'' +
", vehicleType=" + vehicleType +
", carLiveInfo=" + carLiveInfo +
'}';
}
}

View File

@@ -280,7 +280,7 @@ public class MogoModulesManager implements MogoModulesHandler,
mSortedCards.remove( mEnableModuleName );
mSortedCards.add( 0, mEnableModuleName );
SharedPrefsMgr.getInstance( getContext() ).putString( KEY_SORTED_CARD_MODULES, GsonUtil.jsonFromObject( mSortedCards ) );
Log.i( TAG, "enable & disable card cost " + ( System.currentTimeMillis() - start1 ) + "ms" );
Logger.i( TAG, "enable & disable card cost " + ( System.currentTimeMillis() - start1 ) + "ms" );
CardIntroduceConfigs.broadcastCardIntroduce( mActivity, mEnableModuleName );
}
@@ -401,7 +401,7 @@ public class MogoModulesManager implements MogoModulesHandler,
}
}
}
Log.i( TAG, "onMapChanged event cost " + ( System.currentTimeMillis() - start ) + "ms" );
Logger.i( TAG, "onMapChanged event cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
@Override