fix bug and replace the png
This commit is contained in:
@@ -2,11 +2,14 @@ package com.mogo.module.guide.fragment
|
|||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import androidx.viewpager2.widget.ViewPager2
|
|
||||||
import com.mogo.commons.mvp.MvpFragment
|
import com.mogo.commons.mvp.MvpFragment
|
||||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||||
import com.mogo.module.guide.GuideBizManager
|
import com.mogo.module.guide.GuideBizManager
|
||||||
import com.mogo.module.guide.R
|
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.module.guide.util.speak
|
||||||
import com.mogo.utils.logger.Logger
|
import com.mogo.utils.logger.Logger
|
||||||
import com.zhpan.indicator.enums.IndicatorSlideMode
|
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_fragment.*
|
||||||
import kotlinx.android.synthetic.main.module_guide_item_include.*
|
import kotlinx.android.synthetic.main.module_guide_item_include.*
|
||||||
|
|
||||||
|
|
||||||
class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideConstract.View {
|
class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideConstract.View {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TAG = "GuideFragment"
|
const val TAG = "GuideFragment"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var duringTime: Long = 0L
|
||||||
|
|
||||||
override fun getLayoutId(): Int {
|
override fun getLayoutId(): Int {
|
||||||
return R.layout.module_guide_fragment
|
return R.layout.module_guide_fragment
|
||||||
}
|
}
|
||||||
@@ -33,10 +37,11 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
|
|||||||
|
|
||||||
override fun initViews() {
|
override fun initViews() {
|
||||||
Logger.d(TAG, "init Views")
|
Logger.d(TAG, "init Views")
|
||||||
|
duringTime = System.currentTimeMillis()
|
||||||
adapter = GuideAdapter(this)
|
adapter = GuideAdapter(this)
|
||||||
moduleGuideViewPager.adapter = adapter
|
moduleGuideViewPager.adapter = adapter
|
||||||
(moduleGuideViewPager.getChildAt(0) as RecyclerView).layoutManager!!.isItemPrefetchEnabled = false
|
(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))
|
.setSliderWidth(context!!.resources.getDimension(R.dimen.dp_22))
|
||||||
.setSlideMode(IndicatorSlideMode.NORMAL)
|
.setSlideMode(IndicatorSlideMode.NORMAL)
|
||||||
.setIndicatorStyle(IndicatorStyle.CIRCLE)
|
.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
|
module_guide_page_left.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
fun invisibleLeft(){
|
fun invisibleLeft() {
|
||||||
module_guide_page_left.visibility = View.GONE
|
module_guide_page_left.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
fun visibleRight(){
|
fun visibleRight() {
|
||||||
module_guide_page_right.visibility = View.VISIBLE
|
module_guide_page_right.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
fun invisibleRight(){
|
fun invisibleRight() {
|
||||||
module_guide_page_right.visibility = View.GONE
|
module_guide_page_right.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,12 +90,17 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun closeGuideFragment() {
|
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()
|
destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun 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?) {
|
override fun onTTSEnd(ttsId: String?, tts: String?) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import com.mogo.commons.mvp.Presenter
|
|||||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||||
import com.mogo.module.guide.R
|
import com.mogo.module.guide.R
|
||||||
import com.mogo.module.guide.fragment.GuideFragment
|
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
|
import com.mogo.module.guide.util.speak
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +26,6 @@ class GuideStageOneFragment : MvpFragment<IView, Presenter<IView>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun initViews() {
|
override fun initViews() {
|
||||||
AnalyticsUtil.track(INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 1))
|
|
||||||
containerFragment?.visibleRight()
|
containerFragment?.visibleRight()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +34,7 @@ class GuideStageOneFragment : MvpFragment<IView, Presenter<IView>> {
|
|||||||
containerFragment?.invisibleLeft()
|
containerFragment?.invisibleLeft()
|
||||||
speak(context!!, context!!.resources.getString(R.string.module_guide_voice_page_one), object : IMogoVoiceCmdCallBack {
|
speak(context!!, context!!.resources.getString(R.string.module_guide_voice_page_one), object : IMogoVoiceCmdCallBack {
|
||||||
override fun onSpeakEnd(speakText: String?) {
|
override fun onSpeakEnd(speakText: String?) {
|
||||||
if(!isVisible){
|
if (!isVisible) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
containerFragment?.moveToNext()
|
containerFragment?.moveToNext()
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import com.mogo.service.analytics.IMogoAnalytics
|
|||||||
|
|
||||||
object AnalyticsUtil {
|
object AnalyticsUtil {
|
||||||
|
|
||||||
const val INVOKE_TRACK_SHOW = "newhand_show"
|
const val INVOKE_TRACK_PLAY_PASS_ID = "v2x_play_pass"
|
||||||
const val INVOKE_TRACK_CLICK = "newhand_click"
|
const val INVOKE_TRACK_PASS_TIME = "pass_time"
|
||||||
|
const val INVOKE_TRACK_PLAY_TIME = "play_time"
|
||||||
|
|
||||||
private var trackRouter: IMogoAnalytics? = null
|
private var trackRouter: IMogoAnalytics? = null
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 54 KiB |
Reference in New Issue
Block a user