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

This commit is contained in:
tongchenfei
2020-09-10 17:41:57 +08:00
17 changed files with 24 additions and 16 deletions

View File

@@ -2,11 +2,14 @@ package com.mogo.module.guide.fragment
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
import com.mogo.module.guide.GuideBizManager
import com.mogo.module.guide.R
import com.mogo.module.guide.util.AnalyticsUtil
import com.mogo.module.guide.util.AnalyticsUtil.INVOKE_TRACK_PASS_TIME
import com.mogo.module.guide.util.AnalyticsUtil.INVOKE_TRACK_PLAY_PASS_ID
import com.mogo.module.guide.util.AnalyticsUtil.INVOKE_TRACK_PLAY_TIME
import com.mogo.module.guide.util.speak
import com.mogo.utils.logger.Logger
import com.zhpan.indicator.enums.IndicatorSlideMode
@@ -14,13 +17,14 @@ import com.zhpan.indicator.enums.IndicatorStyle
import kotlinx.android.synthetic.main.module_guide_fragment.*
import kotlinx.android.synthetic.main.module_guide_item_include.*
class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideConstract.View {
companion object {
const val TAG = "GuideFragment"
}
private var duringTime: Long = 0L
override fun getLayoutId(): Int {
return R.layout.module_guide_fragment
}
@@ -33,10 +37,11 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
override fun initViews() {
Logger.d(TAG, "init Views")
duringTime = System.currentTimeMillis()
adapter = GuideAdapter(this)
moduleGuideViewPager.adapter = adapter
(moduleGuideViewPager.getChildAt(0) as RecyclerView).layoutManager!!.isItemPrefetchEnabled = false
moduleGuideIndicator.setSliderColor(context!!.resources.getColor(R.color.module_guide_indicator_dark),context!!.resources.getColor(R.color.module_guide_indicator_white))
moduleGuideIndicator.setSliderColor(context!!.resources.getColor(R.color.module_guide_indicator_dark), context!!.resources.getColor(R.color.module_guide_indicator_white))
.setSliderWidth(context!!.resources.getDimension(R.dimen.dp_22))
.setSlideMode(IndicatorSlideMode.NORMAL)
.setIndicatorStyle(IndicatorStyle.CIRCLE)
@@ -53,19 +58,19 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
}
}
fun visibleLeft(){
fun visibleLeft() {
module_guide_page_left.visibility = View.VISIBLE
}
fun invisibleLeft(){
fun invisibleLeft() {
module_guide_page_left.visibility = View.GONE
}
fun visibleRight(){
fun visibleRight() {
module_guide_page_right.visibility = View.VISIBLE
}
fun invisibleRight(){
fun invisibleRight() {
module_guide_page_right.visibility = View.GONE
}
@@ -85,12 +90,17 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
}
fun closeGuideFragment() {
Logger.d(TAG, "closeGuideFragment")
val recordTime = System.currentTimeMillis() - duringTime
val currentItem = moduleGuideViewPager.currentItem + 1
AnalyticsUtil.track(INVOKE_TRACK_PLAY_PASS_ID,
hashMapOf(INVOKE_TRACK_PASS_TIME to currentItem
, INVOKE_TRACK_PLAY_TIME to recordTime))
Logger.d(TAG, "closeGuideFragment -> recordTime : $recordTime , currentItem : $currentItem")
destroy()
}
private fun destroy() {
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_end),object : IMogoVoiceCmdCallBack {
speak(context!!, context!!.resources.getString(R.string.module_guide_voice_page_end), object : IMogoVoiceCmdCallBack {
override fun onTTSEnd(ttsId: String?, tts: String?) {
}

View File

@@ -6,8 +6,6 @@ import com.mogo.commons.mvp.Presenter
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
import com.mogo.module.guide.R
import com.mogo.module.guide.fragment.GuideFragment
import com.mogo.module.guide.util.AnalyticsUtil
import com.mogo.module.guide.util.AnalyticsUtil.INVOKE_TRACK_SHOW
import com.mogo.module.guide.util.speak
@@ -28,7 +26,6 @@ class GuideStageOneFragment : MvpFragment<IView, Presenter<IView>> {
}
override fun initViews() {
AnalyticsUtil.track(INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 1))
containerFragment?.visibleRight()
}
@@ -37,7 +34,7 @@ class GuideStageOneFragment : MvpFragment<IView, Presenter<IView>> {
containerFragment?.invisibleLeft()
speak(context!!, context!!.resources.getString(R.string.module_guide_voice_page_one), object : IMogoVoiceCmdCallBack {
override fun onSpeakEnd(speakText: String?) {
if(!isVisible){
if (!isVisible) {
return
}
containerFragment?.moveToNext()

View File

@@ -7,8 +7,9 @@ import com.mogo.service.analytics.IMogoAnalytics
object AnalyticsUtil {
const val INVOKE_TRACK_SHOW = "newhand_show"
const val INVOKE_TRACK_CLICK = "newhand_click"
const val INVOKE_TRACK_PLAY_PASS_ID = "v2x_play_pass"
const val INVOKE_TRACK_PASS_TIME = "pass_time"
const val INVOKE_TRACK_PLAY_TIME = "play_time"
private var trackRouter: IMogoAnalytics? = null

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -82,7 +82,7 @@ class MogoMainService extends Service implements IMogoLocationListener {
UiThreadHandler.postDelayed(() -> {
Logger.d(TAG, "startTanluService ---------- ");
mServiceApis.getTanluApi().startTanluService();
}, 58_000L
}, 2_000L
);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB