Merge branch 'master' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher

# Conflicts:
#	gradle.properties
#	modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java
#	modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java
#	modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java
This commit is contained in:
wangcongtao
2020-08-03 17:54:28 +08:00
973 changed files with 33390 additions and 1305 deletions

View File

@@ -1,24 +0,0 @@
package com.mogo.module.authorize
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.mogo.module.authorize.test", appContext.packageName)
}
}

View File

@@ -1,17 +0,0 @@
package com.mogo.module.authorize.aspectj
import org.aspectj.lang.annotation.Aspect
import org.aspectj.lang.annotation.Pointcut
@Aspect
class VoiceForbiddenWhenAuthorize {
companion object{
const val TAG = "VoiceForbiddenWhenAuthorize"
}
@Pointcut()
fun authorizeTrackPoint(){
}
}

View File

@@ -131,6 +131,7 @@ open class IMogoAuthorizeController {
}
}
onError {
//todo
Logger.d(TAG, it.message ?: "checkIfNeedAuthorize onError, message is null")
setAuthorizeStatus(agreementType, true)
}

View File

@@ -6,8 +6,6 @@ import com.mogo.module.authorize.authprovider.module.IMogoAcquireAuthorizeListen
import com.mogo.module.authorize.model.proxy.AuthorizeProxy
import com.mogo.module.authorize.model.proxy.toAuthorizeType
import com.mogo.module.authorize.util.SharedPreferenceUtil.needAuthorization
import com.mogo.module.authorize.util.SharedPreferenceUtil.setAuthorizeStatus
import com.mogo.module.authorize.util.isDeviceOfD
import com.mogo.utils.logger.Logger
open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
@@ -19,13 +17,9 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
private val baseController: IMogoAuthorizeController by lazy { IMogoAuthorizeController() }
override fun needAuthorize(tag: String): Boolean {
return if (isDeviceOfD()) {
Logger.d(TAG, "===== needAuthorize update agreement in background")
baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
needAuthorization(tag.toAuthorizeType())
} else {
false
}
Logger.d(TAG, "===== needAuthorize update agreement in background")
baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
return needAuthorization(tag.toAuthorizeType())
}
override fun updateAuthorizeStatus(tag: String) {

View File

@@ -9,24 +9,23 @@ import com.mogo.map.listener.IMogoMapListener
import com.mogo.map.location.IMogoLocationListener
import com.mogo.map.marker.IMogoMarkerClickListener
import com.mogo.map.navi.IMogoNaviListener
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_FRAGMENT
import com.mogo.module.authorize.authprovider.invoke.AuthorizeConstant.Companion.PATH_AGREEMENT_MODULE_NAME
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
import com.mogo.module.authorize.authprovider.launcher.MogoMainAuthorize.Companion.mogoAuthShow
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasGuide
import com.mogo.module.authorize.util.isDeviceOfD
import com.mogo.service.MogoServicePaths
import com.mogo.service.auth.IMogoAuthManager
import com.mogo.service.module.IMogoModuleLifecycle
import com.mogo.service.module.IMogoModuleProvider
import com.mogo.service.module.ModuleType
import com.mogo.utils.logger.Logger
@Route(path = PATH_AGREEMENT_FRAGMENT)
class MogoAuthorizeProvider : IMogoModuleProvider {
@Route(path = MogoServicePaths.PATH_AGREEMENT)
class MogoAuthorizeProvider : IMogoAuthManager {
companion object {
const val TAG = "MogoAuthorizeProvider"
}
private var mContext:Context? = null
override fun createFragment(context: Context?, data: Bundle?): Fragment? {
return null
}
@@ -48,7 +47,7 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
}
override fun getType(): Int {
return ModuleType.TYPE_SERVICE
return 0
}
override fun getNaviListener(): IMogoNaviListener? {
@@ -63,11 +62,10 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
return null
}
override fun init(context: Context) {
//todo 引导判断暂时去掉 后续引导流程更改完再放开
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
if (isDeviceOfD() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
mogoAuthShow.invokeAuthorizeForShow(context)
override fun showAuth(context: Context?) {
mContext = context
if (mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
mogoAuthShow.invokeAuthorizeForShow(mContext!!)
} else {
//首次进入Launcher同步一下授权状态防止由于用户清除数据造成首次加载还会出现授权状态不同步问题
mogoAuthShow.updateAuthorizeStatus(AUTHORIZE_TYPE_LAUNCHER_MAIN)
@@ -75,6 +73,16 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
}
}
override fun dismiss() {
mogoAuthShow.hideAuthorizeView()
}
override fun init(context: Context) {
//todo 引导判断暂时去掉 后续引导流程更改完再放开
// todo if (isDeviceOfD() && hasGuide() && mogoAuthShow.needAuthorize(AUTHORIZE_TYPE_LAUNCHER_MAIN)) {
// todo F系列暂时没有授权功能 1.1需求中添加 全量上
}
override fun getAppPackage(): String? {
return null
}
@@ -82,4 +90,5 @@ class MogoAuthorizeProvider : IMogoModuleProvider {
override fun getAppName(): String? {
return null
}
}

View File

@@ -6,11 +6,6 @@ class AuthorizeConstant {
const val PROVIDER_MODULE = "/authorize/biz"
const val PROVIDER_LAUNCHER = "/authorize/showbiz"
/**
* 展示用户协议模块地址
*/
const val PATH_AGREEMENT_FRAGMENT = "/agreement/showFragment"
/**
* provider模块实例名称(暂时仅有卡片用到)
*/

View File

@@ -2,15 +2,12 @@ package com.mogo.module.authorize.authprovider.launcher
import android.content.Context
import android.os.Looper
import com.mogo.commons.AbsMogoApplication
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
import com.mogo.module.authorize.layout.AuthorizeLayout
import com.mogo.module.authorize.layout.AuthorizeDialog
import com.mogo.module.authorize.model.proxy.toAuthorizeType
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasAuth
import com.mogo.module.common.wm.WindowManagerView
import com.mogo.utils.logger.Logger
class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMogoAuthorizeMainProvider {
@@ -24,7 +21,9 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
}
}
private var windowManagerView: WindowManagerView? = null
private var mContext: Context? = null
private var authorizeDialog: AuthorizeDialog? = null
override fun hasRegister(tag: String): Boolean {
if (tag.isNullOrBlank()) return false
@@ -41,7 +40,8 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
}
fun invokeAuthorizeForShow(context: Context) {
pushLayoutToMainWindow(context, AUTHORIZE_TYPE_LAUNCHER_MAIN)
mContext = context
pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN)
}
fun showAuthorizeView(tag: String, forbiddenVoice: (() -> Unit), onError: ((String) -> Unit)) {
@@ -64,25 +64,28 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
Logger.d(TAG, "ready to forbidden voice")
forbiddenVoice.invoke()
Logger.d(TAG, "ready to push fragment")
pushLayoutToMainWindow(AbsMogoApplication.getApp().applicationContext,tag)
pushLayoutToMainWindow(tag)
}
fun hideAuthorizeView() {
windowManagerView?.dismiss()
if (authorizeDialog != null && authorizeDialog!!.isShowing) {
authorizeDialog?.dismiss()
}
}
private fun pushLayoutToMainWindow(context: Context,tag: String) {
if (windowManagerView == null) {
val authorizeLayout = AuthorizeLayout(tag)
val view = authorizeLayout.getLayoutView()
windowManagerView = WindowManagerView.Builder(context).contentView(view).build()
private fun pushLayoutToMainWindow(tag: String) {
if (authorizeDialog == null) {
authorizeDialog = AuthorizeDialog(tag, mContext!!)
authorizeDialog!!.setOnDismissListener {
authorizeDialog = null
}
}
if (windowManagerView!!.isShowing) {
if (authorizeDialog!!.isShowing) {
Logger.d(TAG, "User is operation authorization, do not repeat invoke")
return
} else {
Logger.d(TAG, "pushLayoutToMainWindow")
windowManagerView!!.show()
authorizeDialog!!.show()
}
}

View File

@@ -0,0 +1,203 @@
package com.mogo.module.authorize.layout
import android.content.Context
import android.text.Html
import android.view.View
import android.widget.Button
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.module.authorize.R
import com.mogo.module.authorize.util.AnalyticsUtil
import com.mogo.module.authorize.voice.IVoiceAuthorizeIntentListener
import com.mogo.module.authorize.voice.IVoiceCommandListener
import com.mogo.module.authorize.voice.VoiceUtil
import com.mogo.module.common.dialog.BaseFloatDialog
import com.mogo.utils.TipToast
import com.mogo.utils.logger.Logger
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import kotlinx.coroutines.withContext
class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandListener, IVoiceAuthorizeIntentListener {
companion object {
const val TAG = "AuthorizeDialog"
}
private var mContext: Context? = null
private var invokeTag: String? = null
private var agreementId: Long = 0L
private var clTopParent: ConstraintLayout? = null
private var clErrorContainer: ConstraintLayout? = null
private var clLoadAuthorizeContainer: ConstraintLayout? = null
private var clContainer: ConstraintLayout? = null
private var clAuthorizeLoading: ConstraintLayout? = null
private var btnAgree: Button? = null
private var btnDisAgree: Button? = null
private var btnLoadingError: Button? = null
private var tvTitle: TextView? = null
private var tvContent: TextView? = null
private var tvButtonContent: TextView? = null
private var tvLastContent: TextView? = null
private var authorizeController: AuthorizeController? = null
constructor(invokeTag: String, context: Context) : super(context) {
mContext = context
this.invokeTag = invokeTag
initView()
}
private fun initView() {
setContentView(R.layout.module_authorize_fragment)
setWrapContent()
initViews()
}
private fun setWrapContent() {
val mWindow = window
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
if (mWindow != null) {
val lp = mWindow.attributes
lp.width = 1024
lp.height = 600
mWindow.attributes = lp
}
}else{
if (mWindow != null) {
val lp = mWindow.attributes
lp.width = 1920
lp.height = 1000
mWindow.attributes = lp
}
}
}
fun initViews() {
Logger.d(TAG, "initView ")
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW)
init()
Logger.d(TAG, "invokeTag :$invokeTag")
authorizeController = AuthorizeController(invokeTag!!)
invokeAuthorizationContent()
VoiceUtil.registerAll(this, this)
}
private fun init() {
clTopParent = findViewById(R.id.clAuthorizeTopParent)
clErrorContainer = findViewById(R.id.clLoadingErrorContainer)
clLoadAuthorizeContainer = findViewById(R.id.clLoadingAuthorizeContainer)
clContainer = findViewById(R.id.clAuthorizeContainer)
clAuthorizeLoading = findViewById(R.id.clAuthorizeLoading)
btnAgree = findViewById(R.id.btnAuthorizeAgree)
btnDisAgree = findViewById(R.id.btnAuthorizeDisAgree)
btnLoadingError = findViewById(R.id.btnAuthorizeLoadingError)
tvTitle = findViewById(R.id.tvAuthorizeTitle)
tvContent = findViewById(R.id.tvAuthorizeContent)
tvButtonContent = findViewById(R.id.tvAuthorizeButtonContent)
tvLastContent = findViewById(R.id.tvAuthorizeLastContent)
btnAgree?.setOnClickListener(this)
btnDisAgree?.setOnClickListener(this)
btnLoadingError?.setOnClickListener(this)
clTopParent?.setOnClickListener(this)
clContainer?.setOnClickListener(this)
clErrorContainer?.setOnClickListener(this)
clLoadAuthorizeContainer?.setOnClickListener(this)
clAuthorizeLoading?.setOnClickListener(this)
}
private fun readyToAuthorize() {
clErrorContainer?.visibility = View.GONE
clLoadAuthorizeContainer?.visibility = View.VISIBLE
}
private fun showAuthorizationAgreementContent(
agreementId: Long,
agreementContent: String,
agreementTitle: String,
agreementBottom: String,
agreementLast: String) {
VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.resources.getString(R.string.module_authorize_agreement_tip), AbsMogoApplication.getApp().applicationContext, this)
this.agreementId = agreementId
clLoadAuthorizeContainer?.visibility = View.GONE
clContainer?.visibility = View.VISIBLE
tvTitle?.text = Html.fromHtml(agreementTitle)
GlobalScope.async(Dispatchers.IO) {
val spannable = Html.fromHtml(agreementContent)
withContext(Dispatchers.Main) {
tvContent?.text = spannable
}
}
tvButtonContent?.text = Html.fromHtml(agreementBottom)
tvLastContent?.text = Html.fromHtml(agreementLast)
}
private fun showAuthorizationError() {
clLoadAuthorizeContainer?.visibility = View.GONE
clErrorContainer?.visibility = View.VISIBLE
}
private fun voiceAuthorizeError() {
TipToast.shortTip("授权失败,请稍后重试")
VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.getString(R.string.module_authorize_failed), AbsMogoApplication.getApp().applicationContext, this)
Logger.d(TAG, "onDestroy")
VoiceUtil.unregisterAll(AbsMogoApplication.getApp().applicationContext, this)
}
override fun onClick(v: View) {
when (v.id) {
R.id.btnAuthorizeAgree -> {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 1))
agreeAuthorize()
}
R.id.btnAuthorizeDisAgree -> {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 1, "operation_result" to 2))
disAgreeAuthorize()
}
R.id.clLoadingErrorContainer, R.id.btnAuthorizeLoadingError -> {
invokeAuthorizationContent()
}
R.id.clAuthorizeTopParent -> {
Logger.i(TAG, "dismiss authorizeView")
authorizeController?.onDestroy()
}
}
}
override fun onVoiceCmdAgree() {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 1))
agreeAuthorize()
}
override fun onVoiceCmdDisAgree() {
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_CLICK, hashMapOf("operation_type" to 2, "operation_result" to 2))
disAgreeAuthorize()
}
private fun agreeAuthorize() {
authorizeController?.agreeAuthorize(invokeTag!!, agreementId) {
voiceAuthorizeError()
}
}
private fun disAgreeAuthorize() {
authorizeController?.disAgreeAuthorize(invokeTag!!, agreementId) {
voiceAuthorizeError()
}
}
private fun invokeAuthorizationContent() {
authorizeController?.invokeAuthorizationContent(invokeTag!!, {
readyToAuthorize()
}, { id: Long, content: String, title: String, bottomContent: String, lastContent: String ->
showAuthorizationAgreementContent(id, content, title, bottomContent, lastContent)
}, {
showAuthorizationError()
})
}
}

View File

@@ -50,11 +50,11 @@ class AuthorizeLayout(private val invokeTag: String) : View.OnClickListener, IVo
return layoutInflater
}
private fun getLayoutId(): Int {
fun getLayoutId(): Int {
return R.layout.module_authorize_fragment
}
private fun initViews(mRootView: View) {
fun initViews(mRootView: View) {
Logger.d(TAG, "initView ")
AnalyticsUtil.track(INVOKE_TRACK_AUTHORIZE_SHOW)
init(mRootView)

View File

@@ -1,10 +0,0 @@
package com.mogo.module.authorize.util
import com.mogo.module.common.utils.CarSeries.*
fun isDeviceOfD(): Boolean {
return when (getSeries()) {
CAR_SERIES_D80X, CAR_SERIES_D81X, CAR_SERIES_D82X, CAR_SERIES_D84X -> true
else -> false
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:radius="@dimen/dp_59" />
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
</shape>
</item>
<item>
<shape>
<corners android:radius="@dimen/dp_59" />
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:bottomLeftRadius="@dimen/dp_30" />
<gradient android:endColor="#805CC1FF" android:startColor="#803E7FFC" />
</shape>
</item>
<item>
<shape>
<corners android:bottomLeftRadius="@dimen/dp_30" />
<gradient android:endColor="#5CC1FF" android:startColor="#3E7FFC" />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_30" />
<gradient
android:endColor="#3F4057"
android:startColor="#50526E " />
</shape>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<corners android:bottomRightRadius="@dimen/dp_30" />
<gradient android:endColor="#803F4057" android:startColor="#8050526E" />
</shape>
</item>
<item>
<shape>
<corners android:bottomRightRadius="@dimen/dp_30" />
<gradient android:endColor="#3F4057" android:startColor="#50526E " />
</shape>
</item>
</selector>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="@dimen/dp_30" android:topRightRadius="@dimen/dp_30" />
<gradient
android:endColor="#2A2B38"
android:startColor="#3F4057" />
</shape>

View File

@@ -0,0 +1,210 @@
<?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:id="@+id/clAuthorizeTopParent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#CC000000">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clLoadingAuthorizeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_301"
android:layout_marginTop="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_301"
android:layout_marginBottom="@dimen/dp_100"
android:background="@drawable/module_authorize_selector_dark_corner"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clAuthorizeLoading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/ivAuthorizeLoading"
android:layout_width="@dimen/dp_154"
android:layout_height="@dimen/dp_154"
android:src="@mipmap/module_authorize_loading"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvAuthorizeLoading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:text="@string/module_authorize_agreement_loading"
android:textColor="#99FFFFFF"
android:textSize="@dimen/dp_40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoading" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clLoadingErrorContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_301"
android:layout_marginTop="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_301"
android:layout_marginBottom="@dimen/dp_100"
android:background="@drawable/module_authorize_selector_dark_corner"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/btnAuthorizeLoadingError"
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_110"
android:layout_marginTop="@dimen/dp_71"
android:background="@drawable/module_authorize_selector_blue_corner"
android:gravity="center"
android:text="@string/module_authorize_agreement_retry"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeLoadingError" />
<ImageView
android:id="@+id/ivAuthorizeLoadingError"
android:layout_width="@dimen/dp_125"
android:layout_height="@dimen/dp_125"
android:layout_marginTop="@dimen/dp_155"
android:src="@mipmap/module_authorize_loading_error"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvAuthorizeLoadingError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_29"
android:text="@string/module_authorize_agreement_error"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivAuthorizeLoadingError" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clAuthorizeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_301"
android:layout_marginTop="@dimen/dp_100"
android:layout_marginRight="@dimen/dp_301"
android:layout_marginBottom="@dimen/dp_100"
android:background="@drawable/module_authorize_selector_dark_corner"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/btnAuthorizeAgree"
android:layout_width="0px"
android:layout_height="@dimen/dp_123"
android:background="@drawable/module_authorize_selector_blue_left_corner"
android:gravity="center"
android:text="@string/module_authorize_agreement_agree"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btnAuthorizeDisAgree" />
<Button
android:id="@+id/btnAuthorizeDisAgree"
android:layout_width="0px"
android:layout_height="@dimen/dp_123"
android:background="@drawable/module_authorize_selector_dark_right_corner"
android:gravity="center"
android:text="@string/module_authorize_agreement_disagree"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_40"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@+id/btnAuthorizeAgree"
app:layout_constraintRight_toRightOf="parent" />
<ScrollView
android:layout_width="0px"
android:layout_height="0px"
android:layout_marginBottom="@dimen/dp_123"
android:scrollbarSize="@dimen/dp_442"
android:layout_marginTop="@dimen/dp_35"
android:scrollbarTrackHorizontal="@drawable/module_authorize_scrollbar"
android:scrollbarThumbVertical="@drawable/module_authorize_scrollbar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAuthorizeTitle">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_55"
android:layout_marginRight="@dimen/dp_55"
android:orientation="vertical">
<TextView
android:id="@+id/tvAuthorizeContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:lineSpacingExtra="@dimen/dp_15"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_36" />
<TextView
android:id="@+id/tvAuthorizeButtonContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_36" />
<TextView
android:id="@+id/tvAuthorizeLastContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_15"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_36" />
</LinearLayout>
</ScrollView>
<TextView
android:id="@+id/tvAuthorizeTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_62"
android:textColor="@android:color/white"
android:textSize="@dimen/dp_42"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,17 +0,0 @@
package com.mogo.module.authorize
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}