[2.12.0] local code style change

This commit is contained in:
zhongchao
2022-11-08 11:03:10 +08:00
parent 39ececd4d7
commit fbe1801488
200 changed files with 4306 additions and 5612 deletions

View File

@@ -1,11 +1,12 @@
package com.mogo.eagle.core.function.chat.facade.analytics
import com.mogo.commons.analytics.AnalyticsUtils
import com.mogo.eagle.core.function.api.chat.biz.IMoGoAnalyticsFacade
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
object ChatAnalyticsFacade: IMoGoAnalyticsFacade {
override fun track(eventType: String, data: Map<String, Any>?) {
BridgeApi.analytics()?.track(eventType, data)
AnalyticsUtils.track(eventType, data)
}
}

View File

@@ -21,13 +21,7 @@ internal object BridgeApi {
internal fun context(): Context = contextHolder?.get() ?: Utils.getApp()
internal fun intentManager() = apis?.intentManagerApi
internal fun statusManager() = apis?.statusManagerApi
internal fun analytics() = apis?.analyticsApi
internal fun topViewManager() = apis?.topViewManager
internal fun floatViewManager() = apis?.windowManagerApi
}

View File

@@ -30,8 +30,8 @@ import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
import com.mogo.eagle.core.function.chat.facade.utils.log
import com.mogo.eagle.core.function.chat.facade.voice.VoiceControlFacade.REQUEST_CLOUD_VOICE_CALL
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform
import com.mogo.eagle.core.utilcode.mogo.glide.GlideRoundedCornersTransform.CornerType.LEFT
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform.CornerType.LEFT
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.Channel.Factory.RENDEZVOUS

View File

@@ -3,13 +3,14 @@ package com.mogo.eagle.core.function.chat.facade.voice
import android.content.Context
import android.content.Intent
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.module.intent.IMogoIntentListener
import com.mogo.commons.module.intent.IntentManager
import com.mogo.commons.voice.AIAssist
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade
import com.mogo.eagle.core.function.api.chat.biz.IMoGoVoiceControlFacade.IMoGoVoiceCallback
import com.mogo.eagle.core.function.chat.facade.bridge.BridgeApi
import com.mogo.eagle.core.function.chat.facade.utils.log
import com.mogo.service.intent.IMogoIntentListener
import java.lang.ref.WeakReference
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicBoolean
@@ -48,10 +49,6 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
private var onSpeechFinish: WeakReference<onSpeedFinish>? = null
private val intentManager by lazy {
BridgeApi.intentManager()
}
override fun speak(context: Context, content: String, listener: IMoGoVoiceCallback) {
listeners += WeakReference(listener)
AIAssist.getInstance(context).speakTTSVoiceWithLevel(content,AIAssist.LEVEL3 ,this)
@@ -123,10 +120,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
}
hasRegister.set(true)
AIAssist.getInstance(BridgeApi.context()).registerUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, customCancelCallArray, this)
intentManager?.also {
it.registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
it.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
}
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
}
override fun registerInviteJoinTeam(context: Context, listener: IMoGoVoiceCallback) {
@@ -156,13 +151,13 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
override fun registerIntentInComingCall(listener: IMoGoVoiceCallback) {
listeners += WeakReference(listener)
intentManager?.registerIntentListener(VOICE_INTENT_ANSWER_CALL, this)
intentManager?.registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_ANSWER_CALL, this)
IntentManager.getInstance().registerIntentListener(VOICE_INTENT_REFUSE_CALL, this)
}
override fun unRegisterIntentInComingCall(context: Context) {
intentManager?.unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this)
intentManager?.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_ANSWER_CALL, this)
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
}
override fun speakAndRegisterCall(onCmdAgree: (Boolean) -> Unit, onSpeakFinish: () -> Unit, listener: IMoGoVoiceCallback) {
@@ -204,10 +199,8 @@ object VoiceControlFacade: IMoGoVoiceControlFacade, IMogoVoiceCmdCallBack, IMogo
hasRegister.set(false)
listeners.clear()
AIAssist.getInstance(BridgeApi.context()).unregisterUnWakeupCommand(VOICE_REGISTER_CANCEL_CALL, this)
intentManager?.also {
it.unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
it.unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
}
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_CANCEL_CALL_COMMAND, this)
IntentManager.getInstance().unregisterIntentListener(VOICE_INTENT_REFUSE_CALL, this)
}
override fun onIntentReceived(cmd: String?, intent: Intent?) {