Merge remote-tracking branch 'origin/dev_1.1.9' into dev_1.1.9
@@ -75,10 +75,12 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
|
||||
|
||||
fun visibleRight() {
|
||||
module_guide_page_right.visibility = View.VISIBLE
|
||||
module_guide_tv_next_step.text = context!!.resources.getString(R.string.module_guide_item_next_step)
|
||||
}
|
||||
|
||||
fun invisibleRight() {
|
||||
module_guide_page_right.visibility = View.GONE
|
||||
module_guide_tv_next_step.text = context!!.resources.getString(R.string.module_guide_finish)
|
||||
}
|
||||
|
||||
fun moveToNext() {
|
||||
|
||||
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 371 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 342 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 337 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 500 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 474 KiB |
|
Before Width: | Height: | Size: 334 KiB After Width: | Height: | Size: 536 KiB |
|
Before Width: | Height: | Size: 309 KiB After Width: | Height: | Size: 445 KiB |
|
Before Width: | Height: | Size: 323 KiB After Width: | Height: | Size: 550 KiB |
|
Before Width: | Height: | Size: 450 KiB After Width: | Height: | Size: 597 KiB |
|
Before Width: | Height: | Size: 419 KiB After Width: | Height: | Size: 568 KiB |
|
Before Width: | Height: | Size: 816 KiB After Width: | Height: | Size: 918 KiB |
|
Before Width: | Height: | Size: 757 KiB After Width: | Height: | Size: 835 KiB |
|
Before Width: | Height: | Size: 844 KiB After Width: | Height: | Size: 978 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1004 KiB |
@@ -3,7 +3,7 @@
|
||||
<string name="module_guide_main">左滑了解更多</string>
|
||||
<string name="module_guide_item_entry_main">进入首页</string>
|
||||
<string name="module_guide_item_next_step">下一步</string>
|
||||
<string name="module_guide_skip">跳过</string>
|
||||
<string name="module_guide_finish">结束</string>
|
||||
|
||||
<string name="module_guide_voice_page_one">欢迎使用蘑菇出行,您下次可以直接对我说,打开蘑菇出行来直接进入应用,点击左下方按钮进行摄像头设置</string>
|
||||
<string name="module_guide_voice_page_two">左边是道路事件的播报,点击右边地图上的事件标示可以查看事件详情,或者直接唤醒小智说,中关村附近堵不堵,来查询目的地周围路况</string>
|
||||
|
||||
@@ -3,24 +3,14 @@ package com.mogo.module.share.strategyreceiver
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.SystemClock
|
||||
import android.util.ArrayMap
|
||||
import com.mogo.commons.network.SubscribeImpl
|
||||
import com.mogo.commons.network.Utils
|
||||
import com.mogo.map.MogoLatLng
|
||||
import com.mogo.module.share.bean.AverateSpeedResponse
|
||||
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.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
|
||||
import com.mogo.utils.storage.SharedPrefsMgr
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.MediaType
|
||||
import okhttp3.RequestBody
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
@@ -35,7 +25,7 @@ private const val SPEED_RECORD_TIME_INTERVAL = 2 * 60 * 1000L
|
||||
*/
|
||||
private const val STOP_FLAG_THRESHOLD = 30
|
||||
private const val TAG = "BlockUploadStrategy"
|
||||
|
||||
private const val TIME_FAULT_TOLERANT = 60 * 60 * 1000L
|
||||
private const val DISTANCE_RECORD_TIME = 3 * 60 * 1000L
|
||||
|
||||
private const val MORNING_PEAK_START_MINUTE = 7 * 60 + 30
|
||||
@@ -48,6 +38,8 @@ private const val DISTANCE_MORNING_PEAK_COUNT = "DISTANCE_MORNING_PEAK_COUNT"
|
||||
private const val DISTANCE_NIGHT_PEAK_COUNT = "DISTANCE_NIGHT_PEAK_COUNT"
|
||||
private const val DISTANCE_NORMAL_COUNT = "DISTANCE_NORMAL_COUNT"
|
||||
|
||||
private const val START_BLOCK_COUNT_DATE = "START_BLOCK_COUNT_DATE"
|
||||
|
||||
|
||||
private const val SPEED_MORNING_PEAK_COUNT = "SPEED_MORNING_PEAK_COUNT"
|
||||
private const val SPEED_NIGHT_PEAK_COUNT = "SPEED_NIGHT_PEAK_COUNT"
|
||||
@@ -118,8 +110,20 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
lastLon = lon
|
||||
lastLat = lat
|
||||
}
|
||||
|
||||
if (current - startRecordTime >= DISTANCE_RECORD_TIME) {
|
||||
val diff = current - startRecordTime
|
||||
if (diff in DISTANCE_RECORD_TIME until TIME_FAULT_TOLERANT) {
|
||||
// 重置count data
|
||||
val countDate = SharedPrefsMgr.getInstance(context).getLong(START_BLOCK_COUNT_DATE, 0)
|
||||
if (countDate == 0L || isDifferentDay(countDate, System.currentTimeMillis())) {
|
||||
// 不是同一天,重置各种计数,重新开始计数
|
||||
SharedPrefsMgr.getInstance(context).putLong(START_BLOCK_COUNT_DATE, System.currentTimeMillis())
|
||||
SharedPrefsMgr.getInstance(context).putInt(DISTANCE_MORNING_PEAK_COUNT, 0)
|
||||
SharedPrefsMgr.getInstance(context).putInt(DISTANCE_NIGHT_PEAK_COUNT, 0)
|
||||
SharedPrefsMgr.getInstance(context).putInt(DISTANCE_NORMAL_COUNT, 0)
|
||||
SharedPrefsMgr.getInstance(context).putInt(SPEED_NORMAL_COUNT, 0)
|
||||
SharedPrefsMgr.getInstance(context).putInt(SPEED_NIGHT_PEAK_COUNT, 0)
|
||||
SharedPrefsMgr.getInstance(context).putInt(SPEED_MORNING_PEAK_COUNT, 0)
|
||||
}
|
||||
|
||||
var blockFromSpeed = false
|
||||
var blockFromDistance = false
|
||||
@@ -128,7 +132,6 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
var latLonFromDistance: MogoLatLng? = null
|
||||
|
||||
val p = TanluUploadParams(IMogoTanluProvider.TYPE_BLOCK, IMogoTanluProvider.UPLOAD_FROM_STRATEGY_BLOCK_AUTO)
|
||||
|
||||
// 到达时间限制,上报速度,数据清空
|
||||
if (stopFlag < STOP_FLAG_THRESHOLD) {
|
||||
// 停车标志位小于阈值,判定不是停车,计算平均值,进行上报
|
||||
@@ -138,7 +141,7 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
}
|
||||
val ave = sum / speedCacheList.size
|
||||
Logger.d(TAG, "平均速度为: $ave")
|
||||
blockFromSpeed = true
|
||||
blockFromSpeed = ave <= 10
|
||||
// 上报平均速度
|
||||
val location = ServiceApisManager.serviceApis.mapServiceApi.getSingletonLocationClient(context).lastKnowLocation
|
||||
latLonFromSpeed = MogoLatLng(location.latitude, location.longitude)
|
||||
@@ -299,4 +302,11 @@ class BlockStrategy(private val context: Context, private val apis: IMogoService
|
||||
val minute = Calendar.getInstance().get(Calendar.MINUTE) + hour * 60
|
||||
return minute in NIGHT_PEAK_START_MINUTE..NIGHT_PEAK_STOP_MINUTE
|
||||
}
|
||||
|
||||
private fun isDifferentDay(a: Long, b: Long): Boolean {
|
||||
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.CHINA)
|
||||
val aDate = dateFormat.format(a)
|
||||
val bDate = dateFormat.format(b)
|
||||
return aDate != bDate
|
||||
}
|
||||
}
|
||||