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

# Conflicts:
#	modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml
#	modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml
#	modules/mogo-module-extensions/src/main/res/values/dimens.xml
This commit is contained in:
wangcongtao
2020-09-23 14:06:55 +08:00
79 changed files with 645 additions and 1945 deletions

View File

@@ -3,15 +3,10 @@ package com.zhidao.mogo.tanlu.api;
import android.content.Context;
import android.util.ArrayMap;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.analytics.AnalyticsUtils;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.tanlu.TanluUploadParams;
import com.mogo.service.share.IMogoTanluProvider;
import com.mogo.service.share.TanluUploadParams;
import com.mogo.utils.logger.Logger;
import com.zhidao.roadcondition.service.MainService;
import com.zhidao.roadcondition.service.UploadParams;

View File

@@ -23,7 +23,7 @@
<dimen name="module_apps_navigator_icon_width">94px</dimen>
<dimen name="module_apps_navigator_icon_height">94px</dimen>
<dimen name="module_apps_navigator_icon_divider">17px</dimen>
<dimen name="module_apps_navigator_icon_divider">9px</dimen>
<dimen name="module_apps_voice_icon_width">55px</dimen>
<dimen name="module_apps_voice_icon_height">55px</dimen>
</resources>

View File

@@ -33,6 +33,19 @@ public class V2XMessageEntity<T> implements Serializable {
*/
boolean showState;
/**
* 是否需要判断重复事件
* true-判断false-不判断
* 默认需要判断
*/
boolean isNeedCompareSameScenario = true;
//是否播报tts
private boolean onlyShow = false;
//本机与事件是否连线
private boolean needAddLine = true;
/**
* 场景具体的数据内容
*/
@@ -54,6 +67,14 @@ public class V2XMessageEntity<T> implements Serializable {
this.showState = showState;
}
public boolean isNeedCompareSameScenario() {
return isNeedCompareSameScenario;
}
public void setNeedCompareSameScenario(boolean needCompareSameScenario) {
isNeedCompareSameScenario = needCompareSameScenario;
}
public T getContent() {
return content;
}
@@ -76,6 +97,22 @@ public class V2XMessageEntity<T> implements Serializable {
return Objects.hash(type, content);
}
public boolean isOnlyShow() {
return onlyShow;
}
public void setOnlyShow(boolean onlyShow) {
this.onlyShow = onlyShow;
}
public boolean isNeedAddLine() {
return needAddLine;
}
public void setNeedAddLine(boolean needAddLine) {
this.needAddLine = needAddLine;
}
/**
* V2X 场景类型
*/

View File

@@ -24,6 +24,7 @@ public class V2XRoadEventEntity implements Serializable {
private MarkerExploreWay noveltyInfo;
// tts 提示
private String tts;
// ADAS 展示文案
private String alarmContent;
// 距离当前车辆的距离

View File

@@ -2,15 +2,15 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@android:id/background"
android:drawable="@drawable/icon_enthusiasm_unchoose">
android:drawable="@drawable/icon_heart_unchoose">
</item>
<item
android:id="@android:id/secondaryProgress"
android:drawable="@drawable/icon_enthusiasm_second">
android:drawable="@drawable/icon_heart_second">
</item>
<item
android:id="@android:id/progress"
android:drawable="@drawable/icon_enthusiasm_choose">
android:drawable="@drawable/icon_heart_choose">
</item>
</layer-list>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="heart_ratingbar_width">17px</dimen>
<dimen name="heart_ratingbar_height">14px</dimen>
</resources>

View File

@@ -1054,5 +1054,7 @@
<dimen name="sp_48">48px</dimen>
<dimen name="module_common_shadow_width">-10px</dimen>
<dimen name="module_common_shadow_width_pos">10px</dimen>
<dimen name="heart_ratingbar_width">31.9px</dimen>
<dimen name="heart_ratingbar_height">26px</dimen>
</resources>

View File

@@ -1045,4 +1045,6 @@
<dimen name="sp_48">26.2500px</dimen>
<dimen name="module_common_shadow_width">-8px</dimen>
<dimen name="module_common_shadow_width_pos">8px</dimen>
<dimen name="heart_ratingbar_width">16px</dimen>
<dimen name="heart_ratingbar_height">20px</dimen>
</resources>

View File

@@ -14,4 +14,19 @@
<item name="android:topDark">@android:color/transparent</item>
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
</style>
<style name="customHeartHeartRatingBarStyle" parent="@style/Widget.AppCompat.RatingBar">
<item name="android:minHeight">@dimen/heart_ratingbar_height</item>
<item name="android:maxHeight">@dimen/heart_ratingbar_height</item>
<item name="android:maxWidth">@dimen/heart_ratingbar_width</item>
<item name="android:minWidth">@dimen/heart_ratingbar_width</item>
<item name="android:numStars">5</item>
<item name="android:rating">1</item>
<item name="android:stepSize">0.5</item>
<item name="android:progressDrawable">@drawable/module_commons_heart_ratingbar_drawable</item>
</style>
</resources>

View File

@@ -0,0 +1,50 @@
package com.mogo.module.extensions.bean;
import com.mogo.commons.data.BaseData;
/**
* @author lixiaopeng
* @description
* @since 2020/9/22
*/
public class CommonConfig {
public Active active;//活动配置
public Auth auth; //授权配置
public Speech speech; //语音播报次数
public CommonConfig(Active active, Auth auth, Speech speech) {
this.active = active;
this.auth = auth;
this.speech = speech;
}
public class Active{
public String imageUrl;
public String webUrl;
public int status;
Active(String imageUrl, String webUrl, int status) {
this.imageUrl = imageUrl;
this.webUrl = webUrl;
this.status = status;
}
}
public class Speech{
public int count;
Speech(int count) {
this.count = count;
}
}
public class Auth{
int isNeedAuth;
Auth(int isNeedAuth) {
this.isNeedAuth = isNeedAuth;
}
}
}

View File

@@ -0,0 +1,13 @@
package com.mogo.module.extensions.bean;
import com.mogo.commons.data.BaseData;
/**
* @author lixiaopeng
* @description
* @since 2020/9/22
*/
public class CommonConfigResponse extends BaseData {
public CommonConfig result;
}

View File

@@ -4,6 +4,7 @@ import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
@@ -21,6 +22,8 @@ import com.bumptech.glide.request.RequestOptions;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.commons.voice.AIAssist;
import com.mogo.map.MogoLatLng;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.location.MogoLocation;
@@ -64,11 +67,22 @@ import com.mogo.utils.TipToast;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.glide.GlideApp;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_BUTTON;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_TIME;
import static com.mogo.module.share.constant.ShareConstants.KEY_SERVER_SHOW_DAY_COUNT;
import static com.mogo.module.share.constant.ShareConstants.KEY_SHARE_INNER_GUIDE;
import static com.mogo.module.share.constant.ShareConstants.KEY_SHARE_INNER_GUIDE_TIME;
import static com.mogo.module.share.constant.ShareConstants.KEY_SHARE_OUTER_GUIDE;
import static com.mogo.module.share.constant.ShareConstants.KEY_SHARE_OUTER_GUIDE_TIME;
import static com.mogo.module.share.constant.ShareConstants.ONE_DAY_TIME;
import static com.mogo.module.share.constant.ShareConstants.SEVEN_DAY_TIME;
/**
* @author congtaowang
* @since 2020-01-07
@@ -123,6 +137,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
private ImageView mUserHeadImg;
private String[] mClickShareVoiceStrings;
private String[] mInnerGuideVoiceStrings;
private String[] mOuterGuideVoiceStrings;
/**
* 搜索莫模块
*/
@@ -170,6 +190,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mUploading = findViewById(R.id.module_entrance_id_uploading);
mUploadRoadCondition.setOnClickListener(view -> {
showShareDialog();
playShareGuideVoice();
});
mDisplayOverview = findViewById(R.id.module_ext_id_display_overview);
@@ -330,8 +351,110 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
dealWeatherContainer();
debugTopView();
UiThreadHandler.postDelayed(() -> {
playShareOuterGuideVoice();
}, 5_000L
);
}
Random random = new Random();
/**
* 外部触发引导
*/
private void playShareOuterGuideVoice() {
long intervalTime = SharedPrefsMgr.getInstance(getContext()).getLong(KEY_SHARE_OUTER_GUIDE_TIME, 0);
int shareItemSum = SharedPrefsMgr.getInstance(getContext()).getInt(KEY_SHARE_OUTER_GUIDE, 0);
int serverIssueCount = SharedPrefsMgr.getInstance(getContext()).getInt(KEY_SERVER_SHOW_DAY_COUNT, 0); //TODO 默认6
Log.d(TAG, " playShareOuterGuideVoice shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime + "----serverIssueCount = " + serverIssueCount);
if (shareItemSum < serverIssueCount) {
long time = System.currentTimeMillis();
Log.d(TAG, "playShareOuterGuideVoice time = " + time);
if (intervalTime == 0) {
Log.d(TAG, " playShareOuterGuideVoice -----1-----");
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_OUTER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_OUTER_GUIDE, ++shareItemSum);
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[random.nextInt(3)]);
} else {
Log.d(TAG, " playShareOuterGuideVoice else interval = " + (time - intervalTime));
if ((time - intervalTime) > SEVEN_DAY_TIME) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_OUTER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_OUTER_GUIDE, ++shareItemSum);
AIAssist.getInstance(getContext()).speakTTSVoice(mOuterGuideVoiceStrings[random.nextInt(3)]);
} else {
Log.e(TAG, " playShareOuterGuideVoice else < ONE_DAY_TIME ");
}
}
}
}
private void playShareGuideVoice() {
long intervalTime = SharedPrefsMgr.getInstance(getContext()).getLong(KEY_CLICK_SHARE_TIME, 0);
int shareItemSum = SharedPrefsMgr.getInstance(getContext()).getInt(KEY_CLICK_SHARE_BUTTON, 0);
Log.d(TAG, " playShareGuideVoice shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime);
if (shareItemSum < 3) {
long time = System.currentTimeMillis();
Log.d(TAG, "playShareGuideVoice time = " + time);
if (intervalTime == 0) {
Log.d(TAG, " playShareGuideVoice -----1-----");
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_CLICK_SHARE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_CLICK_SHARE_BUTTON, ++shareItemSum);
AIAssist.getInstance(getContext()).speakTTSVoice(mClickShareVoiceStrings[0]);
} else {
Log.d(TAG, " playShareGuideVoice else interval = " + (time - intervalTime));
if ((time - intervalTime) > ONE_DAY_TIME) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_CLICK_SHARE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_CLICK_SHARE_BUTTON, ++shareItemSum);
AIAssist.getInstance(getContext()).speakTTSVoice(mClickShareVoiceStrings[1]);
} else {
Log.e(TAG, " playShareGuideVoice else < ONE_DAY_TIME ");
}
}
}
}
/**
* 地图移动和缩放回调
* @param latLng 中点的经纬度
* @param zoom 缩放大小
* @param tilt 倾斜度
* @param bearing 旋转角度
*/
@Override
public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
long intervalTime = SharedPrefsMgr.getInstance(getContext()).getLong(KEY_SHARE_INNER_GUIDE_TIME, 0);
int shareItemSum = SharedPrefsMgr.getInstance(getContext()).getInt(KEY_SHARE_INNER_GUIDE, 0);
Log.d(TAG, " onMapChanged shareItemSum = " + shareItemSum + "---- intervalTime = " + intervalTime);
if (shareItemSum < 3) {
long time = System.currentTimeMillis();
Log.d(TAG, "onMapChanged time = " + time);
if (intervalTime == 0) {
Log.d(TAG, " onMapChanged -----1-----");
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_INNER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_INNER_GUIDE, ++shareItemSum);
AIAssist.getInstance(getContext()).speakTTSVoice(mInnerGuideVoiceStrings[0]);
} else {
Log.d(TAG, " onMapChanged else interval = " + (time - intervalTime));
if ((time - intervalTime) > ONE_DAY_TIME) {
SharedPrefsMgr.getInstance(getContext()).putLong(KEY_SHARE_INNER_GUIDE_TIME, time);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SHARE_INNER_GUIDE, ++shareItemSum);
if (shareItemSum == 1) {
AIAssist.getInstance(getContext()).speakTTSVoice(mInnerGuideVoiceStrings[1]);
} else {
AIAssist.getInstance(getContext()).speakTTSVoice(mInnerGuideVoiceStrings[2]);
}
} else {
Log.e(TAG, " onMapChanged else < ONE_DAY_TIME ");
}
}
}
}
/**
* 由于Launcher和Independent对于天气的表现形式不太一样所以通过此方法区分处理
*/
@@ -381,6 +504,13 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mStatusManager.registerStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW, this);
TopViewAnimHelper.getInstance().setIMogoMapUIController(mMApUIController);
mClickShareVoiceStrings =
getContext().getResources().getStringArray(R.array.click_share_voice_guide_array);
mInnerGuideVoiceStrings =
getContext().getResources().getStringArray(R.array.search_voice_guide_inner_array);
mOuterGuideVoiceStrings =
getContext().getResources().getStringArray(R.array.search_voice_guide_outer_array);
}
@Override

View File

@@ -11,6 +11,9 @@ import com.mogo.commons.mvp.Presenter;
import com.mogo.commons.network.Utils;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.extensions.R;
import com.mogo.module.extensions.bean.CommonConfig;
import com.mogo.module.extensions.bean.CommonConfigResponse;
import com.mogo.module.extensions.net.GetConfigApiServices;
import com.mogo.module.extensions.net.UserInfoNetApiServices;
import com.mogo.module.extensions.userinfo.UserInfo;
import com.mogo.module.extensions.userinfo.UserInfoConstant;
@@ -27,6 +30,7 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
import com.mogo.service.statusmanager.IMogoMsgCenterListener;
import com.mogo.utils.digest.DigestUtils;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.storage.SharedPrefsMgr;
import java.util.Map;
@@ -35,6 +39,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import static com.mogo.module.share.constant.ShareConstants.KEY_CLICK_SHARE_BUTTON;
import static com.mogo.module.share.constant.ShareConstants.KEY_SERVER_SHOW_DAY_COUNT;
/**
* @author congtaowang
* @since 2020-01-07
@@ -101,6 +108,7 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
// 相当于每次onResume都会请求一下个人信息目的是能够相对及时的同步手机端的个人信息修改
requestUserInfo();
}
getCommonConfig();
}
@Override
@@ -120,6 +128,44 @@ public class EntrancePresenter extends Presenter<EntranceView> implements Weathe
}
}
public void getCommonConfig() {
Map<String, Object> params = new ArrayMap<>();
params.put("sn", Utils.getSn());
mNetWork.create(GetConfigApiServices.class, UserInfoConstant.getUserInfoBaseUrl())
.getConfig(params)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SingleObserver<CommonConfigResponse>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onSuccess(CommonConfigResponse config) {
Logger.d(TAG, "getCommonConfig onSuccess -----> ");
if (config != null && config.result != null) {
CommonConfig.Speech speech = config.result.speech;
if (speech != null) {
Logger.d(TAG, "getCommonConfig onSuccess speech.count = " + speech.count);
SharedPrefsMgr.getInstance(getContext()).putInt(KEY_SERVER_SHOW_DAY_COUNT, speech.count);
} else {
Logger.e(TAG, "getCommonConfig onSuccess speech == null ");
}
} else {
Logger.e(TAG, "getCommonConfig onSuccess config == null");
}
}
@Override
public void onError(Throwable e) {
e.printStackTrace();
Logger.e(TAG,"getCommonConfig onError ---> e = " + e);
}
});
}
private UserInfo userInfo;
public void requestUserInfo() {
Map<String, String> params = new ArrayMap<>();

View File

@@ -0,0 +1,23 @@
package com.mogo.module.extensions.net;
import com.mogo.module.extensions.bean.CommonConfig;
import com.mogo.module.extensions.bean.CommonConfigResponse;
import com.mogo.module.extensions.userinfo.UserInfoResponse;
import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Single;
import retrofit2.http.GET;
import retrofit2.http.QueryMap;
/**
* 获取配置信息
*/
public interface GetConfigApiServices {
@GET("dataService/car/customConfig/no/getAll/v1")
Single<CommonConfigResponse> getConfig(@QueryMap Map<String, Object> parameters);
}

View File

@@ -479,7 +479,8 @@ public class TopViewAnimHelper {
tvNextDistance.getId(), ConstraintSet.LEFT,
0);
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP, 0);
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
(int) getDimen(R.dimen.module_common_shadow_width_pos));
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.TOP, naviBg.getId(),
ConstraintSet.TOP, 0);
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,
@@ -541,7 +542,7 @@ public class TopViewAnimHelper {
// .module_ext_navi_info_panel_height);
constraintSet.connect(naviBg.getId(), ConstraintSet.TOP,
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP,
0);
(int) getDimen(R.dimen.module_common_shadow_width_pos));
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.TOP, naviBg.getId(),
ConstraintSet.TOP, 0);
constraintSet.connect(ivTurnIcon.getId(), ConstraintSet.BOTTOM,

View File

@@ -10,6 +10,9 @@
android:background="@drawable/module_ext_dw_navi_info_panel_bkg"
android:focusable="true"
android:clickable="true"
android:layout_marginLeft="@dimen/module_common_shadow_width_pos"
android:layout_marginRight="@dimen/module_common_shadow_width_pos"
android:layout_marginTop="@dimen/module_common_shadow_width_pos"
app:layout_constraintHorizontal_bias="0.501"
app:layout_constraintLeft_toLeftOf="@id/module_entrance_id_top_container"
app:layout_constraintRight_toRightOf="@id/module_entrance_id_top_container"

View File

@@ -8,4 +8,5 @@
<dimen name="module_ext_destination_online_car_drawablePadding">4px</dimen>
<dimen name="module_ext_destination_online_car_paddingLeft">14px</dimen>
<dimen name="module_ext_destination_online_car_paddingRight">14px</dimen>
<dimen name="module_common_shadow_width_pos">8px</dimen>
</resources>

View File

@@ -155,4 +155,6 @@
<dimen name="module_ext_destination_online_car_drawablePadding">8px</dimen>
<dimen name="module_ext_destination_online_car_paddingLeft">21px</dimen>
<dimen name="module_ext_destination_online_car_paddingRight">31px</dimen>
<dimen name="module_common_shadow_width_pos">10px</dimen>
</resources>

View File

@@ -160,4 +160,6 @@
<dimen name="module_ext_destination_online_car_drawablePadding">4px</dimen>
<dimen name="module_ext_destination_online_car_paddingLeft">14px</dimen>
<dimen name="module_ext_destination_online_car_paddingRight">14px</dimen>
<dimen name="module_common_shadow_width_pos">8px</dimen>
</resources>

View File

@@ -48,4 +48,25 @@
<item>你好小智,打开全部应用</item>
<item>你好小智,返回桌面</item>
</string-array>
<!--内部触发-->
<string-array name="search_voice_guide_inner_array">
<item>查询路况,唤醒小智说“天安门附近路况怎么样”</item>
<item>想知道出行路况,唤醒小智说“中关村堵车吗”</item>
<item>出行路况早知道,唤醒小智说“长安街路况怎么样”</item>
</string-array>
<!--点击分享按钮-->
<string-array name="click_share_voice_guide_array">
<item>您可以将当前的路况分享给其他车友,帮助他们获得最新的路况信息,试试对我说“上报路况”</item>
<item>您的分享信息将会帮助更多车友,当您发现以下交通事件,可以直接对我说上报路况</item>
</string-array>
<!--外部触发-->
<string-array name="search_voice_guide_outer_array">
<item>查路况您可以直接唤醒小智说“天安门附近堵不堵”</item>
<item>出行路况早知道,试试唤醒小智说,“附近路况怎么样”</item>
<item>提前看看出行路况,试试唤醒小智说,“中关村路况怎么样”</item>
</string-array>
</resources>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="module_media_music_state_location">468px</dimen>
<dimen name="module_media_music_state_location_x">573px</dimen>
<dimen name="module_media_music_state_location_x">581px</dimen>
<!-- lcc start-->
<dimen name="module_media_back_width">352px</dimen>

View File

@@ -10,6 +10,7 @@ import android.util.ArrayMap;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.ParamsProvider;
import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.network.Utils;
import com.mogo.commons.voice.AIAssist;
@@ -37,8 +38,8 @@ import com.mogo.service.intent.IMogoIntentManager;
import com.mogo.service.share.IMogoShareManager;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
import com.mogo.service.statusmanager.StatusDescriptor;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.tanlu.TanluUploadParams;
import com.mogo.service.share.IMogoTanluProvider;
import com.mogo.service.share.TanluUploadParams;
import com.mogo.utils.NetworkUtils;
import com.mogo.utils.TipToast;
import com.mogo.utils.logger.Logger;
@@ -50,6 +51,7 @@ import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -77,15 +79,15 @@ import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_NO_REPLY_S
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_PUB_ROAD_CONDITION;
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_PUB_TROUBLE_HELP;
import static com.mogo.module.share.constant.ShareConstants.VOICE_CMD_SHARE_DIALOG_CLOSE;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_ACCIDENT;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_BLOCK;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_CLOSURE;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_DENSE_FOG;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_REAL_TIME_TRAFFIC;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_ROAD_CONSTRUCTION;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_ROAD_ICY;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_STAGNANT_WATER;
import static com.mogo.service.tanlu.IMogoTanluProvider.TYPE_TRAFFIC_CHECK;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_ACCIDENT;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_BLOCK;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_CLOSURE;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_DENSE_FOG;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_REAL_TIME_TRAFFIC;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_ROAD_CONSTRUCTION;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_ROAD_ICY;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_STAGNANT_WATER;
import static com.mogo.service.share.IMogoTanluProvider.TYPE_TRAFFIC_CHECK;
/**
* 分享框的逻辑都放到这里吧
@@ -132,11 +134,11 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener,
private void realShowDialog() {
if (mShareDialog == null) {
Logger.d(TAG, "realShowDialog context : " + mContext);
if(DebugConfig.isLauncher()){
mShareDialog = new LaucherShareDialog(mContext);
}else {
mShareDialog = new GridFixableShareDialog(mContext);
}
// if(DebugConfig.isLauncher()){
// mShareDialog = new LaucherShareDialog(mContext);
// }else {
mShareDialog = new GridFixableShareDialog(mContext);
// }
mShareDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
@@ -213,21 +215,22 @@ public class ShareControl implements IMogoShareManager, IMogoIntentListener,
});
}
if (!DebugConfig.isLauncher()) {
ServiceApisManager.serviceApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.ACC_STATUS, new IMogoStatusChangedListener() {
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (isTrue) {
queryShareConfigRetryTime = 0;
queryShareButtonConfig();
}
// if (!DebugConfig.isLauncher()) {
ServiceApisManager.serviceApis.getStatusManagerApi().registerStatusChangedListener(TAG,
StatusDescriptor.ACC_STATUS, new IMogoStatusChangedListener() {
@Override
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
if (isTrue) {
queryShareConfigRetryTime = 0;
queryShareButtonConfig();
}
});
}
});
// 获取分享框配置信息
queryShareConfigRetryTime = 0;
queryShareButtonConfig();
}
// 获取分享框配置信息
queryShareConfigRetryTime = 0;
queryShareButtonConfig();
// }
Logger.d(TAG, "init over====");
}

View File

@@ -27,12 +27,12 @@ class StrategyShareProvider : IProvider {
blockStrategy = BlockStrategy(context, apis)
// 注册事故
apis.getSocketManagerApi(context).registerOnMessageListener(ACCIDENT_STRATEGY_SHARE_PUSH_TYPE, AccidentStrategyReceiver(apis))
if(!DebugConfig.isLauncher()) {
apis.registerCenterApi.registerMogoLocationListener(MogoServicePaths.PATH_STRATEGY_SHARE) {
// if(!DebugConfig.isLauncher()) {
apis.registerCenterApi.registerMogoLocationListener(MogoServicePaths.PATH_STRATEGY_SHARE) {
// Logger.d(S_TAG,"定位发生变化,准备记录速度: ${it.speed}")
blockStrategy.recordSpeed(it.speed * 3.6F)
}
blockStrategy.recordSpeed(it.speed * 3.6F)
}
// }
}
}

View File

@@ -2,7 +2,7 @@ package com.mogo.module.share.bean
import com.mogo.commons.data.BaseData
import com.mogo.module.share.R
import com.mogo.service.tanlu.IMogoTanluProvider.*
import com.mogo.service.share.IMogoTanluProvider.*
/**
* 可配置按钮封装

View File

@@ -86,4 +86,38 @@ public class ShareConstants {
* 分享框配置本地缓存的key
*/
public static final String KEY_SHARE_CONFIG = "SHARE_BUTTON_CONFIG";
/**
* 外部触发
*/
public static final String KEY_SHARE_OUTER_GUIDE = "KEY_SHARE_OUTER_GUIDE";
public static final String KEY_SHARE_OUTER_GUIDE_TIME = "KEY_SHARE_OUTER_GUIDE_TIME";
public static final String KEY_SERVER_SHOW_DAY_COUNT = "KEY_SERVER_SHOW_DAY_COUNT";
/**
* 内部触发
*/
public static final String KEY_SHARE_INNER_GUIDE = "KEY_SHARE_INNER_GUIDE";
public static final String KEY_SHARE_INNER_GUIDE_TIME = "KEY_SHARE_INNER_GUIDE_TIME";
/**
* 点击分享
*/
public static final String KEY_CLICK_SHARE_BUTTON = "KEY_CLICK_SHARE_BUTTON";
public static final String KEY_CLICK_SHARE_TIME = "KEY_CLICK_SHARE_TIME";
/**
* 点击具体分享类别
*/
public static final String KEY_CLICK_SHARE_ITEM_BUTTON = "KEY_CLICK_SHARE_ITEM_BUTTON";
public static final String KEY_CLICK_SHARE_ITEM_TIME = "KEY_CLICK_SHARE_ITEM_TIME";
//1天的毫秒 TODO
public static final long ONE_DAY_TIME = 86400000;
// public static final long ONE_DAY_TIME = 60000;
//7天的毫秒
public static final long SEVEN_DAY_TIME = 604800000;
// public static final long SEVEN_DAY_TIME = 60000;
}

View File

@@ -17,8 +17,8 @@ import com.mogo.service.IMogoServiceApis
import com.mogo.service.MogoServicePaths
import com.mogo.service.analytics.IMogoAnalytics
import com.mogo.service.statusmanager.IMogoStatusManager
import com.mogo.service.tanlu.IMogoTanluProvider
import com.mogo.service.tanlu.TanluUploadParams
import com.mogo.service.share.IMogoTanluProvider
import com.mogo.service.share.TanluUploadParams
import com.mogo.utils.logger.Logger
import kotlin.random.Random

View File

@@ -18,8 +18,8 @@ import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.tanlu.TanluUploadParams;
import com.mogo.service.share.IMogoTanluProvider;
import com.mogo.service.share.TanluUploadParams;
import com.mogo.utils.logger.Logger;

View File

@@ -9,7 +9,7 @@ import android.widget.TextView
import com.mogo.module.share.R
import com.mogo.module.share.bean.FixableButton
import com.mogo.module.share.constant.ShareConstants
import com.mogo.service.tanlu.IMogoTanluProvider
import com.mogo.service.share.IMogoTanluProvider
import com.mogo.utils.glide.GlideApp
import com.mogo.utils.logger.Logger
import com.mogo.utils.network.utils.GsonUtil

View File

@@ -1,64 +1,108 @@
package com.mogo.module.share.manager
import android.content.Context
import android.content.Intent
import android.util.Log
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.voice.AIAssist
import com.mogo.map.MogoLatLng
import com.mogo.map.location.MogoLocation
import com.mogo.module.common.entity.MarkerPoiTypeEnum
import com.mogo.module.share.R
import com.mogo.module.share.ShareControl
import com.mogo.module.share.dialog.LaucherShareDialog
import com.mogo.service.tanlu.TanluUploadParams
import com.mogo.module.share.constant.ShareConstants
import com.mogo.module.share.constant.ShareConstants.*
import com.mogo.service.share.TanluUploadParams
import com.mogo.utils.NetworkUtils
import com.mogo.utils.TipDrawable
import com.mogo.utils.TipToast
import com.mogo.utils.logger.Logger
import com.mogo.utils.storage.SharedPrefsMgr
/**
* 上报工具类
*/
object UploadHelper {
fun upload(context: Context, type: TanluUploadParams, forcePlayVoice: Boolean = false) {
if (DebugConfig.isLauncher()) {
if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
Logger.d("UploadHelper", "正在上报===")
TipToast.tip("正在上报,请稍后重试")
} else {
// if (DebugConfig.isLauncher()) { //TODO launcher和独立应用
// if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
// // 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
// Logger.d("UploadHelper", "正在上报===")
// TipToast.tip("正在上报,请稍后重试")
// } else {
// ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
// if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ || forcePlayVoice) {
// // 因为思必驰语音分享时,语音助手会自己播报一段文字
//// AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传")
//
// var shareItemSum = SharedPrefsMgr.getInstance(context).getInt(KEY_CLICK_SHARE_ITEM_BUTTON, 0)
// var intervalTime = SharedPrefsMgr.getInstance(context).getLong(KEY_CLICK_SHARE_ITEM_TIME, 0)
// Log.d("UploadHelper", "shareItemSum = $shareItemSum --- intervalTime = $intervalTime --type = ${type.eventType}")
//
// if (shareItemSum < 3) {
// var time = System.currentTimeMillis()
// Log.d("UploadHelper", "time = $time ")
// if (intervalTime == 0.toLong()) {
// Log.d("UploadHelper", " -----1-----")
// SharedPrefsMgr.getInstance(context).putLong(KEY_CLICK_SHARE_ITEM_TIME, time)
// SharedPrefsMgr.getInstance(context).putInt(KEY_CLICK_SHARE_ITEM_BUTTON, ++shareItemSum)
// AIAssist.getInstance(context).speakTTSVoice("下次可以直接对我说 上报" + getTypeName(type.eventType))
// } else {
// Log.d("UploadHelper", " else interval = " + (time - intervalTime))
// if ((time - intervalTime) > ONE_DAY_TIME) {
// SharedPrefsMgr.getInstance(context).putLong(KEY_CLICK_SHARE_ITEM_TIME, time)
// SharedPrefsMgr.getInstance(context).putInt(KEY_CLICK_SHARE_ITEM_BUTTON, ++shareItemSum)
// AIAssist.getInstance(context).speakTTSVoice("下次可以直接对我说 上报" + getTypeName(type.eventType))
// } else {
// Log.e("UploadHelper", " else < ONE_DAY_TIME ")
// }
// }
// }
// }
//
// val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
// val latLon = MogoLatLng(location.latitude, location.longitude)
// type.location = latLon
// Logger.d("UploadHelper", "upload ----> $type")
// ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type)
// }
// } else {
if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
} else {
// 判断当前网络状态
if (NetworkUtils.isConnected(context)) {
// 有网就正常上报
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
if (DebugConfig.getAIType() == DebugConfig.AI_TYPE_TXZ || forcePlayVoice) {
// 因为思必驰语音分享时,语音助手会自己播报一段文字
AIAssist.getInstance(context).speakTTSVoice("感谢分享,正在上传")
}
// 上报即成功
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
val latLon = MogoLatLng(location.latitude, location.longitude)
type.location = latLon
Logger.d("UploadHelper", "upload ----> $type")
ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type)
}
} else {
if (ServiceApisManager.serviceApis.statusManagerApi.isUploading) {
// 上报即成功,当前还有正在上报的事件,仅做界面展示,不做具体操作
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
} else {
// 判断当前网络状态
if (NetworkUtils.isConnected(context)) {
// 有网就正常上报
ServiceApisManager.serviceApis.statusManagerApi.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true)
// 上报即成功
ServiceApisManager.serviceApis.tanluUiApi.shareSuccess(type.eventType, type.location)
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
val latLon = MogoLatLng(location.latitude, location.longitude)
type.location = latLon
Logger.d("UploadHelper", "upload ----> $type")
ServiceApisManager.serviceApis.tanluApi.uploadRoadCondition(type)
} else {
// 没网就直接提示失败
AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络")
TipToast.tip("分享失败,请检查网络", TipDrawable(context.resources.getDrawable(R.drawable.module_share_upload_fail)))
}
// 没网就直接提示失败
AIAssist.getInstance(context).speakTTSVoice("分享失败,请检查网络")
TipToast.tip("分享失败,请检查网络", TipDrawable(context.resources.getDrawable(R.drawable.module_share_upload_fail)))
}
}
// }
}
private fun getTypeName(type: String): String? {
var typeName = ""
typeName = when (type) {
MarkerPoiTypeEnum.TRAFFIC_CHECK -> "交通检查"
MarkerPoiTypeEnum.ROAD_CLOSED -> "封路"
MarkerPoiTypeEnum.FOURS_ROAD_WORK -> "施工"
MarkerPoiTypeEnum.FOURS_BLOCK_UP -> "拥堵"
MarkerPoiTypeEnum.FOURS_PONDING -> "道路积水"
MarkerPoiTypeEnum.FOURS_ICE -> "道路结冰"
MarkerPoiTypeEnum.FOURS_FOG -> "浓雾"
MarkerPoiTypeEnum.FOURS_ACCIDENT -> "交通事故"
MarkerPoiTypeEnum.FOURS_LIVING -> "实时路况"
else -> "实时路况"
}
return typeName
}
}

View File

@@ -4,7 +4,6 @@ import com.mogo.commons.data.BaseData
import com.mogo.module.share.bean.AverateSpeedResponse
import com.mogo.module.share.bean.ShareButtonConfigResponse
import io.reactivex.Observable
import io.reactivex.Single
import okhttp3.RequestBody
import retrofit2.http.*
@@ -32,4 +31,5 @@ interface ShareApiService {
@FormUrlEncoded
@POST("/deva/car/poiType/no/poiTypeList")
fun queryShareButtonConfig(@FieldMap param: Map<String, String>):Observable<ShareButtonConfigResponse>
}

View File

@@ -6,8 +6,8 @@ import com.mogo.module.share.strategyreceiver.AccidentStrategyPushWrapper.Compan
import com.mogo.module.share.strategyreceiver.AccidentStrategyPushWrapper.Companion.TYPE_BLOCK
import com.mogo.service.IMogoServiceApis
import com.mogo.service.connection.IMogoOnMessageListener
import com.mogo.service.tanlu.IMogoTanluProvider
import com.mogo.service.tanlu.TanluUploadParams
import com.mogo.service.share.IMogoTanluProvider
import com.mogo.service.share.TanluUploadParams
import com.mogo.utils.logger.Logger
/**

View File

@@ -11,9 +11,8 @@ import com.mogo.module.share.constant.HttpConstant
import com.mogo.module.share.manager.ServiceApisManager
import com.mogo.module.share.net.ShareApiService
import com.mogo.service.IMogoServiceApis
import com.mogo.service.tanlu.IMogoTanluProvider
import com.mogo.service.tanlu.TanluUploadParams
import com.mogo.utils.DeviceIdUtils
import com.mogo.service.share.IMogoTanluProvider
import com.mogo.service.share.TanluUploadParams
import com.mogo.utils.logger.Logger
import com.mogo.utils.network.RequestOptions
import com.mogo.utils.network.utils.GsonUtil

View File

@@ -1,3 +1,4 @@
<resources>
<string name="app_name">share</string>
</resources>

View File

@@ -51,6 +51,8 @@ dependencies {
implementation rootProject.ext.dependencies.androidxconstraintlayout
implementation rootProject.ext.dependencies.rxjava
implementation rootProject.ext.dependencies.rxandroid
implementation rootProject.ext.dependencies.localbroadcastmanager
if (Boolean.valueOf(RELEASE)) {
compileOnly rootProject.ext.dependencies.mogomap
compileOnly rootProject.ext.dependencies.mogoutils
@@ -72,6 +74,11 @@ dependencies {
implementation rootProject.ext.dependencies.videoarm64
implementation rootProject.ext.dependencies.videojava
implementation rootProject.ext.dependencies.eventbus
implementation project(path: ':modules:mogo-module-v2x')
implementation project(path: ':modules:mogo-module-v2x')
implementation project(path: ':modules:mogo-module-v2x')
implementation project(path: ':modules:mogo-module-v2x')
implementation project(path: ':modules:mogo-module-v2x')
// if( Boolean.valueOf(RELEASE)){
// implementation rootProject.ext.dependencies.moduletanlulib

View File

@@ -5,7 +5,7 @@ import com.mogo.commons.data.BaseData;
/**
* @author lixiaopeng
* @description 上报分享
* @description 上报分享 废弃
* @since 2020-01-09
*/
public interface UploadShareCallback {

View File

@@ -2,34 +2,21 @@ package com.mogo.module.tanlu.fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.map.MogoLatLng;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.module.tanlu.callback.DataSetChangedAdapter;
import com.mogo.module.tanlu.model.event.MarkerInfo;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.service.module.IMogoModuleProvider;
import com.mogo.service.module.ModuleType;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.service.tanlu.IMogoTanluUiProvider;
import com.mogo.service.share.IMogoTanluUiProvider;
import com.mogo.utils.logger.Logger;
import org.greenrobot.eventbus.EventBus;
import io.reactivex.Single;
import io.reactivex.SingleEmitter;
import io.reactivex.SingleOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
/**

View File

@@ -20,6 +20,7 @@ import android.view.animation.LinearInterpolator;
import android.widget.RelativeLayout;
import androidx.annotation.NonNull;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.PagerSnapHelper;
import androidx.recyclerview.widget.RecyclerView;
@@ -53,6 +54,8 @@ import com.mogo.module.common.entity.MarkerExploreWayItem;
import com.mogo.module.common.entity.MarkerLocation;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.common.entity.MarkerUserInfo;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.tanlu.R;
import com.mogo.module.tanlu.callback.DataSetChangedAdapter;
import com.mogo.module.tanlu.callback.NaviCallback;
@@ -79,6 +82,7 @@ import com.mogo.module.tanlu.model.event.VoiceControlUpInfo;
import com.mogo.module.tanlu.util.Utils;
import com.mogo.module.tanlu.view.NetErrorDialog;
import com.mogo.module.tanlu.view.UploadFailedDialog;
import com.mogo.module.v2x.V2XConst;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.adas.IMogoADASController;
import com.mogo.service.analytics.IMogoAnalytics;
@@ -365,15 +369,24 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() {
@Override
public boolean onMarkerClicked(IMogoMarker marker) {
GSYVideoManager.releaseAllVideos();
initVideo();
releaseTimer();
//埋点
Map<String, Object> properties = new HashMap<>();
properties.put("type", "2");
mAnalytics.track(TanluConstants.LAUNCHER_ICON_CLICK, properties);
//点击的marker的具体数据
MarkerExploreWay exploreWay = extractFromMarker(marker);
V2XRoadEventEntity roadEventEntity = new V2XRoadEventEntity();
roadEventEntity.setNoveltyInfo(exploreWay);
roadEventEntity.setPoiType(exploreWay.getPoiType());
roadEventEntity.setExpireTime(20000);
//地理位置
MarkerLocation location = exploreWay.getLocation();
roadEventEntity.setLocation(location);
V2XMessageEntity v2XMessageEntity = new V2XMessageEntity();
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
v2XMessageEntity.setShowState(true);
v2XMessageEntity.setOnlyShow(true);
v2XMessageEntity.setNeedAddLine(false);
v2XMessageEntity.setContent(roadEventEntity);
//更新数据
if (markerExploreWayList != null) {
markerExploreWayList.clear();
@@ -382,43 +395,14 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
}
markerExploreWayList.add(exploreWay);
boolean isAdd = TanluServiceManager.getIMogoTopViewManager().isViewAdded(TanluListWindow.this);
hideWindowTimerStart();
Logger.d(TAG, "onMarkerClicked ------ isAdd = " + isAdd);
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
//添加window窗口,重复创建
if (!isAdd) {
ViewGroup.LayoutParams layoutParams =
new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
(int) getContext().getResources().getDimension((R.dimen.tanlu_module_card_height)));
TanluServiceManager.getIMogoTopViewManager().addView(TanluListWindow.this, layoutParams, new IMogoTopViewStatusListener() {
@Override
public void onViewAdded(View view) {
Logger.d(TAG, "onViewAdded -------->");
}
@Override
public void onViewRemoved(View view) {
Logger.e(TAG, "onViewRemoved -------->");
releaseTimer();
releaseAction();
}
@Override
public void beforeViewAddAnim(View view) {
}
@Override
public void beforeViewRemoveAnim(View view) {
}
});
}
renderCardViews();
//埋点
Map<String, Object> properties = new HashMap<>();
properties.put("type", "2");
mAnalytics.track(TanluConstants.LAUNCHER_ICON_CLICK, properties);
return false;
}
@@ -481,7 +465,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
if (mogoIntentManager != null) {
// 同行者 xxx堵不堵唤醒词语音注册
Logger.d(TAG, "initListener====");
mogoIntentManager.registerIntentListener(TXZ_SPECIFIEDROAD_SEARCH,mogoIntentListener);
mogoIntentManager.registerIntentListener(TXZ_SPECIFIEDROAD_SEARCH, mogoIntentListener);
// 通用唤醒词语音注册
mogoIntentManager.registerIntentListener(SPECIFIEDROAD_SEARCH, mogoIntentListener);
mogoIntentManager.registerIntentListener(PLAY_VIDEO_AWAKEN, mogoIntentListener);
@@ -508,7 +492,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
// 直接执行相关查询操作
Logger.d(TAG, "智慧出行在前台,可直接分享--->");
realShare(intentStr, intent);
}else{
} else {
// 需要打开智慧驾驶,然后执行操作
Logger.d(TAG, "智慧出行没在前台,需要打开 --->");
intent.setAction(Intent.ACTION_VIEW);
@@ -522,7 +506,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
}
};
public void realShare(String intentStr, Intent intent){
public void realShare(String intentStr, Intent intent) {
String data = intent.getStringExtra("data");
Logger.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data);
VoiceCmdData voiceData = null;
@@ -1085,7 +1069,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
}
if (!NetworkUtils.isConnected(getContext())) { //没有网络
TipToast.shortTip("分享失败,请检查网络",new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_fail)));
TipToast.shortTip("分享失败,请检查网络", new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_fail)));
} else {
float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度
Logger.d(TAG, "onMarkerInfo event.type = " + event.type + " >>event.lat = " + event.lat + " >>event.lon = " + event.lon + " >>event.imageUrl =" + event.imageUrl);
@@ -1100,7 +1084,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
String.format(voiceShareSuccessTts, getMathRandom())), null);
TipToast.shortTip("分享成功", new TipDrawable(getResources().getDrawable(R.drawable.module_tanlu_upload_success)));
if(TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
if (TanluServiceManager.getMogoStatusManager().isMainPageOnResume()) {
double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude();
double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude();
Log.d(TAG, "onMarkerInfo lat = " + lat + " >>>> lon = " + lon);

View File

@@ -25,7 +25,6 @@ import com.zhidao.carchattingprovider.CallChattingProviderConstant;
* 持有服务接口实例
*/
public class TanluServiceManager {
private static String TAG = "TanluServiceManager";
private static IMogoMapService mMapService;
private static IMogoPoiSearch mPoiSearch;
private static IMogoLocationClient mLocationClient;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -4,10 +4,10 @@
<item>
<shape android:shape="rectangle">
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
android:bottom="@dimen/tanlu_module_shade_size"
android:left="@dimen/tanlu_module_shade_size"
android:right="@dimen/tanlu_module_shade_size"
android:top="@dimen/tanlu_module_shade_size" />
<solid android:color="#00000000" />
<corners android:radius="@dimen/dp_30" />
</shape>
@@ -15,10 +15,10 @@
<item>
<shape android:shape="rectangle">
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
android:bottom="@dimen/tanlu_module_shade_size"
android:left="@dimen/tanlu_module_shade_size"
android:right="@dimen/tanlu_module_shade_size"
android:top="@dimen/tanlu_module_shade_size" />
<solid android:color="#00000000" />
<corners android:radius="@dimen/dp_30" />
</shape>

View File

@@ -80,16 +80,17 @@
<dimen name="tanlu_module_card_height">186px</dimen>
<dimen name="tanlu_module_card_inner_height">176px</dimen>
<dimen name="tanlu_module_card_video_width">250px</dimen>
<dimen name="tanlu_module_card_video_height">172px</dimen>
<dimen name="tanlu_module_card_video_height">158px</dimen>
<dimen name="tanlu_module_close_height">45px</dimen>
<dimen name="tanlu_module_card_margin_top">13px</dimen>
<dimen name="tanlu_module_card_margin_left">8px</dimen>
<dimen name="tanlu_module_margin_right">7px</dimen>
<dimen name="tanlu_module_card_margin_left">6px</dimen>
<dimen name="tanlu_module_margin_right">13px</dimen>
<dimen name="tanlu_module_margin_left">17px</dimen>
<dimen name="tanlu_module_margin_top">3px</dimen>
<dimen name="tanlu_module_mavi_height">18px</dimen>
<dimen name="tanlu_module_button_height">26px</dimen>
<dimen name="tanlu_module_shade_size">4px</dimen>
<dimen name="tanlu_head_image_size">28px</dimen>
<dimen name="tanlu_image_size">56px</dimen>

View File

@@ -90,6 +90,7 @@
<dimen name="tanlu_module_margin_top">9px</dimen>
<dimen name="tanlu_module_mavi_height">27px</dimen>
<dimen name="tanlu_module_button_height">46px</dimen>
<dimen name="tanlu_module_shade_size">4px</dimen>
<dimen name="tanlu_head_image_size">50px</dimen>
<dimen name="tanlu_image_size">90px</dimen>

View File

@@ -90,6 +90,7 @@
<dimen name="tanlu_module_margin_top">9px</dimen>
<dimen name="tanlu_module_mavi_height">27px</dimen>
<dimen name="tanlu_module_button_height">46px</dimen>
<dimen name="tanlu_module_shade_size">4px</dimen>
<dimen name="tanlu_head_image_size">50px</dimen>
<dimen name="tanlu_image_size">98px</dimen>

View File

@@ -80,16 +80,17 @@
<dimen name="tanlu_module_card_height">186px</dimen>
<dimen name="tanlu_module_card_inner_height">176px</dimen>
<dimen name="tanlu_module_card_video_width">250px</dimen>
<dimen name="tanlu_module_card_video_height">172px</dimen>
<dimen name="tanlu_module_card_video_height">158px</dimen>
<dimen name="tanlu_module_close_height">45px</dimen>
<dimen name="tanlu_module_card_margin_top">13px</dimen>
<dimen name="tanlu_module_card_margin_left">8px</dimen>
<dimen name="tanlu_module_card_margin_left">6px</dimen>
<dimen name="tanlu_module_margin_right">7px</dimen>
<dimen name="tanlu_module_margin_left">17px</dimen>
<dimen name="tanlu_module_margin_top">3px</dimen>
<dimen name="tanlu_module_mavi_height">18px</dimen>
<dimen name="tanlu_module_button_height">26px</dimen>
<dimen name="tanlu_module_shade_size">4px</dimen>
<dimen name="tanlu_head_image_size">28px</dimen>
<dimen name="tanlu_image_size">56px</dimen>

View File

@@ -31,7 +31,7 @@ import com.mogo.service.module.IMogoSearchManager;
import com.mogo.service.share.IMogoShareManager;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.strategy.IMogoRefreshStrategyController;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.share.IMogoTanluProvider;
import com.mogo.service.windowview.IMogoTopViewManager;
import com.mogo.service.windowview.IMogoWindowManager;
import com.zhidao.carchattingprovider.CallChattingProviderConstant;

View File

@@ -3,10 +3,8 @@ package com.mogo.module.v2x.scenario.scene.road;
import android.view.View;
import android.view.ViewGroup;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.V2XMessageEntity;
import com.mogo.module.common.entity.V2XRoadEventEntity;
import com.mogo.module.service.ServiceConst;
import com.mogo.module.v2x.R;
import com.mogo.module.v2x.V2XConst;
import com.mogo.module.v2x.V2XServiceManager;
@@ -15,8 +13,6 @@ import com.mogo.module.v2x.scenario.scene.livecar.V2XRoadLiveCarScenario;
import com.mogo.module.v2x.scenario.view.IV2XWindow;
import com.mogo.module.v2x.utils.ADASUtils;
import com.mogo.module.v2x.utils.V2XUtils;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.tanlu.TanluUploadParams;
import com.mogo.service.windowview.IMogoTopViewStatusListener;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
@@ -92,12 +88,18 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
public void show() {
try {
if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) {
// 设置TTS
getV2XMessageEntity().getContent().getTts(false);
// 广播给ADAS
ADASUtils.broadcastToADAS(
V2XServiceManager.getContext(),
getV2XMessageEntity().getContent());
//只展示不播报 不广播
boolean onlyShow = getV2XMessageEntity().isOnlyShow();
if (onlyShow == false){
// 设置TTS
getV2XMessageEntity().getContent().getTts(false);
// 广播给ADASzzz
ADASUtils.broadcastToADAS(
V2XServiceManager.getContext(),
getV2XMessageEntity().getContent());
}
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
getV2XMessageEntity().getContent().getNoveltyInfo());
@@ -204,7 +206,9 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
public void onViewAdded(View view) {
Logger.d(MODULE_NAME, "展示 Window 动画结束");
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
drawPOI();
if (getV2XMessageEntity() != null && getV2XMessageEntity().isNeedAddLine() == true){
drawPOI();
}
}
}

View File

@@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:endColor="#256BFF"
android:startColor="#5CC1FF" />
<corners android:radius="@dimen/dp_30" />
</shape>
<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="#ff113361" android:startColor="#ff124B98" android:type="linear" />
<corners android:radius="@dimen/dp_30" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient android:angle="135" android:endColor="#ff1e57a4" android:startColor="#ff1f7eff" android:type="linear" />
<corners android:radius="@dimen/dp_30" />
</shape>
</item>
</selector>

View File

@@ -12,7 +12,7 @@
android:id="@+id/viewLinStart"
android:layout_width="wrap_content"
android:layout_height="1px"
android:background="#979797"
android:background="@color/share_event_no_more_color"
app:layout_constraintBottom_toBottomOf="@+id/tvNoMoreDataTrip"
app:layout_constraintEnd_toStartOf="@+id/tvNoMoreDataTrip"
app:layout_constraintStart_toStartOf="parent"
@@ -35,7 +35,7 @@
android:id="@+id/viewLinEnd"
android:layout_width="wrap_content"
android:layout_height="1px"
android:background="#979797"
android:background="@color/share_event_no_more_color"
app:layout_constraintBottom_toBottomOf="@+id/tvNoMoreDataTrip"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvNoMoreDataTrip"

View File

@@ -107,7 +107,7 @@
<RatingBar
android:id="@+id/rating_bar"
style="@style/customRatingBarStyle"
style="@style/customHeartHeartRatingBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="true" />

View File

@@ -61,8 +61,7 @@
<dimen name="module_v2x_surrounding_top_textsize">18px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_left_textsize">20px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_right_textsize">16px</dimen>
<dimen name="module_v2x_des_index_width">17px</dimen>
<dimen name="module_v2x_des_index_height">14px</dimen>
<dimen name="module_v2x_panel_width">82px</dimen>
<dimen name="module_v2x_panel_icon_cor">16px</dimen>
<dimen name="share_empty_icon_width">117px</dimen>

View File

@@ -58,8 +58,6 @@
<dimen name="module_v2x_surrounding_top_textsize">32px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_left_textsize">36px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_right_textsize">30px</dimen>
<dimen name="module_v2x_des_index_width">16px</dimen>
<dimen name="module_v2x_des_index_height">42px</dimen>
<dimen name="module_v2x_panel_width">120px</dimen>
<dimen name="module_v2x_panel_tab_height">158px</dimen>

View File

@@ -59,8 +59,7 @@
<dimen name="module_v2x_surrounding_top_textsize">32px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_left_textsize">36px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_right_textsize">30px</dimen>
<dimen name="module_v2x_des_index_width">31.9px</dimen>
<dimen name="module_v2x_des_index_height">26px</dimen>
<dimen name="module_v2x_panel_icon_cor">30px</dimen>
<dimen name="module_v2x_panel_width">140px</dimen>
<dimen name="share_empty_icon_width">219px</dimen>

View File

@@ -57,8 +57,6 @@
<dimen name="module_v2x_surrounding_top_textsize">18px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_left_textsize">20px</dimen>
<dimen name="module_v2x_surrounding_item_bottom_right_textsize">16px</dimen>
<dimen name="module_v2x_des_index_width">16px</dimen>
<dimen name="module_v2x_des_index_height">20px</dimen>
<dimen name="module_v2x_panel_width">82px</dimen>
<dimen name="module_v2x_panel_icon_cor">16px</dimen>
<dimen name="share_empty_icon_width">117px</dimen>

View File

@@ -4,17 +4,6 @@
<attr name="roundLayoutRadius" format="dimension" />
</declare-styleable>
<style name="customRatingBarStyle" parent="@style/Widget.AppCompat.RatingBar">
<item name="android:minHeight">@dimen/module_v2x_des_index_height</item>
<item name="android:maxHeight">@dimen/module_v2x_des_index_height</item>
<item name="android:maxWidth">@dimen/module_v2x_des_index_width</item>
<item name="android:minWidth">@dimen/module_v2x_des_index_width</item>
<item name="android:numStars">5</item>
<item name="android:rating">1</item>
<item name="android:stepSize">0.5</item>
<item name="android:progressDrawable">@drawable/share_rating_bar</item>
</style>
<style name="customTabLayoutTextAppearance" parent="TextAppearance.Design.Tab">
<item name="android:textSize">@dimen/dp_40</item>
</style>

View File

@@ -32,8 +32,8 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider;
import com.mogo.service.strategy.IMogoRefreshStrategyController;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.tanlu.IMogoTanluUiProvider;
import com.mogo.service.share.IMogoTanluProvider;
import com.mogo.service.share.IMogoTanluUiProvider;
import com.mogo.service.windowview.IMogoTopViewManager;
import com.mogo.service.windowview.IMogoWindowManager;
import com.mogo.skin.support.IMogoSkinSupportInstaller;

View File

@@ -1,4 +1,4 @@
package com.mogo.service.tanlu;
package com.mogo.service.share;
import com.alibaba.android.arouter.facade.template.IProvider;

View File

@@ -1,4 +1,4 @@
package com.mogo.service.tanlu;
package com.mogo.service.share;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.map.MogoLatLng;

View File

@@ -1,4 +1,4 @@
package com.mogo.service.tanlu;
package com.mogo.service.share;
import com.mogo.map.MogoLatLng;

View File

@@ -40,12 +40,11 @@ import com.mogo.service.statusmanager.IMogoMsgCenter;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.service.strategy.IMogoOnlineCarListPanelProvider;
import com.mogo.service.strategy.IMogoRefreshStrategyController;
import com.mogo.service.tanlu.IMogoTanluProvider;
import com.mogo.service.tanlu.IMogoTanluUiProvider;
import com.mogo.service.share.IMogoTanluProvider;
import com.mogo.service.share.IMogoTanluUiProvider;
import com.mogo.service.windowview.IMogoTopViewManager;
import com.mogo.service.windowview.IMogoWindowManager;
import com.mogo.skin.support.IMogoSkinSupportInstaller;
import com.mogo.skin.support.MogoSkinManager;
import com.mogo.skin.support.SkinSupportInstallerConstants;
import com.mogo.utils.logger.Logger;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -4,10 +4,10 @@
<item>
<shape android:shape="rectangle">
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
android:bottom="@dimen/tanlu_module_shade_size_l"
android:left="@dimen/tanlu_module_shade_size_l"
android:right="@dimen/tanlu_module_shade_size_l"
android:top="@dimen/tanlu_module_shade_size_l" />
<solid android:color="#0DCCCCCC" />
<corners android:radius="@dimen/dp_30" />
</shape>
@@ -15,10 +15,10 @@
<item>
<shape android:shape="rectangle">
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
android:bottom="@dimen/tanlu_module_shade_size_l"
android:left="@dimen/tanlu_module_shade_size_l"
android:right="@dimen/tanlu_module_shade_size_l"
android:top="@dimen/tanlu_module_shade_size_l" />
<solid android:color="#26CCCCCC" />
<corners android:radius="@dimen/dp_30" />
</shape>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="tanlu_normal_image_radius_size">16px</dimen>
<dimen name="tanlu_dialog_radius_l">10px</dimen>
<dimen name="tanlu_dialog_neterror_radius_l">8px</dimen>
<dimen name="tanlu_module_shade_size_l">4px</dimen>
</resources>

View File

@@ -3,6 +3,7 @@
<dimen name="tanlu_normal_image_radius_size">30px</dimen>
<dimen name="tanlu_dialog_radius_l">20px</dimen>
<dimen name="tanlu_dialog_neterror_radius_l">16px</dimen>
<dimen name="tanlu_module_shade_size_l">4px</dimen>
</resources>

View File

@@ -4,6 +4,7 @@
<dimen name="tanlu_normal_image_radius_size">30px</dimen>
<dimen name="tanlu_dialog_radius_l">20px</dimen>
<dimen name="tanlu_dialog_neterror_radius_l">16px</dimen>
<dimen name="tanlu_module_shade_size_l">4px</dimen>
</resources>

View File

@@ -3,5 +3,6 @@
<dimen name="tanlu_normal_image_radius_size">16px</dimen>
<dimen name="tanlu_dialog_radius_l">10px</dimen>
<dimen name="tanlu_dialog_neterror_radius_l">8px</dimen>
<dimen name="tanlu_module_shade_size_l">4px</dimen>
</resources>

View File

@@ -8,7 +8,7 @@
<color name="v2x_white_light">#333333</color>
<color name="v2x_item_white_light">#FFFFFF</color>
<color name="v2x_white_refresh_light">#FFFFFF</color>
<color name="share_event_no_more_color_light">#CB333333</color>
<color name="share_event_no_more_color_light">#80333333</color>
<color name="v2x_FFF_999_light">#999999</color>
<color name="v2x_FFF_333_light">#B2333333</color>
<color name="v2x_FFF_666_light">#666666</color>