add voice broadcast and add guideView
This commit is contained in:
@@ -10,6 +10,8 @@ class AuthorizeContract {
|
||||
fun readyToAuthorize()
|
||||
|
||||
fun showAuthorizationError()
|
||||
|
||||
fun voiceAuthorizeError()
|
||||
}
|
||||
|
||||
interface Biz {
|
||||
|
||||
@@ -32,7 +32,7 @@ class AuthorizeFragment : MvpFragment<AuthorizeContract.View, AuthorizePresenter
|
||||
}
|
||||
|
||||
private var agreementId: Long = 0L
|
||||
private var invokeTag:String? = null
|
||||
private var invokeTag: String? = null
|
||||
|
||||
private var clErrorContainer: ConstraintLayout? = null
|
||||
private var clLoadAuthorizeContainer: ConstraintLayout? = null
|
||||
@@ -64,9 +64,9 @@ class AuthorizeFragment : MvpFragment<AuthorizeContract.View, AuthorizePresenter
|
||||
VoiceUtil.registerAll(context!!, this, this)
|
||||
}
|
||||
|
||||
private fun init(){
|
||||
if(mRootView == null){
|
||||
Logger.d(TAG,"joker ?")
|
||||
private fun init() {
|
||||
if (mRootView == null) {
|
||||
Logger.d(TAG, "joker ?")
|
||||
mRootView = view
|
||||
}
|
||||
clErrorContainer = mRootView.findViewById(R.id.clLoadingErrorContainer)
|
||||
@@ -116,6 +116,10 @@ class AuthorizeFragment : MvpFragment<AuthorizeContract.View, AuthorizePresenter
|
||||
clErrorContainer?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun voiceAuthorizeError() {
|
||||
VoiceUtil.speak(context!!.getString(R.string.module_authorize_failed), context!!, this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.btnAuthorizeAgree -> {
|
||||
|
||||
@@ -2,12 +2,14 @@ package com.mogo.module.authorize.fragment
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.mogo.commons.mvp.Presenter
|
||||
import com.mogo.module.authorize.R
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||
import com.mogo.module.authorize.authprovider.launcher.MogoAuthorizeMainController
|
||||
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
|
||||
import com.mogo.module.authorize.model.bean.Agreement
|
||||
import com.mogo.module.authorize.util.DateUtil.parseDateToTime
|
||||
import com.mogo.module.authorize.util.SharedPreferenceUtil.updateAuthorizeVersion
|
||||
import com.mogo.module.authorize.voice.VoiceUtil
|
||||
import com.mogo.utils.logger.Logger
|
||||
|
||||
class AuthorizePresenter : Presenter<AuthorizeContract.View>, AuthorizeContract.Biz {
|
||||
@@ -80,6 +82,7 @@ class AuthorizePresenter : Presenter<AuthorizeContract.View>, AuthorizeContract.
|
||||
}, {
|
||||
closeAuthorizeView()
|
||||
})
|
||||
mView.voiceAuthorizeError()
|
||||
}
|
||||
|
||||
private fun closeAuthorizeView() {
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
<string name="module_authorize_agreement_loading">正在加载,请稍等...</string>
|
||||
<string name="module_authorize_agreement_error">加载失败</string>
|
||||
<string name="module_authorize_agreement_retry">点击重试</string>
|
||||
<string name="module_authorize_agreement_tip">您还没有授权,不可分享,您可以说“同意”进行授权。</string>
|
||||
<string name="module_authorize_agreement_tip">请阅读用户协议并做出选择。未授权部分功能的使用会受到限制。您可以说“同意”进行授权。</string>
|
||||
<string name="module_authorize_failed">授权失败</string>
|
||||
</resources>
|
||||
|
||||
@@ -27,7 +27,7 @@ class GuideAdapter(fragmentActivity: GuideFragment) : FragmentStateAdapter(fragm
|
||||
}
|
||||
|
||||
init {
|
||||
guideList.add(GUIDE_PAGE_START, GuideStartFragment())
|
||||
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))
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
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.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.*
|
||||
|
||||
class GuideStartFragment : MvpFragment<IView, Presenter<IView>>() {
|
||||
|
||||
class GuideStartFragment : 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_start
|
||||
@@ -19,6 +32,17 @@ class GuideStartFragment : MvpFragment<IView, Presenter<IView>>() {
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.moduleGuideTvStart, R.id.moduleGuidetIvStart -> {
|
||||
containerFragment?.moveToNext()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class GuideStartPresenter : Presenter<IView> {
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@mipmap/module_guide_item_start"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/module_guide_item_start">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/moduleGuidetIvStart"
|
||||
android:layout_width="@dimen/dp_77"
|
||||
android:layout_height="@dimen/dp_77"
|
||||
android:layout_marginBottom="@dimen/dp_75"
|
||||
android:src="@mipmap/module_guide_item_start_scroll"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/moduleGuideTvStart"
|
||||
app:layout_constraintTop_toTopOf="@+id/moduleGuideTvStart" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/moduleGuideTvStart"
|
||||
android:layout_width="@dimen/dp_307"
|
||||
android:layout_height="@dimen/dp_73"
|
||||
android:layout_marginRight="@dimen/dp_154"
|
||||
android:layout_marginBottom="@dimen/dp_75"
|
||||
android:gravity="center"
|
||||
android:text="@string/module_guide_main"
|
||||
android:textSize="@dimen/dp_51"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 927 B |
@@ -1,5 +1,6 @@
|
||||
<resources>
|
||||
<string name="app_name">mogo-module-guide-agreement</string>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user