This commit is contained in:
unknown
2020-06-30 10:58:17 +08:00
20 changed files with 112 additions and 29 deletions

View File

@@ -1,8 +1,8 @@
import java.text.SimpleDateFormat
apply plugin: 'com.android.application'
apply plugin: 'com.alibaba.arouter'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
import java.text.SimpleDateFormat
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
@@ -25,7 +25,7 @@ android {
externalNativeBuild {
ndk {
// 设置支持的SO库架构
abiFilters 'armeabi-v7a'
abiFilters 'armeabi-v7a','x86'
}
}
}
@@ -98,18 +98,21 @@ android {
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'false'
}
// e系列
e8xx {
dimension "product"
// 使用思必驰语音
buildConfigField 'int', 'AIType','2'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
}
// d系列
d8xx {
dimension "product"
// 使用同行者语音
buildConfigField 'int', 'AIType','1'
buildConfigField 'boolean', 'AI_ASSIST_ACTIVE_STAUTS', 'true'
}
qa {
dimension "env"
@@ -282,4 +285,4 @@ def getGitCommit() {
gitCommit
}
apply plugin: 'arouterhook'
//apply plugin: 'arouterhook'

View File

@@ -37,12 +37,7 @@ public class MogoApplication extends AbsMogoApplication {
@Override
public void onCreate() {
DebugConfig.setNetMode(BuildConfig.NET_ENV);
DebugConfig.setDebug(BuildConfig.DEBUG);
DebugConfig.setAIType(BuildConfig.AIType);
DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE);
DebugConfig.setUseCustomNavi(BuildConfig.USE_CUSTOM_NAVI);
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER);
initDebugConfig();
super.onCreate();
// Crash 日志收集
final long start = System.currentTimeMillis();
@@ -78,6 +73,16 @@ public class MogoApplication extends AbsMogoApplication {
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
}
private void initDebugConfig(){
DebugConfig.setNetMode(BuildConfig.NET_ENV);
DebugConfig.setDebug(BuildConfig.DEBUG);
DebugConfig.setAIType(BuildConfig.AIType);
DebugConfig.setLaunchLocationService(BuildConfig.LAUNCH_LOCATION_SERVICE);
DebugConfig.setUseCustomNavi(BuildConfig.USE_CUSTOM_NAVI);
DebugConfig.setLauncher(BuildConfig.IS_LAUNCHER);
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
}
@Override
protected void init() {
super.init();

View File

@@ -22,7 +22,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.alibaba:arouter-register:1.0.2"
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
classpath "com.mogo.module.pluginhook:module-pluginhook:${HOOKPLUGIN_VERSION}"
// classpath "com.mogo.module.pluginhook:module-pluginhook:${HOOKPLUGIN_VERSION}"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

View File

@@ -17,7 +17,7 @@ ext {
androidxappcompat : "androidx.appcompat:appcompat:1.0.2",
androidxccorektx : "androidx.core:core-ktx:1.2.0",
androidxconstraintlayout : "androidx.constraintlayout:constraintlayout:1.1.3",
boostmultidex : "com.mogo.module.boostmultidex:module-boostmultidex:${BOOST_MULTIDEX_VERSION}",
boostmultidex : "com.bytedance.boost_multidex:boost_multidex:1.0.1",
androidxviewpager2 : "androidx.viewpager2:viewpager2:1.0.0",
androidxrecyclerview : "androidx.recyclerview:recyclerview:1.1.0",
androidxcardview : "androidx.cardview:cardview:1.0.0",

View File

@@ -151,4 +151,17 @@ public class DebugConfig {
public static void setRequestOnlineCarData( boolean sRequestOnlineCarData ) {
DebugConfig.sRequestOnlineCarData = sRequestOnlineCarData;
}
/**
* 是否支持临时激活小智
*/
private static boolean sActiveAIAssistFlag = true;
public static boolean isActiveAIAssistFlag() {
return sActiveAIAssistFlag;
}
public static void setActiveAIAssistFlag( boolean sActiveAIAssistFlag ) {
DebugConfig.sActiveAIAssistFlag = sActiveAIAssistFlag;
}
}

View File

@@ -38,7 +38,7 @@ MOGO_SERVICE_API_VERSION=1.2.1.9
MOGO_CONNECTION_VERSION=1.2.1.9
MOGO_MODULE_APPS_VERSION=1.2.1.9
MOGO_MODULE_NAVI_VERSION=1.2.1.9
MOGO_MODULE_SHARE_VERSION=1.2.1.9
MOGO_MODULE_SHARE_VERSION=1.2.1.18
MOGO_MODULE_COMMON_VERSION=1.2.1.9
MOGO_MODULE_MAIN_VERSION=1.2.1.9
MOGO_MODULE_MAP_VERSION=1.2.1.9
@@ -71,7 +71,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.36
MOGO_MODULE_V2X_VERSION=1.1.47
# 推送
MOGO_MODULE_PUSH_VERSION=1.0.1
# 广告资源位

View File

@@ -6,6 +6,7 @@ import android.content.pm.PackageInfo;
import com.mogo.module.apps.model.AppEnum;
import com.mogo.module.apps.model.AppEnumHelper;
import com.mogo.module.common.utils.CarSeries;
import java.util.Arrays;
import java.util.HashMap;
@@ -29,6 +30,9 @@ public class AppFilterImpl implements AppFilter {
final String[] values = context.getResources().getStringArray( R.array.module_apps_array_filter_packages );
if ( values != null ) {
mFilterPackages = Arrays.asList( values );
if ( CarSeries.getSeries() != CarSeries.CAR_SERIES_F80X ) {
mFilterPackages.add( "com.android.settings" );
}
}
}

View File

@@ -80,6 +80,11 @@ public class AppsPresenter extends Presenter< AppsView > {
Logger.d( TAG, "apps: %s", appInfoList );
final Map< Integer, List< AppInfo > > result = addOthersEntrances( appInfoList );
try {
filterSamePackage( result );
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}
UiThreadHandler.post( () -> {
if ( mView != null ) {
mView.renderApps( result );
@@ -143,7 +148,7 @@ public class AppsPresenter extends Presenter< AppsView > {
}
}
}
// growthCapacity( result );
// 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 ) );
if ( DebugConfig.isDebug() ) {
@@ -154,6 +159,30 @@ public class AppsPresenter extends Presenter< AppsView > {
return result;
}
private void filterSamePackage( Map< Integer, List< AppInfo > > appInfoMap ) {
if ( appInfoMap == null || appInfoMap.isEmpty() ) {
return;
}
for ( Map.Entry< Integer, List< AppInfo > > integerListEntry : appInfoMap.entrySet() ) {
if ( integerListEntry == null ) {
continue;
}
List< AppInfo > oldList = integerListEntry.getValue();
if ( oldList == null
|| oldList.size() > AppsConst.TOTAL_SIZE_EACH_PAGE ) {
return;
}
List< AppInfo > appInfos = new ArrayList<>();
for ( AppInfo appInfo : oldList ) {
if ( appInfos.contains( appInfo ) ) {
continue;
}
appInfos.add( appInfo );
}
integerListEntry.setValue( appInfos );
}
}
/**
* 扩容
*

View File

@@ -1,6 +1,9 @@
package com.mogo.module.apps.model;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import java.util.Objects;
/**
* @author congtaowang
@@ -29,7 +32,7 @@ public class AppInfo {
}
public AppInfo( String mName, String mPackageName, String mVersionName, int mVersionCode, Drawable mIcon, int mIconResId ) {
this(mName, mPackageName, mVersionName, mVersionCode, mIcon, mIconResId, 0);
this( mName, mPackageName, mVersionName, mVersionCode, mIcon, mIconResId, 0 );
}
public int getIconResId() {
@@ -60,6 +63,19 @@ public class AppInfo {
return mTrackType;
}
@Override
public boolean equals( Object o ) {
if ( this == o ) return true;
if ( o == null || getClass() != o.getClass() ) return false;
AppInfo appInfo = ( AppInfo ) o;
return TextUtils.equals( mPackageName, appInfo.mPackageName );
}
@Override
public int hashCode() {
return Objects.hash( mPackageName );
}
@Override
public String toString() {
return "AppInfo{" +

View File

@@ -56,6 +56,7 @@ public class AppsModel {
if ( mPagedApps != null ) {
mPagedApps.clear();
}
mPagedApps = null;
mContext = null;
mAppFilter = null;
sInstance = null;

View File

@@ -30,7 +30,7 @@ class OnAiAssistClickListener implements View.OnClickListener {
@Override
public void onClick( View v ) {
if ( Devices.isBind() ) {
if ( Devices.isBind() || !DebugConfig.isActiveAIAssistFlag() ) {
AIAssist.startAssistant( v.getContext() );
trackNavigatorClickEvent( 5 );
} else {

View File

@@ -13,7 +13,6 @@
<item>com.android.browser</item>
<item>com.android.providers.downloads.ui</item>
<item>com.zhidao.guide.lock</item>
<item>com.android.settings</item>
<item>com.android.calculator2</item>
<item>com.nwd.guidebookskin</item>
<item>com.iflytek.inputmethod.pad</item>

View File

@@ -1,5 +1,7 @@
package com.mogo.module.common.utils;
import android.text.TextUtils;
import java.lang.reflect.Method;
/**
@@ -21,6 +23,7 @@ public class CarSeries {
public static final int CAR_SERIES_E84XCD = 51;
public static final int CAR_SERIES_E85X = 50;
public static final int CAR_SERIES_E85XCD = 51;
public static final int CAR_SERIES_E85XJD = 51;
public static int CAR_SERIES = 0;
@@ -33,6 +36,10 @@ public class CarSeries {
return CAR_SERIES;
}
String device = get( "ro.fota.device" );
if ( TextUtils.isEmpty( device ) ) {
return CAR_SERIES_F80X;
}
if ( "FG166".equals( device ) ) {
CAR_SERIES = CAR_SERIES_C80X;
} else if ( "D801-802".equals( device ) ) {
@@ -58,6 +65,10 @@ public class CarSeries {
CAR_SERIES = CAR_SERIES_E85X;
} else if ( "E85XCD".equals( device ) ) {
CAR_SERIES = CAR_SERIES_E85XCD;
} else if ( "E85XJD".equals( device ) ) {
CAR_SERIES = CAR_SERIES_E85XJD;
} else if ( device.startsWith( "E85" ) ) {
CAR_SERIES = CAR_SERIES_E85XJD;
} else {
CAR_SERIES = CAR_SERIES_F80X;
}

View File

@@ -67,7 +67,7 @@ public abstract class BaseNaviInfoView {
protected String getFormatSurplusTime( int seconds ) {
if ( seconds > 60 * 60 ) {
mFormatSurplusDistanceUnit = "h";
mFormatSurplusTimeUnit = "h";
return String.format( "%.1f", ( ( float ) seconds ) / ( 60 * 60 ) );
}

View File

@@ -17,11 +17,11 @@
<ImageView
android:id="@+id/ivIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/module_service_marker_bubble_icon_width"
android:layout_height="@dimen/module_service_marker_bubble_icon_height"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/module_service_marker_bubble_icon_marginBottom"
tools:src="@drawable/icon_map_marker_road_block_up" />
tools:src="@drawable/icon_map_marker_road_block_up2" />
</FrameLayout>

View File

@@ -32,8 +32,8 @@
<ImageView
android:id="@+id/ivIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/module_service_marker_bubble_icon_width"
android:layout_height="@dimen/module_service_marker_bubble_icon_height"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_15"
android:visibility="invisible"

View File

@@ -4,8 +4,8 @@
<dimen name="module_service_marker_dot_marginTop">8dp</dimen>
<dimen name="module_service_marker_bubble_width">100px</dimen>
<dimen name="module_service_marker_bubble_height">117px</dimen>
<dimen name="module_service_marker_bubble_icon_width">50px</dimen>
<dimen name="module_service_marker_bubble_icon_height">50px</dimen>
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>
<!-- 导航查看全程显示范围-->

View File

@@ -4,8 +4,8 @@
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_bubble_width">56px</dimen>
<dimen name="module_service_marker_bubble_height">65px</dimen>
<dimen name="module_service_marker_bubble_icon_width">27px</dimen>
<dimen name="module_service_marker_bubble_icon_height">27px</dimen>
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>
<dimen name="module_service_marker_bounds_leftMargin">550px</dimen>

View File

@@ -295,7 +295,7 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener, IMo
private void trackVoiceWithType(String type){
Map<String, Object> properties = new HashMap<>();
properties.put("type",type);
properties.put("from","2");
properties.put("from","1");
AnalyticsUtils.track("v2x_share_type",properties);
}

View File

@@ -144,6 +144,7 @@ public class LaucherShareDialog extends BaseFloatDialog implements View.OnClickL
// 事故
Logger.d(TAG,"点击事故");
sendShareReceiver(ShareConstants.TYPE_ACCIDENT);
trackWithType(ShareConstants.TYPE_ACCIDENT);
dismiss();
} else if (id == R.id.tvConstruction) {
// 道路施工
@@ -155,6 +156,7 @@ public class LaucherShareDialog extends BaseFloatDialog implements View.OnClickL
// 实时路况
Logger.d(TAG,"点击实时路况");
sendShareReceiver(ShareConstants.TYPE_REAL_TIME_TRAFFIC);
trackWithType(ShareConstants.TYPE_REAL_TIME_TRAFFIC);
dismiss();
} else if (id == R.id.tvStagnantWater) {
// 道路积水