add product manager

This commit is contained in:
wangcongtao
2020-05-21 14:49:30 +08:00
parent 9c7042246c
commit e1a83c6b8f
35 changed files with 360 additions and 353 deletions

View File

@@ -188,10 +188,25 @@ dependencies {
}
}
//android.applicationVariants.all { variant ->
// variant.outputs.all { //这里修改apk文件名
// outputFileName = "Launcher2.0_V${android.defaultConfig.versionName}_${getCurrentDate()}_${variant.name}_${getGitCommit()}.apk"
// println outputFileName
// }
//}
android.applicationVariants.all { variant ->
variant.outputs.all { //这里修改apk文件名
outputFileName = "Launcher2.0_V${android.defaultConfig.versionName}_${getCurrentDate()}_${variant.name}_${getGitCommit()}.apk"
println outputFileName
def buildTime = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08:00"))
def flavor = variant.productFlavors.collect { it.name }.join('-')
variant.outputs.all { output ->
outputFileName = [
rootProject.applicationName,
"v${variant.versionName}",
buildTime,
flavor.length() > 0 ? "[${flavor}]" : "",
variant.buildType.name
].findAll { it.length() > 0 }.join('_') << ".apk"
}
}

View File

@@ -55,7 +55,7 @@ public class MogoApplication extends AbsMogoApplication {
MogoModulePaths.addModule(new MogoModule(AdCardConstants.TAG, AdCardConstants.MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
// MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, TanluConstants.MODEL_NAME));
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, OnLineCarConstants.MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(V2XConst.PATH_V2X_UI, V2XConst.PATH_V2X_UI));

View File

@@ -72,4 +72,10 @@ MOGO_MODULE_MEDIA_VERSION=1.0.4.3
# 推送
MOGO_MODULE_PUSH_VERSION=1.0.1
# 广告资源位
MOGO_MODULE_AD_CARD_VERSION=1.0.1
MOGO_MODULE_AD_CARD_VERSION=1.0.1
## 产品库必备配置
applicationId=com.mogo.launcer
applicationName=Launcer2.0
appVersionCode=1
appVersionName=1.0.0

View File

@@ -17,7 +17,6 @@ import android.view.animation.Interpolator;
import com.amap.api.maps.AMap;
import com.amap.api.maps.AMapUtils;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.LocationSource;
import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.CameraPosition;
import com.amap.api.maps.model.LatLng;

View File

@@ -50,7 +50,7 @@ public class AppsFragment extends MvpFragment< AppsView, AppsPresenter > impleme
mExit.setOnClickListener( view -> {
if ( getActivity() != null ) {
getActivity().finish();
getActivity().overridePendingTransition( R.anim.module_apps_anim_enter, R.anim.module_apps_anim_exit);
getActivity().overridePendingTransition( 0, R.anim.module_apps_anim_exit);
}
} );
// mAppsList = findViewById( R.id.module_apps_id_apps );

View File

@@ -2,9 +2,11 @@ package com.mogo.module.apps;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
@@ -27,7 +29,12 @@ public class AppsListActivity extends MvpActivity< AppsListView, AppsListPresent
public static void start( Activity context ) {
Intent starter = new Intent( context, AppsListActivity.class );
context.startActivity( starter );
context.overridePendingTransition( R.anim.module_apps_anim_enter, R.anim.module_apps_anim_exit);
}
@Override
protected void onCreate( @Nullable Bundle savedInstanceState ) {
overridePendingTransition( R.anim.module_apps_anim_enter, 0);
super.onCreate( savedInstanceState );
}
@Override

View File

@@ -14,6 +14,7 @@ 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 );
@@ -29,6 +30,7 @@ public class NavigatorApps {
public static List< AppInfo > getAppsWithoutNavigation() {
List< AppInfo > sApps = new ArrayList<>();
sApps.add( app_ );
sApps.add( app2 );
sApps.add( app3 );
sApps.add( app4 );

View File

@@ -4,7 +4,9 @@ package com.mogo.module.apps.receiver;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.mogo.module.apps.AppServiceHandler;
import com.mogo.module.apps.model.AppsModel;
public class AppInstallReceiver extends BroadcastReceiver {
@@ -14,6 +16,9 @@ public class AppInstallReceiver extends BroadcastReceiver {
if ( intent.getAction().equals( Intent.ACTION_PACKAGE_ADDED ) ) {
String packageName = intent.getData().getSchemeSpecificPart();
AppsModel.getInstance( context ).appAdded( packageName );
if ( TextUtils.equals( packageName, "com.zhidao.autopilot" ) ) {
AppServiceHandler.getApis().getAdasControllerApi().showADAS();
}
}
if ( intent.getAction().equals( Intent.ACTION_PACKAGE_REMOVED ) ) {
String packageName = intent.getData().getSchemeSpecificPart();
@@ -21,6 +26,9 @@ public class AppInstallReceiver extends BroadcastReceiver {
}
if ( intent.getAction().equals( Intent.ACTION_PACKAGE_REPLACED ) ) {
String packageName = intent.getData().getSchemeSpecificPart();
if ( TextUtils.equals( packageName, "com.zhidao.autopilot" ) ) {
AppServiceHandler.getApis().getAdasControllerApi().showADAS();
}
}
if ( intent.getAction().equals( Intent.ACTION_PACKAGE_CHANGED ) ) {
String packageName = intent.getData().getSchemeSpecificPart();

View File

@@ -21,9 +21,9 @@
<dimen name="module_apps_all_icon_width">50px</dimen>
<dimen name="module_apps_all_icon_height">50px</dimen>
<dimen name="module_apps_navigator_icon_width">140px</dimen>
<dimen name="module_apps_navigator_icon_height">140px</dimen>
<dimen name="module_apps_navigator_icon_divider">30px</dimen>
<dimen name="module_apps_voice_icon_width">64px</dimen>
<dimen name="module_apps_voice_icon_height">64px</dimen>
<dimen name="module_apps_navigator_icon_width">78px</dimen>
<dimen name="module_apps_navigator_icon_height">78px</dimen>
<dimen name="module_apps_navigator_icon_divider">16px</dimen>
<dimen name="module_apps_voice_icon_width">78px</dimen>
<dimen name="module_apps_voice_icon_height">78px</dimen>
</resources>

View File

@@ -72,7 +72,11 @@ public class BackToMainHomeManager {
params.x = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_left );
params.y = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_top );
params.gravity = Gravity.LEFT | Gravity.CENTER;
params.type = getFitWindowParamsType();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
} else {
params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
}
params.format = PixelFormat.RGBA_8888;
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
windowManager.addView( mBackView, params );
@@ -83,18 +87,4 @@ public class BackToMainHomeManager {
WindowManagerViewHelper.removeView( mBackView );
}
private static int getFitWindowParamsType() {
int type;
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 ) {
// Need request permission.
type = WindowManager.LayoutParams.TYPE_PHONE;
} else if ( Build.MODEL.equalsIgnoreCase( "MI 5" ) ) {
// MI 5 phone not display crawler dot in android 7.0
type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
} else {
// It's will be dismissed automatically 3s after showing in Android 25.
type = WindowManager.LayoutParams.TYPE_TOAST;
}
return type;
}
}

View File

@@ -9,11 +9,12 @@ public class MarkerCardResult implements Serializable {
private List<String> dataType; // 要查询的类型
private List<MarkerCarChat> carChat;
private List<MarkerExploreWay> exploreWay;
private List<MarkerOnlineCar> onlineCar;
private List<MarkerShareMusic> shareMusic;
private List<MarkerNoveltyInfo> noveltyInfo;
private List<MarkerOnlineCar> onlineCar;
private List<MarkerExploreWay> exploreWay;
public List<MarkerCarChat> getCarChat() {
return carChat;
}

View File

@@ -9,6 +9,7 @@ import java.util.List;
@SuppressWarnings("unused")
public class MarkerExploreWay implements Serializable {
private String infoId;
private String type;//卡片类型,
private String sn;
private MarkerLocation location;//位置信息
@@ -20,6 +21,7 @@ public class MarkerExploreWay implements Serializable {
private String cityName;//:"城市名称",
private double distance;//距离
private MarkerUserInfo userInfo;//用户信息
private String poiType;
private List<MarkerExploreWayItem> items;//视频地址和图片地址
public String getAddr() {
@@ -121,6 +123,20 @@ public class MarkerExploreWay implements Serializable {
this.userInfo = userInfo;
}
public String getPoiType() {
return poiType;
}
public String getInfoId() {
return infoId;
}
public MarkerExploreWay setInfoId( String infoId ) {
this.infoId = infoId;
return this;
}
@Override
public String toString() {
return "MarkerExploreWay{" +

View File

@@ -36,4 +36,6 @@ public interface MarkerPoiTypeEnum {
public String FOURS_ACCIDENT = "10013";
//身边
public String FOURS_NEALY = "10014";
//实时路况
public String FOURS_LIVING = "10015";
}

View File

@@ -50,6 +50,7 @@ import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.Logger;
import java.util.HashMap;
@@ -162,6 +163,17 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
private Rect mDisplayOverviewBounds;
private Runnable mLockCarRunnable = new Runnable() {
@Override
public void run() {
if ( !mStatusManager.isDisplayOverview() ) {
return;
}
mStatusManager.setDisplayOverview( TAG, false );
mMApUIController.recoverLockMode();
}
};
@Override
protected int getLayoutId() {
return R.layout.module_ext_layout_entrance;
@@ -197,8 +209,11 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mDisplayOverview.setOnClickListener( view -> {
if ( !mStatusManager.isDisplayOverview() ) {
mMApUIController.displayOverview( mDisplayOverviewBounds );
UiThreadHandler.removeCallbacks( mLockCarRunnable );
UiThreadHandler.postDelayed( mLockCarRunnable, 20_000 );
} else {
mMApUIController.recoverLockMode();
UiThreadHandler.removeCallbacks( mLockCarRunnable );
}
mStatusManager.setDisplayOverview( TAG, !mStatusManager.isDisplayOverview() );
} );
@@ -212,6 +227,10 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
mMApUIController.setLockZoom( 16 );
mMApUIController.changeZoom( 16.0f );
}
if ( mStatusManager.isDisplayOverview() ) {
mMogoStatusManager.setDisplayOverview( TAG, false );
UiThreadHandler.removeCallbacks( mLockCarRunnable );
}
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
mMApUIController.recoverLockMode();
}

View File

@@ -3,7 +3,7 @@
<item>
<shape>
<corners android:radius="@dimen/module_ext_common_corner" />
<gradient android:angle="135" android:endColor="#4C3F435F" android:startColor="#4C2E3141" />
<solid android:color="#BF30334C"/>
</shape>
</item>
</selector>

View File

@@ -15,9 +15,9 @@
<TextView
android:id="@+id/module_ext_id_north"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120"
android:layout_marginTop="@dimen/dp_30"
android:layout_width="@dimen/module_ext_button_width"
android:layout_height="@dimen/module_ext_button_height"
android:layout_marginTop="@dimen/module_ext_camera_button_marginTop"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:drawableTop="@drawable/selector_icon_north_up"
android:gravity="center_horizontal"
@@ -32,15 +32,16 @@
<LinearLayout
android:id="@+id/module_ext_id_display_overview"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120"
android:layout_marginTop="@dimen/dp_30"
android:layout_width="@dimen/module_ext_button_width"
android:layout_height="@dimen/module_ext_button_height"
android:layout_marginTop="@dimen/module_ext_camera_button_marginTop"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/module_entrance_id_navi_info_panel"
app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop"
tools:visibility="visible">
<ImageView
@@ -59,28 +60,20 @@
android:textSize="@dimen/dp_22" />
</LinearLayout>
<LinearLayout
android:id="@+id/module_entrance_id_operation_panel"
android:id="@+id/module_entrance_id_move2_current_location"
android:layout_width="@dimen/module_ext_operation_panel_width"
android:layout_height="wrap_content"
android:layout_height="@dimen/module_ext_operation_panel_move2_height"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:gravity="center"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent">
<LinearLayout
android:id="@+id/module_entrance_id_move2_current_location"
android:layout_width="match_parent"
android:layout_height="@dimen/module_ext_operation_panel_move2_height"
android:background="@drawable/module_ext_dw_common_corner_bkg"
android:gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/module_map_ic_move2_current_location" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/module_map_ic_move2_current_location" />
</LinearLayout>
@@ -89,8 +82,8 @@
android:layout_width="@dimen/module_ext_operation_panel_share_width"
android:layout_height="@dimen/module_ext_operation_panel_share_height"
android:layout_marginBottom="@dimen/module_ext_operation_panel_share_marginBottom"
app:layout_constraintBottom_toTopOf="@+id/module_entrance_id_operation_panel"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_operation_panel"
app:layout_constraintBottom_toTopOf="@+id/module_entrance_id_move2_current_location"
app:layout_constraintRight_toRightOf="@+id/module_entrance_id_move2_current_location"
app:layout_goneMarginBottom="@dimen/module_ext_operation_panel_share_goneMarginBottom">
<TextView
@@ -107,6 +100,7 @@
android:id="@+id/module_entrance_id_uploading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/module_ext_dw_upload_road_condition_bkg"
android:gravity="center"
android:textColor="#FFFFFF"
android:textSize="@dimen/module_ext_operation_panel_share_textSize"

View File

@@ -30,7 +30,7 @@
<dimen name="module_ext_navi_panel_marginLeft">20px</dimen>
<dimen name="module_ext_navi_panel_marginTop">1px</dimen>
<dimen name="module_ext_operation_panel_width">58px</dimen>
<dimen name="module_ext_operation_panel_width">66px</dimen>
<dimen name="module_ext_operation_panel_marginRight">20px</dimen>
<dimen name="module_ext_operation_panel_marginBottom">34.5px</dimen>
<dimen name="module_ext_operation_panel_vr_height">58px</dimen>
@@ -38,16 +38,16 @@
<dimen name="module_ext_operation_panel_divider_width">31.4px</dimen>
<dimen name="module_ext_operation_panel_divider_height">1.2px</dimen>
<dimen name="module_ext_operation_panel_move2_height">58px</dimen>
<dimen name="module_ext_operation_panel_share_width">58px</dimen>
<dimen name="module_ext_operation_panel_share_height">58px</dimen>
<dimen name="module_ext_operation_panel_share_width">66px</dimen>
<dimen name="module_ext_operation_panel_share_height">66px</dimen>
<dimen name="module_ext_operation_panel_share_marginBottom">21px</dimen>
<dimen name="module_ext_operation_panel_share_textSize">20px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginBottom">34.5px</dimen>
<dimen name="module_ext_operation_panel_share_goneMarginRight">20px</dimen>
<dimen name="module_ext_navi_exit_width">64px</dimen>
<dimen name="module_ext_navi_exit_height">64px</dimen>
<dimen name="module_ext_navi_exit_width">66px</dimen>
<dimen name="module_ext_navi_exit_height">66px</dimen>
<dimen name="module_ext_navi_exit_marginLeft">20px</dimen>
<dimen name="module_ext_navi_exit_marginBottom">32px</dimen>
<dimen name="module_ext_button_container_marginLeft">20px</dimen>
@@ -56,7 +56,7 @@
<dimen name="module_entrance_id_button_marginTop">8px</dimen>
<!-- module_ext_layout_extensions.xml-->
<dimen name="module_ext_height">64px</dimen>
<dimen name="module_ext_height">66px</dimen>
<dimen name="module_ext_paddingRight">32px</dimen>
<dimen name="module_ext_paddingLeft">32px</dimen>
@@ -71,14 +71,14 @@
<dimen name="module_ext_weather_temp_textSize">18.48px</dimen>
<dimen name="module_ext_weather_temp_desc_marginRight">16px</dimen>
<dimen name="module_ext_weather_temp_desc_textSize">22px</dimen>
<dimen name="module_ext_msg_marginRight">28px</dimen>
<dimen name="module_ext_msg_marginRight">16px</dimen>
<dimen name="module_ext_msg_counter_width">15px</dimen>
<dimen name="module_ext_msg_counter_height">15px</dimen>
<dimen name="module_ext_msg_counter_textSize">11.73px</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>
<dimen name="module_ext_navi_info_panel_width">544px</dimen>
<dimen name="module_ext_navi_info_panel_height">117px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_width">85px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_height">85px</dimen>
<dimen name="module_ext_navi_info_panel_turn_icon_marginLeft">13px</dimen>
@@ -100,16 +100,29 @@
<dimen name="module_ext_id_voice_msg_icon_margin_left">-1px</dimen>
<dimen name="module_ext_weather_bkg_corner">30px</dimen>
<dimen name="module_ext_weather_container_paddingLeft">40px</dimen>
<dimen name="module_ext_weather_container_paddingRight">40px</dimen>
<dimen name="module_ext_weather_container_paddingLeft">23px</dimen>
<dimen name="module_ext_weather_container_paddingRight">23px</dimen>
<dimen name="module_ext_msg_dot_marginLeft">15px</dimen>
<dimen name="module_ext_msg_dot_marginRight">15px</dimen>
<dimen name="module_ext_navi_next_info_road_marginTop">5px</dimen>
<dimen name="module_ext_remaining_distance_textSize">20px</dimen>
<dimen name="module_ext_remaining_distance_unit_textSize">14px</dimen>
<dimen name="module_ext_remaining_time_textSize">20px</dimen>
<dimen name="module_ext_remaining_time_unit_textSize">14px</dimen>
<dimen name="module_ext_arrive_time_textSize">20px</dimen>
<dimen name="module_ext_arrive_time_unit_textSize">14px</dimen>
<dimen name="module_map_id_remaining_info_marginRight">34px</dimen>
<dimen name="module_map_navi_next_info_road_turn_marginLeft">8px</dimen>
<dimen name="module_map_navi_next_info_road_turn_marginRight">8px</dimen>
<!-- 导航查看全程显示范围-->
<dimen name="module_map_display_overview_left_margin">534px</dimen>
<dimen name="module_map_display_overview_top_margin">100px</dimen>
<dimen name="module_map_display_overview_bottom_margin">68px</dimen>
<dimen name="module_map_display_overview_right_margin">32px</dimen>
<dimen name="module_ext_north_goneMarginTop">240px</dimen>
<dimen name="module_ext_common_corner">16px</dimen>
<dimen name="module_ext_north_goneMarginTop">142px</dimen>
<dimen name="module_ext_button_width">66px</dimen>
<dimen name="module_ext_button_height">66px</dimen>
<dimen name="module_ext_camera_button_marginTop">16px</dimen>
</resources>

View File

@@ -101,6 +101,15 @@
<dimen name="module_ext_msg_dot_marginLeft">15px</dimen>
<dimen name="module_ext_msg_dot_marginRight">15px</dimen>
<dimen name="module_ext_navi_next_info_road_marginTop">5px</dimen>
<dimen name="module_map_id_remaining_info_marginRight">50px</dimen>
<dimen name="module_ext_remaining_distance_textSize">37px</dimen>
<dimen name="module_ext_remaining_distance_unit_textSize">26px</dimen>
<dimen name="module_ext_remaining_time_textSize">37px</dimen>
<dimen name="module_ext_remaining_time_unit_textSize">26px</dimen>
<dimen name="module_ext_arrive_time_textSize">37px</dimen>
<dimen name="module_ext_arrive_time_unit_textSize">26px</dimen>
<dimen name="module_map_navi_next_info_road_turn_marginLeft">15px</dimen>
<dimen name="module_map_navi_next_info_road_turn_marginRight">15px</dimen>
<!-- 导航查看全程显示范围-->
<dimen name="module_map_display_overview_left_margin">952px</dimen>
@@ -108,5 +117,9 @@
<dimen name="module_map_display_overview_bottom_margin">122px</dimen>
<dimen name="module_map_display_overview_right_margin">61px</dimen>
<dimen name="module_ext_north_goneMarginTop">240px</dimen>
<dimen name="module_ext_common_corner">30px</dimen>
<dimen name="module_ext_button_width">120px</dimen>
<dimen name="module_ext_button_height">120px</dimen>
<dimen name="module_ext_camera_button_marginTop">30px</dimen>
</resources>

View File

@@ -119,5 +119,8 @@
<dimen name="module_map_display_overview_right_margin">61px</dimen>
<dimen name="module_ext_common_corner">30px</dimen>
<dimen name="module_ext_north_goneMarginTop">240px</dimen>
<dimen name="module_ext_button_width">120px</dimen>
<dimen name="module_ext_button_height">120px</dimen>
<dimen name="module_ext_camera_button_marginTop">30px</dimen>
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_left_shadow_frame_width">200px</dimen>
<dimen name="module_main_map_left_shadow_frame_width">300px</dimen>
<dimen name="module_main_card_container_marginTop">8px</dimen>
<dimen name="module_main_card_container_width">352px</dimen>
<dimen name="module_main_card_container_height">370px</dimen>
@@ -16,11 +16,11 @@
<dimen name="cards_container_dp_600">320px</dimen>
<dimen name="cards_container_shadow_dp_margin_top">319px</dimen>
<dimen name="module_main_apps_fragment_container_width">200px</dimen>
<dimen name="module_main_apps_fragment_container_padding">30px</dimen>
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
<dimen name="module_main_id_entrance_fragment_container_marginLeft">800px</dimen>
<dimen name="module_main_entrance_fragment_container_padding">30px</dimen>
<dimen name="module_main_apps_fragment_container_width">110px</dimen>
<dimen name="module_main_apps_fragment_container_padding">16px</dimen>
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>
<dimen name="module_main_entrance_fragment_container_padding">16px</dimen>
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_left_shadow_frame_width">200px</dimen>
<dimen name="module_main_map_left_shadow_frame_width">300px</dimen>
<dimen name="module_main_card_container_marginTop">10px</dimen>
<dimen name="module_main_card_container_width">660px</dimen>
<dimen name="module_main_card_container_height">690px</dimen>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- module_main_activity_main.xml-->
<dimen name="module_main_map_left_shadow_frame_width">200px</dimen>
<dimen name="module_main_map_left_shadow_frame_width">150px</dimen>
<dimen name="module_main_card_container_marginTop">10px</dimen>
<dimen name="module_main_card_container_width">660px</dimen>
<dimen name="module_main_card_container_height">690px</dimen>

View File

@@ -8,6 +8,7 @@ import android.graphics.Rect;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.UiThread;
import androidx.lifecycle.LifecycleOwner;
import com.alibaba.android.arouter.launcher.ARouter;
@@ -63,6 +64,18 @@ public class MapPresenter extends Presenter< MapView > implements
private IMogoSettingManager mSettingManager;
private Rect mDisplayOverviewBounds;
private Runnable mLockCarRunnable = new Runnable() {
@Override
public void run() {
if ( !mStatusManager.isDisplayOverview() ) {
return;
}
mStatusManager.setDisplayOverview( TAG, false );
mView.getUIController().recoverLockMode();
}
};
public MapPresenter( MapView view ) {
super( view );
initBroadcast();
@@ -221,6 +234,7 @@ public class MapPresenter extends Presenter< MapView > implements
mStatusManager.setDisplayOverview( TAG, false );
mView.getUIController().recoverLockMode();
AIAssist.getInstance( getContext() ).speakTTSVoice( "已为您继续导航" );
UiThreadHandler.removeCallbacks( mLockCarRunnable );
} else {
mLauncher.backToLauncher( getContext() );
UiThreadHandler.postDelayed( () -> {
@@ -228,6 +242,7 @@ public class MapPresenter extends Presenter< MapView > implements
mStatusManager.setDisplayOverview( TAG, false );
mView.getUIController().recoverLockMode();
AIAssist.getInstance( getContext() ).speakTTSVoice( "已为您继续导航" );
UiThreadHandler.removeCallbacks( mLockCarRunnable );
} catch ( Exception e ) {
e.printStackTrace();
}
@@ -258,6 +273,8 @@ public class MapPresenter extends Presenter< MapView > implements
AIAssist.getInstance( getContext() ).speakTTSVoice( "展示全程路线" );
}, 2_000L );
}
UiThreadHandler.postDelayed( mLockCarRunnable, 20_000 );
}
private void zoomMap( boolean zoomIn ) {

View File

@@ -751,10 +751,13 @@ public class MogoServices implements IMogoMapListener,
mStatusManager.setADASUIShow( ServiceConst.TYPE, status == 1 );
} else if ( Intent.ACTION_POWER_CONNECTED.equals( command ) ) {
mStatusManager.setAccStatus( ServiceConst.TYPE, true );
Logger.d( TAG, "acc status: %s", true );
} else if ( Intent.ACTION_POWER_DISCONNECTED.equals( command ) ) {
mStatusManager.setAccStatus( ServiceConst.TYPE, false );
Logger.d( TAG, "acc status: %s", false );
} else if ( MogoReceiver.ACTION_NWD_ACC.equals( command ) ) {
int state = intent.getByteExtra( MogoReceiver.PARAM_ACC_STATUS, ( byte ) 0 );
Logger.d( TAG, "acc status: %s", state == 1 );
mStatusManager.setAccStatus( ServiceConst.TYPE, state == 1 );
} else if ( MogoReceiver.ACTION_VOICE_UI.equals( command ) ) {
String val = intent.getStringExtra( MogoReceiver.PARRAM_WAKE_STATUS );

View File

@@ -85,7 +85,7 @@ public class ServiceConst {
/**
* 20 s
*/
public static final int DEFAULT_AUTO_REFRESH_WHEN_INTERRUPT = 20 * 1_000;
public static final int DEFAULT_AUTO_REFRESH_WHEN_INTERRUPT = 30 * 1_000;
/**
* 所有卡片显示的每类点的最大数据量

View File

@@ -12,6 +12,7 @@ import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
@@ -36,193 +37,145 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
private ConstraintLayout clMarkerContent;
private ImageView ivReverseTriangle;
public MapMarkerInfoView(Context context) {
super(context);
public MapMarkerInfoView( Context context ) {
super( context );
}
public MapMarkerInfoView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
public MapMarkerInfoView( Context context, @Nullable AttributeSet attrs ) {
super( context, attrs );
}
public MapMarkerInfoView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
public MapMarkerInfoView( Context context, @Nullable AttributeSet attrs, int defStyleAttr ) {
super( context, attrs, defStyleAttr );
}
public MapMarkerInfoView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) {
super(context);
public MapMarkerInfoView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
super( context );
mOptions = options;
updateView(markerShowEntity);
updateView( markerShowEntity );
}
protected void initView(Context context) {
LayoutInflater.from(context).inflate(R.layout.view_map_marker_info, this);
ivUserHead = findViewById(R.id.ivUserHead);
ivIcon = findViewById(R.id.ivIcon);
clMarkerContent = findViewById(R.id.clMarkerContent);
ivReverseTriangle = findViewById(R.id.ivReverseTriangle);
ivCar = findViewById(R.id.ivCar);
tvMarkerContent = findViewById(R.id.tvMarkerContent);
protected void initView( Context context ) {
LayoutInflater.from( context ).inflate( R.layout.view_map_marker_info, this );
ivUserHead = findViewById( R.id.ivUserHead );
ivIcon = findViewById( R.id.ivIcon );
clMarkerContent = findViewById( R.id.clMarkerContent );
ivReverseTriangle = findViewById( R.id.ivReverseTriangle );
ivCar = findViewById( R.id.ivCar );
tvMarkerContent = findViewById( R.id.tvMarkerContent );
}
public void updateView(MarkerShowEntity markerShowEntity) {
public void updateView( MarkerShowEntity markerShowEntity ) {
try {
Object bindObj = markerShowEntity.getBindObj();
switch (markerShowEntity.getMarkerType()) {
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
clMarkerContent.setBackgroundResource( R.drawable.bg_map_marker_yellow_info );
ivReverseTriangle.setImageResource( R.drawable.bg_shape_reverse_yellow );
switch ( markerShowEntity.getMarkerType() ) {
case ServiceConst.CARD_TYPE_CARS_CHATTING:
case ServiceConst.CARD_TYPE_USER_DATA:
ivUserHead.setVisibility(View.VISIBLE);
ivIcon.setVisibility(View.INVISIBLE);
loadImageWithMarker(markerShowEntity);
ivCar.setImageResource(R.drawable.icon_map_marker_car_gray);
ivUserHead.setVisibility( View.VISIBLE );
ivIcon.setVisibility( View.INVISIBLE );
loadImageWithMarker( markerShowEntity );
ivCar.setImageResource( R.drawable.icon_map_marker_car_gray );
//ivCar.setRotation(new Random().nextInt(360));
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
if (bindObj instanceof MarkerOnlineCar) {
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
} else {
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
}
}
ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() );
break;
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
case ServiceConst.CARD_TYPE_NOVELTY:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
ivUserHead.setVisibility( View.INVISIBLE );
ivIcon.setVisibility( View.VISIBLE );
if (bindObj instanceof MarkerNoveltyInfo) {
switch (((MarkerNoveltyInfo) bindObj).getPoiType()) {
if ( bindObj instanceof MarkerExploreWay ) {
switch ( ( ( MarkerExploreWay ) bindObj ).getPoiType() ) {
case MarkerPoiTypeEnum.GAS_STATION:
ivIcon.setImageResource(R.drawable.icon_map_marker_refuel);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_orange_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_orange);
ivIcon.setImageResource( R.drawable.icon_map_marker_refuel );
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_green_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_green);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_check2_light );
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_off);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_dark_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_dark_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_block_off2_light );
break;
case MarkerPoiTypeEnum.SHOP_DISCOUNT:
ivIcon.setImageResource(R.drawable.icon_map_marker_shop_discount);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_red_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_red);
ivIcon.setImageResource( R.drawable.icon_map_marker_shop_discount );
break;
case MarkerPoiTypeEnum.FOURS_4S:
ivIcon.setImageResource(R.drawable.icon_map_marker_4s);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_dark_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_dark_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_4s );
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_work);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_dark_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_dark_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_work2_light );
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_block_up2_light );
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
ivIcon.setImageResource(R.drawable.icon_map_marker_pondingl);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_pondingl2_light );
break;
case MarkerPoiTypeEnum.FOURS_SHOP_FREE:
ivIcon.setImageResource(R.drawable.icon_map_marker_shop);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_dark_green_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_dark_green);
ivIcon.setImageResource( R.drawable.icon_map_marker_shop );
break;
case MarkerPoiTypeEnum.FOURS_FOG:
ivIcon.setImageResource(R.drawable.module_service_ic_rc_dark_frog2);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_grey_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_grey);
ivIcon.setImageResource( R.drawable.module_service_ic_rc_dark_frog2_light );
break;
case MarkerPoiTypeEnum.FOURS_ICE:
ivIcon.setImageResource(R.drawable.module_service_ic_rc_freeze2);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
ivIcon.setImageResource( R.drawable.module_service_ic_rc_freeze2_light );
break;
case MarkerPoiTypeEnum.FOURS_PARKING:
ivIcon.setImageResource(R.drawable.module_service_ic_rc_parking2);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_dark_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_dark_blue);
ivIcon.setImageResource( R.drawable.module_service_ic_rc_parking2 );
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
ivIcon.setImageResource(R.drawable.module_service_ic_rc_accident2);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_red_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_red);
ivIcon.setImageResource( R.drawable.module_service_ic_rc_accident3_light );
break;
case MarkerPoiTypeEnum.FOURS_NEALY:
ivIcon.setImageResource(R.drawable.icon_map_marker_shear_news);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_shear_news );
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
ivIcon.setImageResource( R.drawable.icon_map_marker_living_light );
break;
default:
ivIcon.setImageResource(R.drawable.icon_map_marker_shear_news);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_dark_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_dark_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_shear_news );
break;
}
}
break;
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivUserHead.setVisibility( View.INVISIBLE );
ivIcon.setVisibility( View.VISIBLE );
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
if (bindObj instanceof MarkerShareMusic) {
if ( bindObj instanceof MarkerShareMusic ) {
// 2 为书籍听书3 为新闻,1 为qq音乐,int
switch (((MarkerShareMusic) bindObj).getShareType()) {
switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) {
case 1:
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
break;
case 2:
ivIcon.setImageResource(R.drawable.icon_map_marker_book);
ivIcon.setImageResource( R.drawable.icon_map_marker_book );
break;
case 3:
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
ivIcon.setImageResource( R.drawable.icon_map_marker_news );
break;
default:
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
break;
}
}
break;
}
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {
if ( !TextUtils.isEmpty( markerShowEntity.getTextContent() ) ) {
String content;
if (markerShowEntity.getTextContent().length() > 8) {
content = markerShowEntity.getTextContent().substring(0, 7) + "...";
if ( markerShowEntity.getTextContent().length() > 8 ) {
content = markerShowEntity.getTextContent().substring( 0, 7 ) + "...";
} else {
content = markerShowEntity.getTextContent();
}
tvMarkerContent.setText(content);
tvMarkerContent.setText( content );
}
} catch (Exception e) {
} catch ( Exception e ) {
e.printStackTrace();
}
}

View File

@@ -222,19 +222,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
trackData( mLastDataResult );
}
/**
* 是否是语音搜索的在线车辆数据:目前根据返回数据判断
*
* @param markerCardResult
* @return
*/
private boolean isOnlineCarDataOnly( MarkerCardResult markerCardResult ) {
if ( markerCardResult != null && markerCardResult.getDataType() != null && markerCardResult.getDataType().size() == 1 && markerCardResult.getDataType().contains( ServiceConst.CARD_TYPE_USER_DATA ) ) {
return true;
}
return false;
}
/**
* 根据类型绘制
*
@@ -260,12 +247,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
*/
private void drawAllMarker( MarkerCardResult markerCardResult ) {
List< MarkerExploreWay > exploreWayList = markerCardResult.getExploreWay();
// List< MarkerShareMusic > shareMusicList = markerCardResult.getShareMusic();
List< MarkerNoveltyInfo > noveltyInfoList = markerCardResult.getNoveltyInfo();
drawRoadConditionMarker( exploreWayList, ServiceConst.MAX_AMOUNT_ALL );
// drawShareMusicMarker( shareMusicList, ServiceConst.MAX_AMOUNT_ALL );
drawNoveltyMarker( noveltyInfoList, ServiceConst.MAX_AMOUNT_ALL );
}
/**
@@ -318,6 +301,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
int size = getAppropriateSize( maxAmount, exploreWayList );
Map< String, IMogoMarker > existCarMap = purgeMarkerData( exploreWayList, ModuleNames.CARD_TYPE_ROAD_CONDITION );
Logger.i( TAG, "existCarMap: size = %d", existCarMap.size() );
for ( int i = 0; i < size; i++ ) {
MarkerExploreWay markerExploreWay = exploreWayList.get( i );
if ( !markerExploreWay.getCanLive() ) {
@@ -332,6 +316,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
String sn = getCarSnFromEntity( markerExploreWay );
IMogoMarker mogoMarker = existCarMap.get( sn );
if ( mogoMarker == null ) {
Logger.d( TAG, "draw road condition, sn = %s", sn );
drawMapMarker( markerShowEntity );
}
}
@@ -453,7 +438,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
} else if ( entity instanceof MarkerNoveltyInfo ) {
return ( ( MarkerNoveltyInfo ) entity ).getSn();
} else if ( entity instanceof MarkerExploreWay ) {
return ( ( MarkerExploreWay ) entity ).getUserInfo().getSn();
return ( ( MarkerExploreWay ) entity ).getInfoId();
}
} catch ( Exception e ) {
@@ -494,76 +479,12 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
return;
}
JSONArray array = new JSONArray();
List< MarkerOnlineCar > onlineCarList = markerCardResult.getOnlineCar();
List< MarkerExploreWay > exploreWayList = markerCardResult.getExploreWay();
List< MarkerShareMusic > shareMusicList = markerCardResult.getShareMusic();
List< MarkerNoveltyInfo > noveltyInfoList = markerCardResult.getNoveltyInfo();
int size = onlineCarList == null ? 0 : onlineCarList.size();
fillPoiTypeTrackBody( array, ModuleNames.CARD_TYPE_USER_DATA, size );
int size = 0;
size = exploreWayList == null ? 0 : exploreWayList.size();
fillPoiTypeTrackBody( array, ModuleNames.CARD_TYPE_ROAD_CONDITION, size );
size = noveltyInfoList == null ? 0 : noveltyInfoList.size();
JSONObject novelty = fillPoiTypeTrackBody( array, ModuleNames.CARD_TYPE_NOVELTY, size );
if ( noveltyInfoList != null ) {
Map< String, Integer > counter = new HashMap<>();
for ( MarkerNoveltyInfo markerNoveltyInfo : noveltyInfoList ) {
if ( markerNoveltyInfo == null ) {
continue;
}
String childType = markerNoveltyInfo.getPoiType();
if ( !counter.containsKey( childType ) ) {
counter.put( childType, 0 );
}
int s = counter.get( childType ).intValue();
counter.put( childType, s + 1 );
}
if ( !counter.isEmpty() ) {
JSONArray onlineCarJsonArray = new JSONArray();
for ( Map.Entry< String, Integer > entry : counter.entrySet() ) {
fillPoiChildTypeTrackBody( onlineCarJsonArray, entry.getKey(), entry.getValue() );
}
if ( onlineCarJsonArray.length() > 0 ) {
try {
novelty.put( "content", onlineCarJsonArray );
} catch ( JSONException e ) {
e.printStackTrace();
}
}
}
}
size = shareMusicList == null ? 0 : shareMusicList.size();
JSONObject shareMusic = fillPoiTypeTrackBody( array, ModuleNames.CARD_TYPE_SHARE_MUSIC, size );
if ( shareMusicList != null ) {
Map< String, Integer > counter = new HashMap<>();
for ( MarkerShareMusic markerShareMusic : shareMusicList ) {
if ( markerShareMusic == null ) {
continue;
}
String childType = markerShareMusic.getShareType() + "";
if ( !counter.containsKey( childType ) ) {
counter.put( childType, 0 );
}
int s = counter.get( childType ).intValue();
counter.put( childType, s + 1 );
}
if ( !counter.isEmpty() ) {
JSONArray shareMusicJsonArray = new JSONArray();
for ( Map.Entry< String, Integer > entry : counter.entrySet() ) {
fillPoiChildTypeTrackBody( shareMusicJsonArray, entry.getKey(), entry.getValue() );
}
if ( shareMusicJsonArray.length() > 0 ) {
try {
shareMusic.put( "content", shareMusicJsonArray );
} catch ( JSONException e ) {
e.printStackTrace();
}
}
}
}
try {
if ( array.length() == 0 ) {
return;
@@ -585,12 +506,8 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( mLastDataResult == null ) {
return;
}
// List<MarkerOnlineCar> onlineCarList = mLastDataResult.getOnlineCar();
List< MarkerExploreWay > exploreWayList = mLastDataResult.getExploreWay();
List< MarkerNoveltyInfo > noveltyInfoList = mLastDataResult.getNoveltyInfo();
// dispatchDataToBis(ServiceConst.CARD_TYPE_USER_DATA, onlineCarList == null ?new ArrayList<>() : onlineCarList);
dispatchDataToBis( ServiceConst.CARD_TYPE_ROAD_CONDITION, exploreWayList == null ? new ArrayList<>() : exploreWayList );
dispatchDataToBis( ServiceConst.CARD_TYPE_NOVELTY, noveltyInfoList == null ? new ArrayList<>() : noveltyInfoList );
}
/**

View File

@@ -9,6 +9,7 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
@@ -31,156 +32,137 @@ public class MapMarkerView extends MapMarkerBaseView {
private ImageView ivBg;
public MapMarkerView(Context context) {
super(context);
public MapMarkerView( Context context ) {
super( context );
}
public MapMarkerView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
public MapMarkerView( Context context, @Nullable AttributeSet attrs ) {
super( context, attrs );
}
public MapMarkerView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
public MapMarkerView( Context context, @Nullable AttributeSet attrs, int defStyleAttr ) {
super( context, attrs, defStyleAttr );
}
public MapMarkerView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) {
super(context);
public MapMarkerView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
super( context );
mOptions = options;
updateView(markerShowEntity);
updateView( markerShowEntity );
}
protected void initView(Context context) {
LayoutInflater.from(context).inflate(R.layout.view_map_marker, this);
ivUserHead = findViewById(R.id.ivUserHead);
ivIcon = findViewById(R.id.ivIcon);
ivCar = findViewById(R.id.ivCar);
ivBg = findViewById(R.id.ivBg);
clMarkerTopView = findViewById(R.id.clMarkerTopView);
protected void initView( Context context ) {
LayoutInflater.from( context ).inflate( R.layout.view_map_marker, this );
ivUserHead = findViewById( R.id.ivUserHead );
ivIcon = findViewById( R.id.ivIcon );
ivCar = findViewById( R.id.ivCar );
ivBg = findViewById( R.id.ivBg );
clMarkerTopView = findViewById( R.id.clMarkerTopView );
}
public void updateView(MarkerShowEntity markerShowEntity) {
public void updateView( MarkerShowEntity markerShowEntity ) {
try {
Object bindObj = markerShowEntity.getBindObj();
switch (markerShowEntity.getMarkerType()) {
ivBg.setImageResource( R.drawable.bg_map_marker_dark );
switch ( markerShowEntity.getMarkerType() ) {
case ServiceConst.CARD_TYPE_CARS_CHATTING:
case ServiceConst.CARD_TYPE_USER_DATA:
ivUserHead.setVisibility(View.VISIBLE);
ivIcon.setVisibility(View.INVISIBLE);
loadImageWithMarker(markerShowEntity);
ivCar.setImageResource(R.drawable.icon_map_marker_car_gray);
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
ivUserHead.setVisibility( View.VISIBLE );
ivIcon.setVisibility( View.INVISIBLE );
loadImageWithMarker( markerShowEntity );
ivCar.setImageResource( R.drawable.icon_map_marker_car_gray );
ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() );
// ivCar.setRotation(new Random().nextInt(360));
clMarkerTopView.setVisibility(View.GONE);
if (bindObj instanceof MarkerOnlineCar) {
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
clMarkerTopView.setVisibility( View.GONE );
if ( bindObj instanceof MarkerOnlineCar ) {
if ( ( ( MarkerOnlineCar ) bindObj ).getUserInfo().getGenderValue() == 0 ) {
} else {
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
}
}
break;
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
case ServiceConst.CARD_TYPE_NOVELTY:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivUserHead.setVisibility( View.INVISIBLE );
ivIcon.setVisibility( View.VISIBLE );
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
if (bindObj instanceof MarkerNoveltyInfo) {
switch (((MarkerNoveltyInfo) bindObj).getPoiType()) {
if ( bindObj instanceof MarkerExploreWay ) {
switch ( ( ( MarkerExploreWay ) bindObj ).getPoiType() ) {
case MarkerPoiTypeEnum.GAS_STATION:
ivIcon.setImageResource(R.drawable.icon_map_marker_refuel);
ivBg.setImageResource(R.drawable.bg_map_marker_oragne);
ivIcon.setImageResource( R.drawable.icon_map_marker_refuel );
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
ivBg.setImageResource(R.drawable.bg_map_marker_green);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_check2 );
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_off);
ivBg.setImageResource(R.drawable.bg_map_marker_blue_dark);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_block_off2 );
break;
case MarkerPoiTypeEnum.SHOP_DISCOUNT:
ivIcon.setImageResource(R.drawable.icon_map_marker_shop_discount);
ivBg.setImageResource(R.drawable.bg_map_marker_red);
ivIcon.setImageResource( R.drawable.icon_map_marker_shop_discount );
break;
case MarkerPoiTypeEnum.FOURS_4S:
ivIcon.setImageResource(R.drawable.icon_map_marker_4s);
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_4s );
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_work);
ivBg.setImageResource(R.drawable.bg_map_marker_blue_dark);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_work2 );
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_road_block_up2 );
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
ivIcon.setImageResource(R.drawable.icon_map_marker_pondingl);
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_pondingl2 );
break;
case MarkerPoiTypeEnum.FOURS_SHOP_FREE:
ivIcon.setImageResource(R.drawable.icon_map_marker_shop);
ivBg.setImageResource(R.drawable.bg_map_marker_green_dark);
ivIcon.setImageResource( R.drawable.icon_map_marker_shop );
break;
case MarkerPoiTypeEnum.FOURS_FOG:
ivBg.setImageResource(R.drawable.module_service_ic_rc_dark_frog);
ivIcon.setImageResource( R.drawable.module_service_ic_rc_dark_frog2 );
break;
case MarkerPoiTypeEnum.FOURS_ICE:
ivBg.setImageResource(R.drawable.module_service_ic_rc_freeze);
break;
case MarkerPoiTypeEnum.FOURS_PARKING:
ivBg.setImageResource(R.drawable.module_service_ic_rc_parking);
ivIcon.setImageResource( R.drawable.module_service_ic_rc_freeze2 );
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
ivBg.setImageResource(R.drawable.module_service_ic_rc_accident);
ivIcon.setImageResource( R.drawable.module_service_ic_rc_accident3 );
break;
case MarkerPoiTypeEnum.FOURS_NEALY:
ivIcon.setImageResource(R.drawable.icon_map_marker_shear_news);
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
ivIcon.setImageResource( R.drawable.icon_map_marker_shear_news );
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
ivIcon.setImageResource( R.drawable.icon_map_marker_living );
break;
case MarkerPoiTypeEnum.FOURS_PARKING:
default:
ivIcon.setImageResource(R.drawable.icon_map_marker_shear_news);
ivBg.setImageResource(R.drawable.bg_map_marker_blue_dark);
ivIcon.setImageResource( R.drawable.icon_map_marker_shear_news );
break;
}
}
break;
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
ivUserHead.setVisibility( View.INVISIBLE );
ivIcon.setVisibility( View.VISIBLE );
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
if (bindObj instanceof MarkerShareMusic) {
if ( bindObj instanceof MarkerShareMusic ) {
// 2 为书籍听书3 为新闻,1 为qq音乐,int
switch (((MarkerShareMusic) bindObj).getShareType()) {
switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) {
case 1:
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
break;
case 2:
ivIcon.setImageResource(R.drawable.icon_map_marker_book);
ivIcon.setImageResource( R.drawable.icon_map_marker_book );
break;
case 3:
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
ivIcon.setImageResource( R.drawable.icon_map_marker_news );
break;
default:
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
break;
}
}
break;
}
} catch (Exception e) {
} catch ( Exception e ) {
e.printStackTrace();
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@@ -22,4 +22,5 @@ public interface IMogoModuleLifecycle {
* accOn 事件回调
*/
void accOn();
}

View File

@@ -48,6 +48,7 @@ dependencies {
implementation rootProject.ext.dependencies.mogocommons
implementation rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.mogoconnection
implementation rootProject.ext.dependencies.modulecommon
} else {
api project(":libraries:mogo-map")
implementation project(":libraries:mogo-map-api")
@@ -55,6 +56,7 @@ dependencies {
implementation project(":foudations:mogo-commons")
implementation project(":services:mogo-service-api")
implementation project(":foudations:mogo-connection")
implementation project(":modules:mogo-module-common")
}
}

View File

@@ -1,13 +1,16 @@
package com.mogo.service.impl.adas;
import android.app.ActivityManager;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.os.RemoteException;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.map.MogoOverlayManager;
import com.mogo.module.common.utils.CarSeries;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.impl.MogoServiceApis;
@@ -20,6 +23,8 @@ import com.zhidao.autopilot.support.api.AutopilotServiceManage;
import org.json.JSONObject;
import java.util.List;
/**
* @author congtaowang
* @since 2020-03-10
@@ -61,6 +66,11 @@ public class MogoADASController implements IMogoADASController {
public void showADAS() {
Logger.d( TAG, "show adas" );
if ( !isProcessRunning( AbsMogoApplication.getApp(), getPackageUid( AbsMogoApplication.getApp(), "com.zhidiao.autopilot" ) ) ) {
init( AbsMogoApplication.getApp() );
}
int delay = CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ? 0 : 500;
UiThreadHandler.postDelayed( () -> {
try {
@@ -84,7 +94,7 @@ public class MogoADASController implements IMogoADASController {
Logger.e( TAG, e1, "error." );
}
}
}, 500 );
}, delay );
}
@Override
@@ -122,4 +132,38 @@ public class MogoADASController implements IMogoADASController {
public void init( Context context ) {
AutopilotServiceManage.getInstance().init( context );
}
//获取已安装应用的 uid-1 表示未安装此应用或程序异常
public static int getPackageUid( Context context, String packageName ) {
try {
ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo( packageName, 0 );
if ( applicationInfo != null ) {
return applicationInfo.uid;
}
} catch ( Exception e ) {
return -1;
}
return -1;
}
/**
* 判断某一 uid 的程序是否有正在运行的进程,即是否存活
* Created by cafeting on 2017/2/4.
*
* @param context 上下文
* @param uid 已安装应用的 uid
* @return true 表示正在运行false 表示没有运行
*/
public static boolean isProcessRunning( Context context, int uid ) {
ActivityManager am = ( ActivityManager ) context.getSystemService( Context.ACTIVITY_SERVICE );
List< ActivityManager.RunningServiceInfo > runningServiceInfos = am.getRunningServices( 200 );
if ( runningServiceInfos.size() > 0 ) {
for ( ActivityManager.RunningServiceInfo appProcess : runningServiceInfos ) {
if ( uid == appProcess.uid ) {
return true;
}
}
}
return false;
}
}