Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangcongtao
2020-12-04 18:41:01 +08:00
238 changed files with 1084 additions and 616 deletions

View File

@@ -44,6 +44,8 @@ public class AppsListActivity extends MvpActivity< AppsListView, AppsListPresent
getWindow().setStatusBarColor( Color.BLACK );
}
super.onCreate( savedInstanceState );
// 透明 activity 不会让前一个 activity 走 onStop 方法
AppServiceHandler.getApis().getStatusManagerApi().setMainPageIsBackgroundStatus( TAG, true );
AppServiceHandler.getApis().getStatusManagerApi().setAppListUIShow( TAG, true );
}

View File

@@ -24,8 +24,8 @@ public class AppIndicatorAdapter extends RecycleBaseAdapter< AppInfo > {
@Override
public void onBindViewHolder( RecycleViewHolder holder, AppInfo app, int position ) {
ImageView ivIndicator = holder.getView( R.id.module_apps_id_app_icon );
ivIndicator.setImageResource( app.getIconResId() );
holder.itemView.setOnClickListener( view -> {
ivIndicator.setBackgroundResource( app.getIconResId() );
ivIndicator.setOnClickListener( ( view ) -> {
if ( getOnItemClickedListener() != null ) {
getOnItemClickedListener().onItemClicked( app, position );
}

View File

@@ -13,18 +13,18 @@ import java.util.List;
*/
public class NavigatorApps {
private static AppInfo app = new AppInfo( "高德地图", "com.autonavi.amapauto", "", 0, null, R.drawable.module_apps_ic_navigator_navi, 1 );
private static AppInfo app = new AppInfo( "高德地图", "com.autonavi.amapauto", "", 0, null, R.drawable.module_apps_ic_navigator_navi_selector, 1 );
private static AppInfo app_ = new AppInfo( "高德地图", "com.autonavi.amapauto", "", 0, null, R.drawable.module_apps_ic_navigator_navi_disable, 1 );
// private static AppInfo app2 = new AppInfo( "音乐", "com.tencent.wecarflow", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
private static AppInfo app2 = new AppInfo( "音乐", "com.zhidao.music", "", 0, null, R.drawable.module_apps_ic_navigator_media, 2 );
private static AppInfo app3 = new AppInfo( "车聊聊", "com.zhidao.imdemo", "", 0, null, R.drawable.module_apps_ic_navigator_im, 6 );
private static AppInfo app4 = new AppInfo( "全部应用", "com.mogo.launcher.applist", "", 0, null, R.drawable.module_apps_ic_navigator_applist, 4 );
private static AppInfo app2 = new AppInfo( "音乐", "com.zhidao.music", "", 0, null, R.drawable.module_apps_ic_navigator_media_selector, 2 );
// private static AppInfo app3 = new AppInfo( "车聊聊", "com.zhidao.imdemo", "", 0, null, R.drawable.module_apps_ic_navigator_im_selector, 6 );
private static AppInfo app4 = new AppInfo( "全部应用", "com.mogo.launcher.applist", "", 0, null, R.drawable.module_apps_ic_navigator_applist_selector, 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;
}
@@ -33,7 +33,7 @@ public class NavigatorApps {
List< AppInfo > sApps = new ArrayList<>();
sApps.add( app );
sApps.add( app2 );
sApps.add( app3 );
// sApps.add( app3 );
sApps.add( app4 );
return sApps;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/module_apps_ic_navigator_applist_pressed"/>
<item android:drawable="@drawable/module_apps_ic_navigator_applist" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/module_apps_ic_navigator_im_pressed"/>
<item android:drawable="@drawable/module_apps_ic_navigator_im" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/module_apps_ic_navigator_media_pressed"/>
<item android:drawable="@drawable/module_apps_ic_navigator_media" />
</selector>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/module_apps_ic_navigator_navi_pressed"/>
<item android:drawable="@drawable/module_apps_ic_navigator_navi" />
</selector>

View File

@@ -23,7 +23,7 @@
<dimen name="module_apps_navigator_icon_width">160px</dimen>
<dimen name="module_apps_navigator_icon_height">160px</dimen>
<dimen name="module_apps_navigator_icon_divider">30px</dimen>
<dimen name="module_apps_navigator_icon_divider">10px</dimen>
<dimen name="module_apps_voice_icon_width">100px</dimen>
<dimen name="module_apps_voice_icon_height">100px</dimen>
</resources>

View File

@@ -26,6 +26,7 @@
<item>com.android.messaging</item>
<item>com.android.contacts</item>
<item>com.android.dialer</item>
<item>com.zhidao.imdemo</item>
</string-array>
<string-array name="module_apps_array_filter_packages">
<item>com.mogo.launcher</item>
@@ -44,5 +45,6 @@
<item>com.iflytek.inputmethod.pad</item>
<item>com.nwd.tools.reboot</item>
<item>com.android.car.setting</item>
<item>com.zhidao.imdemo</item>
</string-array>
</resources>

View File

@@ -2,11 +2,13 @@ package com.mogo.module.authorize.authprovider.module
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
import com.mogo.module.authorize.util.SharedPreferenceUtil
import com.mogo.service.module.IMogoModuleProvider
import com.mogo.utils.logger.Logger
class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeModuleProvider {
@@ -21,14 +23,18 @@ class MogoModuleAuthorize private constructor() : MogoAuthorizeManagerImpl(), IM
}
override fun invokeAuthorization(tag: String) {
if(!SharedPreferenceUtil.hasGuide()){
val guideService = ARouter.getInstance().build("/guide/showFragment").navigation()
if(guideService is IMogoModuleProvider){
guideService.init(AbsMogoApplication.getApp().applicationContext)
if (DebugConfig.isNeedLoadGuideModule()) {
if(!SharedPreferenceUtil.hasGuide()){
val guideService = ARouter.getInstance().build("/guide/showFragment").navigation()
if(guideService is IMogoModuleProvider){
guideService.init(AbsMogoApplication.getApp().applicationContext)
}
val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
listener?.authorizeFailed("需要先执行用户引导")
return
}
val listener = MogoAuthorizeRegisterHandler.getAuthorizeListener(tag)
listener?.authorizeFailed("需要先执行用户引导")
return
}else{
Logger.i(TAG,"没有添加Guide模块无需判断是否引导准备展示授权")
}
mogoAuthShow.showAuthorizeView(tag, {
//todo SP存储状态

View File

@@ -42,7 +42,7 @@ public final class MogoApisHandler {
public IMogoServiceApis getApis() {
if ( sApis == null ) {
synchronized ( this ) {
if ( sApis != null ) {
if ( sApis == null ) {
sApis = ARouter.getInstance().navigation( IMogoServiceApis.class );
}
}

View File

@@ -7,7 +7,9 @@ import android.view.WindowManager;
import androidx.annotation.NonNull;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.R;
import com.mogo.utils.logger.Logger;
/**
* 浮在各种wm上面的dialog基类调用了window.setType
@@ -15,13 +17,16 @@ import com.mogo.module.common.R;
* @author tongchenfei
*/
public class BaseFloatDialog extends Dialog {
private static final String TAG = "BaseFloatDialog";
public BaseFloatDialog(@NonNull Context context) {
this(context, R.style.BaseFloatDialogStyle);
}
public BaseFloatDialog(@NonNull Context context, int themeResId) {
super(context, themeResId);
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD) {
if (DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD) {
addFlag();
}
}
@@ -32,4 +37,23 @@ public class BaseFloatDialog extends Dialog {
| WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
| WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE);
}
@Override
public void show() {
Logger.d(TAG, "onShow====");
if (DebugConfig.isNeedHideAdasWhenShare()) {
MogoApisHandler.getInstance().getApis().getAdasControllerApi().closeADAS();
}
super.show();
}
@Override
public void dismiss() {
Logger.d(TAG, "onDismiss====");
if (DebugConfig.isNeedHideAdasWhenShare()
&& MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageOnResume()) {
MogoApisHandler.getInstance().getApis().getAdasControllerApi().showADAS();
}
super.dismiss();
}
}

View File

@@ -27,11 +27,13 @@ public class MapCenterPointStrategy {
{
// 选点场景,定位中心点
Map< String, MapCenterPoint > choosePoint = new HashMap<>();
choosePoint.put( "d80x", new MapCenterPoint( 0.5D, 0.5D ) );
choosePoint.put( "em4", new MapCenterPoint( 0.5D, 0.5D ) );
choosePoint.put( "e8xx", new MapCenterPoint( 0.5D, 0.5D ) );
choosePoint.put( "f80x", new MapCenterPoint( 0.5D, 0.5D ) );
choosePoint.put( "f8xx", new MapCenterPoint( 0.5D, 0.5D ) );
final MapCenterPoint point = new MapCenterPoint( 0.5D, 0.5D );
choosePoint.put( "d80x", point );
choosePoint.put( "em4", point );
choosePoint.put( "em3", point );
choosePoint.put( "e8xx", point );
choosePoint.put( "f80x", point );
choosePoint.put( "f8xx", point );
sStrategies.put( Scene.CHOOSE_POINT, choosePoint );
}
@@ -39,10 +41,13 @@ public class MapCenterPointStrategy {
// 导航场景,定位视图右下角偏下
Map< String, MapCenterPoint > navi = new HashMap<>();
navi.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.573333333333D ) );
navi.put( "em4", new MapCenterPoint( 0.734375D, 0.573333333333D ) );
navi.put( "e8xx", new MapCenterPoint( 0.734375D, 0.573333333333D ) );
navi.put( "f80x", new MapCenterPoint( 0.705208333D, 0.575D ) );
navi.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.575D ) );
final MapCenterPoint em4 = new MapCenterPoint( 0.734375D, 0.573333333333D );
navi.put( "em4", em4 );
navi.put( "em3", em4 );
navi.put( "e8xx", em4 );
final MapCenterPoint f80x = new MapCenterPoint( 0.705208333D, 0.575D );
navi.put( "f80x", f80x );
navi.put( "f8xx", f80x );
sStrategies.put( Scene.NAVI, navi );
}
@@ -50,10 +55,13 @@ public class MapCenterPointStrategy {
// 导航场景 vs 道路事件展示场景,定位视图右下角偏下
Map< String, MapCenterPoint > naviWithRoadEvent = new HashMap<>();
naviWithRoadEvent.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.73936170212766D ) );
naviWithRoadEvent.put( "em4", new MapCenterPoint( 0.734375D, 0.73936170212766D ) );
naviWithRoadEvent.put( "e8xx", new MapCenterPoint( 0.734375D, 0.73936170212766D ) );
naviWithRoadEvent.put( "f80x", new MapCenterPoint( 0.705208333D, 0.683333333333D ) );
naviWithRoadEvent.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.683333333333D ) );
final MapCenterPoint em4 = new MapCenterPoint( 0.734375D, 0.73936170212766D );
naviWithRoadEvent.put( "em4", em4 );
naviWithRoadEvent.put( "em3", em4 );
naviWithRoadEvent.put( "e8xx", em4 );
final MapCenterPoint f80x = new MapCenterPoint( 0.705208333D, 0.683333333333D );
naviWithRoadEvent.put( "f80x", f80x );
naviWithRoadEvent.put( "f8xx", f80x );
sStrategies.put( Scene.NAVI_WITH_ROAD_EVENT, naviWithRoadEvent );
}
@@ -61,10 +69,13 @@ public class MapCenterPointStrategy {
// 巡航场景
Map< String, MapCenterPoint > aimless = new HashMap<>();
aimless.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.5D ) );
aimless.put( "em4", new MapCenterPoint( 0.734375D, 0.5D ) );
aimless.put( "e8xx", new MapCenterPoint( 0.734375D, 0.5D ) );
aimless.put( "f80x", new MapCenterPoint( 0.705208333D, 0.5D ) );
aimless.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.5D ) );
final MapCenterPoint em4 = new MapCenterPoint( 0.734375D, 0.5D );
aimless.put( "em4", em4 );
aimless.put( "em3", em4 );
aimless.put( "e8xx", em4 );
final MapCenterPoint f80x = new MapCenterPoint( 0.705208333D, 0.5D );
aimless.put( "f80x", f80x );
aimless.put( "f8xx", f80x );
sStrategies.put( Scene.AIMLESS, aimless );
}
@@ -72,32 +83,41 @@ public class MapCenterPointStrategy {
// 巡航场景 vs 道路事件展示场景
Map< String, MapCenterPoint > aimlessWithRoadEvent = new HashMap<>();
aimlessWithRoadEvent.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.68617 ) );
aimlessWithRoadEvent.put( "em4", new MapCenterPoint( 0.734375D, 0.68617 ) );
aimlessWithRoadEvent.put( "e8xx", new MapCenterPoint( 0.734375D, 0.68617 ) );
aimlessWithRoadEvent.put( "f80x", new MapCenterPoint( 0.705208333D, 0.599074074D ) );
aimlessWithRoadEvent.put( "f8xx", new MapCenterPoint( 0.705208333D, 0.599074074D ) );
final MapCenterPoint em4 = new MapCenterPoint( 0.734375D, 0.68617 );
aimlessWithRoadEvent.put( "em4", em4 );
aimlessWithRoadEvent.put( "em3", em4 );
aimlessWithRoadEvent.put( "e8xx", em4 );
final MapCenterPoint f80x = new MapCenterPoint( 0.705208333D, 0.599074074D );
aimlessWithRoadEvent.put( "f80x", f80x );
aimlessWithRoadEvent.put( "f8xx", f80x );
sStrategies.put( Scene.AIMLESS_WITH_ROAD_EVENT, aimlessWithRoadEvent );
}
{
// 规划路线,定位视图右边
Map< String, MapCenterPoint > calculatePath = new HashMap<>();
calculatePath.put( "d80x", new MapCenterPoint( 0.733398D, 0.610833D ) );
calculatePath.put( "em4", new MapCenterPoint( 0.733398D, 0.610833D ) );
calculatePath.put( "e8xx", new MapCenterPoint( 0.733398D, 0.610833D ) );
calculatePath.put( "f80x", new MapCenterPoint( 0.703125D, 0.6083333D ) );
calculatePath.put( "f8xx", new MapCenterPoint( 0.703125D, 0.6083333D ) );
final MapCenterPoint d80x = new MapCenterPoint( 0.733398D, 0.610833D );
calculatePath.put( "d80x", d80x );
calculatePath.put( "em4", d80x );
calculatePath.put( "em3", d80x );
calculatePath.put( "e8xx", d80x );
final MapCenterPoint f80x = new MapCenterPoint( 0.703125D, 0.6083333D );
calculatePath.put( "f80x", f80x );
calculatePath.put( "f8xx", f80x );
sStrategies.put( Scene.CALCULATE_PATH, calculatePath );
}
{
// 分类搜索,定位视图右边
Map< String, MapCenterPoint > categorySearch = new HashMap<>();
categorySearch.put( "d80x", new MapCenterPoint( 0.733398D, 0.5D ) );
categorySearch.put( "em4", new MapCenterPoint( 0.733398D, 0.5D ) );
categorySearch.put( "e8xx", new MapCenterPoint( 0.733398D, 0.5D ) );
categorySearch.put( "f80x", new MapCenterPoint( 0.733594D, 0.5D ) );
categorySearch.put( "f8xx", new MapCenterPoint( 0.733594D, 0.5D ) );
final MapCenterPoint d80x = new MapCenterPoint( 0.733398D, 0.5D );
categorySearch.put( "d80x", d80x );
categorySearch.put( "em4", d80x );
categorySearch.put( "em3", d80x );
categorySearch.put( "e8xx", d80x );
final MapCenterPoint f80x = new MapCenterPoint( 0.733594D, 0.5D );
categorySearch.put( "f80x", f80x );
categorySearch.put( "f8xx", f80x );
sStrategies.put( Scene.CATEGORY_SEARCH, categorySearch );
}
@@ -105,10 +125,13 @@ public class MapCenterPointStrategy {
// V2X场景视图右边
Map< String, MapCenterPoint > categoryV2XEvent = new HashMap<>();
categoryV2XEvent.put( "d80x", new MapCenterPoint( 0.669444444444444, 0.7D ) );
categoryV2XEvent.put( "em4", new MapCenterPoint( 0.677734375D, 0.7D ) );
categoryV2XEvent.put( "e8xx", new MapCenterPoint( 0.677734375D, 0.7D ) );
categoryV2XEvent.put( "f80x", new MapCenterPoint( 0.6963541D, 0.65D ) );
categoryV2XEvent.put( "f8xx", new MapCenterPoint( 0.6963541D, 0.65D ) );
final MapCenterPoint em4 = new MapCenterPoint( 0.677734375D, 0.7D );
categoryV2XEvent.put( "em4", em4 );
categoryV2XEvent.put( "em3", em4 );
categoryV2XEvent.put( "e8xx", em4 );
final MapCenterPoint f80x = new MapCenterPoint( 0.6963541D, 0.65D );
categoryV2XEvent.put( "f80x", f80x );
categoryV2XEvent.put( "f8xx", f80x );
sStrategies.put( Scene.CATEGORY_V2X_EVENT, categoryV2XEvent );
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/module_common_icon_close_press" android:state_pressed="true" />
<item android:drawable="@drawable/module_common_icon_close" android:state_pressed="false" />
<item android:drawable="@drawable/module_common_icon_close" />
</selector>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/selector_call_btn_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/selector_call_btn_normal" android:state_pressed="false" />
<item android:drawable="@drawable/selector_call_btn_normal" />
</selector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -1,15 +1,10 @@
package com.mogo.module.extensions.entrance;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -26,7 +21,6 @@ import androidx.constraintlayout.widget.ConstraintSet;
import androidx.constraintlayout.widget.Group;
import com.alibaba.android.arouter.launcher.ARouter;
import com.amap.api.maps.model.MyLocationStyle;
import com.bumptech.glide.request.RequestOptions;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
@@ -187,6 +181,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
};
private Group seekHelpGroup;
private Group groupUserHead;
private UploadButtonAnimatorController mUploadButtonAnimatorController;
@@ -196,9 +191,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
@Override
protected int getLayoutId() {
if(DebugConfig.isMapBased()) {
if (DebugConfig.isMapBased()) {
return R.layout.module_ext_layout_entrance;
}else{
} else {
return R.layout.module_ext_layout_entrance_no_map;
}
}
@@ -221,20 +216,20 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mUploadRoadCondition = findViewById(R.id.module_entrance_id_upload_road_condition);
mUpload = findViewById(R.id.module_entrance_id_upload);
mUploading = findViewById(R.id.module_entrance_id_uploading);
mUploadRoadCondition.setOnClickListener( new OnPreventFastClickListener() {
mUploadRoadCondition.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
showShareDialog();
playShareGuideVoice();
}
} );
});
mDisplayOverview = findViewById(R.id.module_ext_id_display_overview);
mDisplayOverviewText = findViewById(R.id.module_ext_id_display_overview_text);
mDisplayOverviewIcon = findViewById(R.id.module_ext_id_display_overview_icon);
mDisplayOverview.setOnClickListener( new OnPreventFastClickListener() {
mDisplayOverview.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
if (getContext() != null) {
// 加此判断是解决下面setDisplayOverview后本Fragment回调中出现not attached to a context问题
if (!mStatusManager.isDisplayOverview()) {
@@ -248,12 +243,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mStatusManager.setDisplayOverview(TAG, !mStatusManager.isDisplayOverview());
}
}
} );
});
mMove2CurrentLocation = findViewById(R.id.module_entrance_id_move2_current_location);
mMove2CurrentLocation.setOnClickListener( new OnPreventFastClickListener() {
mMove2CurrentLocation.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
if (mStatusManager.isDisplayOverview()) {
mStatusManager.setDisplayOverview(TAG, false);
UiThreadHandler.removeCallbacks(mLockCarRunnable);
@@ -267,12 +262,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
// } else {
//
// }
if ( !mApis.getRefreshStrategyControllerApi().restartAutoRefreshAtTime( 0 ) ) {
if (!mApis.getRefreshStrategyControllerApi().restartAutoRefreshAtTime(0)) {
mStatusManager.setUserInteractionStatus(TAG, true, false);
mMApUIController.recoverLockMode();
}
}
} );
});
if (DebugConfig.isDebug()) {
mMove2CurrentLocation.setOnLongClickListener(view -> {
@@ -293,9 +288,9 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
mExitNavi = findViewById(R.id.module_entrance_id_exit_navi);
mExitNavi.setOnClickListener( new OnPreventFastClickListener() {
mExitNavi.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
if (mMogoNavi != null) {
if (mIsLock) {
new WMDialog.Builder(getContext())
@@ -316,19 +311,19 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
}
}
} );
});
mCameraMode = findViewById(R.id.module_ext_id_north);
mCameraMode.setOnClickListener( new OnPreventFastClickListener() {
mCameraMode.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
if (mCameraMode.isSelected()) {
mMApUIController.changeMapMode(EnumMapUI.CarUp_2D);
} else {
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
}
}
} );
});
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, this);
@@ -349,42 +344,43 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mNaviInfo = new NaviInfoView();
mNaviInfo.inflate(rootView);
findViewById(R.id.module_map_id_navi_bg).setOnClickListener( new OnPreventFastClickListener() {
findViewById(R.id.module_map_id_navi_bg).setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
try {
LaunchUtils.launchByPkg(getContext(), "com.autonavi.amapauto");
} catch (Exception e) {
e.printStackTrace();
}
}
} );
});
mWeatherContainer = findViewById(R.id.module_ext_id_weather_container);
mWeatherIcon = findViewById(R.id.module_ext_id_weather_icon);
mWeatherTemp = findViewById(R.id.module_ext_id_weather_temp);
mUserHeadImg = findViewById(R.id.ivUserHeadImg);
groupUserHead = findViewById(R.id.groupUserHead);
mMsgContainer = findViewById(R.id.module_ext_id_msg);
mMsgContainer.setOnClickListener( new OnPreventFastClickListener() {
mMsgContainer.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
try {
if ( mMessageHistoryPanelProvider == null ) {
mMessageHistoryPanelProvider = (IFragmentProvider)ARouter.getInstance().build("/push/ui/message").navigation(getContext());
if (mMessageHistoryPanelProvider == null) {
mMessageHistoryPanelProvider = (IFragmentProvider) ARouter.getInstance().build("/push/ui/message").navigation(getContext());
}
mMessageHistoryPanelProvider.createFragment( getActivity(), mMogoFragmentManager.getMessageHistoryContainerId(), null );
} catch( Exception e ){
mMessageHistoryPanelProvider.createFragment(getActivity(), mMogoFragmentManager.getMessageHistoryContainerId(), null);
} catch (Exception e) {
}
}
} );
});
mMsgCounter = findViewById(R.id.module_ext_id_msg_counter);
mUserHeadImg.setOnClickListener( new OnPreventFastClickListener() {
mUserHeadImg.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
try {
LaunchUtils.launchByPkg(getContext(), "com.zhidao.auto.personal");
// 埋点
@@ -396,23 +392,23 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
Logger.e(TAG, e, "打开个人中心Exception");
}
}
} );
});
mUserHeadImg.setVisibility(DebugConfig.isLauncher() ? View.VISIBLE : View.GONE);
groupUserHead.setVisibility(DebugConfig.isLauncher() ? View.VISIBLE : View.GONE);
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload,
mStatusManager);
mOnlineCarEntrance = findViewById( R.id.module_ext_id_destination_online_car );
mOnlineCarEntrance.setOnClickListener( new OnPreventFastClickListener() {
mOnlineCarEntrance = findViewById(R.id.module_ext_id_destination_online_car);
mOnlineCarEntrance.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl( View v ) {
public void onClickImpl(View v) {
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().showPanel();
Map<String, Object> properties = new HashMap<>();
properties.put( "type", 1 );
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track( "APP_Find_Mogoer", properties );
properties.put("type", 1);
MogoApisHandler.getInstance().getApis().getAnalyticsApi().track("APP_Find_Mogoer", properties);
}
} );
});
dealWeatherContainer();
@@ -425,16 +421,17 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mMove2CurrentLocation.setVisibility(View.GONE);
mWeatherContainer.setVisibility(View.GONE);
mMsgContainer.setVisibility(View.GONE);
mUserHeadImg.setVisibility(View.GONE);
groupUserHead.setVisibility(View.GONE);
}
isShowGuide = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(getSpGuide(), false);
Logger.d(TAG, " isShowGuide = " + isShowGuide + " --isGreaterThanOneDay = " + isGreaterThanOneDay());
if (isShowGuide && isGreaterThanOneDay()) {
UiThreadHandler.postDelayed(() -> {
playShareOuterGuideVoice();
}, 5_000L
);
if (DebugConfig.isNeedLoadGuideModule()) {
isShowGuide = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(getSpGuide(), false);
Logger.d(TAG, " isShowGuide = " + isShowGuide + " --isGreaterThanOneDay = " + isGreaterThanOneDay());
if (isShowGuide && isGreaterThanOneDay()) {
UiThreadHandler.postDelayed(this::playShareOuterGuideVoice, 5_000L);
}
} else {
UiThreadHandler.postDelayed(this::playShareOuterGuideVoice, 5_000L);
}
}
@@ -464,7 +461,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
if (shareItemSum < serverIssueCount) {
long time = System.currentTimeMillis();
Logger.d(TAG, " playShareOuterGuideVoice shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + "----serverIssueCount = " + serverIssueCount + "---time = " + time);
Logger.d(TAG, " playShareOuterGuideVoice shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + "----serverIssueCount = " + serverIssueCount + "---time = " + time);
if (intervalTime == 0) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_OUTER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_OUTER_GUIDE, ++shareItemSum);
@@ -499,7 +496,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
int shareItemSum = SharedPrefsMgr.getInstance(getContext()).getInt(KEY_CLICK_SHARE_BUTTON, 0);
if (shareItemSum < VOICE_ALERT_COUNT) {
long time = System.currentTimeMillis();
Logger.d(TAG, " playShareGuideVoice shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + ">>> time = " + time);
Logger.d(TAG, " playShareGuideVoice shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + ">>> time = " + time);
if (intervalTime == 0) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_CLICK_SHARE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_CLICK_SHARE_BUTTON, ++shareItemSum);
@@ -524,6 +521,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
/**
* 地图移动和缩放回调
*
* @param latLng 中点的经纬度
* @param zoom 缩放大小
* @param tilt 倾斜度
@@ -539,7 +537,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
int shareItemSum = SharedPrefsMgr.getInstance(getContext()).getInt(KEY_SHARE_INNER_GUIDE, 0);
if (shareItemSum < VOICE_ALERT_COUNT) {
long time = System.currentTimeMillis();
Logger.d(TAG, " showSlideMapVoiceGuide shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + "---time = " + time);
Logger.d(TAG, " showSlideMapVoiceGuide shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + "---time = " + time);
if (intervalTime == 0) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_INNER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_INNER_GUIDE, ++shareItemSum);
@@ -587,11 +585,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
/**
* 由于Launcher和Independent对于天气的表现形式不太一样所以通过此方法区分处理
*/
private void dealWeatherContainer(){
private void dealWeatherContainer() {
if (!DebugConfig.isLauncher()) {
ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone((ConstraintLayout) getView());
constraintSet.clear(R.id.module_ext_id_weather_container,ConstraintSet.START);
constraintSet.clear(R.id.module_ext_id_weather_container, ConstraintSet.START);
constraintSet.connect(R.id.module_ext_id_weather_container, ConstraintSet.END,
getView().getId(), ConstraintSet.END);
constraintSet.applyTo((ConstraintLayout) getView());
@@ -669,11 +667,11 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
}
mCameraMode.setText(getString(mCameraMode.isSelected() ?
R.string.mode_car_up : R.string.mode_north_up));
} else if( key_type == 10021 ){
} else if (key_type == 10021) {
try {
onStopNavi();
} catch ( Exception e ) {
Logger.e( TAG, e, "onIntentReceived -> 10021" );
} catch (Exception e) {
Logger.e(TAG, e, "onIntentReceived -> 10021");
}
}
}
@@ -777,7 +775,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
return;
}
if (descriptor == StatusDescriptor.UPLOADING&&DebugConfig.isLauncher()) {
if (descriptor == StatusDescriptor.UPLOADING && DebugConfig.isLauncher()) {
if (isTrue) {
mUploading.setVisibility(View.VISIBLE);
mUpload.setVisibility(View.GONE);
@@ -851,7 +849,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
Logger.d(TAG, "renderUserInfo: " + userInfo);
RequestOptions options =
new RequestOptions().circleCrop().placeholder(R.drawable.model_ext_default_user_head).error(R.drawable.model_ext_default_user_head);
GlideApp.with(getContext()).asBitmap().apply( options ).load(userInfo.getHeadImgurl()).into(new SkinAbleBitmapTarget(mUserHeadImg, options));
GlideApp.with(getContext()).asBitmap().apply(options).load(userInfo.getHeadImgurl()).into(new SkinAbleBitmapTarget(mUserHeadImg, options));
}
}
@@ -864,7 +862,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
"://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705236512" +
"&di=50620661ded7035fb84899a408f9f27e&imgtype=0&src=http%3A%2F%2Fb-ssl" +
".duitang.com%2Fuploads%2Fitem%2F201409%2F11%2F20140911211243_3rT4u.jpeg");
MyLocationUtil.setMyLocationIconUrl(getContext(),"https" +
MyLocationUtil.setMyLocationIconUrl(getContext(), "https" +
"://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1605705236512" +
"&di=50620661ded7035fb84899a408f9f27e&imgtype=0&src=http%3A%2F%2Fb-ssl" +
".duitang.com%2Fuploads%2Fitem%2F201409%2F11%2F20140911211243_3rT4u.jpeg");
@@ -953,28 +951,28 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
tv.setText("entrance add");
mApis.getEntranceButtonController().addBottomLayerView(tv, 50, 50);
});
findViewById(R.id.btnShowTextTip).setOnClickListener(v-> TipToast.tip("分享成功分享成功分享成功分享成功分享成功分享成功分享成功分享成功分享成功"));
findViewById(R.id.btnShowTextTip).setOnClickListener(v -> TipToast.tip("分享成功分享成功分享成功分享成功分享成功分享成功分享成功分享成功分享成功"));
findViewById(R.id.btnShowDrawableTip).setOnClickListener(v->{
findViewById(R.id.btnShowDrawableTip).setOnClickListener(v -> {
mMsgContainer.setVisibility(View.VISIBLE);
TipDrawable drawable =
new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head), 150, 150);
TipToast.tip("分享成功",drawable);
TipToast.tip("分享成功", drawable);
});
findViewById(R.id.btnShowDrawableTipNoSize).setOnClickListener(v->{
findViewById(R.id.btnShowDrawableTipNoSize).setOnClickListener(v -> {
mMsgContainer.setVisibility(View.GONE);
String enthusiasmIndex = "一般的字加粗的字一般的字";
SpannableString spannableStringUnSelectCountStr = new SpannableString(enthusiasmIndex);
ForegroundColorSpan foregroundColorSpanUnSelectCount = new ForegroundColorSpan(Color.RED);
spannableStringUnSelectCountStr.setSpan(foregroundColorSpanUnSelectCount, 4, 7, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
TipToast.tip(spannableStringUnSelectCountStr.toString());
// TipDrawable drawable =
// new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head));
// TipToast.tip("分享成功",drawable);
// String enthusiasmIndex = "一般的字加粗的字一般的字";
// SpannableString spannableStringUnSelectCountStr = new SpannableString(enthusiasmIndex);
// ForegroundColorSpan foregroundColorSpanUnSelectCount = new ForegroundColorSpan(Color.RED);
// spannableStringUnSelectCountStr.setSpan(foregroundColorSpanUnSelectCount, 4, 7, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
//
// TipToast.tip(spannableStringUnSelectCountStr.toString());
TipDrawable drawable =
new TipDrawable(getResources().getDrawable(R.drawable.model_ext_default_user_head));
TipToast.tip("分享成功", drawable);
});
}
@@ -997,30 +995,30 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private IMogoOnMessageListener<String> seekHelpNoticeListener =
new IMogoOnMessageListener<String>() {
@Override
public Class target() {
return String.class;
}
@Override
public Class target() {
return String.class;
}
@Override
public void onMsgReceived(String obj) {
if(mStatusManager.isSeekHelping()) {
int seekNum = SharedPrefsMgr.getInstance(getContext()).getInt("seek_help_num", 0);
final int finalSeekNum = seekNum++;
SharedPrefsMgr.getInstance(getContext()).putInt("seek_help_num", seekNum);
handler.post(() -> {
seekHelpGroup.setVisibility(View.VISIBLE);
seekHelpNum.setText("" + finalSeekNum);
});
}
}
};
@Override
public void onMsgReceived(String obj) {
if (mStatusManager.isSeekHelping()) {
int seekNum = SharedPrefsMgr.getInstance(getContext()).getInt("seek_help_num", 0);
final int finalSeekNum = seekNum++;
SharedPrefsMgr.getInstance(getContext()).putInt("seek_help_num", seekNum);
handler.post(() -> {
seekHelpGroup.setVisibility(View.VISIBLE);
seekHelpNum.setText("" + finalSeekNum);
});
}
}
};
private Handler handler = new Handler();
private void listenSeekNumber(){
private void listenSeekNumber() {
mApis.getSocketManagerApi(getContext()).registerOnMessageListener(SEEK_HELP_NOTICE_NUM_MSG_TYPE, seekHelpNoticeListener);
mStatusManager.registerStatusChangedListener(TAG,StatusDescriptor.SEEK_HELPING,this);
mStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.SEEK_HELPING, this);
}
@Override

View File

@@ -120,9 +120,6 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
// 相当于每次onResume都会请求一下个人信息目的是能够相对及时的同步手机端的个人信息修改
requestUserInfo();
}
if(DebugConfig.isMapBased()) {
requestCarModelList();
}
getCommonConfig();
}
@@ -242,38 +239,4 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
return "";
}
}
private void requestCarModelList() {
Map<String, String> params = new HashMap<>(8);
// params.put("sn", Utils.getSn());
params.put("sn", "ZD802B1932L00617");
mNetWork.create(UserInfoNetApiServices.class, DztHttpConstant.getBaseUrl()).
requestCarModelList(params).
subscribeOn(Schedulers.io()).
observeOn(Schedulers.io()).
subscribe(new SubscribeImpl<CarModelListResponse>(RequestOptions.create(context)) {
@Override
public void onSuccess(CarModelListResponse o) {
super.onSuccess(o);
Logger.d(TAG, "请求车模列表成功: " + o);
// todo 保存到sp中
SharedPrefsMgr.getInstance(context).putString("CAR_MODEL_LIST",
GsonUtil.jsonFromObject(o.getResult()));
}
@Override
public void onError(Throwable e) {
super.onError(e);
Logger.e(TAG, e, "请求自车模型失败");
}
@Override
public void onError(String message, int code) {
super.onError(message, code);
Logger.e(TAG, "请求自车模型失败: " + message);
}
});
}
}

View File

@@ -23,7 +23,4 @@ public interface UserInfoNetApiServices {
*/
@GET("carlife/carMachine/getAccountInfo")
Single<UserInfoResponse> requestUserInfo(@QueryMap Map<String, String> params);
@GET("yycp-userDataService/app/enthusiasm/getEnthusiasmInfo/v1")
Observable<CarModelListResponse> requestCarModelList(@QueryMap Map<String, String> params);
}

View File

@@ -48,7 +48,11 @@ public class TopViewManager implements IMogoTopViewManager {
public void addView(View view, ViewGroup.LayoutParams params,
IMogoTopViewStatusListener statusListener) {
parentParams = params;
TopViewAnimHelper.getInstance().startTopInAnim(view, params, statusListener);
try {
TopViewAnimHelper.getInstance().startTopInAnim(view, params, statusListener);
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override
@@ -72,7 +76,11 @@ public class TopViewManager implements IMogoTopViewManager {
public void addViewNoLinkage(View view, ViewGroup.LayoutParams params,
IMogoTopViewStatusListener statusListener) {
parentParams = params;
TopViewNoLinkageAnimHelper.getInstance().startTopInAnim(view, params, statusListener);
try {
TopViewNoLinkageAnimHelper.getInstance().startTopInAnim(view, params, statusListener);
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override
@@ -82,31 +90,55 @@ public class TopViewManager implements IMogoTopViewManager {
@Override
public void addSubView(View view, IMogoTopViewStatusListener statusListener) {
TopViewAnimHelper.getInstance().addSubView(view, parentParams, statusListener);
try {
TopViewAnimHelper.getInstance().addSubView(view, parentParams, statusListener);
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override
public void removeView(View view) {
TopViewAnimHelper.getInstance().startTopOutAnim(view);
try {
TopViewAnimHelper.getInstance().startTopOutAnim(view);
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override
public void removeViewNoLinkage(View view) {
TopViewNoLinkageAnimHelper.getInstance().startTopOutAnim(view);
try {
TopViewNoLinkageAnimHelper.getInstance().startTopOutAnim(view);
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override
public void removeSubView(View view) {
TopViewAnimHelper.getInstance().removeSubView(view);
try {
TopViewAnimHelper.getInstance().removeSubView(view);
} catch ( Exception e ) {
e.printStackTrace();
}
}
@Override
public boolean isViewAdded(View view) {
return TopViewAnimHelper.getInstance().isViewAdded(view);
try {
return TopViewAnimHelper.getInstance().isViewAdded(view);
} catch ( Exception e ){
return false;
}
}
@Override
public boolean isViewNoLinkageAdded(View view) {
return TopViewNoLinkageAnimHelper.getInstance().isViewAdded(view);
try {
return TopViewNoLinkageAnimHelper.getInstance().isViewAdded(view);
} catch( Exception e ){
return false;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#59000000" android:startColor="#59000000" android:type="linear" />
<gradient android:angle="135" android:endColor="#164079" android:startColor="#1363A4" android:type="linear" />
<corners android:radius="@dimen/module_ext_common_corner" />
</shape>
</item>

View File

@@ -69,14 +69,30 @@
tools:text="···" />
</RelativeLayout>
<ImageView
android:id="@+id/ivUserHeadBoard"
android:layout_width="@dimen/module_ext_user_avator_board_size"
android:layout_height="@dimen/module_ext_user_avator_board_size"
android:background="@drawable/model_ext_default_user_head_board"
android:layout_marginRight="@dimen/module_common_shadow_width_pos"
android:layout_marginTop="@dimen/module_common_shadow_width_pos"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<ImageView
android:id="@+id/ivUserHeadImg"
android:layout_width="@dimen/module_ext_user_avator_size"
android:layout_height="@dimen/module_ext_user_avator_size"
android:layout_marginRight="@dimen/module_common_shadow_width_pos"
android:layout_marginTop="@dimen/module_common_shadow_width_pos"
android:src="@drawable/model_ext_default_user_head"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
tools:visibility="visible"
app:layout_constraintLeft_toLeftOf="@id/ivUserHeadBoard"
app:layout_constraintTop_toTopOf="@id/ivUserHeadBoard"
app:layout_constraintRight_toRightOf="@id/ivUserHeadBoard"
app:layout_constraintBottom_toBottomOf="@id/ivUserHeadBoard"/>
<androidx.constraintlayout.widget.Group
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/groupUserHead"
app:constraint_referenced_ids="ivUserHeadBoard,ivUserHeadImg" />
</merge>

View File

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_ext_msg_counter_margin">26px</dimen>
<dimen name="module_ext_user_avator_size">66px</dimen>
<dimen name="module_ext_user_avator_size">56px</dimen>
<dimen name="module_ext_user_avator_board_size">80px</dimen>
<dimen name="module_ext_layout_padding">10px</dimen>
<dimen name="module_ext_layout_paddingRight">2px</dimen>
<dimen name="module_ext_layout_paddingBottom">2px</dimen>

View File

@@ -147,7 +147,8 @@
<dimen name="module_ext_top_over_navi_height">40px</dimen>
<dimen name="module_ext_msg_counter_margin">45px</dimen>
<dimen name="module_ext_user_avator_size">120px</dimen>
<dimen name="module_ext_user_avator_size">100px</dimen>
<dimen name="module_ext_user_avator_board_size">134px</dimen>
<dimen name="module_ext_layout_padding">30px</dimen>
<dimen name="module_ext_layout_paddingRight">20px</dimen>
<dimen name="module_ext_layout_paddingBottom">20px</dimen>

View File

@@ -150,7 +150,8 @@
<dimen name="module_ext_notice_margin_start">10px</dimen>
<dimen name="module_ext_weather_margin_start">10px</dimen>
<dimen name="module_ext_msg_counter_margin">45px</dimen>
<dimen name="module_ext_user_avator_size">120px</dimen>
<dimen name="module_ext_user_avator_size">100px</dimen>
<dimen name="module_ext_user_avator_board_size">134px</dimen>
<dimen name="module_ext_layout_padding">30px</dimen>
<dimen name="module_ext_layout_paddingRight">20px</dimen>
<dimen name="module_ext_layout_paddingBottom">20px</dimen>

View File

@@ -158,7 +158,8 @@
<dimen name="module_ext_top_over_navi_height">19px</dimen>
<dimen name="module_ext_weather_margin_start">0px</dimen>
<dimen name="module_ext_msg_counter_margin">26px</dimen>
<dimen name="module_ext_user_avator_size">66px</dimen>
<dimen name="module_ext_user_avator_size">56px</dimen>
<dimen name="module_ext_user_avator_board_size">80px</dimen>
<dimen name="module_ext_layout_padding">10px</dimen>
<dimen name="module_ext_layout_paddingRight">2px</dimen>
<dimen name="module_ext_layout_paddingBottom">2px</dimen>

View File

@@ -233,7 +233,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
@Override
public void hideCoverUpLayout() {
Logger.d( TAG, "隐藏遮罩" );
getWindow().setBackgroundDrawable( null );
mCoverUpLayout.setVisibility( View.GONE );
mServiceApis.getAdasControllerApi().showADAS();
}
@@ -314,6 +314,9 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void onStop() {
super.onStop();
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, true );
if ( shouldCloseADASPanelWhenPause() ) {
mServiceApis.getAdasControllerApi().closeADAS();
}
}
@Override
@@ -370,9 +373,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
mServiceApis.getRefreshStrategyControllerApi().clearAllData();
AIAssist.getInstance( this ).release();
mServiceApis.getOnlineCarPanelApi().clear();
if ( CallChatApi.getInstance().getApiProvider() != null ) {
CallChatApi.getInstance().getApiProvider().initVehicleTeamContainer("init", 0, null);
}
ContextHolderUtil.releaseContext();
MogoModulesManager.getInstance().onDestroy();
SchemeIntent.getInstance().clear();

View File

@@ -7,6 +7,7 @@ import android.text.TextUtils;
import android.util.Log;
import com.mogo.map.MogoLatLng;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;

View File

@@ -2,6 +2,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/module_main_window_background_color"
android:layout_height="match_parent"
android:orientation="vertical">
@@ -25,9 +26,9 @@
android:layout_width="@dimen/module_main_apps_fragment_container_width"
android:layout_height="match_parent"
android:paddingLeft="@dimen/module_main_apps_fragment_container_padding"
android:paddingRight="@dimen/module_main_apps_fragment_container_padding"
android:paddingTop="@dimen/module_main_apps_fragment_container_paddingTop"
android:paddingBottom="@dimen/module_main_apps_fragment_container_paddingTop"/>
android:paddingRight="@dimen/module_main_apps_fragment_container_padding"
android:paddingBottom="@dimen/module_main_apps_fragment_container_paddingTop" />
<!-- 左侧浮层,布局位置目前只考虑了1+16独立app情况 -->
<FrameLayout
@@ -42,8 +43,8 @@
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
android:paddingLeft="@dimen/module_main_apps_fragment_container_padding"
android:paddingRight="@dimen/module_main_apps_fragment_container_padding"
android:paddingTop="@dimen/module_main_apps_fragment_container_paddingTop"
android:paddingRight="@dimen/module_main_apps_fragment_container_padding"
android:paddingBottom="@dimen/module_main_apps_fragment_container_paddingTop" />
<!-- 浮层-->
@@ -58,15 +59,15 @@
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
android:paddingLeft="@dimen/module_main_event_panel_fragment_paddingLeft"
android:paddingRight="@dimen/module_main_event_panel_fragment_paddingRight"
android:paddingTop="@dimen/module_main_event_panel_fragment_paddingTop"
android:paddingRight="@dimen/module_main_event_panel_fragment_paddingRight"
android:paddingBottom="@dimen/module_main_event_panel_fragment_paddingBottom" />
<FrameLayout
android:id="@+id/module_main_id_message_history_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"/>
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" />
<FrameLayout
android:id="@+id/module_main_id_search_fragment"
@@ -77,8 +78,8 @@
android:id="@+id/module_main_id_cover_up"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@drawable/main_bitmap_splash_bg"
android:scaleType="centerCrop"
android:visibility="visible" />
<FrameLayout

View File

@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/module_main_window_background_color"
android:orientation="vertical">
<!-- 地图-->

View File

@@ -31,4 +31,9 @@
<dimen name="module_ext_top_view_max_width">1920px</dimen>
<dimen name="module_main_panel_margin_right">0px</dimen>
<!--事件面板-->
<dimen name="module_main_event_panel_fragment_paddingTop">0px</dimen>
<dimen name="module_main_event_panel_fragment_paddingBottom">0px</dimen>
<dimen name="module_main_event_panel_fragment_paddingLeft">6px</dimen>
<dimen name="module_main_event_panel_fragment_paddingRight">6px</dimen>
</resources>

View File

@@ -28,8 +28,8 @@
<dimen name="module_event_fragment_container_padding">20px</dimen>
<dimen name="module_main_apps_fragment_container_paddingTop">20px</dimen>
<dimen name="module_main_event_panel_fragment_paddingTop">15px</dimen>
<dimen name="module_main_event_panel_fragment_paddingBottom">15px</dimen>
<dimen name="module_main_event_panel_fragment_paddingLeft">15px</dimen>
<dimen name="module_main_event_panel_fragment_paddingRight">15px</dimen>
<dimen name="module_main_event_panel_fragment_paddingTop">20px</dimen>
<dimen name="module_main_event_panel_fragment_paddingBottom">18px</dimen>
<dimen name="module_main_event_panel_fragment_paddingLeft">18px</dimen>
<dimen name="module_main_event_panel_fragment_paddingRight">18px</dimen>
</resources>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="module_main_window_background_color">#1D1D1D</color>
<color name="module_main_window_background_color">#212831</color>
</resources>

View File

@@ -33,6 +33,6 @@
<!--事件面板-->
<dimen name="module_main_event_panel_fragment_paddingTop">2px</dimen>
<dimen name="module_main_event_panel_fragment_paddingBottom">2px</dimen>
<dimen name="module_main_event_panel_fragment_paddingLeft">6px</dimen>
<dimen name="module_main_event_panel_fragment_paddingRight">6px</dimen>
<dimen name="module_main_event_panel_fragment_paddingLeft">2px</dimen>
<dimen name="module_main_event_panel_fragment_paddingRight">4px</dimen>
</resources>

View File

@@ -26,6 +26,7 @@ class AutoNaviBroadcastIntentHandler implements IMogoIntentListener {
// 接收高德
public static final String AUTONAVI_STANDARD_BROADCAST_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
private EnumMapUI mLastAMapUiType = null;
public void register( IMogoIntentManager manager ) {
manager.registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, this );
@@ -131,11 +132,17 @@ class AutoNaviBroadcastIntentHandler implements IMogoIntentListener {
// 高德改变黑夜白天模式后传递给launcher顺便改变其他
if ( extraState == 37 ) {
// 白天模式
mLastAMapUiType = EnumMapUI.Type_Light;
MogoApisHandler.getInstance().getApis().getAdasControllerApi().changeAdasControlMode( EnumMapUI.Type_Light );
} else if ( extraState == 38 ) {
// 夜间模式
mLastAMapUiType = EnumMapUI.Type_Night;
MogoApisHandler.getInstance().getApis().getAdasControllerApi().changeAdasControlMode( EnumMapUI.Type_Night );
}
}
}
public EnumMapUI getLastAMapUiType() {
return mLastAMapUiType;
}
}

View File

@@ -103,6 +103,10 @@ class MapControlCommandHandler {
return;
}
if ( mCallback.getAMapLastType() == ui ) {
return;
}
int KEY_TYPE = 10048;
int state = 0;//2黑夜;1白天 ;0自动
switch ( ui ) {

View File

@@ -296,6 +296,14 @@ public class MapPresenter extends Presenter< MapView > implements
mRegisterCenter.registerADASControlStatusChangedListener( TAG, this );
}
@Override
public EnumMapUI getAMapLastType() {
if ( mAutoNaviReceiver != null ) {
return mAutoNaviReceiver.getLastAMapUiType();
}
return null;
}
private void initBroadcast() {
mAutoNaviReceiver = new AutoNaviBroadcastIntentHandler();
mAutoNaviReceiver.setCallback( this );

View File

@@ -36,4 +36,7 @@ public interface OnMapControlCallback {
// 缩放地图
void onZoomMap( boolean zoomIn );
// 高德地图上次类型
EnumMapUI getAMapLastType();
}

View File

@@ -45,7 +45,6 @@ import com.mogo.module.service.launchercard.LauncherCardRefresher;
import com.mogo.module.service.marker.MapMarkerManager;
import com.mogo.module.service.network.RefreshCallback;
import com.mogo.module.service.network.RefreshModel;
import com.mogo.module.service.ttsConfig.TtsConfigModleData;
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushData;
import com.mogo.module.service.network.bean.HomeCompanyDistanceForPushResponse;
import com.mogo.module.service.onlinecar.panel.NavigationTargetInfo;
@@ -54,6 +53,7 @@ import com.mogo.module.service.refresh.AutoRefreshStrategy;
import com.mogo.module.service.refresh.CustomRefreshStrategy;
import com.mogo.module.service.refresh.RefreshObject;
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
import com.mogo.module.service.ttsConfig.TtsConfigModleData;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
@@ -76,7 +76,6 @@ import com.zhidao.carchattingprovider.CallChattingProviderConstant;
import com.zhidao.carchattingprovider.ICallChatResponse;
import com.zhidao.carchattingprovider.ICallProviderResponse;
import com.zhidao.carchattingprovider.ICarsChattingProvider;
import com.zhidao.smartv2x.common.utils.LoggerUtils;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
@@ -400,20 +399,23 @@ public class MogoServices implements IMogoMapListener,
* 关闭所有模块的控制面板
*/
private void closeAllPanel() {
LoggerUtils.log("zy=======stop");
mCallProviderResponse = new ICallChatResponse() {
@Override
public void hideUserWindowError(@NotNull String errorMsg) {
LoggerUtils.log("zy=======errorMsg:" + errorMsg);
}
};
if ( mCallProviderResponse == null ) {
mCallProviderResponse = new ICallChatResponse() {
@Override
public void hideUserWindowError(@NotNull String errorMsg) {
}
};
}
MogoApisHandler.getInstance().getApis().getShareManager().dismissShareDialog();
MogoApisHandler.getInstance().getApis().getOnlineCarPanelApi().hidePanel();
MogoApisHandler.getInstance().getApis().getAdasControllerApi().setSettingStatus(false);
MogoApisHandler.getInstance().getApis().getEventPanelManager().hidePanel();
carsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
if ( carsChattingProvider == null ) {
carsChattingProvider = (ICarsChattingProvider) ARouter.getInstance().build(CallChattingProviderConstant.CAR_CALL_PROVIDER).navigation();
}
if ( carsChattingProvider != null ) {
carsChattingProvider.hideUserWindow("MOGO_COMMON_SERVICE", mContext, mCallProviderResponse);
carsChattingProvider.hideUserWindow(TAG, mContext, mCallProviderResponse);
}
}
@@ -433,6 +435,7 @@ public class MogoServices implements IMogoMapListener,
mStatusManager.registerStatusChangedListener(ServiceConst.TYPE, StatusDescriptor.SEEK_HELPING, statusChangedListener);
mStatusManager.registerStatusChangedListener(ServiceConst.TYPE, StatusDescriptor.ACC_STATUS, statusChangedListener);
mStatusManager.registerStatusChangedListener(ServiceConst.TYPE, StatusDescriptor.TOP_VIEW, statusChangedListener);
mStatusManager.registerStatusChangedListener(ServiceConst.TYPE, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListener);
mStatusManager.setAIAssistReady(TAG, AIAssist.getInstance(mContext).hasFlush());
registerMogoReceiver(context);
@@ -482,6 +485,10 @@ public class MogoServices implements IMogoMapListener,
}
AutoPilotRemoteController.getInstance().start();
Intent intent = new Intent( "com.freedom.ser.ACTION" );
intent.addFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
mContext.sendBroadcast( intent );
}
private void initLocationServiceProcess(Context context) {
@@ -566,7 +573,6 @@ public class MogoServices implements IMogoMapListener,
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
try {
context.getApplicationContext().registerReceiver(mAIAssistReceiver, filter);
Logger.i(TAG, "register voice receiver.");
} catch (Exception e) {
Logger.e(TAG, e, "error. ");
}
@@ -585,7 +591,6 @@ public class MogoServices implements IMogoMapListener,
float width = getMapCameraFactWidth();
float height = getMapCameraFactHeight();
mIsVertical = width < height;
Logger.i(TAG, "map status is vertical : " + mIsVertical);
mIsMapStatusOk = true;
} catch (Exception e) {
e.printStackTrace();
@@ -620,7 +625,6 @@ public class MogoServices implements IMogoMapListener,
case MotionEvent.ACTION_DOWN:
if (mLastZoomLevel == 0) {
mLastZoomLevel = mUiController.getZoomLevel();
Logger.i(TAG, "初始化缩放级别 为:%f", mLastZoomLevel);
}
break;
case MotionEvent.ACTION_UP:
@@ -668,7 +672,6 @@ public class MogoServices implements IMogoMapListener,
if (mStatusManager.isUserInteracted()) {
mLastCustomRefreshCenterLocation = latLng;
mLastZoomLevel = zoom;
Logger.d(TAG, "user interacted");
return;
}
@@ -676,7 +679,6 @@ public class MogoServices implements IMogoMapListener,
if (mStatusManager.isV2XShow()) {
mLastCustomRefreshCenterLocation = latLng;
mLastZoomLevel = zoom;
Logger.d(TAG, "user v2x show");
return;
}
@@ -684,12 +686,9 @@ public class MogoServices implements IMogoMapListener,
if (mStatusManager.isSearchUIShow()) {
mLastCustomRefreshCenterLocation = latLng;
mLastZoomLevel = zoom;
Logger.d(TAG, "user search Ui show");
return;
}
Logger.d(TAG, "mLastZoomLevel = %s, zoom = %s", mLastZoomLevel, zoom);
// 手动刷新触发
if (mLastZoomLevel - zoom > mCustomRefreshStrategy.getZoomOutLevel()) {
// 缩放级别缩小
@@ -704,7 +703,6 @@ public class MogoServices implements IMogoMapListener,
msg.what = ServiceConst.MSG_MAP_CHANGED;
msg.obj = new RefreshObject(mCustomRefreshCallback, getQueryRadius(), latLng, 0);
mThreadHandler.sendMessage(msg);
Logger.d(TAG, "平移触发");
}
}
@@ -738,7 +736,6 @@ public class MogoServices implements IMogoMapListener,
return false;
}
float distance = Utils.calculateLineDistance(latLng, mLastCustomRefreshCenterLocation);
Logger.d(TAG, "move distance = %s, factor = %s", distance, (factor / 2));
return distance > (factor / 2);
} catch (Exception e) {
Logger.e(TAG, e, "warming. ");
@@ -838,7 +835,6 @@ public class MogoServices implements IMogoMapListener,
if (mStatusManager.isSearchUIShow()) {
return;
}
Logger.d(TAG, mAutoRefreshCallback == callback ? "触发自动刷新" : "触发手动刷新");
int amount = 20;
Message msg = Message.obtain();
@@ -886,16 +882,13 @@ public class MogoServices implements IMogoMapListener,
delay = mRefreshRemainingTime;
}
if (time == 0) {
Logger.d(TAG, "立即刷新");
invokeAutoRefresh();
} else {
mHandler.sendEmptyMessageDelayed(ServiceConst.MSG_TYPE_REFRESH_DECREASE, delay);
}
Logger.i(TAG, "下次刷新时间:%sms后", mRefreshRemainingTime);
}
public void refreshStrategy() {
Logger.d(TAG, "move to center and refresh data.");
mStatusManager.setUserInteractionStatus(ServiceConst.TYPE, true, false);
mUiController.recoverLockMode();// 锁车代替移到中心点
restartAutoRefreshAtTime(0);

View File

@@ -65,6 +65,13 @@ class AccStatusIntentHandler implements IntentHandler {
if ( state != ACC_OFF && state != ACC_ON && state != ACC_OFF_DELAY ) {
return;
}
if ( state == ACC_ON || state == ACC_OFF_DELAY ) {
Intent newIntent = new Intent( "com.freedom.ser.ACTION" );
newIntent.putExtra( "acc", true );
newIntent.addFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
context.sendBroadcast( newIntent );
Logger.d( TAG, "发送广播com.freedom.ser.ACTION" );
}
boolean accOn = state == ACC_ON;
if ( MarkerServiceHandler.getMogoStatusManager().isAccOn() == accOn ) {
return;

View File

@@ -4,11 +4,9 @@ import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.mogo.module.service.ServiceConst;
import com.mogo.utils.LaunchUtils;
import com.mogo.utils.TipToast;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
@@ -25,7 +23,7 @@ public class AppOperationIntentHandler implements IntentHandler {
public final Map< String, String > sAppPackages = new HashMap<>();
public AppOperationIntentHandler() {
sAppPackages.put( "车聊聊", "com.zhidao.imdemo" );
// sAppPackages.put( "车聊聊", "com.zhidao.imdemo" );
}
@Override

View File

@@ -129,6 +129,7 @@ class LauncherCardRefresher {
switch ( msg.what ) {
case MSG_WAIT_NETWORK:
trtRequestNetworkConfigStrategy();
break;
case MSG_LOAD_NET_CONFIG:
loadNetworkConfigStrategy();
break;
@@ -526,9 +527,18 @@ class LauncherCardRefresher {
} else if ( datum instanceof TtsConfigData.NearRoads ) {
result = handleNearRoadsTtsConfig( ( ( TtsConfigData.NearRoads ) datum ) );
} else if ( datum instanceof TtsConfigData.OnlineCarVsExplorerWay ) {
result = handleExplorerWayTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) );
if ( !result ) {
if ( node.type == LauncherCardRefreshType.ExplorerWay ) {
result = handleExplorerWayTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) );
if ( !result ) {
node.type = LauncherCardRefreshType.OnlineCar;
result = handleOnlineCarTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) );
}
} else if( node.type == LauncherCardRefreshType.OnlineCar ){
result = handleOnlineCarTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) );
if ( !result ) {
node.type = LauncherCardRefreshType.ExplorerWay;
result = handleExplorerWayTtsConfig( ( ( TtsConfigData.OnlineCarVsExplorerWay ) datum ) );
}
}
}
if ( result ) {
@@ -594,7 +604,7 @@ class LauncherCardRefresher {
String tts = mContext.getString( R.string.module_service_launcher_card_tips );
String info = mContext.getString( R.string.module_service_launcher_card_info );
speakTTS( String.format( tts, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay.getDesc() ), false );
notifyRefreshChanged( String.format( info, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay ), explorerWay.poiTotal, tts );
notifyRefreshChanged( String.format( info, explorerWay.poiTotal, LauncherCardRefreshType.ExplorerWay.getDesc() ), explorerWay.poiTotal, tts );
return true;
}
@@ -611,7 +621,7 @@ class LauncherCardRefresher {
String tts = mContext.getString( R.string.module_service_launcher_card_tips );
String info = mContext.getString( R.string.module_service_launcher_card_info );
speakTTS( String.format( tts, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar.getDesc() ), false );
notifyRefreshChanged( String.format( info, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar ), onlineCar.carTotal, tts );
notifyRefreshChanged( String.format( info, onlineCar.carTotal, LauncherCardRefreshType.OnlineCar.getDesc() ), onlineCar.carTotal, tts );
return true;
}

View File

@@ -7,20 +7,15 @@ import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.facebook.drawee.backends.pipeline.PipelineDraweeControllerBuilder;
import com.facebook.drawee.interfaces.DraweeController;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.marker.PoiWrapper;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
import com.mogo.service.imageloader.IMogoImageLoaderListener;
@@ -108,7 +103,6 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV
@Override
public void onCompleted(Bitmap bitmap) {
Logger.d(TAG, "loadImageWithMarker loaded.");
// 使用view渲染地图marker刷新纹理的时候需要重新用view生成纹理然后在设置
if (mMarker != null) {
mMarker.setIcon(fromView(MapMarkerBaseView.this));
@@ -117,7 +111,6 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV
@Override
public void onFailure(Exception e) {
Logger.e(TAG, "loadImageWithMarker onFailure.");
}
});
}

View File

@@ -36,12 +36,10 @@ import com.mogo.module.service.utils.ViewUtils;
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
import com.mogo.service.connection.IMogoOnMessageListener;
import com.mogo.service.module.IMogoBizActionDoneListener;
import com.mogo.utils.AppUtils;
import com.mogo.utils.ResourcesHelper;
import com.mogo.utils.ThreadPoolService;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.WorkThreadHandler;
import com.mogo.utils.logger.Logger;
import com.zhidao.carchattingprovider.ICallChatResponse;
import org.json.JSONArray;
@@ -105,8 +103,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
return;
}
Logger.d( TAG, "初始化" );
mContext = context.getApplicationContext();
mRefreshModel = new RefreshModel( mContext );
CloudPoiManager.getInstance().updateFromConfig(context);
@@ -140,7 +136,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
*/
@Override
public boolean onMarkerClicked( IMogoMarker marker ) {
Logger.d( TAG, "onMarkerClicked 点击了大而全中的Marker" + marker );
try {
boolean result = switchMarkerOpenStatus( marker );
if ( !result ) {
@@ -181,7 +176,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( mLastCheckMarker != null ) {
// 判断点击的是否是同一个
if ( marker.equals( mLastCheckMarker ) ) {
Logger.d( TAG, "onMarkerClicked 与上一次点击的Marker一样不做处理" + marker );
return false;
}
// 将上次选中 Marker 设置为未选中状态
@@ -235,7 +229,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
MarkerOnlineCar onlineCar = ( MarkerOnlineCar ) ( ( MarkerShowEntity ) marker.getObject() ).getBindObj();
CallChatApi.getInstance().showUserWindow( mContext, onlineCar );
} catch ( Exception e ) {
Logger.e( TAG, e, "openMarker" );
}
}
}
@@ -406,7 +399,6 @@ 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() ) {
@@ -449,7 +441,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
marker.startScaleAnimationWithAlpha( 0, 1.2f, 0, 1.2f, 0f, 1f, 300, new LinearInterpolator(), new OnMarkerAnimationListener() {
@Override
public void onAnimStart() {
Logger.d( TAG, " onAnimStart ---1----> " );
}
@Override
@@ -641,7 +632,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
return;
}
try {
Logger.d( TAG, "dispatch data to %s", biz );
MarkerServiceHandler.getDataManager().syncData( biz, object );
} catch ( Exception e ) {
e.printStackTrace();
@@ -689,7 +679,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
try {
return drawMapMarkerImpl( markerShowEntity, zIndex );
} catch ( Exception e ) {
Logger.e( TAG, e, "drawMapMarker" );
return null;
}
}
@@ -730,7 +719,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( ignoreDrawRequest() ) {
return;
}
Logger.d( TAG, "接收到了地图大而全数据" );
runOnTargetThread( () -> {
drawMapMarker( response );
} );
@@ -925,7 +913,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
if ( points.size() >= 1 ) {
iMogoMarker.startSmooth( points, SMOOTH_DURATION );
} else {
Logger.d( TAG, "静止小车,但是有相同的连续坐标" );
}
}
@@ -947,7 +934,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
double lat2 = Double.valueOf( end.getCoordinates().get( 1 ) + "" );
double lng2 = Double.valueOf( end.getCoordinates().get( 0 ) + "" );
if ( Utils.calculateLineDistance( new MogoLatLng( lat1, lng1 ), new MogoLatLng( lat2, lng2 ) ) >= 500 ) {
Logger.d( TAG, "filter point" );
return true;
}
} catch ( Exception e ) {
@@ -975,7 +961,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
@Override
public void onBizActionDone( String biz, int position, Object data ) {
Logger.d( TAG, "biz = %s, position = %s", biz, position );
if ( data instanceof MarkerShowEntity && ( ( MarkerShowEntity ) data ).getMarker() != null ) {
switchMarkerOpenStatus( ( ( MarkerShowEntity ) data ).getMarker() );
} else {
@@ -986,7 +971,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
IMogoMarker marker = markers.get( position );
switchMarkerOpenStatus( marker );
} catch ( Exception e ) {
Logger.e( TAG, e, "occur error." );
}
}
}

View File

@@ -72,11 +72,9 @@ public class MogoReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
Logger.i(TAG, "receive intent action: %s", action);
if (TextUtils.equals(VOICE_ACTION, action)) {
String cmd = intent.getStringExtra(PARAM_COMMAND);
if (!TextUtils.isEmpty(cmd)) {
Logger.d( TAG, "receive command: %s", cmd );
mMogoIntentManager.invoke(cmd, intent);
}
} else {

View File

@@ -96,6 +96,7 @@ public class GlobalUnwakeManager implements IProvider, IMogoIntentListener, IMog
* @param type 面板位置索引
*/
private void showPanelByStatus(String target, int type){
MogoApisHandler.getInstance().getApis().getAdasControllerApi().setSettingStatus(false);
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageOnResume() ) {
MogoApisHandler.getInstance().getApis().getEventPanelManager().showPanelWithSelectedItem(type);
} else {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/service_car_panel_call_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/service_car_panel_call_normal" android:state_pressed="false" />
<item android:drawable="@drawable/service_car_panel_call_normal" />
</selector>

View File

@@ -28,7 +28,7 @@
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="@dimen/module_services_online_car_panel_close_margin_top"
android:src="@drawable/module_services_close" />
android:src="@drawable/module_common_close_selector" />
<ProgressBar
android:id="@+id/module_services_id_loading"

View File

@@ -62,7 +62,7 @@
android:layout_width="@dimen/modle_car_panel_call"
android:layout_height="@dimen/modle_car_panel_call"
android:layout_marginEnd="@dimen/modle_car_panel_call_margin"
android:background="@drawable/selector_service_car_panel_call"
android:background="@drawable/module_common_selector_call"
android:padding="@dimen/module_services_panel_item_detail_padding"
android:textColor="@color/module_services_panel_item_detail_textColor"
android:textSize="@dimen/module_services_panel_item_detail_textSize"

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">16dp</dimen>
<dimen name="module_service_marker_dot_marginTop">2dp</dimen>
<dimen name="module_service_marker_bubble_width">56px</dimen>
<dimen name="module_service_marker_bubble_height">65px</dimen>
<dimen name="module_service_marker_dot_marginTop">2px</dimen>
<dimen name="module_service_marker_bubble_width">70px</dimen>
<dimen name="module_service_marker_bubble_height">76px</dimen>
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">16dp</dimen>
<dimen name="module_service_marker_dot_marginTop">2dp</dimen>
<dimen name="module_service_marker_bubble_width">56px</dimen>
<dimen name="module_service_marker_bubble_height">65px</dimen>
<dimen name="module_service_marker_dot_marginTop">2px</dimen>
<dimen name="module_service_marker_bubble_width">70px</dimen>
<dimen name="module_service_marker_bubble_height">76px</dimen>
<dimen name="module_service_marker_bubble_icon_width">35px</dimen>
<dimen name="module_service_marker_bubble_icon_height">35px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">4px</dimen>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">20dp</dimen>
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_bubble_width">100px</dimen>
<dimen name="module_service_marker_bubble_height">117px</dimen>
<dimen name="module_service_marker_dot_marginTop">4px</dimen>
<dimen name="module_service_marker_bubble_width">120px</dimen>
<dimen name="module_service_marker_bubble_height">130px</dimen>
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">20dp</dimen>
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_bubble_width">100px</dimen>
<dimen name="module_service_marker_bubble_height">117px</dimen>
<dimen name="module_service_marker_dot_marginTop">4px</dimen>
<dimen name="module_service_marker_bubble_width">120px</dimen>
<dimen name="module_service_marker_bubble_height">130px</dimen>
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>
@@ -23,8 +23,8 @@
<dimen name="module_service_content_minWidth">120px</dimen>
<dimen name="module_service_id_marker_content_paddingRight_widthoutCall">20px</dimen>
<dimen name="module_services_online_car_panel_marginTop">13px</dimen>
<dimen name="module_services_online_car_panel_marginBottom">13px</dimen>
<dimen name="module_services_online_car_panel_marginTop">18px</dimen>
<dimen name="module_services_online_car_panel_marginBottom">18px</dimen>
<dimen name="module_services_online_car_panel_marginRight">13px</dimen>
<dimen name="module_services_online_car_panel_paddingLeft">43px</dimen>
<dimen name="module_services_online_car_panel_paddingBottom">28px</dimen>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_service_marker_anchor_size">20dp</dimen>
<dimen name="module_service_marker_dot_marginTop">4dp</dimen>
<dimen name="module_service_marker_bubble_width">100px</dimen>
<dimen name="module_service_marker_bubble_height">117px</dimen>
<dimen name="module_service_marker_dot_marginTop">4px</dimen>
<dimen name="module_service_marker_bubble_width">120px</dimen>
<dimen name="module_service_marker_bubble_height">130px</dimen>
<dimen name="module_service_marker_bubble_icon_width">60px</dimen>
<dimen name="module_service_marker_bubble_icon_height">60px</dimen>
<dimen name="module_service_marker_bubble_icon_marginBottom">8px</dimen>

View File

@@ -48,7 +48,7 @@ class StrategyShareProvider : IProvider {
// adas返回前车距离单位是米
val frontDistanceItem = GsonUtil.objectFromJson(it, AdasFrontCarDistanceY::class.java)
frontDistanceItem.result.distanceY?.apply {
blockStrategy.refreshFrontDistance(it.toDouble().toInt())
blockStrategy.refreshFrontDistance(this.toDouble().toInt())
}
}
} catch (e: Exception) {

View File

@@ -568,7 +568,9 @@ public class TanluManager implements IMogoMarkerClickListener,
@Override
public void onAnimEnd() {
UiThreadHandler.postDelayed( () -> {
mogoAnimationMarker.destroy();
if (mogoAnimationMarker != null) {
mogoAnimationMarker.destroy();
}
}, 1_200L );
}
});

View File

@@ -105,22 +105,10 @@ class GridFixableShareDialog(context: Context) : BaseFloatDialog(context) {
}
override fun show() {
Logger.d(TAG, "onShow====")
if (!DebugConfig.isLauncher()) {
mApis.adasControllerApi.closeADAS()
}
gridBtnManager.showShareButton()
super.show()
}
override fun dismiss() {
Logger.d(TAG, "onDismiss=====")
if (!DebugConfig.isLauncher() && mApis.statusManagerApi.isMainPageOnResume) {
mApis.adasControllerApi.showADAS()
}
super.dismiss()
}
companion object {
private const val TAG = "GridFixableShareDialog"
}

View File

@@ -136,7 +136,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
if (current - startRecordDistanceTime >= DISTANCE_RECORD_TIME) {
// 超过阈值,准备判断是否拥堵
startRecordDistanceTime = 0L
if (tripDistance in 30..1000 && isClose() && currentSpeed < 40) {
if (tripDistance in 100..1000 && isClose() && currentSpeed < 40) {
Logger.d(TAG, "根据距离,判定为拥堵,准备上报, tripDistance: $tripDistance, frontDistance: $frontDistance, currentSpeed: $currentSpeed")
val p = TanluUploadParams(IMogoTanluProvider.TYPE_BLOCK, IMogoTanluProvider.UPLOAD_FROM_STRATEGY_BLOCK_AUTO)
val latLon = MogoLatLng(lat, lon)

View File

@@ -15,7 +15,6 @@ import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.module.v2x.fragment.V2XEventPanelFragment;
import com.mogo.service.eventpanel.IEventPanelProvider;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.module.ModuleType;
import com.mogo.utils.logger.Logger;
@@ -35,6 +34,7 @@ public class V2XEventPanelModuleProvider implements
@Override
public Fragment createFragment(Context context, Bundle data) {
Logger.e(MODULE_NAME, "事件模版 createFragment。。。。");
V2XServiceManager.init(context);
return V2XEventPanelFragment.Companion.getInstance();
}
@@ -92,6 +92,7 @@ public class V2XEventPanelModuleProvider implements
@Override
public void init(Context context) {
V2XServiceManager.init(context);
Logger.e(MODULE_NAME, "事件模版 模块初始化。。。。");
}

View File

@@ -189,13 +189,13 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
public shareEmptyViewHolder(@NonNull View itemView) {
super(itemView);
Button shareBtn = itemView.findViewById(R.id.share_event_button);
shareBtn.setOnClickListener(view -> {
TextView share = itemView.findViewById(R.id.share_event_button);
share.setOnClickListener(view -> {
V2XEventPanelFragment.Companion.getInstance().hidePanel();
mApis.getShareManager().showShareDialog();
});
Button refresh = itemView.findViewById(R.id.refresh_button);
TextView refresh = itemView.findViewById(R.id.refresh_button);
refresh.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@@ -10,11 +10,13 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mogo.commons.voice.AIAssist;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingViewHolder;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingItemClickListener;
import com.mogo.module.v2x.utils.V2XUtils;
import java.util.List;

View File

@@ -16,6 +16,7 @@ import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.adapter.holder.V2XSurroundingDetailVH;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
import com.mogo.module.v2x.listener.SurroundingDetailItemListener;
import com.mogo.module.v2x.utils.RoadConditionUtils;
import com.mogo.module.v2x.view.HeartLikeView;
import com.mogo.module.v2x.view.HeartUnLikeView;
@@ -39,10 +40,12 @@ public class V2XSurroundingDetailAdapter extends RecyclerView.Adapter<V2XSurroun
private HeartLikeView mHeartLikeView;
private HeartUnLikeView mUnHeartLikeView;
private SurroundingDetailItemListener mListener;
public V2XSurroundingDetailAdapter(Context context, List<MarkerExploreWay> list) {
public V2XSurroundingDetailAdapter(Context context, List<MarkerExploreWay> list, SurroundingDetailItemListener listener) {
mContext = context;
markerExploreWays = list;
mListener = listener;
}
@Override
@@ -77,18 +80,19 @@ public class V2XSurroundingDetailAdapter extends RecyclerView.Adapter<V2XSurroun
mAddressTv.setText(exploreWay.getAddr());
mTimeTv.setText(DateTimeUtils.getTimeText(exploreWay.getGenerateTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
Logger.d(V2XConst.MODULE_NAME, "exploreWay.isFabulous() = " + exploreWay.isFabulous());
showView(exploreWay.isFabulous());
mHeartLikeView.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈有用 position = " + position);
roadReportTrue(exploreWay);
showView(true);
mListener.onItemClickListener(v, position, exploreWay);
});
mUnHeartLikeView.setOnClickCallListener(v -> {
Logger.d(V2XConst.MODULE_NAME, "反馈无用 position = " + position);
roadReportErr(exploreWay);
showView(true);
mListener.onItemClickListener(v, position, exploreWay);
});
}

View File

@@ -63,7 +63,7 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryS
mTagEventType.setText(EventTypeUtils.getPoiTypeStr(mExploreWay.getPoiType()));
try {
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + " 的分享 时间:" +
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + "的分享 " +
TimeUtils.millis2String(mOldScenarioData.getTriggerTime(), "MM月dd日 HH:mm"));
} catch (Exception e) {
e.printStackTrace();

View File

@@ -1,6 +1,7 @@
package com.mogo.module.v2x.entity.panel;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import java.io.Serializable;
import java.util.ArrayList;
@@ -35,4 +36,41 @@ public class SurroundingConstruction implements Serializable {
public void addMarkerExploreWay(MarkerExploreWay item) {
construtList.add(item);
}
public String getTypeNameTTS(String type) {
String typeName = "请查看周边的";
switch (type) {
case MarkerPoiTypeEnum.ROAD_CLOSED:
typeName += "封路";
break;
case MarkerPoiTypeEnum.FOURS_ICE:
typeName += "道路结冰";
break;
case MarkerPoiTypeEnum.FOURS_FOG:
typeName += "浓雾";
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
typeName += "交通检查";
break;
case MarkerPoiTypeEnum.FOURS_ACCIDENT:
typeName += "交通事故";
break;
case MarkerPoiTypeEnum.FOURS_BLOCK_UP:
typeName += "拥堵";
break;
case MarkerPoiTypeEnum.FOURS_ROAD_WORK:
typeName += "施工";
break;
case MarkerPoiTypeEnum.FOURS_PONDING:
typeName += "道路积水";
break;
case MarkerPoiTypeEnum.FOURS_LIVING:
typeName += "实时路况";
break;
default:
typeName += "实时路况";
break;
}
return typeName + "信息";
}
}

View File

@@ -32,6 +32,7 @@ import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
import com.mogo.module.v2x.adapter.V2XSurroundingDetailAdapter
import com.mogo.module.v2x.entity.panel.BackRefreshInfo
import com.mogo.module.v2x.entity.panel.SurroundingConstruction
import com.mogo.module.v2x.listener.SurroundingDetailItemListener
import com.mogo.module.v2x.presenter.EventPanelPresenter
import com.mogo.module.v2x.utils.TrackUtils
import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView
@@ -49,7 +50,7 @@ import org.greenrobot.eventbus.ThreadMode
*
* @author tongchenfei
*/
class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPresenter>() {
class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPresenter>(), SurroundingDetailItemListener {
private val TAG = "EventPanelFragment"
@@ -239,6 +240,8 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
V2XServiceManager.getMogoEntranceButtonController()
.addBottomLayerView(mV2XEventPanelHistoryCountView, x, y)
changeEventCount()
} else {
selectWithItem(1)
}
} catch (e: Exception) {
@@ -267,10 +270,14 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
selectWithItem(item)
}
override fun onItemClickListener(v: View?, position: Int, exploreWay: MarkerExploreWay?) {
markerExploreWays[position].isFabulous = true
mSurroundingDetailAdapter.notifyItemChanged(position)
}
private fun initDetail() {
mDetailRecyclerView!!.addItemDecoration(SpacesItemDecoration(resources.getDimension(R.dimen.share_item_padding).toInt()))
mSurroundingDetailAdapter = V2XSurroundingDetailAdapter(activity, markerExploreWays)
mSurroundingDetailAdapter = V2XSurroundingDetailAdapter(activity, markerExploreWays, this)
mDetailRecyclerView!!.adapter = mSurroundingDetailAdapter
val linearLayoutManager = LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)
mDetailRecyclerView!!.layoutManager = linearLayoutManager
@@ -312,7 +319,9 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
mRgTabSelect?.visibility = View.VISIBLE
mVpEventPanel?.visibility = View.VISIBLE
mBtnHidePanels?.visibility = View.VISIBLE
if (DebugConfig.isMapBased()) {
mBtnHidePanels?.visibility = View.VISIBLE
}
} else {
mBackImage?.visibility = View.VISIBLE
mTopBriefTv?.visibility = View.VISIBLE
@@ -320,7 +329,9 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
mRgTabSelect?.visibility = View.GONE
mVpEventPanel?.visibility = View.GONE
mBtnHidePanels?.visibility = View.GONE
if (DebugConfig.isMapBased()) {
mBtnHidePanels?.visibility = View.GONE
}
}
}
@@ -346,23 +357,19 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
when (item) {
0 -> {
try {
mRbScenarioHistory?.isChecked = true
mV2XScenarioHistoryFragment.fromVoice = true
if (mRbScenarioHistory?.isChecked == true) {
mV2XScenarioHistoryFragment.ttsForVoiceCheckout()
} else {
mRbScenarioHistory?.isChecked = true
}
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
}
1 -> {
try {
mV2XSurroundingFragment.fromVoice = true
if (mRbSurroundingEvent?.isChecked == true) {
mV2XSurroundingFragment.ttsForVoiceCheckout()
} else {
mRbSurroundingEvent?.isChecked = true
mV2XSurroundingFragment.fromVoice = true
}
} catch (e: java.lang.Exception) {
e.printStackTrace()
@@ -370,11 +377,11 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
}
2 -> {
try {
mV2XShareEventsFragment.fromVoice = true
if (mRbShareEvents?.isChecked == true) {
mV2XShareEventsFragment.ttsForVoiceCheckout()
} else {
mRbShareEvents?.isChecked = true
mV2XShareEventsFragment.fromVoice = true
}
} catch (e: java.lang.Exception) {
e.printStackTrace()

View File

@@ -128,11 +128,11 @@ public class V2XScenarioHistoryFragment
mClHistoryList.setVisibility(View.GONE);
}
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
if (fromVoice == true){
ttsForHistoryFirstToday();
if (fromVoice == true) {
ttsForVoiceCheckout();
fromVoice = false;
}
ttsForHistoryFirstToday();
}
});
}
@@ -155,9 +155,9 @@ public class V2XScenarioHistoryFragment
}
/*
* 语音查询出行动态 TTS播报
* */
public void ttsForVoiceCheckout(){
* 语音查询出行动态 TTS播报
* */
public void ttsForVoiceCheckout() {
if (mV2XHistoryScenarioData.size() > 0) {
AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice("为您找到以下动态请查看", null);

View File

@@ -34,6 +34,7 @@ import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.R;
@@ -197,6 +198,8 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
spannableString.setSpan(new StyleSpan(Typeface.BOLD), 7,
originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTotalTv.setText(spannableString);
ttsForSurroundingFirstToday(exploreWayList.size());
} else {
mTopLayout.setVisibility(View.GONE);
mRecyclerView.setVisibility(View.GONE);
@@ -206,19 +209,19 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
ttsForVoiceCheckout();
fromVoice = false;
}
ttsForSurroundingFirstToday();
}
/*
/**
* 手动点击周边事件 TTS播报
* */
private void ttsForSurroundingFirstToday() {
*/
private void ttsForSurroundingFirstToday(int eventCount) {
boolean hasBroadTts = V2XUtils.isFirstTodayWithKey("TTS_FOR_SURROUNDING_SELECTED");
if (hasBroadTts == false) {
if (poiInfosList.size() > 0) {
if (!hasBroadTts) {
if (eventCount > 0) {
AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice("发现周边" + poiInfosList.size() + "条交通信息", null);
speakTTSVoice("发现周边" + eventCount + "条交通信息", null);
} else {
Logger.e(TAG,"周边没有发现交通信息");
}
}
}
@@ -382,10 +385,14 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
e.printStackTrace();
}
}
/*
* 子类信息tts播报
* */
AIAssist.getInstance(V2XUtils.getApp()).
speakTTSVoice(construction.getTypeNameTTS(construction.getPoiType()), null);
}
}
/**
* 自适应显示
*

View File

@@ -0,0 +1,15 @@
package com.mogo.module.v2x.listener;
import android.view.View;
import com.mogo.module.common.entity.MarkerExploreWay;
import com.mogo.module.v2x.entity.panel.SurroundingConstruction;
/**
* @author lixiaopeng
* @description
* @since 2020/8/10
*/
public interface SurroundingDetailItemListener {
void onItemClickListener(View v, int position, MarkerExploreWay exploreWay);
}

View File

@@ -27,6 +27,7 @@ import com.mogo.module.v2x.utils.DrivingDirectionUtils;
import com.mogo.module.v2x.utils.LocationUtils;
import com.mogo.module.v2x.utils.MarkerUtils;
import com.mogo.module.v2x.utils.TrackUtils;
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -35,6 +36,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP;
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
/**
@@ -167,6 +169,16 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
v2XMessageEntity.setContent(v2XRoadEventEntity);
v2XMessageEntity.setShowState(true);
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
// 存储本地,出行动态作展示
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
v2XRoadEventEntity.getNoveltyInfo());
//如果poiType是道路拥堵则调用接口查询拥堵状态
String poiType = v2XRoadEventEntity.getPoiType();
if(poiType != null && poiType.equals(FOURS_BLOCK_UP)){
V2XServiceManager.getIMogoTrafficUploadProvider().verifyCurrentTrafficStatus();
}
}
}
@@ -299,4 +311,16 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_SHOW, properties);
}
/**
* 存储本地数据
*
* @param markerExploreWay 要存储的场景
*/
public void saveLocalStory(int scenarioType, Object markerExploreWay) {
try {
V2XSQLiteUtils.saveLocalStory(scenarioType,markerExploreWay);
} catch (Exception e) {
e.printStackTrace();
}
}
}

Some files were not shown because too many files have changed in this diff Show More