diff --git a/libraries/mogo-tanlu-api/src/main/java/com/zhidao/mogo/tanlu/api/MogoTanluApiProvider.java b/libraries/mogo-tanlu-api/src/main/java/com/zhidao/mogo/tanlu/api/MogoTanluApiProvider.java index 3cf0f80644..b5aa2b650d 100644 --- a/libraries/mogo-tanlu-api/src/main/java/com/zhidao/mogo/tanlu/api/MogoTanluApiProvider.java +++ b/libraries/mogo-tanlu-api/src/main/java/com/zhidao/mogo/tanlu/api/MogoTanluApiProvider.java @@ -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; diff --git a/modules/mogo-module-apps/src/main/res/values/dimens.xml b/modules/mogo-module-apps/src/main/res/values/dimens.xml index 8864e74f0f..e73af0f665 100644 --- a/modules/mogo-module-apps/src/main/res/values/dimens.xml +++ b/modules/mogo-module-apps/src/main/res/values/dimens.xml @@ -23,7 +23,7 @@ 94px 94px - 17px + 9px 55px 55px \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java index 6dcf23400f..98f567ac0b 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java @@ -33,6 +33,19 @@ public class V2XMessageEntity 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 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 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 场景类型 */ diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java index 2546f5bebf..80039b4244 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java @@ -24,6 +24,7 @@ public class V2XRoadEventEntity implements Serializable { private MarkerExploreWay noveltyInfo; // tts 提示 private String tts; + // ADAS 展示文案 private String alarmContent; // 距离当前车辆的距离 diff --git a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_enthusiasm_choose.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_heart_choose.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_enthusiasm_choose.png rename to modules/mogo-module-common/src/main/res/drawable-ldpi/icon_heart_choose.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_enthusiasm_second.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_heart_second.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_enthusiasm_second.png rename to modules/mogo-module-common/src/main/res/drawable-ldpi/icon_heart_second.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_enthusiasm_unchoose.png b/modules/mogo-module-common/src/main/res/drawable-ldpi/icon_heart_unchoose.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_enthusiasm_unchoose.png rename to modules/mogo-module-common/src/main/res/drawable-ldpi/icon_heart_unchoose.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_enthusiasm_choose.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/icon_heart_choose.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_enthusiasm_choose.png rename to modules/mogo-module-common/src/main/res/drawable-mdpi/icon_heart_choose.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_enthusiasm_second.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/icon_heart_second.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_enthusiasm_second.png rename to modules/mogo-module-common/src/main/res/drawable-mdpi/icon_heart_second.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_enthusiasm_unchoose.png b/modules/mogo-module-common/src/main/res/drawable-mdpi/icon_heart_unchoose.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-mdpi/icon_enthusiasm_unchoose.png rename to modules/mogo-module-common/src/main/res/drawable-mdpi/icon_heart_unchoose.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_enthusiasm_choose.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_choose.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_enthusiasm_choose.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_choose.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_enthusiasm_second.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_enthusiasm_second.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_second.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_enthusiasm_unchoose.png b/modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose.png similarity index 100% rename from modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_enthusiasm_unchoose.png rename to modules/mogo-module-common/src/main/res/drawable-xhdpi/icon_heart_unchoose.png diff --git a/modules/mogo-module-v2x/src/main/res/drawable/share_rating_bar.xml b/modules/mogo-module-common/src/main/res/drawable/module_commons_heart_ratingbar_drawable.xml similarity index 63% rename from modules/mogo-module-v2x/src/main/res/drawable/share_rating_bar.xml rename to modules/mogo-module-common/src/main/res/drawable/module_commons_heart_ratingbar_drawable.xml index afded5aacb..ee83cb56c4 100644 --- a/modules/mogo-module-v2x/src/main/res/drawable/share_rating_bar.xml +++ b/modules/mogo-module-common/src/main/res/drawable/module_commons_heart_ratingbar_drawable.xml @@ -2,15 +2,15 @@ + android:drawable="@drawable/icon_heart_unchoose"> + android:drawable="@drawable/icon_heart_second"> + android:drawable="@drawable/icon_heart_choose"> \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/values-mdpi/dimens.xml b/modules/mogo-module-common/src/main/res/values-mdpi/dimens.xml new file mode 100644 index 0000000000..d1a19e49b6 --- /dev/null +++ b/modules/mogo-module-common/src/main/res/values-mdpi/dimens.xml @@ -0,0 +1,5 @@ + + + 17px + 14px + \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml index ca1346e002..4e810485fc 100644 --- a/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-common/src/main/res/values-xhdpi/dimens.xml @@ -1054,5 +1054,7 @@ 48px -10px 10px + 31.9px + 26px diff --git a/modules/mogo-module-common/src/main/res/values/dimens.xml b/modules/mogo-module-common/src/main/res/values/dimens.xml index 170c5a430d..a292d9e1b4 100644 --- a/modules/mogo-module-common/src/main/res/values/dimens.xml +++ b/modules/mogo-module-common/src/main/res/values/dimens.xml @@ -1045,4 +1045,6 @@ 26.2500px -8px 8px + 16px + 20px diff --git a/modules/mogo-module-common/src/main/res/values/styles.xml b/modules/mogo-module-common/src/main/res/values/styles.xml index 10ca997feb..122d4944f8 100644 --- a/modules/mogo-module-common/src/main/res/values/styles.xml +++ b/modules/mogo-module-common/src/main/res/values/styles.xml @@ -14,4 +14,19 @@ @android:color/transparent @android:color/transparent + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/bean/CommonConfig.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/bean/CommonConfig.java new file mode 100644 index 0000000000..0f9f7cd97a --- /dev/null +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/bean/CommonConfig.java @@ -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; + } + } +} diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/bean/CommonConfigResponse.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/bean/CommonConfigResponse.java new file mode 100644 index 0000000000..e4e640d788 --- /dev/null +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/bean/CommonConfigResponse.java @@ -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; +} diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index e310869dfa..db0bc24a44 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -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 { showShareDialog(); + playShareGuideVoice(); }); mDisplayOverview = findViewById(R.id.module_ext_id_display_overview); @@ -330,8 +351,110 @@ public class EntranceFragment extends MvpFragment { + 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 implements Weathe // 相当于每次onResume都会请求一下个人信息,目的是能够相对及时的同步手机端的个人信息修改 requestUserInfo(); } + getCommonConfig(); } @Override @@ -120,6 +128,44 @@ public class EntrancePresenter extends Presenter implements Weathe } } + public void getCommonConfig() { + Map 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() { + @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 params = new ArrayMap<>(); diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/net/GetConfigApiServices.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/net/GetConfigApiServices.java new file mode 100644 index 0000000000..f0c8bca6c4 --- /dev/null +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/net/GetConfigApiServices.java @@ -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 getConfig(@QueryMap Map parameters); + + +} diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java index 465e2dbf3c..e71a78f3cd 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/TopViewAnimHelper.java @@ -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, diff --git a/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml b/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml index 97dc87283c..289e64c9d9 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/include_navi_info_panle.xml @@ -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" diff --git a/modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml index dac57dbe90..955ddf2c93 100644 --- a/modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values-mdpi/dimens.xml @@ -8,4 +8,5 @@ 4px 14px 14px + 8px \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml index aa75703d09..33ef63c151 100644 --- a/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values-xhdpi/dimens.xml @@ -155,4 +155,6 @@ 8px 21px 31px + + 10px \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/res/values/dimens.xml b/modules/mogo-module-extensions/src/main/res/values/dimens.xml index 8d6484ba10..f92b46b195 100644 --- a/modules/mogo-module-extensions/src/main/res/values/dimens.xml +++ b/modules/mogo-module-extensions/src/main/res/values/dimens.xml @@ -160,4 +160,6 @@ 4px 14px 14px + + 8px \ No newline at end of file diff --git a/modules/mogo-module-extensions/src/main/res/values/strings.xml b/modules/mogo-module-extensions/src/main/res/values/strings.xml index 48600136b3..65e4b58ae8 100644 --- a/modules/mogo-module-extensions/src/main/res/values/strings.xml +++ b/modules/mogo-module-extensions/src/main/res/values/strings.xml @@ -48,4 +48,25 @@ 你好小智,打开全部应用 你好小智,返回桌面 + + + + 查询路况,唤醒小智说“天安门附近路况怎么样” + 想知道出行路况,唤醒小智说“中关村堵车吗” + 出行路况早知道,唤醒小智说“长安街路况怎么样” + + + + + 您可以将当前的路况分享给其他车友,帮助他们获得最新的路况信息,试试对我说“上报路况” + 您的分享信息将会帮助更多车友,当您发现以下交通事件,可以直接对我说上报路况 + + + + + 查路况您可以直接唤醒小智说“天安门附近堵不堵” + 出行路况早知道,试试唤醒小智说,“附近路况怎么样” + 提前看看出行路况,试试唤醒小智说,“中关村路况怎么样” + + diff --git a/modules/mogo-module-media/src/main/res/values/dimens.xml b/modules/mogo-module-media/src/main/res/values/dimens.xml index 7a4f9479f7..a6fd4099f3 100644 --- a/modules/mogo-module-media/src/main/res/values/dimens.xml +++ b/modules/mogo-module-media/src/main/res/values/dimens.xml @@ -1,7 +1,7 @@ 468px - 573px + 581px 352px diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java index be7bb6d82a..5b524654c0 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/ShareControl.java @@ -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===="); } diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt index a09b3a53c0..f7c667d3fa 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/StrategyShareProvider.kt @@ -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) } +// } } } \ No newline at end of file diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/bean/FixableButton.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/bean/FixableButton.kt index 17ec692ef6..f80afbfa52 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/bean/FixableButton.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/bean/FixableButton.kt @@ -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.* /** * 可配置按钮封装 diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/constant/ShareConstants.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/constant/ShareConstants.java index e55fcb61c9..57fc5c2498 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/constant/ShareConstants.java +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/constant/ShareConstants.java @@ -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; + } diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/GridFixableShareDialog.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/GridFixableShareDialog.kt index 8b8eaa14ee..c3d16fe965 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/GridFixableShareDialog.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/GridFixableShareDialog.kt @@ -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 diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java index 238667d7fb..bf5bcf8365 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/dialog/LaucherShareDialog.java @@ -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; diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/GridBtnManager.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/GridBtnManager.kt index 7dd041a33e..07d436adba 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/GridBtnManager.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/GridBtnManager.kt @@ -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 diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt index 62cc8b2584..dc0d235f3f 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/manager/UploadHelper.kt @@ -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 + } + } \ No newline at end of file diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/net/ShareApiService.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/net/ShareApiService.kt index fb427784f0..7921527e17 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/net/ShareApiService.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/net/ShareApiService.kt @@ -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):Observable + } \ No newline at end of file diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/AccidentStrategyReceiver.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/AccidentStrategyReceiver.kt index 242faf2381..987454e88b 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/AccidentStrategyReceiver.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/AccidentStrategyReceiver.kt @@ -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 /** diff --git a/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt b/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt index 1cc241dddc..b8ba3c7cc8 100644 --- a/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt +++ b/modules/mogo-module-share/src/main/java/com/mogo/module/share/strategyreceiver/BlockStrategy.kt @@ -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 diff --git a/modules/mogo-module-share/src/main/res/values/strings.xml b/modules/mogo-module-share/src/main/res/values/strings.xml index 94c5463011..4c1ef21f86 100644 --- a/modules/mogo-module-share/src/main/res/values/strings.xml +++ b/modules/mogo-module-share/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ share + diff --git a/modules/mogo-module-tanlu/build.gradle b/modules/mogo-module-tanlu/build.gradle index c1b444cdc9..293b941e74 100644 --- a/modules/mogo-module-tanlu/build.gradle +++ b/modules/mogo-module-tanlu/build.gradle @@ -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 diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/UploadShareCallback.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/UploadShareCallback.java index c0ae07ea7a..550b674874 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/UploadShareCallback.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/callback/UploadShareCallback.java @@ -5,7 +5,7 @@ import com.mogo.commons.data.BaseData; /** * @author lixiaopeng - * @description 上报分享 + * @description 上报分享 废弃 * @since 2020-01-09 */ public interface UploadShareCallback { diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java deleted file mode 100644 index 7766ac1280..0000000000 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewFragment.java +++ /dev/null @@ -1,1713 +0,0 @@ -package com.mogo.module.tanlu.fragment; - -import android.content.Intent; -import android.graphics.Bitmap; -import android.graphics.Rect; -import android.os.Bundle; -import android.os.CountDownTimer; -import android.os.Handler; -import android.text.TextUtils; -import android.view.MotionEvent; -import android.view.View; -import android.view.animation.Interpolator; -import android.view.animation.LinearInterpolator; -import android.widget.RelativeLayout; -import android.widget.TextView; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.recyclerview.widget.GridLayoutManager; -import androidx.recyclerview.widget.RecyclerView; - -import com.alibaba.android.arouter.launcher.ARouter; -import com.mogo.commons.data.BaseData; -import com.mogo.commons.mvp.IView; -import com.mogo.commons.mvp.MvpFragment; -import com.mogo.commons.mvp.Presenter; -import com.mogo.commons.voice.AIAssist; -import com.mogo.commons.voice.IMogoVoiceCmdCallBack; -import com.mogo.map.MogoLatLng; -import com.mogo.map.listener.IMogoMapListener; -import com.mogo.map.location.IMogoLocationListener; -import com.mogo.map.location.MogoLocation; -import com.mogo.map.marker.IMogoMarker; -import com.mogo.map.marker.IMogoMarkerClickListener; -import com.mogo.map.marker.IMogoMarkerManager; -import com.mogo.map.marker.MogoMarkerOptions; -import com.mogo.map.marker.anim.OnMarkerAnimationListener; -import com.mogo.map.model.MogoPoi; -import com.mogo.map.navi.IMogoNaviListener; -import com.mogo.map.navi.MogoNaviInfo; -import com.mogo.map.navi.MogoTraffic; -import com.mogo.map.search.geo.IMogoGeoSearch; -import com.mogo.map.search.geo.IMogoGeoSearchListener; -import com.mogo.map.search.geo.MogoGeocodeAddress; -import com.mogo.map.search.geo.MogoGeocodeResult; -import com.mogo.map.search.geo.MogoPoiItem; -import com.mogo.map.search.geo.MogoRegeocodeResult; -import com.mogo.map.search.geo.query.MogoGeocodeQuery; -import com.mogo.map.search.poisearch.IMogoPoiSearch; -import com.mogo.map.search.poisearch.IMogoPoiSearchListener; -import com.mogo.map.search.poisearch.MogoPoiResult; -import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery; -import com.mogo.map.uicontroller.EnumMapUI; -import com.mogo.map.uicontroller.IMogoMapUIController; -import com.mogo.module.common.entity.MarkerExploreWay; -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.tanlu.R; -import com.mogo.module.tanlu.callback.DataSetChangedAdapter; -import com.mogo.module.tanlu.callback.NaviCallback; -import com.mogo.module.tanlu.callback.RoadLineCallback; -import com.mogo.module.tanlu.callback.UploadShareCallback; -import com.mogo.module.tanlu.callback.VoiceSearchCallback; -import com.mogo.module.tanlu.constant.TanluConstants; -import com.mogo.module.tanlu.model.Center; -import com.mogo.module.tanlu.model.Information; -import com.mogo.module.tanlu.model.Items; -import com.mogo.module.tanlu.model.NaviResult; -import com.mogo.module.tanlu.model.PathLineResult; -import com.mogo.module.tanlu.model.TanluModelData; -import com.mogo.module.tanlu.model.VoiceSearchResult; -import com.mogo.module.tanlu.model.event.ControlClickUpInfo; -import com.mogo.module.tanlu.model.event.DataErrorInfo; -import com.mogo.module.tanlu.model.event.GetInfoError; -import com.mogo.module.tanlu.model.event.MarkerInfo; -import com.mogo.module.tanlu.model.event.PushTypeInfo; -import com.mogo.module.tanlu.model.event.SharedialogEvent; -import com.mogo.module.tanlu.model.event.StartPlayInfo; -import com.mogo.module.tanlu.model.event.VoiceControlUpInfo; -import com.mogo.module.tanlu.util.LocationUtils; -import com.mogo.module.tanlu.util.Utils; -import com.mogo.module.tanlu.view.NetErrorDialog; -import com.mogo.module.tanlu.view.UploadFailedDialog; -import com.mogo.service.IMogoServiceApis; -import com.mogo.service.MogoServicePaths; -import com.mogo.service.adas.IMogoADASController; -import com.mogo.service.analytics.IMogoAnalytics; -import com.mogo.service.cardmanager.IMogoCardManager; -import com.mogo.service.datamanager.IMogoDataChangedListener; -import com.mogo.service.fragmentmanager.IMogoFragmentManager; -import com.mogo.service.imageloader.IMogoImageloader; -import com.mogo.service.intent.IMogoIntentListener; -import com.mogo.service.intent.IMogoIntentManager; -import com.mogo.service.map.IMogoMapService; -import com.mogo.service.module.IMogoActionListener; -import com.mogo.service.module.IMogoActionManager; -import com.mogo.service.module.IMogoModuleLifecycle; -import com.mogo.service.module.IMogoRegisterCenter; -import com.mogo.service.module.MogoAction; -import com.mogo.service.statusmanager.IMogoStatusManager; -import com.mogo.utils.TipToast; -import com.mogo.utils.logger.Logger; -import com.shuyu.gsyvideoplayer.GSYVideoManager; - -import org.greenrobot.eventbus.EventBus; -import org.greenrobot.eventbus.Subscribe; -import org.greenrobot.eventbus.ThreadMode; -import org.json.JSONObject; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import static android.view.View.OVER_SCROLL_NEVER; -import static com.mogo.module.tanlu.video.VideoInitKt.initVideo; - -/** - * @author lixiaopeng - * @description 探路卡片 - * @since 2020-01-02 - */ -public class TanluCardViewFragment extends MvpFragment> - implements IView, - IMogoMarkerClickListener, - IMogoModuleLifecycle, - IMogoMapListener, - IMogoPoiSearchListener, - IMogoLocationListener, - View.OnClickListener, - IMogoDataChangedListener, - IMogoGeoSearchListener { - - private static final String TAG = "TanluCardViewFragment"; - //map - private IMogoMarkerManager mMarkerManager; - private IMogoMapService mMogoMapService; - private IMogoCardManager iMogoCardManager; - private IMogoStatusManager mMogoStatusManager; - private IMogoIntentManager mogoIntentManager; - private IMogoMapUIController mMApUIController; - private IMogoAnalytics mAnalytics; - private IMogoGeoSearch mIMogoGeoSearch; - private IMogoFragmentManager mIMogoFragmentManager; - private IMogoImageloader mogoImageloader; - private IMogoADASController mADASController; - - //语音上一条,下一条 - private IMogoServiceApis mIMogoServiceApis; - private IMogoActionManager mActionManager; - - //声音控制文字 - private String voiceGetInfoMationTts; - // private String[] searchingVoiceStrings; - private String[] searchfaileVoiceStrings; - private String voiceShareSuccessTts; - - private List markerExploreWayList = new ArrayList<>(); - private int mCurrentPosition = 0; //卡片媒体当前位置 - private Bitmap mMarkerIcon; - private Bitmap multiMarkerIcon; - private TanluModelData mTanluModelData; - private List passedByPoints; - private IMogoRegisterCenter mMogoRegisterCenter; - private String mKeywords; - private boolean isCurrentPage; - //新修改 - private RecyclerView mLoopRecyclerView; -// private TanluSlideAdapter mTanluSlideAdapter; - private RelativeLayout mEmptyLayout; - private TextView mEmptyTv; - - - @Override - protected int getLayoutId() { - return R.layout.tanlu_main_media_recycler; - } - - @Override - protected void initViews() { - initVideo(); - initInterface(); - - mLoopRecyclerView = findViewById(R.id.tanlu_rloop_recycleview); - mEmptyLayout = findViewById(R.id.layout_empty_data_show); - mEmptyTv = findViewById(R.id.tv_main_empty); - mEmptyTv.setOnClickListener(this); - mEmptyLayout.setVisibility(View.VISIBLE); - mLoopRecyclerView.setVisibility(View.GONE); - - mLoopRecyclerView.setHasFixedSize(true); - mLoopRecyclerView.setOverScrollMode(OVER_SCROLL_NEVER); - GridLayoutManager layoutManage = new GridLayoutManager(getContext(), 1); - mLoopRecyclerView.setLayoutManager(layoutManage); - -// mTanluSlideAdapter = new TanluSlideAdapter(getContext(), mAnalytics); -// mLoopRecyclerView.setAdapter(mTanluSlideAdapter); - - //保证滑动单页显示 -// PagerSnapHelper snapHelper = new PagerSnapHelper(); -// snapHelper.attachToRecyclerView(mLoopRecyclerView); - - //滑动监听 - mLoopRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { - @Override - public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) { -// super.onScrollStateChanged(recyclerView, newState); - if (recyclerView != null && recyclerView.getChildCount() > 0) { - try { - int currentPositionPage = ((RecyclerView.LayoutParams) recyclerView.getChildAt(0).getLayoutParams()).getViewAdapterPosition(); - Logger.e(TAG, "fragment currentPositionPage = " + currentPositionPage + " >>> size = " + markerExploreWayList.size() + " >>mCurrentPosition = " + mCurrentPosition); - if (currentPositionPage >= markerExploreWayList.size()) { - return; - } - - if (mCurrentPosition != currentPositionPage) { - mCurrentPosition = currentPositionPage; - Logger.d(TAG, "fragment-------mCurrentPosition = " + mCurrentPosition); - moveMapLocation(mCurrentPosition); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - @Override - public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { -// super.onScrolled(recyclerView, dx, dy); - } - }); - } - - /** - * 移动地图位置 - */ - private void moveMapLocation(int currentPositionPage) { - Logger.d(TAG, "fragment moveMapLocation size() =" + markerExploreWayList.size() + " >>>currentPositionPage = " + currentPositionPage); - if (markerExploreWayList.size() > currentPositionPage) { - MarkerExploreWay exploreWay = markerExploreWayList.get(currentPositionPage); - mActionManager.bizInvoke(TanluConstants.MODEL_NAME, currentPositionPage, markerExploreWayList.get(currentPositionPage)); - moveMapToInfoFragement(exploreWay); - } else { - Logger.e(TAG, "Fragment error markerExploreWayList.size() <= currentPositionPage "); - } - } - - /** - * 移动地图到某个位置 - * - * @param exploreWay - */ - private void moveMapToInfoFragement(MarkerExploreWay exploreWay) { - //经度 - Double longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - //纬度 - Double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - - if (exploreWay.getLocation() == null) { - return; - } - double distance = LocationUtils.getDistance(lat, longit, exploreWay.getLocation().getLat(), exploreWay.getLocation().getLon()); - Logger.e(TAG, " fragment moveMapToInfoFragement distance =" + distance); - if (distance >= 20000) { - moveToMarcker(exploreWay.getLocation().getLat(), exploreWay.getLocation().getLon()); - } else { - Rect rect = new Rect( - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_left), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_top), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_right), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_bottom)); - Logger.d(TAG, " Fragment moveMapToInfoFragement size() = " + getList(exploreWay).size()); - moveNotFresh(); - //第一个参数:调用者,第二个参数:当前自车的位置,第三个参数:需要显示在范围内的点(不包含自车的位置) - //第四个参数:显示范围的UI边界,第五个参数:是否锁定自车位置(看业务需要) - mMApUIController.showBounds(TanluConstants.MODEL_NAME, new MogoLatLng(lat, longit), - getList(exploreWay), rect, true); - } - } - - private void moveNotFresh() { - mMogoStatusManager.setUserInteractionStatus(TAG, true, false); - } - - - /** - * 构造经纬度列表 - * - * @param markerExploreWay - * @return - */ - private List getList(MarkerExploreWay markerExploreWay) { - List list = new ArrayList<>(); - if (markerExploreWay != null) { - MarkerLocation location = markerExploreWay.getLocation(); - if (location != null) { - Logger.d(TAG, "getList location.getLon() =" + location.getLon() + " >>>location.getLat()=" + location.getLat()); - MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon()); - //经度 - Double longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - //维度 - Double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - - list.add(mogoLatLng); - } else { - Logger.e(TAG, "getList() location == null"); - } - } else { - Logger.e(TAG, "getList() markerExploreWay == null"); - } - return list; - } - - - private void initInterface() { - mIMogoServiceApis = (IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(); - mActionManager = mIMogoServiceApis.getActionManagerApi(); - mADASController = mIMogoServiceApis.getAdasControllerApi(); - - //地图marker,地图操作 - mMogoMapService = (IMogoMapService) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICES_MAP).navigation(getActivity()); - mMarkerManager = mMogoMapService.getMarkerManager(getContext()); - mMApUIController = mMogoMapService.getMapUIController(); - //地图逆序 - mIMogoGeoSearch = mMogoMapService.getGeoSearch(getContext()); - mogoImageloader = (IMogoImageloader) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_IMAGE_LOADER).navigation(); - //切换卡片操作 - iMogoCardManager = (IMogoCardManager) ARouter.getInstance().build(MogoServicePaths.PATH_CARD_MANAGER).navigation(getActivity()); - mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance().build(MogoServicePaths.PATH_REGISTER_CENTER).navigation(getContext()); - mMogoRegisterCenter.registerMogoModuleLifecycle(TanluConstants.MODEL_NAME, this); - //唤醒 - mogoIntentManager = (IMogoIntentManager) ARouter.getInstance().build(MogoServicePaths.PATH_INTENT_MANAGER).navigation(getContext()); - - mMogoStatusManager = (IMogoStatusManager) ARouter.getInstance().build(MogoServicePaths.PATH_STATUS_MANAGER).navigation(getContext()); - mAnalytics = (IMogoAnalytics) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation(getContext()); - - mIMogoFragmentManager = (IMogoFragmentManager) ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_MANAGER).navigation(getContext()); - - mIMogoGeoSearch.setGeoSearchListener(this); - DataSetChangedAdapter.getInstance().setDelegate(this); - } - - @Override - public void onActivityCreated(@Nullable Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - getViewLifecycleOwner().getLifecycle().addObserver(mPresenter); - EventBus.getDefault().register(this); - initModelData(); - initMap(); - initStrings(); - initListener(); - Logger.d(TAG, "onActivityCreated ------>"); - // 数据先到,卡片后创建 - initData(DataSetChangedAdapter.getInstance().getData()); - sendShareReceiver("0"); - } - - private void initModelData() { - if (mTanluModelData == null) { - mTanluModelData = new TanluModelData(getContext()); - } - } - - @Override - public void onResume() { - super.onResume(); - } - - @Override - public void onRegeocodeSearched(MogoRegeocodeResult regeocodeResult) { - Logger.d(TAG, "onRegeocodeSearched -----> "); - } - - @Override - public void onGeocodeSearched(MogoGeocodeResult geocodeResult) { - Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords); - if (geocodeResult != null) { - if (geocodeResult.getAddresses() != null && geocodeResult.getAddresses().size() > 0) { - Logger.d(TAG, "geocodeResult.getAddresses().size() = " + geocodeResult.getAddresses().size()); - MogoGeocodeAddress geocodeAddress = geocodeResult.getAddresses().get(0); - MogoLatLng latLon = geocodeAddress.getLatlng(); - Double longit; //经度 - Double lat; //维度 - if (mKeywords.equals("附近")) { - Logger.d(TAG, "附近 ----1---"); - longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - } else { - Logger.d(TAG, "其他 ---1----"); - longit = latLon.lng; - lat = latLon.lat; - } - Logger.d(TAG, "geoSearch keywords =" + mKeywords + ">>longitude= " + longit + "--latitude= " + lat); - getVoiceControlRoadData(mKeywords, lat, longit); - } else { - Logger.d(TAG, "onGeocodeSearched ------mKeywords =" + mKeywords); - handlePoi(mKeywords); - } - } else { - Logger.e(TAG, "geocodeResult.getAddresses() == null"); - speakFailVoice(searchfaileVoiceStrings[2]); - } - } - - - /** - * 初始化导航 - */ - private void initMap() { - mMogoRegisterCenter.registerMogoNaviListener(TanluConstants.MODEL_NAME, new IMogoNaviListener() { - @Override - public void onInitNaviFailure() { - } - - @Override - public void onInitNaviSuccess() { - } - - @Override - public void onNaviInfoUpdate(MogoNaviInfo naviinfo) { - } - - @Override - public void onStartNavi() { //开始导航 - Logger.d(TAG, "onStartNavi ------> "); - initModelData(); - getNavigationData(); - } - - @Override - public void onStopNavi() { - } - - @Override - public void onCalculateSuccess() { - } - - @Override - public void onoCalculateFailed() { - } - - @Override - public void onUpdateTraffic(MogoTraffic traffic) { - } - }); - - //监听marker点击 - mMogoRegisterCenter.registerMogoMarkerClickListener(TanluConstants.MODEL_NAME, new IMogoMarkerClickListener() { - @Override - public boolean onMarkerClicked(IMogoMarker marker) { - //marker 点击 - Map properties = new HashMap<>(); - properties.put("type", "2"); - mAnalytics.track(TanluConstants.LAUNCHER_ICON_CLICK, properties); - - MarkerExploreWay exploreWay = extractFromMarker(marker); - if (exploreWay == null) { // 自己打点数据 - double lat = marker.getPosition().lat; - //更新当前位置 - for (int i = 0; i < markerExploreWayList.size(); i++) { - if (markerExploreWayList.get(i).getLocation().getLat() == lat) { - mCurrentPosition = i; - break; - } - } - Logger.d(TAG, "onMarkerClicked 自己打点数据 mCurrentPosition = " + mCurrentPosition + " >>size = " + markerExploreWayList.size()); - mActionManager.bizInvoke(TanluConstants.MODEL_NAME, mCurrentPosition, markerExploreWayList.get(mCurrentPosition)); - if (markerExploreWayList.size() == 1) { - //不处理 - } else { - mLoopRecyclerView.scrollToPosition(mCurrentPosition); - } - } else { //大而全数据 - double lat = exploreWay.getLocation().getLat(); - for (int i = 0; i < markerExploreWayList.size(); i++) { - if (markerExploreWayList.get(i).getLocation().getLat() == lat) { - mCurrentPosition = i; - break; - } - } - Logger.d(TAG, "onMarkerClicked 大而全数据 mCurrentPosition = " + mCurrentPosition + " >>size = " + markerExploreWayList.size()); - mActionManager.bizInvoke(TanluConstants.MODEL_NAME, mCurrentPosition, markerExploreWayList.get(mCurrentPosition)); - if (markerExploreWayList.size() == 1) { - //不处理 - } else { - mLoopRecyclerView.scrollToPosition(mCurrentPosition); - } - } - return false; - } - }); - } - - /** - * 处理关键词搜索 - * - * @return - */ - private void handleActionFoo(String keywords) { - speakSearchingVoice(); - MogoGeocodeQuery geocodeQuery; - String cityCode = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityCode(); - - geocodeQuery = new MogoGeocodeQuery(); - geocodeQuery.setLocationName(keywords); - geocodeQuery.setCity(cityCode); - mIMogoGeoSearch.getFromLocationNameAsyn(geocodeQuery); - } - - /** - * poi 搜索 - * - * @param keywords - */ - private void handlePoi(String keywords) { - String cityCode = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityCode(); - MogoPoiSearchQuery poiSearchQuery = new MogoPoiSearchQuery(keywords, "", cityCode); - IMogoPoiSearch poiSearch = mMogoMapService.getPoiSearch(getContext(), poiSearchQuery); - poiSearch.setPoiSearchListener(this); - poiSearch.searchPOIAsyn(); - } - - /** - * 注册listener监听 - */ - private void initListener() { - mogoIntentManager.registerIntentListener(TanluConstants.SPECIFIEDROAD_SEARCH, mogoIntentListener); - mogoIntentManager.registerIntentListener(TanluConstants.PLAY_VIDEO_AWAKEN, mogoIntentListener); - } - - /** - * 唤醒语音 - */ - private IMogoIntentListener mogoIntentListener = new IMogoIntentListener() { - @Override - public void onIntentReceived(String intentStr, Intent intent) { - String data = intent.getStringExtra("data"); - Logger.d(TAG, "唤醒 mogoIntentListener intentStr =" + intentStr + ">>data =" + data); - if (intentStr.equals(TanluConstants.SPECIFIEDROAD_SEARCH)) { //地点堵不堵 --ok - try { - JSONObject jsonObject = new JSONObject(data); - mKeywords = jsonObject.get("location").toString(); - Logger.d(TAG, "mogoIntentListener specified mKeywords = " + mKeywords); - handleActionFoo(mKeywords); - } catch (Exception e) { - e.printStackTrace(); - } - } else if (intentStr.equals(TanluConstants.PLAY_VIDEO_AWAKEN)) { //播放路况 唤醒 - Logger.d(TAG, "mogoIntentListener 播放路况 唤醒 ----> "); - delayTime(); - } - } - }; - - - /** - * 免唤醒语音监听 - */ - private IMogoVoiceCmdCallBack mogoVoiceListener = new IMogoVoiceCmdCallBack() { - @Override - public void onCmdSelected(String cmd) { - Logger.d(TAG, "mogoVoiceListener cmd = " + cmd); - if (cmd.equals(TanluConstants.PLAY_VIDEO)) { //播放路况 --ok - //语音会中断播放 - AIAssist.getInstance(getContext()).speakTTSVoice(getString(R.string.tanlu_prepare_play), null); - delayTime(); - } - } - - @Override - public void onCmdAction(String speakText) { - } - - @Override - public void onCmdCancel(String speakText) { - } - - @Override - public void onSpeakEnd(String speakText) { - } - - @Override - public void onSpeakSelectTimeOut(String speakText) { - } - }; - - - /** - * 上一条,下一条 - */ - private IMogoActionListener mogoActionListener = new IMogoActionListener() { - @Override - public void onActionDone(MogoAction mogoAction) { - Logger.d(TAG, "mogoActionListener mogoAction = " + mogoAction); - if (mogoAction == MogoAction.Prev) { - EventBus.getDefault().post(new VoiceControlUpInfo("1")); - } else if (mogoAction == MogoAction.Next) { - EventBus.getDefault().post(new VoiceControlUpInfo("2")); - } - } - }; - - - private void delayTime() { - new Handler().postDelayed(new Runnable() { - public void run() { - EventBus.getDefault().post(new StartPlayInfo(mCurrentPosition)); - } - }, 1500); - } - - /** - * type=1 路况 - * type=2 油价 - * type=3 交通检查 - * type=4 封路 - * - * @param type - */ - private void traceTypeData(String type) { - Map properties = new HashMap<>(); - properties.put("type", type); - mAnalytics.track(TanluConstants.LAUNCHER_SHARE_TYPE, properties); - } - - /** - * 分享/上报按钮点击 from=1 手动点击 from=2 语音打开 - * - * @param from - */ - private void traceData(String from) { - Map properties = new HashMap<>(); - properties.put("from", from); - mAnalytics.track(TanluConstants.LAUNCHER_SHARE_CLICK, properties); - } - - private void traceTanluData(String type) { - Map properties = new HashMap<>(); - properties.put("type", type); - mAnalytics.track(TanluConstants.CARNET_USER_UPLOAD, properties); - } - - /** - * 发送广播 audiofocus - */ - private void sendAudioFocusReceiver() { - Logger.d(TAG, "TanluCardViewFragment sendAudioFocusReceiver ---->"); - Intent intent = new Intent(); - intent.setAction("com.zhidao.action.audio.package"); - intent.putExtra("package", "com.mogo.module.tanlu"); - getContext().sendBroadcast(intent); - } - - /** - * 发送广播 type: 1拥堵,2交通检查,3封路,4实时路况,5积水,6积冰,7大雾,8事故 - */ - private void sendShareReceiver(String type) { - if (!type.equals("0")) { - mMogoStatusManager.setUploadingStatus("CARD_TYPE_ROAD_CONDITION", true); - } - - Logger.d(TAG, "TanluCardViewFragment sendShareReceiver ---->"); - Intent intent = new Intent(); - intent.setAction("com.zhidao.share.roadcondition.action"); - intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); - intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); - intent.putExtra("type", type); - getContext().sendBroadcast(intent); - } - - - private MarkerExploreWay extractFromMarker(IMogoMarker marker) { - if (marker == null) { - return null; - } - if (marker.getObject() instanceof MarkerShowEntity) { - MarkerShowEntity showEntity = ((MarkerShowEntity) marker.getObject()); - if (showEntity.getBindObj() instanceof MarkerExploreWay) { - return ((MarkerExploreWay) showEntity.getBindObj()); - } - } - - return null; - } - - /** - * @param view - */ - @Override - public void onClick(View view) { - int id = view.getId(); - if (id == R.id.tv_main_empty) { //上报路况 - sendShareReceiver("1"); - } - } - - private void moveToMarcker(double lat, double lon) { - MogoLatLng latLng = new MogoLatLng(lat, lon); - mMogoStatusManager.setUserInteractionStatus(TAG, true, false); - mMApUIController.moveToCenter(latLng); - } - - /** - * marker点击事件 - * - * @param marker - * @return - */ - @Override - public boolean onMarkerClicked(IMogoMarker marker) { - return true; - } - - @NonNull - @Override - protected Presenter createPresenter() { - return new Presenter(this) { - }; - } - - /** - * C位事件,如何获取数据,需要有默认数据 - * 如果只有一个数据,不显示上下切换按钮,没有数据显示空页面 - */ - @Override - public void onPerform() { - //免唤醒 - AIAssist.getInstance(getActivity()).registerUnWakeupCommand(TanluConstants.PLAY_VIDEO, - TanluConstants.CMD_PLAY_ROAD_CONDITION, mogoVoiceListener); - mActionManager.registerActionListener(TanluConstants.MODEL_NAME, mogoActionListener); - - isCurrentPage = true; - Logger.d(TAG, "tanlu卡片 onPerform 有效 ---->"); - new Handler().postDelayed(new Runnable() { - public void run() { - renderCardViews(); - } - }, 500); - } - - /** - * 根据数据展示页面 - */ - private void renderCardViews() { - if (markerExploreWayList != null && markerExploreWayList.size() > 0) { - mEmptyLayout.setVisibility(View.GONE); - mLoopRecyclerView.setVisibility(View.VISIBLE); - Logger.d(TAG, "renderCardViews size = " + markerExploreWayList.size()); -// mTanluSlideAdapter.setDatas(markerExploreWayList); -// mTanluSlideAdapter.notifyDataSetChanged(); - } else { - mLoopRecyclerView.setVisibility(View.GONE); - mEmptyLayout.setVisibility(View.VISIBLE); -// mEmptyTv.setText(Html.fromHtml(getContext().getString(R.string.main_empty_content))); - Logger.e(TAG, "renderCardViews markerExploreWayList == null "); - } - } - - @Override - public void onDataSetChanged(Object data) { - Logger.d(TAG, "receive data changed. isCurrentPage = " + isCurrentPage); - initData(data); - if (isCurrentPage) { //更新数据 - Logger.d(TAG, "receive data changed 111 -------> "); - renderCardViews(); - } - } - - private void initData(Object data) { - if (markerExploreWayList != null) { - markerExploreWayList.clear(); - } else { - markerExploreWayList = new ArrayList<>(); - } - try { - markerExploreWayList.addAll((List) data); - Logger.d(TAG, "initData size = " + markerExploreWayList.size()); - } catch (Exception e) { - Logger.e(TAG, e, "error."); - } - } - - /** - * 离开C位事件 - */ - @Override - public void onDisable() { - Logger.d(TAG, "tanlu卡片 无效 ----->"); - isCurrentPage = false; - - AIAssist.getInstance(getActivity()).unregisterUnWakeupCommand(TanluConstants.PLAY_VIDEO); - if (mActionManager != null) { - mActionManager.unregisterActionListener(TanluConstants.MODEL_NAME, mogoActionListener); - } - } - - @Override - public void accOn() { - - } - - @Override - public void onMapLoaded() { - } - - @Override - public void onTouch(MotionEvent motionEvent) { - } - - @Override - public void onPOIClick(MogoPoi poi) { - if (poi != null) { - TipToast.shortTip(poi.getName()); - TanluServiceManager.getPoiSearch().searchPOIIdAsyn(poi.getPoiId()); - } - } - - /** - * poi - * - * @param p0 - * @param p1 - */ - @Override - public void onPoiSearched(MogoPoiResult p0, int p1) { - if (p1 == 1000) { - if (p0.getPois() != null && p0.getPois().size() > 0) { - MogoPoiItem poi = p0.getPois().get(0); - MogoLatLng latLon = poi.getPoint(); - Double longit; //经度 - Double lat; //维度 - if (mKeywords.equals("附近")) { - Logger.d(TAG, "附近 -onPoiSearched---1---"); - longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - } else { - Logger.d(TAG, "其他 -onPoiSearched---1----"); - longit = latLon.lng; - lat = latLon.lat; - } - getVoiceControlRoadData(mKeywords, lat, longit); - Logger.d(TAG, "setOnPoiSearchListener keywords =" + mKeywords + ">>longitude= " + longit + "--latitude" + lat); - } else { - Logger.e(TAG, "poi == null"); - Double longit; //经度 - Double lat; //维度 - if (mKeywords.equals("附近")) { - Logger.d(TAG, "附近 -onPoiSearched---2---"); - longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - getVoiceControlRoadData(mKeywords, lat, longit); - } else { - Logger.d(TAG, "其他 -onPoiSearched---2----"); - speakFailVoice(searchfaileVoiceStrings[2]); - } - } - } else { - Logger.e(TAG, "poi search result p1 = " + p1); - speakFailVoice(searchfaileVoiceStrings[2]); - } - } - - @Override - public void onPoiItemSearched(MogoPoiItem item, int errorCode) { - if (item == null) { - return; - } - } - - @Override - public void onLocationChanged(MogoLocation location) { - } - - @Override - public void onMapClick(MogoLatLng latLng) { - - } - - @Override - public void onLockMap(boolean isLock) { - - } - - @Override - public void onMapModeChanged(EnumMapUI ui) { - Logger.d(TAG, ui.name()); - } - - @Override - public void onMapChanged(MogoLatLng location, float zoom, float tilt, float bearing) { - - } - - @Override - public void onDestroyView() { - super.onDestroyView(); - EventBus.getDefault().unregister(this); - getViewLifecycleOwner().getLifecycle().removeObserver(mPresenter); - TanluServiceManager.getLocationClient().removeLocationListener(this); - mMogoRegisterCenter.unregisterMogoNaviListener(TanluConstants.MODEL_NAME); - Logger.d(TAG, "onDestroyView --------> "); - GSYVideoManager.releaseAllVideos(); -// if (mTanluSlideAdapter != null) { -// mTanluSlideAdapter.release(); -// } - } - - /** - * 列表滑动位置 - * - * @param event - */ - @Subscribe(threadMode = ThreadMode.MAIN) - public void onButtonUpAndDown(final ControlClickUpInfo event) { - if (event != null) { - Logger.d(TAG, " onButtonUpAndDown event.type = " + event.type + " >>>mCurrentPosition = " + mCurrentPosition); - if (event.type.equals("1")) { //上一条 - if (mCurrentPosition > 0) { - mLoopRecyclerView.smoothScrollToPosition(mCurrentPosition - 1); - } else { - Logger.e(TAG, " onButtonUpAndDown 上一条 mCurrentPosition <= 0 "); - TipToast.shortTip("已经是第一条"); - } - } else if (event.type.equals("2")) { //下一条 - if (mCurrentPosition >= (markerExploreWayList.size() - 1)) { - TipToast.shortTip("已经是最后一条"); - Logger.e(TAG, " onButtonUpAndDown 下一条 mCurrentPosition >= markerExploreWayList.size() - 1"); - } else { - mLoopRecyclerView.smoothScrollToPosition(mCurrentPosition + 1); - } - } - } else { - Logger.e(TAG, "onButtonUpAndDown event == null "); - } - } - - /** - * 接收到错误数据信息 - * - * @param event - */ - @Subscribe(threadMode = ThreadMode.MAIN) - public void onDataErrorInfo(final DataErrorInfo event) { - if (event == null) { - return; - } - Logger.d(TAG, " onDataErrorInfo id = " + event.id + " >>>poiType = " + event.poiType + ">>>updateType = " + event.updateType); - mTanluModelData.uploadDeleteErrorDataInfo(event.id, event.poiType, event.updateType, - new UploadShareCallback() { - @Override - public void onSuccess(BaseData data) { - Logger.d(TAG, "uploadDeleteErrorDataInfo onSuccess -----> "); - } - - @Override - public void onFail(String message, int code) { - Logger.e(TAG, "uploadDeleteErrorDataInfo onFail -----> message = " + message); - } - }); - } - - /** - * 分享弹框 - * - * @param event - */ - @Subscribe(threadMode = ThreadMode.MAIN) - public void onShareDialog(final SharedialogEvent event) { - if (event == null) { - return; - } - - if (mADASController != null) { - mADASController.closeADAS(); - } -// ShareControl.getInstance(getActivity()).showDialog(); - } - - /** - * 获取情报失败 - */ - @Subscribe(threadMode = ThreadMode.MAIN) - public void onGetInfoFailed(final GetInfoError error) { - mMogoStatusManager.setUploadingStatus(TanluConstants.MODEL_NAME, false); - float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度 - Logger.d(TAG, "onGetInfoFailed bearing = " + bearing + " >>>type = " + error.type); - //失败提示框 - if (error == null) { - return; - } - - if (error.type == null) { - return; - } - - mErrorType = error.type; - if (error.type.equals("100")) { - //网络弹框 - if (errorDialog != null && errorDialog.isShowing()) { - //TODO - } else { - showNetErrorDialog(); - } - } else { - if (customDialog != null && customDialog.isShowing()) { - //TODO - } else { - showNormalDialog(error.type); - } - } - } - - private UploadFailedDialog customDialog; - private NetErrorDialog errorDialog; - private String mErrorType; - - - private void showNormalDialog(final String type) { - customDialog = new UploadFailedDialog(getActivity()); - customDialog.setContent("抱歉,无法获取到相关数据"); - customDialog.setSubContent("分享失败"); - customDialog.setOnCancelListener("取消", new View.OnClickListener() { - @Override - public void onClick(View v) { - timer.cancel(); //取消倒计时 - } - }); - customDialog.setOnOkClickListener("重新分享", new View.OnClickListener() { - @Override - public void onClick(View v) { - Logger.d(TAG, "重新分享 --------->"); - //发送广播 type:1拥堵,2交通检查,3封路 - sendShareReceiver(type); - } - }); - customDialog.show(); - timer.start(); - } - - private void showNetErrorDialog() { - errorDialog = new NetErrorDialog(getActivity()); - errorDialog.setContent("由于网络原因上传失败"); - errorDialog.setSubContent("系统将在网络恢复时自动上传"); - errorDialog.setOnCancelListener("好的", new View.OnClickListener() { - @Override - public void onClick(View v) { - timer.cancel(); - } - }); - errorDialog.show(); - timer.start(); - } - - /** - * 倒计时 - */ - CountDownTimer timer = new CountDownTimer(11000, 1000) { - @Override - public void onTick(long arg) { - int theTime = (int) (arg / 1000); - if (mErrorType.equals("100")) { //无网 - if (errorDialog != null) { - errorDialog.getTxtCancel().setText(getString(R.string.tanlu_neterror_cancle_time, theTime + "")); - } - } else { - if (customDialog != null) { - customDialog.getTxtCancel().setText(getString(R.string.tanlu_cancle_time, theTime + "")); - } - } - } - - @Override - public void onFinish() { - if (mErrorType.equals("100")) { //无网 - if (errorDialog != null) { - errorDialog.dismiss(); - } - } else { - if (customDialog != null) { - customDialog.dismiss(); - } - } - } - }; - - - /** - * 接收到分享对应数据打点 - * - * @param event - */ - @Subscribe(threadMode = ThreadMode.MAIN) - public void onMarkerInfo(final MarkerInfo event) { - if (event == null) { - return; - } - Logger.d(TAG, "onMarkerInfo event.type =" + event.type + " >>event.lat = " + event.lat + " >>event.lon = " + event.lon + " >>event.imageUrl =" + event.imageUrl); - - String poiType = ""; -// if (event.type.equals(TanluConstants.TANLU_ROAD_CONGESTION_COMPAT)) { //上报路况 -// poiType = "100"; -// mMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up); -// } else { -// poiType = "-1"; -// } - - double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - Logger.d(TAG, "onMarkerInfo share onCompleted ---poiType =" + poiType); - if (!poiType.equals("-1")) { - Logger.d(TAG, "onMarkerInfo share onCompleted ---!poiType------->"); - MogoMarkerOptions options = new MogoMarkerOptions() - .icon(mMarkerIcon) - .latitude(lat) //event.lat - .owner("share_tag") - .longitude(lon); //event.lon - final IMogoMarker mogoMarker = mMarkerManager.addMarker("share_tag", options); //随便传tag,不可点击 share_tag TanluConstants.MODEL_NAME - Logger.d(TAG, "getMathRandom() = " + getMathRandom()); - AIAssist.getInstance(getContext()).speakTTSVoice(( - String.format(voiceShareSuccessTts, getMathRandom())), null); -// ShareControl.getInstance(getActivity()).dismissDialog(); - - //开启动画 - mogoMarker.startScaleAnimation(0, 1, 0, 1, 300, new LinearInterpolator(), new OnMarkerAnimationListener() { - @Override - public void onAnimStart() { - Logger.d(TAG, " onAnimStart ---1----> "); - } - - @Override - public void onAnimEnd() { - Logger.d(TAG, " onAnimEnd -----1---> "); - showJumpAnimation(mogoMarker); - } - }); - } else { - Logger.d(TAG, "onMarkerInfo share onCompleted ---!poiType--- else ---->"); - } - - mMogoStatusManager.setUploadingStatus(TanluConstants.MODEL_NAME, false); - - //请求分享接口,只有封路和交通检查走新接口,老接口只有上报拥堵使用,并且定时任务都是拥堵的type - if (poiType.equals("100") || poiType.equals("-1")) { - Logger.d(TAG, "poiType = 100 || -1 "); - } else { - if (markerExploreWayList != null && markerExploreWayList.size() > 0) { - MarkerExploreWay markerExploreWay = markerExploreWayList.get(0); - if (markerExploreWay.getUserInfo() != null && !TextUtils.isEmpty(poiType)) { //上报路况不使用这个接口 - uploadShareInfo(poiType, event.imageUrl, markerExploreWay.getUserInfo().getUserName(), - markerExploreWay.getUserInfo().getUserHead()); - } else { - Logger.e(TAG, "onMarkerInfo markerExploreWay.getUserInfo() == null"); - uploadShareInfo(poiType, event.imageUrl, "", ""); - } - } else { - Logger.e(TAG, "onMarkerInfo share markerExploreWayList = null"); - uploadShareInfo(poiType, event.imageUrl, "", ""); - } - } - } - - private void showJumpAnimation(final IMogoMarker mogoMarker) { - if (mogoMarker == null) { - return; - } - - mogoMarker.startJumpAnimation(80, 300, new Interpolator() { - @Override - public float getInterpolation(float input) { - if (input <= 0.5) { - return (float) (0.5f - 2.0 * (0.5 - input) * (0.5 - input)); - } else { - return (float) (0.5f - Math.sqrt(input - 0.5f) * (1.5f - input)); - } - } - }, new OnMarkerAnimationListener() { - @Override - public void onAnimStart() { -// Logger.d(TAG, " onAnimStart ----2--> "); - } - - @Override - public void onAnimEnd() { -// Logger.d(TAG, " onAnimEnd ----2--> "); - } - }); - } - - - /** - * 上报分享信息 - */ - private void uploadShareInfo(final String poiType, String poiImgUrl, String nickname, String headImgUrl) { - double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - double lon = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - float bearing = TanluServiceManager.getLocationClient().getLastKnowLocation().getBearing(); //角度 - - String addressStr = TanluServiceManager.getLocationClient().getLastKnowLocation().getAddress(); - Logger.d(TAG, "uploadShareInfo lat =" + lat + ">>>lon =" + lon + ">>>addressStr =" + addressStr + " >>bearing =" + bearing); - mTanluModelData.addTrafficCheckInfo(poiType, poiImgUrl, nickname, headImgUrl, lat, lon, addressStr, bearing, - new UploadShareCallback() { - @Override - public void onSuccess(BaseData data) { - Logger.d(TAG, "uploadShareInfo onSuccess -----> poiType = " + poiType); - } - - @Override - public void onFail(String message, int code) { - Logger.e(TAG, "uploadShareInfo onFail -----> poiType = " + poiType); - } - }); - } - - - /** - * push 类型,1为导航数据,2为通勤族 - * - * @param event - */ - @Subscribe(threadMode = ThreadMode.MAIN) - public void onPushInfo(final PushTypeInfo event) { - if (event != null && TextUtils.isEmpty(event.type)) { - Logger.d(TAG, " onPushInfo event.type =" + event.type); - if (event.type.equals("1")) { - getNaviRoadLineInfo(); - } else if (event.type.equals("2")) { - getRoadLineData(); - } - } else { - Logger.e(TAG, "event == null "); - } - } - - - /** - * 导航路线数据事件 - */ - public void getNavigationData() { - if (mADASController != null) { - mADASController.closeADAS(); - } - - mTanluModelData.getNaviInformation(mMogoMapService.getNavi(getContext()).getCalculatedPathPos(), - new NaviCallback() { - @Override - public void onSuccess(NaviResult data) { - List informationList = data.getResult().getInformations(); - Logger.d(TAG, "getNavigationData onSuccess informationList =" + informationList); - if (informationList == null || (informationList != null && informationList.size() == 0)) { - return; - } - - if (markerExploreWayList != null && markerExploreWayList.size() > 0) { - markerExploreWayList.clear(); //刷新之前先删除之前的,然后再添加成请求的 - mCurrentPosition = 0; - } - - //转换数据结构 - convertData(informationList); - //切换到探路卡片 - if (!isCurrentPage) { - iMogoCardManager.switch2(TanluConstants.MODEL_NAME); - } - - //清除探路之前的数据 - mMarkerManager.removeMarkers(TanluConstants.MODEL_NAME); - - //打点 - ArrayList optionList = new ArrayList<>(); - for (int i = 0; i < informationList.size(); i++) { - //根据type确定添加的图片 - String trafficType = informationList.get(i).trafficInfoType; -// if (trafficType.equals("traffic_jam")) { //拥堵 -// multiMarkerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.tanlu_marker_block_up); -// } - - MarkerShowEntity markerShowEntity = new MarkerShowEntity(); - markerShowEntity.setBindObj(markerExploreWayList.get(i)); - markerShowEntity.setTextContent(informationList.get(i).addr); - markerShowEntity.setMarkerType(TanluConstants.MODEL_NAME); - MogoMarkerOptions options = new MogoMarkerOptions() - .object(markerShowEntity) - .icon(multiMarkerIcon) - .latitude(informationList.get(i).lat) - .owner(TanluConstants.MODEL_NAME) - .longitude(informationList.get(i).lon); - - optionList.add(options); - mMarkerManager.addMarker(TanluConstants.MODEL_NAME, options); - } - Logger.d(TAG, "getNavigationData optionList.size() = " + optionList.size()); -// mMarkerManager.addMarkers(TanluConstants.MODEL_NAME, optionList, true); - - mLoopRecyclerView.scrollToPosition(0); - - //播报 -// speakFailVoice(getString(R.string.tanlu_navi_voice_play)); - - //自身位置和第一个情报自适应显示 - Rect rect = new Rect( - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_left), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_top), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_right), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_bottom)); - - mMogoStatusManager.setUserInteractionStatus(TAG, true, true); - //经度 - Double longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - //纬度 - Double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - //第一个参数:调用者,第二个参数:当前自车的位置,第三个参数:需要显示在范围内的点(不包含自车的位置) - //第四个参数:显示范围的UI边界,第五个参数:是否锁定自车位置(看业务需要) - if (markerExploreWayList.size() > 0) { - mMApUIController.showBounds(TanluConstants.MODEL_NAME, new MogoLatLng(lat, longit), - getList(markerExploreWayList.get(0)), rect, true); - } - } - - @Override - public void onFail(String message, int code) { - Logger.d(TAG, "getNavigationData message = " + message + ">>>code =" + code); - } - }); - } - - /** - * 通勤族 事件,监听消息自己请求路线数据 - */ - public void getRoadLineData() { - mTanluModelData.getRoadLineData(new RoadLineCallback() { - @Override - public void onSuccess(PathLineResult o) { - //绘制线路线 - if (o != null && o.getResult() != null && o.getResult().getPointList() != null - && o.getResult().getPointList().size() > 0) { - drawMapLine(o.getResult().getPointList()); - } else { - Logger.e(TAG, "getRoadLineData onSuccess o.getPointList() == null"); - } - } - - @Override - public void onFail(String message, int code) { - Logger.e(TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code); - } - }); - } - - /** - * 导航路线,监听消息自己请求路线数据 - */ - public void getNaviRoadLineInfo() { - mTanluModelData.getNaviRoadLineInfo(new RoadLineCallback() { - @Override - public void onSuccess(PathLineResult o) { - //绘制线路线 - if (o != null && o.getResult() != null && o.getResult().getPointList() != null - && o.getResult().getPointList().size() > 0) { - drawMapLine(o.getResult().getPointList()); - } else { - Logger.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null"); - } - } - - @Override - public void onFail(String message, int code) { - Logger.e(TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code); - } - }); - } - - /** - * 绘制线路 - */ - private void drawMapLine(List
pointList) { - //避免人为操作,刷新 - mMogoStatusManager.setUserInteractionStatus(TanluConstants.MODEL_NAME, true, true); - - int intervalNum = Utils.getIntervalValue(pointList.size()); - Logger.d(TAG, "drawMapLine intervalNum = " + intervalNum + ">>> pointList.size =" + pointList.size()); - int listSize = pointList.size(); - passedByPoints = new ArrayList<>(); - - //沿途最多15个点 - for (int i = 0; i < listSize; i += intervalNum) { - passedByPoints.add(new MogoLatLng(pointList.get(i).getLat(), (pointList.get(i).getLon()))); - } - - Logger.d(TAG, "drawMapLine passedByPoints.size() ----> " + passedByPoints.size()); - MogoLatLng startLatLng = new MogoLatLng(pointList.get(0).getLat(), pointList.get(0).getLon()); - MogoLatLng endLatLng = new MogoLatLng(pointList.get(listSize - 1).getLat(), pointList.get(listSize - 1).getLon()); - mMarkerManager.addRouteWay(getContext(), startLatLng, endLatLng, passedByPoints); - } - - - /** - * 声音控制道路数据 - */ - public void getVoiceControlRoadData(String keywords, final double lat, final double lon) { - if (mADASController != null) { - mADASController.closeADAS(); - } - - String adCode = TanluServiceManager.getLocationClient().getLastKnowLocation().getAdCode(); - String cityCode = TanluServiceManager.getLocationClient().getLastKnowLocation().getCityCode(); - //移动到具体位置 - mMogoStatusManager.setUserInteractionStatus(TanluConstants.MODEL_NAME, true, true); - moveToMarcker(lat, lon); - - inputlon = lon; - inputlat = lat; - - if (mIMogoFragmentManager.getStackSize() > 0) { - mIMogoFragmentManager.clearAll(); - } - - Logger.d(TAG, "getVoiceControlRoadData lat =" + lat + ">>>lon =" + lon + ">>>cityCode= " + cityCode + " >>>adCode = " + adCode); - mTanluModelData.getVoiceControlRoadData(keywords, cityCode, lon, lat, adCode, new VoiceSearchCallback() { - @Override - public void onSuccess(VoiceSearchResult o) { - String discription = o.getResult().getDescription(); - Logger.d(TAG, "getVoiceControlRoadData onSuccess ----1--->"); - if (o.getResult().getInformations() != null && o.getResult().getInformations().size() > 0) { - Logger.d(TAG, "getVoiceControlRoadData onSuccess ----2--->"); - if (markerExploreWayList != null && markerExploreWayList.size() > 0) { - markerExploreWayList.clear(); //刷新之前先删除之前的,然后再添加成请求的 - mCurrentPosition = 0; - } - - //转换数据结构 - convertData(o.getResult().getInformations()); - //切换到探路卡片 - if (!isCurrentPage) { - iMogoCardManager.switch2(TanluConstants.MODEL_NAME); - } - - speakSuccessVoice(o.getResult().getInformations(), discription == null ? "" : discription); - - List informationList = o.getResult().getInformations(); - Logger.d(TAG, "getVoiceControlRoadData onSuccess informationList =" + informationList); - if (informationList == null || (informationList != null && informationList.size() == 0)) { - return; - } - //清除探路之前的数据 - mMarkerManager.removeMarkers(TanluConstants.MODEL_NAME); - //添加埋点数据 - datalon = informationList.get(0).lon; - datalat = informationList.get(0).lat; - - //打点 - ArrayList optionList = new ArrayList<>(); - for (int i = 0; i < informationList.size(); i++) { - //根据type确定添加的图片 - String trafficType = informationList.get(i).trafficInfoType; - - MarkerShowEntity markerShowEntity = new MarkerShowEntity(); - markerShowEntity.setBindObj(markerExploreWayList.get(i)); - markerShowEntity.setTextContent(informationList.get(i).addr); - markerShowEntity.setMarkerType(TanluConstants.MODEL_NAME); - MogoMarkerOptions options = new MogoMarkerOptions() - .object(markerShowEntity) - .icon(multiMarkerIcon) - .latitude(informationList.get(i).lat) - .owner(TanluConstants.MODEL_NAME) - .longitude(informationList.get(i).lon); - -// optionList.add(options); - mMarkerManager.addMarker(TanluConstants.MODEL_NAME, options); - } - Logger.d(TAG, "getVoiceControlRoadData optionList.size() = " + optionList.size()); - mMogoStatusManager.setUserInteractionStatus(TanluConstants.MODEL_NAME, true, true); -// mMarkerManager.addMarkers(TanluConstants.MODEL_NAME, optionList, true); - - //展示6个在区域内显示 - showBonndsRoadtion(); - - //直接使用当前数据list,作为切换的数据源,切换左侧列表到最新的数据 - mLoopRecyclerView.scrollToPosition(0); - } else { - if (!TextUtils.isEmpty(discription)) { - Logger.d(TAG, "getVoiceControlRoadData discription != null else ----1--->"); - AIAssist.getInstance(getContext()).speakTTSVoice(discription, null); - } else { - Logger.d(TAG, "getVoiceControlRoadData discription == null else ----2--->"); -// AIAssist.getInstance(getContext()).speakTTSVoice("未找到其他车主分享的路况信息", null); - } - } - } - - @Override - public void onFail(String message, int code) { - Logger.e(TAG, "getVoiceControlRoadData onFail message = " + message + ">>>code= " + code); - speakFailVoice(searchfaileVoiceStrings[2]); - } - }); - } - - - private void showBonndsRoadtion() { - Logger.e(TAG, "showBonndsRoadtion getMogoList markerExploreWayList.size() = " + markerExploreWayList.size()); - //经度 - Double longit = TanluServiceManager.getLocationClient().getLastKnowLocation().getLongitude(); - //纬度 - Double lat = TanluServiceManager.getLocationClient().getLastKnowLocation().getLatitude(); - - Rect rect = new Rect( - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_left), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_top), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_right), - (int) getContext().getResources().getDimension(R.dimen.tanlu_module_map_bottom)); - - moveNotFresh(); - - //第一个参数:调用者,第二个参数:当前自车的位置,第三个参数:需要显示在范围内的点(不包含自车的位置) - //第四个参数:显示范围的UI边界,第五个参数:是否锁定自车位置(看业务需要) - mMApUIController.showBounds(TanluConstants.MODEL_NAME, new MogoLatLng(lat, longit), - getMogoList(), rect, true); - Logger.d(TAG, " getMogoList() = " + getMogoList().size()); - } - - - /** - * 构造经纬度列表 - * - * @return - */ - private List getMogoList() { - List list = new ArrayList<>(); - if (markerExploreWayList != null && markerExploreWayList.size() > 0) { - if (markerExploreWayList.size() < 6) { - for (int i = 0; i < markerExploreWayList.size(); i++) { - MarkerLocation location = markerExploreWayList.get(i).getLocation(); - if (location != null) { - MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon()); - list.add(mogoLatLng); - } else { - Logger.e(TAG, "getMogoList() < 6 location == null"); - } - } - } else { - for (int i = 0; i < 6; i++) { - MarkerLocation location = markerExploreWayList.get(i).getLocation(); - if (location != null) { - MogoLatLng mogoLatLng = new MogoLatLng(location.getLat(), location.getLon()); - list.add(mogoLatLng); - } else { - Logger.e(TAG, "getMogoList() location == null"); - } - } - } - } else { - Logger.e(TAG, "getMogoList() markerExploreWay == null"); - } - return list; - } - - - /** - * 将探路的数据结构转换成 MarkerExploreWay的列表 - */ - private void convertData(List informations) { - if (markerExploreWayList != null) { - markerExploreWayList.clear(); - } - - for (int i = 0; i < informations.size(); i++) { - MarkerExploreWay markerExploreWay = new MarkerExploreWay(); - markerExploreWay.setAddr(informations.get(i).addr); - markerExploreWay.setCityName(informations.get(i).cityName); - markerExploreWay.setDistance(informations.get(i).distance); - markerExploreWay.setFileType(informations.get(i).type); - markerExploreWay.setItems(convertMediaData(informations.get(i).items)); - markerExploreWay.setLocation(convertLocation(informations.get(i))); - markerExploreWay.setUserInfo(convertUserInfo(informations.get(i))); - - markerExploreWayList.add(markerExploreWay); - } - - //更新数据 - renderCardViews(); - } - - /** - * 转换媒体数据 - * - * @param items - * @return - */ - private List convertMediaData(ArrayList items) { - List exploreWayItems = new ArrayList<>(); - MarkerExploreWayItem item = new MarkerExploreWayItem(); - if (items != null && items.size() > 0) { - item.setThumbnail(items.get(0).getThumbnail()); - item.setUrl(items.get(0).getUrl()); - - exploreWayItems.add(item); - } - - return exploreWayItems; - } - - - private MarkerLocation convertLocation(Information information) { - MarkerLocation location = new MarkerLocation(); - location.setAddress(information.addr); - location.setAngle(0); - location.setLat(information.lat); - location.setLon(information.lon); - - return location; - } - - - private MarkerUserInfo convertUserInfo(Information information) { - MarkerUserInfo userInfo = new MarkerUserInfo(); - userInfo.setUserHead(information.headImgUrl); - userInfo.setUserName(information.nickName); - - return userInfo; - } - - - Random random = new Random(); - - private void speakSuccessVoice(List informations, String - trafficStatus) { - Logger.d(TAG, "speakSuccessVoice informations.size() = " + informations.size()); - switch (informations.size()) { - case 0: - speakFailVoice(searchfaileVoiceStrings[random.nextInt(3)]); - break; - - case 1: - trackVoiceSearch(1); - AIAssist.getInstance(getContext()).speakTTSVoice(( - String.format(voiceGetInfoMationTts, "1") + trafficStatus), null); - break; - - case 2: - trackVoiceSearch(1); - AIAssist.getInstance(getContext()).speakTTSVoice(( - String.format( - voiceGetInfoMationTts, - "2" - ) + trafficStatus), null); - break; - case 3: - trackVoiceSearch(1); - AIAssist.getInstance(getContext()).speakTTSVoice(( - String.format( - voiceGetInfoMationTts, - "3" - ) + trafficStatus), null); - break; - - default: - trackVoiceSearch(1); - AIAssist.getInstance(getContext()).speakTTSVoice(( - String.format( - voiceGetInfoMationTts, - "多" - ) + trafficStatus), null); - } - } - - private void initStrings() { - voiceGetInfoMationTts = - getContext().getResources().getString(R.string.voice_get_informations_tts); -// searchingVoiceStrings = -// getContext().getResources().getStringArray(R.array.searching_voice_string_array); - searchfaileVoiceStrings = - getContext().getResources().getStringArray(R.array.search_fail_voice_array); - voiceShareSuccessTts = getContext().getResources().getString(R.string.tanlu_share_success); - } - - private void speakFailVoice(String string) { - AIAssist.getInstance(getContext()).speakTTSVoice(string, null); - } - - private void speakSearchingVoice() { -// AIAssist.getInstance(getContext()).speakTTSVoice(searchingVoiceStrings[random.nextInt(3)], null); - } - - - Double inputlon = 0.0;//经度 - Double inputlat = 0.0; //维度 - Double datalon = 0.0; //经度 - Double datalat = 0.0; //维度 - - //上报语音搜索 - private void trackVoiceSearch(int type) { - Map properties = new HashMap<>(); - properties.put("type", type); - properties.put("searchtext", mKeywords); - properties.put("inputlon", inputlon); - properties.put("inputlat", inputlat); - properties.put("datalon", datalon); - properties.put("datalat", datalat); - mAnalytics.track(TanluConstants.CARNET_VOICE_SEARCH, properties); - } - - private String getMathRandom() { - Random random = new Random(); - int temp = random.nextInt(50) + 10; - - return String.valueOf(temp); - } -} - - diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java index e7485bdc8c..c184721629 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluCardViewProvider.java @@ -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; /** diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java index cc757b123b..d532afd8a4 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluListWindow.java @@ -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 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 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); diff --git a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluServiceManager.java b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluServiceManager.java index 3709aed460..78d541c5d8 100644 --- a/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluServiceManager.java +++ b/modules/mogo-module-tanlu/src/main/java/com/mogo/module/tanlu/fragment/TanluServiceManager.java @@ -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; diff --git a/modules/mogo-module-tanlu/src/main/res/drawable-mdpi/tanlu_icon_logo.png b/modules/mogo-module-tanlu/src/main/res/drawable-mdpi/tanlu_icon_logo.png index 957c298fd6..5480b6d165 100644 Binary files a/modules/mogo-module-tanlu/src/main/res/drawable-mdpi/tanlu_icon_logo.png and b/modules/mogo-module-tanlu/src/main/res/drawable-mdpi/tanlu_icon_logo.png differ diff --git a/modules/mogo-module-tanlu/src/main/res/drawable/tanlu_alert_window_bg.xml b/modules/mogo-module-tanlu/src/main/res/drawable/tanlu_alert_window_bg.xml index 7ae04a2bed..1520ad601e 100644 --- a/modules/mogo-module-tanlu/src/main/res/drawable/tanlu_alert_window_bg.xml +++ b/modules/mogo-module-tanlu/src/main/res/drawable/tanlu_alert_window_bg.xml @@ -4,10 +4,10 @@ + 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" /> @@ -15,10 +15,10 @@ + 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" /> diff --git a/modules/mogo-module-tanlu/src/main/res/values-mdpi/dimens.xml b/modules/mogo-module-tanlu/src/main/res/values-mdpi/dimens.xml index 7716b8ccc7..2a32aa9897 100644 --- a/modules/mogo-module-tanlu/src/main/res/values-mdpi/dimens.xml +++ b/modules/mogo-module-tanlu/src/main/res/values-mdpi/dimens.xml @@ -80,16 +80,17 @@ 186px 176px 250px - 172px + 158px 45px 13px - 8px - 7px + 6px + 13px 17px 3px 18px 26px + 4px 28px 56px diff --git a/modules/mogo-module-tanlu/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-tanlu/src/main/res/values-xhdpi-1920x1000/dimens.xml index 4062891c80..969d398b55 100644 --- a/modules/mogo-module-tanlu/src/main/res/values-xhdpi-1920x1000/dimens.xml +++ b/modules/mogo-module-tanlu/src/main/res/values-xhdpi-1920x1000/dimens.xml @@ -90,6 +90,7 @@ 9px 27px 46px + 4px 50px 90px diff --git a/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml index 88af7354b4..1676116d31 100644 --- a/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-tanlu/src/main/res/values-xhdpi/dimens.xml @@ -90,6 +90,7 @@ 9px 27px 46px + 4px 50px 98px diff --git a/modules/mogo-module-tanlu/src/main/res/values/dimens.xml b/modules/mogo-module-tanlu/src/main/res/values/dimens.xml index 7716b8ccc7..af1c70909d 100644 --- a/modules/mogo-module-tanlu/src/main/res/values/dimens.xml +++ b/modules/mogo-module-tanlu/src/main/res/values/dimens.xml @@ -80,16 +80,17 @@ 186px 176px 250px - 172px + 158px 45px 13px - 8px + 6px 7px 17px 3px 18px 26px + 4px 28px 56px diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java index 823faa7f2f..a8d0ffe1ac 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/V2XServiceManager.java @@ -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; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java index f2565bbf67..145f8aa01b 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/road/V2XRoadEventScenario.java @@ -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 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 imp public void onViewAdded(View view) { Logger.d(MODULE_NAME, "展示 Window 动画结束"); if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) { - drawPOI(); + if (getV2XMessageEntity() != null && getV2XMessageEntity().isNeedAddLine() == true){ + drawPOI(); + } } } diff --git a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_live_show.xml b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_live_show.xml index b0b87a8207..00d8af5a9a 100644 --- a/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_live_show.xml +++ b/modules/mogo-module-v2x/src/main/res/drawable/bg_v2x_event_live_show.xml @@ -1,10 +1,15 @@ - - - - - - \ No newline at end of file + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/layout/footer_nomore_view.xml b/modules/mogo-module-v2x/src/main/res/layout/footer_nomore_view.xml index b516dedff0..b524ced9c9 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/footer_nomore_view.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/footer_nomore_view.xml @@ -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" diff --git a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_share_description.xml b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_share_description.xml index 836cc77d1f..67abcccd31 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_share_description.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/module_v2x_event_share_description.xml @@ -107,7 +107,7 @@ diff --git a/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml index 16cfb44d2c..56f8efe5eb 100644 --- a/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml @@ -61,8 +61,7 @@ 18px 20px 16px - 17px - 14px + 82px 16px 117px diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi-1920x1000/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi-1920x1000/dimens.xml index a7faf7fc01..adda1e011f 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi-1920x1000/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi-1920x1000/dimens.xml @@ -58,8 +58,6 @@ 32px 36px 30px - 16px - 42px 120px 158px diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml index 17b9d0b340..21d1f7de8c 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml @@ -59,8 +59,7 @@ 32px 36px 30px - 31.9px - 26px + 30px 140px 219px diff --git a/modules/mogo-module-v2x/src/main/res/values/dimens.xml b/modules/mogo-module-v2x/src/main/res/values/dimens.xml index cc787677d3..0a2a6ea64b 100644 --- a/modules/mogo-module-v2x/src/main/res/values/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values/dimens.xml @@ -57,8 +57,6 @@ 18px 20px 16px - 16px - 20px 82px 16px 117px diff --git a/modules/mogo-module-v2x/src/main/res/values/style.xml b/modules/mogo-module-v2x/src/main/res/values/style.xml index a6641ea9c8..41038019b1 100644 --- a/modules/mogo-module-v2x/src/main/res/values/style.xml +++ b/modules/mogo-module-v2x/src/main/res/values/style.xml @@ -4,17 +4,6 @@ - - diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java b/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java index 25fd02c006..e119875657 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/IMogoServiceApis.java @@ -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; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluProvider.java b/services/mogo-service-api/src/main/java/com/mogo/service/share/IMogoTanluProvider.java similarity index 98% rename from services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluProvider.java rename to services/mogo-service-api/src/main/java/com/mogo/service/share/IMogoTanluProvider.java index 77cebf1b3a..994e811744 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluProvider.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/share/IMogoTanluProvider.java @@ -1,4 +1,4 @@ -package com.mogo.service.tanlu; +package com.mogo.service.share; import com.alibaba.android.arouter.facade.template.IProvider; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluUiProvider.java b/services/mogo-service-api/src/main/java/com/mogo/service/share/IMogoTanluUiProvider.java similarity index 96% rename from services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluUiProvider.java rename to services/mogo-service-api/src/main/java/com/mogo/service/share/IMogoTanluUiProvider.java index 1b7ce77f3c..53d0aa6cd6 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/IMogoTanluUiProvider.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/share/IMogoTanluUiProvider.java @@ -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; diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/TanluUploadParams.java b/services/mogo-service-api/src/main/java/com/mogo/service/share/TanluUploadParams.java similarity index 98% rename from services/mogo-service-api/src/main/java/com/mogo/service/tanlu/TanluUploadParams.java rename to services/mogo-service-api/src/main/java/com/mogo/service/share/TanluUploadParams.java index e63f637d79..448a918057 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/tanlu/TanluUploadParams.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/share/TanluUploadParams.java @@ -1,4 +1,4 @@ -package com.mogo.service.tanlu; +package com.mogo.service.share; import com.mogo.map.MogoLatLng; diff --git a/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java b/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java index 7f0ca8cec1..f000760d41 100644 --- a/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java +++ b/services/mogo-service/src/main/java/com/mogo/service/impl/MogoServiceApis.java @@ -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; diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-ldpi/tanlu_head_image_light.png b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-ldpi/tanlu_head_image_light.png new file mode 100644 index 0000000000..d6aeb4ec4f Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-ldpi/tanlu_head_image_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-mdpi/tanlu_head_image_light.png b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-mdpi/tanlu_head_image_light.png new file mode 100644 index 0000000000..d6aeb4ec4f Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-mdpi/tanlu_head_image_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-xhdpi-1920x1000/tanlu_head_image_light.png b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-xhdpi-1920x1000/tanlu_head_image_light.png new file mode 100644 index 0000000000..8968f0595c Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-xhdpi-1920x1000/tanlu_head_image_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-xhdpi/tanlu_head_image_light.png b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-xhdpi/tanlu_head_image_light.png new file mode 100644 index 0000000000..8968f0595c Binary files /dev/null and b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable-xhdpi/tanlu_head_image_light.png differ diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/drawable/tanlu_alert_window_bg_light.xml b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable/tanlu_alert_window_bg_light.xml index afd05b86dd..94999dc002 100644 --- a/skin/mogo-skin-light/src/main/module-tanlu-res/drawable/tanlu_alert_window_bg_light.xml +++ b/skin/mogo-skin-light/src/main/module-tanlu-res/drawable/tanlu_alert_window_bg_light.xml @@ -4,10 +4,10 @@ + 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" /> @@ -15,10 +15,10 @@ + 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" /> diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/values-mdpi/dimens.xml b/skin/mogo-skin-light/src/main/module-tanlu-res/values-mdpi/dimens.xml new file mode 100644 index 0000000000..3a2df8bb23 --- /dev/null +++ b/skin/mogo-skin-light/src/main/module-tanlu-res/values-mdpi/dimens.xml @@ -0,0 +1,8 @@ + + + 16px + 10px + 8px + 4px + + \ No newline at end of file diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi-1920x1000/dimens.xml b/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi-1920x1000/dimens.xml index 9514cc43b3..b51d728283 100644 --- a/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi-1920x1000/dimens.xml +++ b/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi-1920x1000/dimens.xml @@ -3,6 +3,7 @@ 30px 20px 16px + 4px diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi/dimens.xml b/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi/dimens.xml index b22064a243..9def827f0f 100644 --- a/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi/dimens.xml +++ b/skin/mogo-skin-light/src/main/module-tanlu-res/values-xhdpi/dimens.xml @@ -4,6 +4,7 @@ 30px 20px 16px + 4px diff --git a/skin/mogo-skin-light/src/main/module-tanlu-res/values/dimens.xml b/skin/mogo-skin-light/src/main/module-tanlu-res/values/dimens.xml index 6a87855ba7..3a2df8bb23 100644 --- a/skin/mogo-skin-light/src/main/module-tanlu-res/values/dimens.xml +++ b/skin/mogo-skin-light/src/main/module-tanlu-res/values/dimens.xml @@ -3,5 +3,6 @@ 16px 10px 8px + 4px \ No newline at end of file diff --git a/skin/mogo-skin-light/src/main/module-v2x-res/values/colors.xml b/skin/mogo-skin-light/src/main/module-v2x-res/values/colors.xml index 4eb258787e..21bd14ebf9 100644 --- a/skin/mogo-skin-light/src/main/module-v2x-res/values/colors.xml +++ b/skin/mogo-skin-light/src/main/module-v2x-res/values/colors.xml @@ -8,7 +8,7 @@ #333333 #FFFFFF #FFFFFF - #CB333333 + #80333333 #999999 #B2333333 #666666