add guide
This commit is contained in:
@@ -29,8 +29,9 @@ object GuideBizManager {
|
||||
|
||||
private fun initService() {
|
||||
val mogoService = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation()
|
||||
if (mogoService is IMogoServiceApis) {
|
||||
if (mogoService is IMogoServiceApis && serviceApi == null) {
|
||||
serviceApi = mogoService
|
||||
serviceApi?.adasControllerApi?.closeADAS()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +51,7 @@ object GuideBizManager {
|
||||
serviceApi?.let {
|
||||
it.fragmentManagerApi.pop()
|
||||
}
|
||||
serviceApi?.adasControllerApi?.showADAS()
|
||||
}
|
||||
|
||||
fun invokeAuthorize() {
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.mogo.map.navi.IMogoNaviListener
|
||||
import com.mogo.module.guide.GuideConstant.Companion.PATH_GUIDE_FRAGMENT
|
||||
import com.mogo.module.guide.GuideConstant.Companion.PATH_GUIDE_MODULE_NAME
|
||||
import com.mogo.module.guide.util.isDeviceOfD
|
||||
import com.mogo.service.module.IMogoModuleLifecycle
|
||||
import com.mogo.service.module.IMogoModuleProvider
|
||||
import com.mogo.service.module.ModuleType
|
||||
import com.mogo.utils.UiThreadHandler
|
||||
@@ -36,10 +35,6 @@ class MogoGuideProvider : IMogoModuleProvider {
|
||||
return PATH_GUIDE_MODULE_NAME
|
||||
}
|
||||
|
||||
override fun getCardLifecycle(): IMogoModuleLifecycle? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getMapListener(): IMogoMapListener? {
|
||||
return null
|
||||
}
|
||||
@@ -62,9 +57,7 @@ class MogoGuideProvider : IMogoModuleProvider {
|
||||
|
||||
override fun init(context: Context?) {
|
||||
if (isDeviceOfD()) {
|
||||
UiThreadHandler.postDelayed({
|
||||
GuideBizManager.init()
|
||||
}, 5000L)
|
||||
GuideBizManager.init()
|
||||
} else {
|
||||
Logger.d("MogoGuideProvider", "device type is not D")
|
||||
}
|
||||
|
||||
@@ -17,23 +17,19 @@ class GuideAdapter(fragmentActivity: GuideFragment) : FragmentStateAdapter(fragm
|
||||
private val guideList: MutableList<Fragment> = mutableListOf()
|
||||
|
||||
companion object {
|
||||
const val GUIDE_PAGE_START = 0
|
||||
const val GUIDE_PAGE_CARD = 1
|
||||
const val GUIDE_PAGE_ONLINE_CAR = 2
|
||||
const val GUIDE_PAGE_NAVIGATION = 3
|
||||
const val GUIDE_PAGE_LOCATION = 4
|
||||
const val GUIDE_PAGE_APP_LIST = 5
|
||||
const val GUIDE_PAGE_ENTRY_MAIN = 6
|
||||
const val GUIDE_PAGE_ONE = 0
|
||||
const val GUIDE_PAGE_TWO = 1
|
||||
const val GUIDE_PAGE_THREE = 2
|
||||
const val GUIDE_PAGE_FOUR = 3
|
||||
const val GUIDE_PAGE_FIVE = 4
|
||||
}
|
||||
|
||||
init {
|
||||
guideList.add(GUIDE_PAGE_START, GuideStartFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_CARD, GuideCardFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_ONLINE_CAR, GuideOnLineCarFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_NAVIGATION, GuideNavigationFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_LOCATION, GuideLocationFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_APP_LIST, GuideAppListFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_ENTRY_MAIN, GuideEntryMainFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_ONE, GuideStageOneFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_TWO, GuideStageTwoFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_THREE, GuideStageThreeFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_FOUR, GuideStageFourFragment(fragmentActivity))
|
||||
guideList.add(GUIDE_PAGE_FIVE, GuideStageFiveFragment(fragmentActivity))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.mogo.module.guide.fragment
|
||||
|
||||
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.speak
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_guide_fragment.*
|
||||
|
||||
@@ -35,8 +37,12 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
|
||||
}
|
||||
}
|
||||
|
||||
fun moveToLast() {
|
||||
moduleGuideViewPager.setCurrentItem(adapter!!.itemCount, false)
|
||||
fun moveToBack() {
|
||||
val count = adapter?.itemCount
|
||||
val backCount = moduleGuideViewPager.currentItem - 1
|
||||
if (moduleGuideViewPager.currentItem != count && backCount != 0) {
|
||||
moduleGuideViewPager.currentItem = backCount
|
||||
}
|
||||
}
|
||||
|
||||
fun closeGuideFragment() {
|
||||
@@ -45,6 +51,11 @@ class GuideFragment : MvpFragment<GuideConstract.View, GuidePresenter>(), GuideC
|
||||
}
|
||||
|
||||
private fun destroy() {
|
||||
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_end),object : IMogoVoiceCmdCallBack {
|
||||
override fun onTTSEnd(ttsId: String?, tts: String?) {
|
||||
|
||||
}
|
||||
})
|
||||
GuideBizManager.removeGuideFragmentToStack()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.guide.R
|
||||
import com.mogo.module.guide.fragment.GuideFragment
|
||||
import com.mogo.module.guide.util.AnalyticsUtil
|
||||
import kotlinx.android.synthetic.main.module_guide_item_app_list.*
|
||||
|
||||
class GuideAppListFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_app_list
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideAppListPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 6))
|
||||
moduleGuideAppListNext.setOnClickListener(this)
|
||||
moduleGuideAppListSkip.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideAppListNext -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 6, "button_type" to 1))
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.moduleGuideAppListSkip -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 6, "button_type" to 2))
|
||||
containerFragment?.moveToLast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideAppListPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
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_CLICK
|
||||
import com.mogo.module.guide.util.AnalyticsUtil.INVOKE_TRACK_SHOW
|
||||
import kotlinx.android.synthetic.main.module_guide_item_card.*
|
||||
|
||||
class GuideCardFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_card
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideCardPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
AnalyticsUtil.track(INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 2))
|
||||
moduleGuideCardNext.setOnClickListener(this)
|
||||
moduleGuideCardSkip.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideCardNext -> {
|
||||
AnalyticsUtil.track(INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 2, "button_type" to 1))
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.moduleGuideCardSkip -> {
|
||||
AnalyticsUtil.track(INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 2, "button_type" to 2))
|
||||
containerFragment?.moveToLast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideCardPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.guide.R
|
||||
import com.mogo.module.guide.fragment.GuideFragment
|
||||
import com.mogo.module.guide.util.AnalyticsUtil
|
||||
import kotlinx.android.synthetic.main.module_guide_item_entry_main.*
|
||||
|
||||
class GuideEntryMainFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_entry_main
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideEntryPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 7))
|
||||
moduleGuideEntryMain.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideEntryMain -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 7, "button_type" to 3))
|
||||
containerFragment?.closeGuideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideEntryPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.guide.R
|
||||
import com.mogo.module.guide.fragment.GuideFragment
|
||||
import com.mogo.module.guide.util.AnalyticsUtil
|
||||
import kotlinx.android.synthetic.main.module_guide_item_location.*
|
||||
|
||||
class GuideLocationFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_location
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideLocationPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 5))
|
||||
moduleGuideLocationNext.setOnClickListener(this)
|
||||
moduleGuideLocationSkip.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideLocationNext -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 5, "button_type" to 1))
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.moduleGuideLocationSkip -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 5, "button_type" to 2))
|
||||
containerFragment?.moveToLast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideLocationPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.guide.R
|
||||
import com.mogo.module.guide.fragment.GuideFragment
|
||||
import com.mogo.module.guide.util.AnalyticsUtil
|
||||
import kotlinx.android.synthetic.main.module_guide_item_navigation.*
|
||||
|
||||
class GuideNavigationFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_navigation
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideNavigationPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 4))
|
||||
moduleGuideNavigationNext.setOnClickListener(this)
|
||||
moduleGuideNavigationSkip.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideNavigationNext -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 4, "button_type" to 1))
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.moduleGuideNavigationSkip -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 4, "button_type" to 2))
|
||||
containerFragment?.moveToLast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideNavigationPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.guide.R
|
||||
import com.mogo.module.guide.fragment.GuideFragment
|
||||
import com.mogo.module.guide.util.AnalyticsUtil
|
||||
import kotlinx.android.synthetic.main.module_guide_item_online_car.*
|
||||
|
||||
class GuideOnLineCarFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_online_car
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideOnLineCarPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 3))
|
||||
moduleGuideOnLineCarNext.setOnClickListener(this)
|
||||
moduleGuideOnLineCarSkip.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideOnLineCarNext -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 3, "button_type" to 1))
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.moduleGuideOnLineCarSkip -> {
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_CLICK, hashMapOf("pages_num" to 3, "button_type" to 2))
|
||||
containerFragment?.moveToLast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideOnLineCarPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
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.speak
|
||||
import kotlinx.android.synthetic.main.module_guide_item_stage_five.*
|
||||
|
||||
class GuideStageFiveFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_stage_five
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideLocationPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
module_guide_page_left.setOnClickListener(this)
|
||||
module_guide_tv_jump.setOnClickListener(this)
|
||||
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_five),object : IMogoVoiceCmdCallBack {
|
||||
override fun onTTSEnd(ttsId: String?, tts: String?) {
|
||||
containerFragment?.closeGuideFragment()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.module_guide_page_left -> {
|
||||
containerFragment?.moveToBack()
|
||||
}
|
||||
R.id.module_guide_tv_jump -> {
|
||||
containerFragment?.closeGuideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideLocationPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
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.speak
|
||||
import kotlinx.android.synthetic.main.module_guide_item_include.*
|
||||
|
||||
class GuideStageFourFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_stage_four
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideNavigationPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
module_guide_page_left.setOnClickListener(this)
|
||||
module_guide_page_right.setOnClickListener(this)
|
||||
module_guide_tv_jump.setOnClickListener(this)
|
||||
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_four),object : IMogoVoiceCmdCallBack {
|
||||
override fun onTTSEnd(ttsId: String?, tts: String?) {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.module_guide_page_left -> {
|
||||
containerFragment?.moveToBack()
|
||||
}
|
||||
R.id.module_guide_page_right -> {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.module_guide_tv_jump -> {
|
||||
containerFragment?.closeGuideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideNavigationPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,19 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.graphics.Color
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Shader
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
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 kotlinx.android.synthetic.main.module_guide_item_start.*
|
||||
import com.mogo.module.guide.util.speak
|
||||
import kotlinx.android.synthetic.main.module_guide_item_stage_one.*
|
||||
|
||||
|
||||
class GuideStartFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
class GuideStageOneFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
@@ -23,7 +22,7 @@ class GuideStartFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickLis
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_start
|
||||
return R.layout.module_guide_item_stage_one
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
@@ -32,18 +31,23 @@ class GuideStartFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickLis
|
||||
|
||||
override fun initViews() {
|
||||
AnalyticsUtil.track(INVOKE_TRACK_SHOW, hashMapOf("pages_num" to 1))
|
||||
val mLinearGradient = LinearGradient(0f, 0f, 0f, moduleGuideTvStart.paint.textSize,
|
||||
Color.parseColor("#B3B3B3"), Color.parseColor("#EBEBEB"), Shader.TileMode.CLAMP)
|
||||
moduleGuideTvStart.paint.shader = mLinearGradient
|
||||
moduleGuideTvStart.setOnClickListener(this)
|
||||
moduleGuideIvStart.setOnClickListener(this)
|
||||
module_guide_page_right.setOnClickListener(this)
|
||||
module_guide_tv_jump.setOnClickListener(this)
|
||||
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_one),object : IMogoVoiceCmdCallBack {
|
||||
override fun onTTSEnd(ttsId: String?, tts: String?) {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideTvStart, R.id.moduleGuideIvStart -> {
|
||||
R.id.module_guide_page_right -> {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.module_guide_tv_jump -> {
|
||||
containerFragment?.closeGuideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
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.speak
|
||||
import kotlinx.android.synthetic.main.module_guide_item_include.*
|
||||
|
||||
class GuideStageThreeFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_stage_three
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideOnLineCarPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
module_guide_page_left.setOnClickListener(this)
|
||||
module_guide_page_right.setOnClickListener(this)
|
||||
module_guide_tv_jump.setOnClickListener(this)
|
||||
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_three),object : IMogoVoiceCmdCallBack {
|
||||
override fun onTTSEnd(ttsId: String?, tts: String?) {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.module_guide_page_left -> {
|
||||
containerFragment?.moveToBack()
|
||||
}
|
||||
R.id.module_guide_page_right -> {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.module_guide_tv_jump -> {
|
||||
containerFragment?.closeGuideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideOnLineCarPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.mogo.module.guide.guide
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.IView
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
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.speak
|
||||
import kotlinx.android.synthetic.main.module_guide_item_include.*
|
||||
|
||||
class GuideStageTwoFragment : MvpFragment<IView, Presenter<IView>>, View.OnClickListener {
|
||||
|
||||
private var containerFragment: GuideFragment? = null
|
||||
|
||||
constructor(containerFragment: GuideFragment) {
|
||||
this.containerFragment = containerFragment
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_guide_item_stage_two
|
||||
}
|
||||
|
||||
override fun createPresenter(): Presenter<IView> {
|
||||
return GuideCardPresenter(this)
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
module_guide_page_left.setOnClickListener(this)
|
||||
module_guide_page_right.setOnClickListener(this)
|
||||
module_guide_tv_jump.setOnClickListener(this)
|
||||
speak(context!!,context!!.resources.getString(R.string.module_guide_voice_page_two),object : IMogoVoiceCmdCallBack {
|
||||
override fun onTTSEnd(ttsId: String?, tts: String?) {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.module_guide_page_left -> {
|
||||
containerFragment?.moveToBack()
|
||||
}
|
||||
R.id.module_guide_page_right -> {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
R.id.module_guide_tv_jump -> {
|
||||
containerFragment?.closeGuideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideCardPresenter : Presenter<IView> {
|
||||
|
||||
constructor(view: IView?) : super(view)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.mogo.module.guide.util
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.commons.voice.VoicePreemptType
|
||||
|
||||
fun speak(context: Context, text: String, callBack: IMogoVoiceCmdCallBack?) {
|
||||
AIAssist.getInstance(context).speakTTSVoice(text, VoicePreemptType.PREEMPT_TYPE_IMMEADIATELY, callBack)
|
||||
}
|
||||
Reference in New Issue
Block a user