This commit is contained in:
wangcongtao
2020-07-15 11:48:23 +08:00
296 changed files with 213 additions and 4842 deletions

View File

@@ -1,6 +1,7 @@
package com.mogo.module.apps;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
@@ -30,7 +31,7 @@ public class AppsListActivity extends MvpActivity< AppsListView, AppsListPresent
private BottomSheetBehavior mBottomSheetBehavior;
private IMogoFragmentManager mMogoFragmentManager;
public static void start( Activity context ) {
public static void start( Context context ) {
Intent starter = new Intent( context, AppsListActivity.class );
context.startActivity( starter );
}

View File

@@ -1,17 +1,15 @@
package com.mogo.module.apps;
import android.text.TextUtils;
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.module.apps.applaunch.AppLaunchFilter;
import com.mogo.module.apps.applaunch.AppLauncher;
import com.mogo.module.apps.applaunch.CardAppLauncher;
import com.mogo.module.apps.applaunch.GuideShowLauncher;
import com.mogo.module.apps.applaunch.InternalFunctionLauncher;
import com.mogo.module.apps.model.AppInfo;
import com.mogo.module.apps.model.AppsModel;
import com.mogo.module.apps.model.UnScannedApps;
@@ -24,7 +22,6 @@ import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import java.sql.ClientInfoStatus;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -54,11 +51,13 @@ public class AppsPresenter extends Presenter< AppsView > {
super( view );
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
mCardManager = mApis.getCardManagerApi();
InternalFunctionLauncher internalFunctionLauncher = new InternalFunctionLauncher( getContext() );
CardAppLauncher cardAppLauncher = new CardAppLauncher( this, mCardManager );
GuideShowLauncher guideShowLauncher = new GuideShowLauncher( mApis.getMapServiceApi().getNavi( getContext() ) );
internalFunctionLauncher.setNext( cardAppLauncher );
cardAppLauncher.setNext( guideShowLauncher );
guideShowLauncher.setNext( new AppLauncher() );
mLauncher = cardAppLauncher;
mLauncher = internalFunctionLauncher;
}
@Override
@@ -130,7 +129,7 @@ public class AppsPresenter extends Presenter< AppsView > {
if ( appInfo == null ) {
continue;
}
if ( TextUtils.equals( appInfo.getPackageName(), app.getPackageName() ) ) {
if ( appInfo.equals( app ) ) {
addFlag = false;
break;
}
@@ -145,14 +144,6 @@ public class AppsPresenter extends Presenter< AppsView > {
}
}
}
// 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() ) {
// 添加测试入口
growthCapacity( result );
result.get( result.size() - 1 ).add( new AppInfo( "包管理程序", "com.mogo.packages.manager", null, 0, null, -1 ) );
}
return result;
}

View File

@@ -1,27 +1,29 @@
package com.mogo.module.apps.applaunch;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.mogo.module.apps.AppServiceHandler;
import com.mogo.module.apps.AppsListActivity;
import com.mogo.module.apps.model.AppInfo;
import com.mogo.module.common.map.CustomNaviInterrupter;
import com.mogo.utils.LaunchUtils;
import com.mogo.utils.TipToast;
/**
* @author congtaowang
* @since 2020-05-14
* <p>
* 描述
* 处理一些特殊的跳转
*/
public class InternalFunctionLauncher extends BaseAppLauncher {
private Activity mActivity;
private Context mContext;
public InternalFunctionLauncher( Activity activity ) {
this.mActivity = activity;
public InternalFunctionLauncher( Context activity ) {
this.mContext = activity;
}
@Override
@@ -39,7 +41,14 @@ public class InternalFunctionLauncher extends BaseAppLauncher {
}
break;
case "com.mogo.launcher.applist":
AppsListActivity.start( mActivity );
AppsListActivity.start( mContext );
break;
case "com.zhidao.bluetooth":
if ( TextUtils.equals( "蓝牙音乐", appInfo.getName() ) ) {
startActivity( context, appInfo, "com.zhidao.bluetooth.ui.MusicActivity" );
} else if ( TextUtils.equals( "蓝牙电话", appInfo.getName() ) ) {
startActivity( context, appInfo, "com.zhidao.bluetooth.ui.MainActivity" );
}
break;
default:
if ( getNext() != null ) {
@@ -48,6 +57,26 @@ public class InternalFunctionLauncher extends BaseAppLauncher {
}
}
private void startActivity( Context context, AppInfo target, String page ) {
if ( context == null || target == null ) {
return;
}
if ( TextUtils.isEmpty( page ) ) {
if ( getNext() != null ) {
getNext().launch( context, target );
return;
}
}
try {
Intent intent = new Intent();
intent.setComponent( new ComponentName( target.getPackageName(), page ) );
intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
context.startActivity( intent );
} catch ( Exception e ) {
TipToast.shortTip( "APP未安装" );
}
}
@Override
public void destroy() {
if ( getNext() != null ) {

View File

@@ -86,7 +86,8 @@ public enum AppEnum {
CanBus( "车辆信息", "com.nwd.can.setting", R.drawable.module_apps_ic_canbus ),
// 蓝牙电话
BT_PHONE( "蓝牙电话", "com.nwd.android.phone", R.drawable.module_apps_ic_bt_phone ),
BT_PHONE_NWD( "蓝牙电话", "com.nwd.android.phone", R.drawable.module_apps_ic_bt_phone ),
BT_PHONE( "蓝牙电话", "com.zhidao.bluetooth", R.drawable.module_apps_ic_bt_phone ),
// 本地音乐
LOCAL_MUSIC( "本地音乐", "com.nwd.android.music.ui", R.drawable.module_apps_ic_local_music ),
@@ -95,7 +96,8 @@ public enum AppEnum {
WEATHER( "天气", "com.zhidao.weather", R.drawable.module_apps_ic_weather ),
// 蓝牙音乐
BT_MUSIC( "蓝牙音乐", "com.nwd.bt.music", R.drawable.module_apps_ic_bt_music ),
BT_MUSIC_NWD( "蓝牙音乐", "com.nwd.bt.music", R.drawable.module_apps_ic_bt_music ),
BT_MUSIC( "蓝牙音乐", "com.zhidao.bluetooth", R.drawable.module_apps_ic_bt_music ),
// 高德地图
AUTO_NAVI( "高德地图", "com.autonavi.amapauto", R.drawable.module_apps_ic_auto_navi ),

View File

@@ -68,7 +68,8 @@ public class AppInfo {
if ( this == o ) return true;
if ( o == null || getClass() != o.getClass() ) return false;
AppInfo appInfo = ( AppInfo ) o;
return TextUtils.equals( mPackageName, appInfo.mPackageName );
return TextUtils.equals( mPackageName, appInfo.mPackageName )
&& TextUtils.equals( mName, appInfo.mName );
}
@Override

View File

@@ -1,5 +1,7 @@
package com.mogo.module.apps.model;
import com.mogo.module.common.utils.CarSeries;
import java.util.ArrayList;
import java.util.List;
@@ -14,11 +16,17 @@ 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() ) );
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
sUnScannedApps.add( new AppInfo( AppEnum.BT_PHONE.getName(), AppEnum.BT_PHONE.getPkg(), null, 0, null, AppEnum.BT_PHONE.getIconResId() ) );
sUnScannedApps.add( new AppInfo( AppEnum.BT_MUSIC.getName(), AppEnum.BT_MUSIC.getPkg(), null, 0, null, AppEnum.BT_PHONE.getIconResId() ) );
} else {
sUnScannedApps.add( new AppInfo( AppEnum.BT_PHONE_NWD.getName(), AppEnum.BT_PHONE_NWD.getPkg(), null, 0, null, AppEnum.BT_PHONE_NWD.getIconResId() ) );
}
sUnScannedApps.add( new AppInfo( AppEnum.CanBus.getName(), AppEnum.CanBus.getPkg(), null, 0, null, AppEnum.CanBus.getIconResId() ) );
}
public static List< AppInfo > getUnScannedApps() {
return sUnScannedApps;
}
}

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_search_fragment_padding" >32px</dimen>
<dimen name="module_search_fragment_padding_top">32px</dimen>
<dimen name="module_search_et_width">640px</dimen>
<dimen name="module_search_et_hight">64px</dimen>
<dimen name="module_search_iv_back_hight">42px</dimen>
<dimen name="module_search_iv_back_margin_left">12px</dimen>
<dimen name="module_search_iv_back_margin_right">10px</dimen>
<dimen name="module_search_et_margin_right">30px</dimen>
<dimen name="module_search_et_text_size">22px</dimen>
<dimen name="module_search_btn_width">142px</dimen>
<dimen name="module_search_btn_right_margin">4px</dimen>
<dimen name="module_search_txt_big">22px</dimen>
<dimen name="module_search_btn_height">55.5px</dimen>
<dimen name="module_search_navi_home_width">304px</dimen>
<dimen name="module_search_navi_home_height">64px</dimen>
<dimen name="module_search_navi_home_margin_left">16px</dimen>
<dimen name="txt_normal">18px</dimen>
<dimen name="module_search_dp_72">38px</dimen>
<dimen name="module_search_dp_75">75px</dimen>
<dimen name="module_search_navi_home_padding_left">40px</dimen>
<dimen name="module_search_dp_778">410px</dimen>
<dimen name="module_search_dp_1200">640px</dimen>
<dimen name="module_search_dp_32">16px</dimen>
<dimen name="module_search_dp_40">20px</dimen>
<dimen name="module_search_dp_60">30px</dimen>
<dimen name="module_search_dp_37">20px</dimen>
<dimen name="txt_large">28px</dimen>
<dimen name="module_search_dp_268">144px</dimen>
<dimen name="module_search_dp_236">126px</dimen>
<dimen name="module_search_dp_180">96px</dimen>
<dimen name="module_search_dp_80">42px</dimen>
<dimen name="module_search_dp_70">38px</dimen>
<dimen name="module_search_25sp">28px</dimen>
<dimen name="module_search_dp_42">23px</dimen>
<dimen name="module_search_dp_160">96px</dimen>
<dimen name="module_search_dp_150">69px</dimen>
<dimen name="module_search_180dp">192px</dimen>
<dimen name="module_search_dp_120">64px</dimen>
<dimen name="module_search_txt_setting_width">24px</dimen>
<dimen name="module_search_dp_838">446px</dimen>
<dimen name="module_search_category_margin_bottom">83px</dimen>
<dimen name="module_search_dp_104">56px</dimen>
<dimen name="module_search_strategy_name_width" >100px</dimen>
<dimen name="module_search_marker_number_textSize">18px</dimen>
<dimen name="module_search_choose_path_item_height">111px</dimen>
<dimen name="module_search_calculate_item_strategy_name_textSize">16px</dimen>
<dimen name="module_search_calculate_item_strategy_name_marginLeft">20px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingLeft">12px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingRight">12px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingTop">2px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingBottom">2px</dimen>
<dimen name="module_search_calculate_item_strategy_time_textSize">22px</dimen>
<dimen name="module_search_calculate_item_strategy_time_marginTop">3px</dimen>
<dimen name="module_search_calculate_item_strategy_divider_marginLeft">16px</dimen>
<dimen name="module_search_calculate_item_strategy_desc_textSize">16px</dimen>
<dimen name="module_search_calculate_item_strategy_desc_marginTop">2px</dimen>
<dimen name="module_search_search_padding">32px</dimen>
<dimen name="module_search_search_paddingTop">34px</dimen>
<dimen name="module_search_search_result_marginTop">16px</dimen>
<dimen name="module_search_start_button">20px</dimen>
</resources>

View File

@@ -1,66 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="txt_normal">18px</dimen>
<dimen name="txt_normal">@dimen/sp_32</dimen>
<dimen name="fragment_left_margin">@dimen/dp_60</dimen>
<dimen name="txt_title">@dimen/sp_40</dimen>
<dimen name="txt_large">28px</dimen>
<dimen name="module_search_fragment_padding" >32px</dimen>
<dimen name="module_search_fragment_padding_top">32px</dimen>
<dimen name="module_search_et_width">640px</dimen>
<dimen name="module_search_et_hight">64px</dimen>
<dimen name="module_search_iv_back_hight">42px</dimen>
<dimen name="module_search_iv_back_margin_left">12px</dimen>
<dimen name="module_search_iv_back_margin_right">10px</dimen>
<dimen name="module_search_et_margin_right">30px</dimen>
<dimen name="module_search_et_text_size">22px</dimen>
<dimen name="module_search_btn_width">142px</dimen>
<dimen name="module_search_btn_right_margin">4px</dimen>
<dimen name="module_search_txt_big">22px</dimen>
<dimen name="module_search_btn_height">55.5px</dimen>
<dimen name="module_search_navi_home_width">304px</dimen>
<dimen name="module_search_navi_home_height">64px</dimen>
<dimen name="module_search_navi_home_margin_left">16px</dimen>
<dimen name="module_search_dp_72">38px</dimen>
<dimen name="txt_large">25sp</dimen>
<dimen name="module_search_fragment_padding">@dimen/dp_60</dimen>
<dimen name="module_search_fragment_padding_top">@dimen/dp_40</dimen>
<dimen name="module_search_et_width">600dp</dimen>
<dimen name="module_search_et_hight">@dimen/dp_120</dimen>
<dimen name="module_search_iv_back_hight">@dimen/dp_80</dimen>
<dimen name="module_search_iv_back_margin_left">@dimen/dp_24</dimen>
<dimen name="module_search_iv_back_margin_right">@dimen/dp_20</dimen>
<dimen name="module_search_et_margin_right">@dimen/dp_50</dimen>
<dimen name="module_search_et_text_size">40px</dimen>
<dimen name="module_search_btn_width">266px</dimen>
<dimen name="module_search_btn_right_margin">8px</dimen>
<dimen name="module_search_txt_big">40px</dimen>
<dimen name="module_search_btn_height">104px</dimen>
<dimen name="module_search_navi_home_width">568px</dimen>
<dimen name="module_search_navi_home_height">120px</dimen>
<dimen name="module_search_navi_home_margin_left">32px</dimen>
<dimen name="module_search_navi_home_padding_left">75px</dimen>
<dimen name="module_search_dp_72">72px</dimen>
<dimen name="module_search_dp_75">75px</dimen>
<dimen name="module_search_navi_home_padding_left">40px</dimen>
<dimen name="module_search_dp_778">410px</dimen>
<dimen name="module_search_dp_1200">640px</dimen>
<dimen name="module_search_dp_32">16px</dimen>
<dimen name="module_search_dp_40">20px</dimen>
<dimen name="module_search_dp_60">30px</dimen>
<dimen name="module_search_dp_37">20px</dimen>
<dimen name="module_search_dp_268">144px</dimen>
<dimen name="module_search_dp_236">126px</dimen>
<dimen name="module_search_dp_180">96px</dimen>
<dimen name="module_search_dp_80">42px</dimen>
<dimen name="module_search_dp_70">38px</dimen>
<dimen name="module_search_25sp">28px</dimen>
<dimen name="module_search_dp_42">23px</dimen>
<dimen name="module_search_dp_160">96px</dimen>
<dimen name="module_search_dp_150">69px</dimen>
<dimen name="module_search_180dp">192px</dimen>
<dimen name="module_search_dp_120">64px</dimen>
<dimen name="module_search_txt_setting_width">24px</dimen>
<dimen name="module_search_dp_838">446px</dimen>
<dimen name="module_search_category_margin_bottom">83px</dimen>
<dimen name="module_search_dp_104">56px</dimen>
<dimen name="module_search_strategy_name_width" >100px</dimen>
<dimen name="module_search_marker_number_textSize">18px</dimen>
<dimen name="module_search_choose_path_item_height">111px</dimen>
<dimen name="module_search_calculate_item_strategy_name_textSize">16px</dimen>
<dimen name="module_search_calculate_item_strategy_name_marginLeft">20px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingLeft">12px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingRight">12px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingTop">2px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingBottom">2px</dimen>
<dimen name="module_search_calculate_item_strategy_time_textSize">22px</dimen>
<dimen name="module_search_calculate_item_strategy_time_marginTop">3px</dimen>
<dimen name="module_search_calculate_item_strategy_divider_marginLeft">16px</dimen>
<dimen name="module_search_calculate_item_strategy_desc_textSize">16px</dimen>
<dimen name="module_search_calculate_item_strategy_desc_marginTop">2px</dimen>
<dimen name="module_search_search_padding">32px</dimen>
<dimen name="module_search_search_paddingTop">34px</dimen>
<dimen name="module_search_search_result_marginTop">16px</dimen>
<dimen name="module_search_start_button">20px</dimen>
<dimen name="module_search_dp_778">778px</dimen>
<dimen name="module_search_dp_1200">1200px</dimen>
<dimen name="module_search_dp_32">32px</dimen>
<dimen name="module_search_dp_40">40px</dimen>
<dimen name="module_search_dp_60">60px</dimen>
<dimen name="module_search_dp_37">37px</dimen>
<dimen name="module_search_dp_268">268px</dimen>
<dimen name="module_search_dp_236">236px</dimen>
<dimen name="module_search_dp_180">180px</dimen>
<dimen name="module_search_dp_80">80px</dimen>
<dimen name="module_search_dp_70">70px</dimen>
<dimen name="module_search_25sp">25sp</dimen>
<dimen name="module_search_dp_42">42px</dimen>
<dimen name="module_search_dp_160">160px</dimen>
<dimen name="module_search_dp_150">150px</dimen>
<dimen name="module_search_180dp">180dp</dimen>
<dimen name="module_search_dp_120">120px</dimen>
<dimen name="module_search_txt_setting_width">45px</dimen>
<dimen name="module_search_dp_838">838px</dimen>
<dimen name="module_search_category_margin_bottom">142px</dimen>
<dimen name="module_search_dp_104">104px</dimen>
<dimen name="module_search_strategy_name_width" >154px</dimen>
<dimen name="module_search_marker_number_textSize">32px</dimen>
<dimen name="module_search_choose_path_item_height">212px</dimen>
<dimen name="module_search_calculate_item_strategy_name_textSize">26px</dimen>
<dimen name="module_search_calculate_item_strategy_name_marginLeft">40px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingLeft">20px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingRight">20px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingTop">3px</dimen>
<dimen name="module_search_calculate_item_strategy_name_paddingBottom">3px</dimen>
<dimen name="module_search_calculate_item_strategy_time_textSize">48px</dimen>
<dimen name="module_search_calculate_item_strategy_time_marginTop">14px</dimen>
<dimen name="module_search_calculate_item_strategy_divider_marginLeft">36px</dimen>
<dimen name="module_search_calculate_item_strategy_desc_textSize">30px</dimen>
<dimen name="module_search_calculate_item_strategy_desc_marginTop">3px</dimen>
<dimen name="module_search_search_padding">60px</dimen>
<dimen name="module_search_search_paddingTop">40px</dimen>
<dimen name="module_search_search_result_marginTop">32px</dimen>
<dimen name="module_search_start_button">40px</dimen>
</resources>

View File

@@ -715,9 +715,11 @@ public class MogoServices implements IMogoMapListener,
if ( isTrue ) {
mADASController.showADAS();
refreshStrategy();
MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).stop();
} else {
try {
MarkerServiceHandler.getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers();
MarkerServiceHandler.getApis().getMapServiceApi().getSingletonLocationClient( mContext ).start();
} catch ( Exception e ) {
Logger.e( TAG, e, "error." );
}