Merge branch 'dev' into dev_split_ext_share

# Conflicts:
#	foudations/mogo-commons/src/main/java/com/mogo/commons/debug/DebugConfig.java
This commit is contained in:
tongchenfei
2020-06-09 09:50:33 +08:00
29 changed files with 328 additions and 145 deletions

2
.idea/misc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>

View File

@@ -76,6 +76,8 @@ android {
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'false'
// 是否使用自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否作为 launcher 运行
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
}
// launcher app
launcher{
@@ -85,6 +87,8 @@ android {
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'true'
// 是否使用自定义导航
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'false'
// 是否作为 launcher 运行
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
}
// f系列-分体机全系列,未细分
f8xx{

View File

@@ -14,11 +14,11 @@
android:supportsRtl="true"
android:theme="@style/AppTheme.App"
tools:replace="android:label">
<provider
android:name="com.mogo.module.navi.cp.AddressContentProvider"
android:authorities="com.zhidao.auto.personal.provider"
android:enabled="true"
android:exported="true" />
<!-- <provider-->
<!-- android:name="com.mogo.module.navi.cp.AddressContentProvider"-->
<!-- android:authorities="com.zhidao.auto.personal.provider"-->
<!-- android:enabled="true"-->
<!-- android:exported="true" />-->
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="40e2e7e773c7562b1f2b13699a93992c"

View File

@@ -55,11 +55,13 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
MogoModulePaths.addModule(new MogoModule( V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI));
MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
// 暂时去掉推送
// MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
Log.i("timer", "cost " + (System.currentTimeMillis() - start) + "ms");
DebugConfig.setLaunchLocationService( BuildConfig.LAUNCH_LOCATION_SERVICE );
DebugConfig.setLaunchLocationService( BuildConfig.USE_CUSTOM_NAVI );
DebugConfig.setUseCustomNavi( BuildConfig.USE_CUSTOM_NAVI );
DebugConfig.setLauncher( BuildConfig.IS_LAUNCHER );
}
@Override

View File

@@ -145,7 +145,7 @@ ext {
gpssimulatordebug : "com.mogo.module:module-gps-simulator-debug:${MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION}",
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
adasapi : "com.zhidao.autopilot.support:adas:1.0.0",
adasapi : "com.zhidao.autopilot.support:adas:1.0.1-SNAPSHOT",
// 个人中心的SDK
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",

View File

@@ -122,4 +122,17 @@ public class DebugConfig {
public static int getAIType(){
return sAIType;
}
/**
* 是否作为launcher运行
*/
private static boolean sIsLauncher = false;
public static boolean isLauncher() {
return sIsLauncher;
}
public static void setLauncher( boolean isLauncher ) {
DebugConfig.sIsLauncher = isLauncher;
}
}

View File

@@ -0,0 +1,43 @@
package com.mogo.commons.device;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import com.mogo.commons.AbsMogoApplication;
public
/**
* @author congtaowang
* @since 2020/6/8
*
* 描述
*/
class Devices {
public static final Uri CONTENT_URI_BIND = Uri.parse( "content://com.zhidao.guide.lock.product.bindstatus/status" );
/**
* 检测车机激活状态
*
* @return
*/
public static boolean checkBindState() {
try {
ContentResolver resolver = AbsMogoApplication.getApp().getContentResolver();
if ( resolver == null ) {
return false;
}
try ( Cursor cursor = resolver.query( CONTENT_URI_BIND, null, null, null, null ) ) {
if ( cursor == null || !cursor.moveToFirst() ) {
return false;
}
int status = cursor.getInt( cursor.getColumnIndex( "lock_status" ) );
return ( status == 1 );
}
} catch ( Exception e ) {
e.printStackTrace();
}
return false;
}
}

View File

@@ -123,9 +123,9 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
Iterator< IMogoVoiceCmdCallBack > iterator = null;
try {
List< IMogoVoiceCmdCallBack > cmdCallBacks = mCmdMap.get( cmd );
List< IMogoVoiceCmdCallBack > cmdCallBacks = mCmdMap.get( cmd );
iterator = new ArrayList<>( cmdCallBacks ).iterator();
} catch( Exception e ){
} catch ( Exception e ) {
}
while ( iterator != null && iterator.hasNext() ) {
@@ -348,10 +348,18 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
}
public static void startAssistant( Context context ) {
startAssistant( context, 1 );
}
/**
* @param context
* @param status window_start_cancel 0 - 结束, 1 - 显示, 2 - 未激活调试进入
*/
public static void startAssistant( Context context, int status ) {
final Intent intent = new Intent();
intent.setFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
intent.setAction( "pvetec.intent.action.txz.switch" );
intent.putExtra( "window_start_cancel", 1 );
intent.putExtra( "window_start_cancel", status );
intent.putExtra( "extra_switch_type", "window_start_cancel" );
context.sendBroadcast( intent );
}
@@ -462,12 +470,12 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack, OnTtsListener {
try {
mSpeakVoiceMap.remove( text );
mogoVoiceManager.shutUp( ttsId );
} catch( Exception e ){
} catch ( Exception e ) {
}
}
public void clearTTSCallback(String text){
public void clearTTSCallback( String text ) {
try {
mSpeakVoiceMap.remove( text );
} catch ( Exception e ) {

View File

@@ -27,33 +27,33 @@ PASSWORD=xintai2018
RELEASE=false
# 模块版本
## 工程内模块
MOGO_COMMONS_VERSION=1.1.0.15
MOGO_UTILS_VERSION=1.1.0.15
MAP_AMAP_VERSION=1.1.0.15
MAP_AUTONAVI_VERSION=1.1.0.15
MOGO_MAP_VERSION=1.1.0.15
MOGO_MAP_API_VERSION=1.1.0.15
MOGO_SERVICE_VERSION=1.1.0.15
MOGO_SERVICE_API_VERSION=1.1.0.15
MOGO_CONNECTION_VERSION=1.1.0.15
MOGO_MODULE_APPS_VERSION=1.1.0.15
MOGO_MODULE_NAVI_VERSION=1.1.0.15
MOGO_MODULE_SHARE_VERSION=1.1.0.15
MOGO_MODULE_COMMON_VERSION=1.1.0.15
MOGO_MODULE_MAIN_VERSION=1.1.0.15
MOGO_MODULE_MAP_VERSION=1.1.0.15
MOGO_MODULE_SERVICE_VERSION=1.1.0.15
MOGO_MODULE_EXTENSIONS_VERSION=1.1.0.15
MOGO_MODULE_SEARCH_VERSION=1.1.0.15
MOGO_MODULE_BACK_VERSION=1.1.0.15
MOGO_MODULE_GPS_SIMULATOR_VERSION=1.1.0.15
MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.1.0.15
MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.1.0.15
MOGO_MODULE_AUTHORIZE_VERSION=1.1.0.15
MOGO_MODULE_GUIDE_VERSION=1.1.0.15
MOGO_COMMONS_VERSION=1.2.0
MOGO_UTILS_VERSION=1.2.0
MAP_AMAP_VERSION=1.2.0
MAP_AUTONAVI_VERSION=1.2.0
MOGO_MAP_VERSION=1.2.0
MOGO_MAP_API_VERSION=1.2.0
MOGO_SERVICE_VERSION=1.2.0
MOGO_SERVICE_API_VERSION=1.2.0
MOGO_CONNECTION_VERSION=1.2.0
MOGO_MODULE_APPS_VERSION=1.2.0
MOGO_MODULE_NAVI_VERSION=1.2.0
MOGO_MODULE_SHARE_VERSION=1.2.0
MOGO_MODULE_COMMON_VERSION=1.2.0
MOGO_MODULE_MAIN_VERSION=1.2.0
MOGO_MODULE_MAP_VERSION=1.2.0
MOGO_MODULE_SERVICE_VERSION=1.2.0
MOGO_MODULE_EXTENSIONS_VERSION=1.2.0
MOGO_MODULE_SEARCH_VERSION=1.2.0
MOGO_MODULE_BACK_VERSION=1.2.0
MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.0
MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.0
MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.0
MOGO_MODULE_AUTHORIZE_VERSION=1.2.0
MOGO_MODULE_GUIDE_VERSION=1.2.0
MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.0.0.0
MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.0.0.0
MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.0.0.1
MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.0.0.1
## 工程外部模块

View File

@@ -42,4 +42,6 @@ dependencies {
implementation project(':libraries:map-amap')
}
}
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -117,13 +117,18 @@ public class AutoNaviReceiver extends BroadcastReceiver {
switch ( state ) {
case MapStateValue.START_NAVI:
case MapStateValue.START_EMULATOR_NAVI:
if ( MapState.getInstance().isNaving() ) {
return;
}
MapState.getInstance().setNaving( true );
MogoNaviListenerHandler.getInstance().onStartNavi();
break;
case MapStateValue.STOP_NAVI:
case MapStateValue.STOP_EMULATOR_NAVI:
MapState.getInstance().setNaving( false );
MogoNaviListenerHandler.getInstance().onStopNavi();
if ( MapState.getInstance().isNaving() ) {
MapState.getInstance().setNaving( false );
MogoNaviListenerHandler.getInstance().onStopNavi();
}
break;
case MapStateValue.START_AIMLESS_NAVI:
MapState.getInstance().setAimless( true );

View File

@@ -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();

View File

@@ -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

View File

@@ -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{" +

View File

@@ -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;
}

View File

@@ -12,6 +12,8 @@ import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.module.extensions.userinfo.UserInfo;
import com.mogo.module.extensions.utils.LaunchUtils;
import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
/**
@@ -35,6 +37,8 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
private View mMsgContainer;
private TextView mMsgCounter;
private ImageView mUserHeadImg;
@Override
protected int getLayoutId() {
return R.layout.module_ext_layout_extensions;
@@ -47,11 +51,20 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
mWeatherIcon = findViewById( R.id.module_ext_id_weather_icon );
mWeatherTemp = findViewById( R.id.module_ext_id_weather_temp );
mUserHeadImg = findViewById(R.id.ivUserHeadImg);
mMsgContainer = findViewById( R.id.module_ext_id_msg );
mMsgContainer.setOnClickListener( view -> {
ARouter.getInstance().build( "/push/ui/message" ).navigation( getContext() );
} );
mMsgCounter = findViewById( R.id.module_ext_id_msg_counter );
mUserHeadImg.setOnClickListener(view ->{
try {
LaunchUtils.launchByPkg(getContext(), "com.zhidao.auto.personal");
} catch (Exception e) {
Logger.e(TAG, e, "打开个人中心Exception");
}
});
}
@NonNull
@@ -100,5 +113,6 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
@Override
public void renderUserInfo(UserInfo userInfo) {
Logger.d(TAG, "renderUserInfo: " + userInfo);
GlideApp.with(getContext()).load(userInfo.getHeadImgurl()).circleCrop().into(mUserHeadImg);
}
}

View File

@@ -0,0 +1,29 @@
package com.mogo.module.extensions.utils;
import android.content.Context;
import android.content.Intent;
/**
* @author congtaowang
* @since 2020-02-03
* <p>
* 描述
*/
public class LaunchUtils {
/**
* 通过包名启动app
*
* @param context
* @param pkg 包名
*/
public static void launchByPkg( Context context, String pkg ) throws Exception {
Intent intent = getLaunchIntentForPackage( context, pkg );
intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
context.startActivity( intent );
}
public static Intent getLaunchIntentForPackage( Context context, String pkg ) {
return context.getPackageManager().getLaunchIntentForPackage( pkg );
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -41,8 +41,9 @@
android:layout_marginRight="@dimen/module_ext_msg_marginRight"
android:background="@drawable/module_ext_drawable_msg_container_bkg"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/ivUserHeadImg"
app:layout_constraintRight_toLeftOf="@+id/ivUserHeadImg"
app:layout_constraintTop_toTopOf="@+id/ivUserHeadImg"
tools:visibility="visible">
<ImageView
@@ -66,5 +67,14 @@
tools:text="···" />
</FrameLayout>
<ImageView
android:id="@+id/ivUserHeadImg"
android:layout_width="@dimen/module_ext_height"
android:layout_height="@dimen/module_ext_height"
android:layout_marginEnd="@dimen/dp_16"
android:src="@drawable/model_ext_default_user_head"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -73,6 +73,9 @@
<dimen name="module_ext_msg_counter_height">30px</dimen>
<dimen name="module_ext_msg_counter_textSize">20px</dimen>
<dimen name="module_ext_user_img_width">103px</dimen>
<dimen name="module_ext_user_img_height">103px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">1058px</dimen>
<dimen name="module_ext_navi_info_panel_height">210px</dimen>

View File

@@ -76,6 +76,9 @@
<dimen name="module_ext_msg_counter_height">15px</dimen>
<dimen name="module_ext_msg_counter_textSize">11.73px</dimen>
<dimen name="module_ext_user_img_width">56px</dimen>
<dimen name="module_ext_user_img_height">56px</dimen>
<!-- module_map_layout_navi_info_panel.xml-->
<dimen name="module_ext_navi_info_panel_width">544px</dimen>
<dimen name="module_ext_navi_info_panel_height">117px</dimen>

View File

@@ -7,6 +7,9 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
import com.mogo.module.media.constants.MusicConstant;
import com.mogo.module.media.listener.NoDoubleClickListener;
import com.mogo.module.media.model.MediaInfoData;
@@ -21,6 +24,7 @@ import com.mogo.module.media.widget.ScrollingTextView;
import com.mogo.utils.TipToast;
import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
import com.tencent.wecarflow.flowoutside.sdk.FlowPlayControl;
/**
* 适配爱趣听的window
@@ -54,7 +58,19 @@ public class MediaWindow2 implements IMusicView {
mPresenter = new WeCarFlowPresenter(this);
mPresenter.init(context);
isFirstPlay = true;
if(DebugConfig.isLauncher()) {
AIAssist.getInstance(context).registerUnWakeupCommand("flow_we_car_stop", new String[]{"停止播放", "暂停播放"}, new IMogoVoiceCmdCallBack() {
@Override
public void onCmdSelected(String cmd) {
// 简单添加暂停播放全局免唤醒词
if ("flow_we_car_stop".equals(cmd)) {
FlowPlayControl.getInstance().doPause();
}
}
});
}
isFirstPlay = true;
}
private void addWindowView() {

View File

@@ -9,6 +9,9 @@ import com.mogo.module.media.utils.MusicControlBroadCast;
import com.mogo.utils.ActivityLifecycleManager;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import com.tencent.wecarflow.flowoutside.sdk.FlowPlayControl;
import io.reactivex.processors.FlowableProcessor;
/**
* 我要听{歌手/歌名}
@@ -35,30 +38,32 @@ public class MediaSpeechReceiver extends BroadcastReceiver {
//我要听{歌手/歌名}
Logger.d("MediaSpeechReceiver"," "+"type qq ");
String musicModel = intent.getStringExtra("music_model");
if (appActive){
MusicControlBroadCast.playSomeBodyMusic(musicModel);
MusicControlBroadCast.mediaCenterBroadcast();
}else {
MusicControlBroadCast.playSomeBodyMusic(musicModel);
UiThreadHandler.postDelayed(new Runnable() {
@Override
public void run() {
MusicControlBroadCast.qqOpenQQMusic();
}
},300);
}
FlowPlayControl.getInstance().semanticSearch(context, "launcher", musicModel);
// if (appActive){
// MusicControlBroadCast.playSomeBodyMusic(musicModel);
// MusicControlBroadCast.mediaCenterBroadcast();
// }else {
// MusicControlBroadCast.playSomeBodyMusic(musicModel);
// UiThreadHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// MusicControlBroadCast.qqOpenQQMusic();
// }
// },300);
// }
}else if (cmdAction.equals("com.zhidao.speech.awake.notify")){
//播放音乐
String musicCmd = intent.getStringExtra("command");
Logger.d("MediaSpeechReceiver"," "+"qq book"+musicCmd==null?"":musicCmd);
if (musicCmd.equals("com.ileja.music.playapp")){
//QQ音乐
if (appActive){
MusicControlBroadCast.qqPlayQQMusic();
MusicControlBroadCast.mediaCenterBroadcast();
}else{
MusicControlBroadCast.qqOpenQQMusic();
}
FlowPlayControl.getInstance().doPlay();
// if (appActive){
// MusicControlBroadCast.qqPlayQQMusic();
// MusicControlBroadCast.mediaCenterBroadcast();
// }else{
// MusicControlBroadCast.qqOpenQQMusic();
// }
}else if (musicCmd.equals("com.zhidao.book.play")){
//懒人听书
if (appActive){

View File

@@ -16,6 +16,7 @@ import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerResponse;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
@@ -110,6 +111,20 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( !result ) {
return false;
}
Map< String, Object > properties = new HashMap<>();
if ( marker.getObject() instanceof MarkerShowEntity ) {
properties.put( "sn", getCarSnFromMarker( marker ) );
if ( ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() instanceof MarkerExploreWay ) {
MarkerExploreWay exploreWay = ( MarkerExploreWay ) ( ( MarkerShowEntity ) marker.getObject() ).getBindObj();
properties.put( "dbid", exploreWay.getInfoId() );
properties.put( "type", exploreWay.getPoiType() );
} else if ( ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() instanceof MarkerOnlineCar ) {
properties.put( "type", "10000" );
}
}
MarkerServiceHandler.getMogoAnalytics().track( "v2x_road_click", properties );
} catch ( Exception e ) {
e.printStackTrace();
}
@@ -479,12 +494,38 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( markerCardResult == null ) {
return;
}
JSONArray array = new JSONArray();
List< MarkerExploreWay > exploreWayList = markerCardResult.getExploreWay();
JSONArray array = new JSONArray();
int size = 0;
size = exploreWayList == null ? 0 : exploreWayList.size();
fillPoiTypeTrackBody( array, ModuleNames.CARD_TYPE_ROAD_CONDITION, size );
final Map< String, Integer > typeCounterMap = new HashMap<>();
for ( int i = 0; i < size; i++ ) {
MarkerExploreWay exploreWay = exploreWayList.get( i );
String poiType = exploreWay.getPoiType();
int counter = 0;
if ( !typeCounterMap.containsKey( poiType ) ) {
counter = 0;
} else {
counter = typeCounterMap.get( poiType );
}
typeCounterMap.put( poiType, counter + 1 );
}
if ( !typeCounterMap.isEmpty() ) {
for ( Map.Entry< String, Integer > entry : typeCounterMap.entrySet() ) {
if ( entry == null || entry.getKey() == null ) {
continue;
}
JSONObject object = new JSONObject();
try {
object.put( "type", entry.getKey() );
object.put( "num", entry.getValue() );
array.put( object );
} catch ( JSONException e ) {
e.printStackTrace();
}
}
}
try {
if ( array.length() == 0 ) {
@@ -492,7 +533,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
final Map< String, Object > properties = new HashMap<>();
properties.put( "data", array.toString() );
MarkerServiceHandler.getMogoAnalytics().track( "Launcher_Data_Get", properties );
MarkerServiceHandler.getMogoAnalytics().track( "v2x_data_get", properties );
} catch ( Exception e ) {
e.printStackTrace();
}
@@ -650,6 +691,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
int limit,
int radius ) {
if ( latLng == null ) {
return;
}
if ( ignoreOnlineCarRequest() ) {
removeCarMarkers();
return;
@@ -668,14 +713,31 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
return;
}
int size = onlineCarList == null ? 0 : onlineCarList.size();
trackData( size );
runOnTargetThread( () -> {
drawOnlineCarMarkers( onlineCarList, Integer.MAX_VALUE );
} );
}
@Override
public void onFail() {
private void trackData( int size ) {
JSONArray array = new JSONArray();
JSONObject object = new JSONObject();
try {
object.put( "type", "10000" );
object.put( "num", size );
array.put( object );
} catch ( JSONException e ) {
e.printStackTrace();
}
if ( array.length() == 0 ) {
return;
}
final Map< String, Object > properties = new HashMap<>();
properties.put( "data", array.toString() );
MarkerServiceHandler.getMogoAnalytics().track( "v2x_data_get", properties );
}
} );
}

View File

@@ -10,5 +10,5 @@ public interface RefreshCallback <T> {
void onSuccess(T o);
void onFail();
default void onFail(){}
}

View File

@@ -101,55 +101,6 @@ public class RefreshModel {
}
}
/**
* 查询在线车辆
*
* @param latLng 经纬度
* @param radius 半径
* @param onlyFocus 是否仅查询已关注的好友
* @param onlySameCity 是否仅查询注册城市相同的同城用户
* @param callback
*/
public void queryOnLineCar( MogoLatLng latLng,
int radius,
boolean onlyFocus,
boolean onlySameCity,
final RefreshCallback callback ) {
if ( mRefreshApiService != null ) {
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
final RefreshBody refreshBody = new RefreshBody();
refreshBody.limit = 100;
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
refreshBody.radius = radius;
refreshBody.onlyFocus = onlyFocus;
refreshBody.onlySameCity = onlySameCity;
refreshBody.dataType.add( ServiceConst.CARD_TYPE_USER_DATA );
query.put( "data", GsonUtil.jsonFromObject( refreshBody ) );
mRefreshApiService.refreshData( query )
.subscribeOn( Schedulers.io() )
.observeOn( AndroidSchedulers.mainThread() )
.subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( mContext ) ) {
@Override
public void onSuccess( BaseData o ) {
super.onSuccess( o );
if ( callback != null ) {
callback.onSuccess( o );
}
}
@Override
public void onError( String message, int code ) {
super.onError( message, code );
if ( callback != null ) {
callback.onFail();
}
}
} );
}
}
/**
* 查询车辆 及路线
*
@@ -171,6 +122,7 @@ public class RefreshModel {
if ( limit > 0 ) {
refreshBody.limit = limit;
}
refreshBody.radius = radius;
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
refreshBody.onlyFocus = onlyFocus;
refreshBody.onlySameCity = onlySameCity;

View File

@@ -67,8 +67,8 @@ public class MogoADASController implements IMogoADASController {
Logger.d( TAG, "show adas" );
if ( !isProcessRunning( AbsMogoApplication.getApp(), getPackageUid( AbsMogoApplication.getApp(), "com.zhidiao.autopilot" ) ) ) {
init( AbsMogoApplication.getApp() );
}
init( AbsMogoApplication.getApp() );
if ( mStatusManager.isSearchUIShow() ) {
return;

View File

@@ -6,7 +6,7 @@
./gradlew :services:mogo-service-api:clean :services:mogo-service-api:uploadArchives
./gradlew :foudations:mogo-connection:clean :foudations:mogo-connection:uploadArchives
./gradlew :libraries:map-amap:clean :libraries:map-amap:uploadArchives
./gradlew :libraries:map-autommap:clean :libraries:map-autommap:uploadArchives
./gradlew :libraries:map-autonavi:clean :libraries:map-autonavi:uploadArchives
./gradlew :libraries:mogo-map:clean :libraries:mogo-map:uploadArchives
./gradlew :services:mogo-service:clean :services:mogo-service:uploadArchives
./gradlew :modules:mogo-module-common:clean :modules:mogo-module-common:uploadArchives
@@ -18,8 +18,9 @@
./gradlew :modules:mogo-module-extensions:clean :modules:mogo-module-extensions:uploadArchives
./gradlew :modules:mogo-module-gps-simulator:clean :modules:mogo-module-gps-simulator:uploadArchives
./gradlew :modules:mogo-module-search:clean :modules:mogo-module-search:uploadArchives
./gradlew :modules:mogo-module-main:clean :modules:mogo-module-main:uploadArchives
./gradlew :modules:mogo-module-media:clean :modules:mogo-module-media:uploadArchives
./gradlew :modules:mogo-module-back:clean :modules:mogo-module-back:uploadArchives
./gradlew :modules:mogo-module-main:clean :modules:mogo-module-main:uploadArchives
./gradlew :modules:mogo-module-guide:clean :modules:mogo-module-guide:uploadArchives
./gradlew :modules:mogo-module-gps-simulator-debug:clean :modules:mogo-module-gps-simulator-debug:uploadArchives
./gradlew :modules:mogo-module-gps-simulator-noop:clean :modules:mogo-module-gps-simulator-noop:uploadArchives