Merge remote-tracking branch 'origin/qa_byd' into qa_byd
This commit is contained in:
@@ -131,6 +131,7 @@ open class IMogoAuthorizeController {
|
||||
}
|
||||
}
|
||||
onError {
|
||||
//todo
|
||||
Logger.d(TAG, it.message ?: "checkIfNeedAuthorize onError, message is null")
|
||||
setAuthorizeStatus(agreementType, true)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
|
||||
|
||||
override fun needAuthorize(tag: String): Boolean {
|
||||
Logger.d(TAG, "===== needAuthorize update agreement in background")
|
||||
// baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
|
||||
baseController.checkIfNeedAuthorize(tag.toAuthorizeType())
|
||||
return needAuthorization(tag.toAuthorizeType())
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
}
|
||||
}
|
||||
|
||||
private var mContext:Context? = null
|
||||
private var mContext: Context? = null
|
||||
|
||||
private var authorizeDialog: AuthorizeDialog? = null
|
||||
|
||||
@@ -41,7 +41,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
|
||||
fun invokeAuthorizeForShow(context: Context) {
|
||||
mContext = context
|
||||
// pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN)
|
||||
pushLayoutToMainWindow(AUTHORIZE_TYPE_LAUNCHER_MAIN)
|
||||
}
|
||||
|
||||
fun showAuthorizeView(tag: String, forbiddenVoice: (() -> Unit), onError: ((String) -> Unit)) {
|
||||
@@ -64,7 +64,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
Logger.d(TAG, "ready to forbidden voice")
|
||||
forbiddenVoice.invoke()
|
||||
Logger.d(TAG, "ready to push fragment")
|
||||
// pushLayoutToMainWindow(tag)
|
||||
pushLayoutToMainWindow(tag)
|
||||
}
|
||||
|
||||
fun hideAuthorizeView() {
|
||||
@@ -73,7 +73,7 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
|
||||
private fun pushLayoutToMainWindow(tag: String) {
|
||||
if (authorizeDialog == null) {
|
||||
authorizeDialog = AuthorizeDialog(tag,mContext!!)
|
||||
authorizeDialog = AuthorizeDialog(tag, mContext!!)
|
||||
}
|
||||
if (authorizeDialog!!.isShowing) {
|
||||
Logger.d(TAG, "User is operation authorization, do not repeat invoke")
|
||||
|
||||
@@ -7,12 +7,14 @@ 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
|
||||
@@ -21,6 +23,10 @@ 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
|
||||
|
||||
@@ -49,14 +55,28 @@ class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandList
|
||||
|
||||
private fun initView() {
|
||||
setContentView(R.layout.module_authorize_fragment)
|
||||
setWrapContent()
|
||||
initViews()
|
||||
}
|
||||
|
||||
private fun setWrapContent() {
|
||||
if(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD){
|
||||
return
|
||||
}
|
||||
val mWindow = window
|
||||
if (mWindow != null) {
|
||||
val lp = mWindow.attributes
|
||||
lp.width = 1920
|
||||
lp.height = 1000
|
||||
mWindow.attributes = lp
|
||||
}
|
||||
}
|
||||
|
||||
fun initViews() {
|
||||
Logger.d(AuthorizeLayout.TAG, "initView ")
|
||||
Logger.d(TAG, "initView ")
|
||||
AnalyticsUtil.track(AnalyticsUtil.INVOKE_TRACK_AUTHORIZE_SHOW)
|
||||
init()
|
||||
Logger.d(AuthorizeLayout.TAG, "invokeTag :$invokeTag")
|
||||
Logger.d(TAG, "invokeTag :$invokeTag")
|
||||
authorizeController = AuthorizeController(invokeTag!!)
|
||||
invokeAuthorizationContent()
|
||||
VoiceUtil.registerAll(this, this)
|
||||
@@ -117,8 +137,9 @@ class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandList
|
||||
}
|
||||
|
||||
private fun voiceAuthorizeError() {
|
||||
TipToast.shortTip("授权失败,请稍后重试")
|
||||
VoiceUtil.speak(AbsMogoApplication.getApp().applicationContext.getString(R.string.module_authorize_failed), AbsMogoApplication.getApp().applicationContext, this)
|
||||
Logger.d(AuthorizeLayout.TAG, "onDestroy")
|
||||
Logger.d(TAG, "onDestroy")
|
||||
VoiceUtil.unregisterAll(AbsMogoApplication.getApp().applicationContext, this)
|
||||
}
|
||||
|
||||
@@ -136,7 +157,7 @@ class AuthorizeDialog : BaseFloatDialog, View.OnClickListener, IVoiceCommandList
|
||||
invokeAuthorizationContent()
|
||||
}
|
||||
R.id.clAuthorizeTopParent -> {
|
||||
Logger.i(AuthorizeLayout.TAG, "dismiss authorizeView")
|
||||
Logger.i(TAG, "dismiss authorizeView")
|
||||
authorizeController?.onDestroy()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mServiceApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
}
|
||||
mServiceApis.getShareManager().resetContext(this);
|
||||
// mServiceApis.getAuthManagerApi().resetContext(this);
|
||||
mServiceApis.getAuthManagerApi().resetContext(this);
|
||||
mMogoStatusManager = mServiceApis.getStatusManagerApi();
|
||||
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
|
||||
AutopilotServiceManage.getInstance().init( getContext() );
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -67,6 +67,9 @@ public class KwPresenter extends BaseMediaPresenter<IMusicView> {
|
||||
});
|
||||
|
||||
kwapi.registerPlayerStatusListener((playerStatus, music) -> {
|
||||
if ( music == null ) {
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "onPlayerStatusListener: " + playerStatus + " music: " + music.name);
|
||||
switch (playerStatus) {
|
||||
case BUFFERING:
|
||||
|
||||
Reference in New Issue
Block a user