diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 663459aa50..0d156937bb 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -3,9 +3,18 @@ + diff --git a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt index 1cff5c7d5a..7909e83a62 100644 --- a/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt +++ b/libraries/tanlulib/src/main/java/com/zhidao/roadcondition/service/MainService.kt @@ -11,10 +11,14 @@ import android.os.IBinder import android.util.Log import com.elegant.analytics.Analytics import com.mogo.commons.AbsMogoApplication -import com.mogo.commons.debug.DebugConfig +import com.mogo.utils.logger.Logger +import com.mogo.utils.storage.SharedPrefsMgr import com.zhidao.cosupload.manager.CosUploadManagerImpl import com.zhidao.roadcondition.BuildConfig -import com.zhidao.roadcondition.constant.* +import com.zhidao.roadcondition.constant.DEFAULT_VIDEO_DURATION +import com.zhidao.roadcondition.constant.TANLU_ROAD_CURRENT +import com.zhidao.roadcondition.constant.UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO +import com.zhidao.roadcondition.constant.UPLOAD_FROM_STRATEGY_BLOCK_AUTO import com.zhidao.roadcondition.event.GetImageSuccessEvent import com.zhidao.roadcondition.event.LatLngStickyEventBus import com.zhidao.roadcondition.util.* @@ -221,12 +225,16 @@ class MainService : Service() { //开始开始监听速度,只要超过一次5公里每小时则即开始获取策略进行本地上报 只有release才加此判断,qa环境方便测试 LocationUtil.getInstance().setonSpeedlistenner(object : LocationUtil.SpeedListener { override fun onSpeedGet(speed: Float) { - if (speed > (5 / 3.6f) && !isGetStrategies) { - mainServiceHttpModel.initStrategies { - handleReportStrategy() + var isOpen = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp().applicationContext).getBoolean("KEY_SERVER_REPORTSTRATEGY_SWITCH", false) + Logger.d("EntrancePresenter", " -------- isOpen = $isOpen") + if (isOpen) { + if (speed > (5 / 3.6f) && !isGetStrategies) { + mainServiceHttpModel.initStrategies { + handleReportStrategy() + } + Log.d("MainService", "initLocationListener more than 5 start upload speed = $speed") + isGetStrategies = true } - Log.d("MainService", "initLocationListener more than 5 start upload speed = $speed") - isGetStrategies = true } } }) 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 index 0f9f7cd97a..36e5ca7a48 100644 --- 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 @@ -12,11 +12,13 @@ public class CommonConfig { public Active active;//活动配置 public Auth auth; //授权配置 public Speech speech; //语音播报次数 + public ReportStrategy reportStrategy; //被动上报策略开关 - public CommonConfig(Active active, Auth auth, Speech speech) { + public CommonConfig(Active active, Auth auth, Speech speech, ReportStrategy reportStrategy) { this.active = active; this.auth = auth; this.speech = speech; + this.reportStrategy = reportStrategy; } public class Active{ @@ -47,4 +49,11 @@ public class CommonConfig { this.isNeedAuth = isNeedAuth; } } + + public class ReportStrategy { + public boolean open; + ReportStrategy(boolean open) { + this.open = open; + } + } } diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java index ab25f3a2ba..6f1b8824f4 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntrancePresenter.java @@ -130,7 +130,6 @@ 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()) @@ -145,12 +144,20 @@ public class EntrancePresenter extends Presenter implements Weathe Logger.d(TAG, "getCommonConfig onSuccess -----> "); if (config != null && config.result != null) { CommonConfig.Speech speech = config.result.speech; + CommonConfig.ReportStrategy strategy = config.result.reportStrategy; 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 "); } + + if (strategy != null) { + Logger.d(TAG, "getCommonConfig onSuccess strategy.open = " + strategy.open); + SharedPrefsMgr.getInstance(getContext()).putBoolean("KEY_SERVER_REPORTSTRATEGY_SWITCH", strategy.open); + } else { + Logger.e(TAG, "getCommonConfig onSuccess strategy == null "); + } } else { Logger.e(TAG, "getCommonConfig onSuccess config == null"); } diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml index a4df8026d8..886ad47555 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml @@ -52,7 +52,7 @@ android:paddingRight="@dimen/dp_10" android:paddingBottom="@dimen/dp_3" android:textColor="#fff" - android:textSize="@dimen/dp_24" + android:textSize="@dimen/module_v2x_event_type_title_text_size" app:layout_constraintStart_toEndOf="@+id/rlRoadEventImg" app:layout_constraintTop_toTopOf="@+id/rlRoadEventImg" tools:text="道路施工" /> @@ -66,7 +66,7 @@ android:ellipsize="end" android:maxLines="1" android:textColor="@color/v2x_FFF_333" - android:textSize="@dimen/dp_36" + android:textSize="@dimen/module_v2x_event_title_text_size" android:textStyle="bold" app:layout_constraintEnd_toStartOf="@+id/ivEventHead" app:layout_constraintStart_toStartOf="@+id/tvEventTypeTitle" @@ -89,7 +89,7 @@ android:layout_marginStart="@dimen/dp_10" android:alpha="0.6" android:textColor="@color/v2x_FFF_666" - android:textSize="@dimen/dp_28" + android:textSize="@dimen/module_v2x_event_sub_title_text_size" app:layout_constraintBottom_toBottomOf="@id/ivEventDistanceLogo" app:layout_constraintStart_toEndOf="@id/ivEventDistanceLogo" app:layout_constraintTop_toTopOf="@id/ivEventDistanceLogo" @@ -102,7 +102,7 @@ android:layout_marginStart="@dimen/dp_30" android:alpha="0.6" android:textColor="@color/v2x_FFF_999" - android:textSize="@dimen/dp_28" + android:textSize="@dimen/module_v2x_event_sub_title_text_size" app:layout_constraintBottom_toBottomOf="@id/ivEventDistanceLogo" app:layout_constraintStart_toEndOf="@+id/tvEventDistance" app:layout_constraintTop_toTopOf="@id/ivEventDistanceLogo" @@ -110,8 +110,8 @@ @@ -78,7 +78,7 @@ android:layout_marginEnd="@dimen/dp_30" android:gravity="center_vertical" android:textColor="@color/v2x_FFF_333" - android:textSize="@dimen/dp_80" + android:textSize="@dimen/module_v2x_event_help_distance_text_size" android:textStyle="bold" app:layout_constraintBottom_toBottomOf="@+id/ivFaultHelpEventCall" app:layout_constraintEnd_toStartOf="@+id/ivFaultHelpEventCall" diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking.xml index 9bd3f76b78..1a0f011c8c 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_illegal_parking.xml @@ -33,7 +33,7 @@ android:paddingBottom="@dimen/dp_3" android:text="违章停车" android:textColor="#FFFFFF" - android:textSize="@dimen/dp_24" + android:textSize="@dimen/module_v2x_event_type_title_text_size" android:textStyle="bold" app:layout_constraintBottom_toTopOf="@+id/tvAddress" app:layout_constraintStart_toEndOf="@+id/ivIconP" @@ -48,7 +48,7 @@ android:ellipsize="end" android:maxLines="1" android:textColor="@color/v2x_FFF_333" - android:textSize="@dimen/dp_34" + android:textSize="@dimen/module_v2x_event_title_text_size" app:layout_constraintBottom_toTopOf="@+id/tvAddressDistance" app:layout_constraintEnd_toStartOf="@+id/llIllegalParkingLike" app:layout_constraintStart_toStartOf="@+id/tagEventType" @@ -63,7 +63,7 @@ android:alpha="0.6" android:gravity="center_vertical" android:textColor="@color/v2x_FFF_666" - android:textSize="@dimen/dp_26" + android:textSize="@dimen/module_v2x_event_sub_title_text_size" app:layout_constraintEnd_toEndOf="@+id/tvAddress" app:layout_constraintStart_toStartOf="@+id/tagEventType" app:layout_constraintTop_toBottomOf="@+id/tvAddress" diff --git a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_normal.xml b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_normal.xml index 9cbfa8f4ef..99bb075aaf 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_normal.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/view_video_layout_normal.xml @@ -42,7 +42,7 @@ android:layout_marginStart="@dimen/dp_20" android:text="直播获取失败" android:textColor="@color/v2x_FFF_333" - android:textSize="@dimen/dp_36" + android:textSize="@dimen/module_v2x_event_live_error_text_size" app:layout_constraintBottom_toBottomOf="@+id/ivErrorIcon" app:layout_constraintStart_toEndOf="@+id/ivErrorIcon" app:layout_constraintTop_toTopOf="@+id/ivErrorIcon" /> @@ -59,7 +59,7 @@ android:paddingBottom="@dimen/dp_25" android:text="重试" android:textColor="@color/v2x_FFF_333" - android:textSize="@dimen/dp_34" + android:textSize="@dimen/module_v2x_event_live_error_text_size" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/ivErrorIcon" /> diff --git a/modules/mogo-module-v2x/src/main/res/values-ldpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-ldpi/dimens.xml index 63f2dac657..e911308385 100644 --- a/modules/mogo-module-v2x/src/main/res/values-ldpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-ldpi/dimens.xml @@ -4,21 +4,13 @@ 18px 20px - 190px - 250px + 190px 210px - 136px 82px - 54px - - 64px - - 156px - 234px 34px @@ -28,7 +20,6 @@ 6px - 150px 550px 200px 200px @@ -81,4 +72,31 @@ 16px 20px 6px + + + 13px + 20px + 16px + 31px + 20px + 150px + 54px + 64px + + + 190px + 250px + 156px + 234px + + + 136px + + 41px + 18px + 14px + 44px + 19px + + 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 7afc5f5e14..17684331f1 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 @@ -4,21 +4,14 @@ 18px 20px - 190px - 250px + 190px 210px - 136px 82px - 54px - 64px - - 156px - 234px 34px @@ -28,7 +21,6 @@ 6px - 150px 550px 200px 200px @@ -81,4 +73,31 @@ 16px 20px 3px + + + 13px + 20px + 16px + 31px + 20px + 150px + 54px + 64px + + + 190px + 250px + 156px + 234px + + + 136px + + 41px + 18px + 14px + 44px + 19px + + 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 2e18d47106..4d5042d290 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 @@ -4,27 +4,19 @@ 32px 32px - 330px - 450px + 390px 410px - 200px 160px - 110px - 100px - - 270px - 480px 60px 40px 80px - 310px 15px 550px 200px @@ -64,4 +56,30 @@ 158px + + 24px + 36px + 28px + 55px + 36px + 310px + 110px + 120px + + + 270px + 480px + 330px + 450px + + + 200px + + 75px + 32px + 26px + 80px + 34px + + 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 562b1d7038..714c300b34 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 @@ -4,28 +4,19 @@ 32px 32px - 330px - 450px + 390px 410px - 234px 147px - 98px - 130px - - 280px - 421px - 60px 40px 80px - 310px 15px 550px 200px @@ -80,4 +71,30 @@ 25px 2px + + 24px + 36px + 28px + 55px + 36px + 310px + 98px + 130px + + + 330px + 450px + 280px + 421px + + + 234px + + 75px + 32px + 26px + 80px + 34px + + 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 f0c403220a..0153624746 100644 --- a/modules/mogo-module-v2x/src/main/res/values/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values/dimens.xml @@ -4,21 +4,12 @@ 18px 20px - 190px - 250px + 190px 210px - 136px - 82px - 54px - - 64px - - 156px - 234px 34px @@ -28,7 +19,6 @@ 6px - 170px 550px 200px 200px @@ -74,5 +64,30 @@ -8px 84px + + 13px + 20px + 16px + 31px + 20px + 170px + 54px + 64px + + + 190px + 250px + 156px + 234px + + + 136px + + 41px + 18px + 14px + 44px + 34px +