[6.2.0]
[xiaozhi] [taxi 和无人化taxi 小智和动画]
@@ -7,10 +7,22 @@ import android.os.Handler
|
|||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import com.mogo.commons.AbsMogoApplication
|
import com.mogo.commons.AbsMogoApplication
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||||
|
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON
|
||||||
|
import com.mogo.och.common.module.wigets.ZhiView
|
||||||
import java.lang.RuntimeException
|
import java.lang.RuntimeException
|
||||||
import java.lang.ref.SoftReference
|
import java.lang.ref.SoftReference
|
||||||
|
|
||||||
class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFirstFrame:Boolean = true,width:Int = -1,height:Int = -1){
|
class FrameAnimatorContainer (resId: Int,
|
||||||
|
fps: Int,
|
||||||
|
imageView: ImageView,
|
||||||
|
sequence: Boolean = true,// 播放顺序 true 正序 false 倒序
|
||||||
|
isOnce: Boolean = false,// 一次性的 true 值播放一次 false 重复播放
|
||||||
|
initFirstFrame:Boolean = true,
|
||||||
|
width:Int = -1,
|
||||||
|
height:Int = -1){
|
||||||
|
private val TAG = "FrameAnimatorContainer"
|
||||||
private lateinit var mFrames: IntArray // 帧数组
|
private lateinit var mFrames: IntArray // 帧数组
|
||||||
private var mIndex = 0 // 当前帧
|
private var mIndex = 0 // 当前帧
|
||||||
private var mShouldRun = false // 开始/停止播放用
|
private var mShouldRun = false // 开始/停止播放用
|
||||||
@@ -21,9 +33,13 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir
|
|||||||
private var mOnAnimationStoppedListener: OnAnimationStoppedListener? = null//播放停止监听
|
private var mOnAnimationStoppedListener: OnAnimationStoppedListener? = null//播放停止监听
|
||||||
private var mBitmap: Bitmap? = null
|
private var mBitmap: Bitmap? = null
|
||||||
private var mBitmapOptions: BitmapFactory.Options? = null //Bitmap管理类,可有效减少Bitmap的OOM问题
|
private var mBitmapOptions: BitmapFactory.Options? = null //Bitmap管理类,可有效减少Bitmap的OOM问题
|
||||||
|
var isOnce:Boolean = false
|
||||||
|
var sequence:Boolean = true
|
||||||
|
|
||||||
init {
|
init {
|
||||||
createAnimation(imageView, getData(resId), fps,initFirstFrame,width,height)
|
createAnimation(imageView, getData(resId), fps,initFirstFrame,width,height)
|
||||||
|
this.isOnce = isOnce
|
||||||
|
this.sequence = sequence
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createAnimation(
|
private fun createAnimation(
|
||||||
@@ -74,13 +90,21 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir
|
|||||||
private val next: Int
|
private val next: Int
|
||||||
get() {
|
get() {
|
||||||
mIndex++
|
mIndex++
|
||||||
if (mIndex >= mFrames.size) mIndex = 0
|
if (mIndex >= mFrames.size){
|
||||||
|
mIndex = 0
|
||||||
|
if(isOnce){// 一次性动画 播放完毕后直接结束
|
||||||
|
stop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!sequence){// 倒叙
|
||||||
|
return mFrames[mFrames.size-1-mIndex]
|
||||||
|
}
|
||||||
return mFrames[mIndex]
|
return mFrames[mIndex]
|
||||||
}
|
}
|
||||||
|
|
||||||
@Synchronized
|
@Synchronized
|
||||||
fun reStart(){
|
fun reStart(){
|
||||||
mIndex = 0
|
mIndex = -1
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,9 +127,16 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir
|
|||||||
}
|
}
|
||||||
mIsRunning = true
|
mIsRunning = true
|
||||||
//新开线程去读下一帧
|
//新开线程去读下一帧
|
||||||
mHandler!!.postDelayed(this, mDelayMillis.toLong())
|
|
||||||
if (imageView.isShown) {
|
if (imageView.isShown) {
|
||||||
val imageRes: Int = next
|
val imageRes: Int = next
|
||||||
|
if (!mShouldRun || imageView == null) {
|
||||||
|
mIsRunning = false
|
||||||
|
if (mOnAnimationStoppedListener != null) {
|
||||||
|
mOnAnimationStoppedListener!!.AnimationStopped()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mHandler?.postDelayed(this, mDelayMillis.toLong())
|
||||||
if (mBitmap != null) { // so Build.VERSION.SDK_INT >= 11
|
if (mBitmap != null) { // so Build.VERSION.SDK_INT >= 11
|
||||||
var bitmap: Bitmap? = null
|
var bitmap: Bitmap? = null
|
||||||
try {
|
try {
|
||||||
@@ -158,7 +189,7 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir
|
|||||||
* @param resId
|
* @param resId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private fun getData(resId: Int): IntArray {
|
fun getData(resId: Int): IntArray {
|
||||||
val array = AbsMogoApplication.getApp().resources.obtainTypedArray(resId)
|
val array = AbsMogoApplication.getApp().resources.obtainTypedArray(resId)
|
||||||
val len = array.length()
|
val len = array.length()
|
||||||
val intArray = IntArray(array.length())
|
val intArray = IntArray(array.length())
|
||||||
@@ -169,6 +200,10 @@ class FrameAnimatorContainer (resId: Int, fps: Int, imageView: ImageView,initFir
|
|||||||
return intArray
|
return intArray
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setData(mFrames: IntArray){
|
||||||
|
this.mFrames = mFrames
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 停止播放监听
|
* 停止播放监听
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import com.mogo.tts.base.zhi.AsrTextBean
|
|||||||
import com.mogo.tts.base.zhi.CallbackWidget
|
import com.mogo.tts.base.zhi.CallbackWidget
|
||||||
import com.mogo.tts.base.zhi.AvatarManager
|
import com.mogo.tts.base.zhi.AvatarManager
|
||||||
import com.mogo.tts.base.zhi.ZhiRecordWinUi
|
import com.mogo.tts.base.zhi.ZhiRecordWinUi
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
|
|
||||||
class ZhiView @JvmOverloads constructor(
|
class ZhiView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
@@ -27,49 +28,75 @@ class ZhiView @JvmOverloads constructor(
|
|||||||
const val TAG = "ZhiView"
|
const val TAG = "ZhiView"
|
||||||
}
|
}
|
||||||
|
|
||||||
private var normalAnim: FrameAnimatorContainer?=null
|
private var currentAnim = FrameAnimatorContainer(R.array.xiaozhi_normal, 20,this)
|
||||||
private var listeningAnim: FrameAnimatorContainer?=null
|
|
||||||
private var understandingAnim: FrameAnimatorContainer?=null
|
|
||||||
private var speakingAnim: FrameAnimatorContainer?=null
|
|
||||||
|
|
||||||
@Volatile
|
@Volatile
|
||||||
private var currentAni:FrameAnimatorContainer?=null
|
private var status = ZhiRecordWinUi.RecordStatus.STATUS_SILENCE
|
||||||
|
private var animalState = AnimalState.Normal
|
||||||
init {
|
init {
|
||||||
normalAnim = FrameAnimatorContainer(R.array.xiaozhi_normal, 20,this)
|
val xiaozhiNormal = currentAnim.getData(R.array.xiaozhi_normal)
|
||||||
normalAnim?.setOnAnimStopListener(object : FrameAnimatorContainer.OnAnimationStoppedListener{
|
val xiaozhiThink = currentAnim.getData(R.array.xiaozhi_think)
|
||||||
|
val xiaozhiThinkNormal = currentAnim.getData(R.array.xiaozhi_think_normal)
|
||||||
|
currentAnim.setOnAnimStopListener(object : FrameAnimatorContainer.OnAnimationStoppedListener{
|
||||||
override fun AnimationStopped() {
|
override fun AnimationStopped() {
|
||||||
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "常态动画暂停")
|
when (status) {
|
||||||
currentAni?.reStart()
|
ZhiRecordWinUi.RecordStatus.STATUS_SILENCE -> {
|
||||||
|
if(animalState==AnimalState.SPEAK){
|
||||||
|
currentAnim.setData(xiaozhiThinkNormal)
|
||||||
|
currentAnim.isOnce = true
|
||||||
|
currentAnim.sequence = false
|
||||||
|
currentAnim.reStart()
|
||||||
|
animalState = AnimalState.NORMAL_SPEAK
|
||||||
|
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status speak to normal")
|
||||||
|
}else{
|
||||||
|
currentAnim.setData(xiaozhiNormal)
|
||||||
|
currentAnim.isOnce = false
|
||||||
|
currentAnim.sequence = true
|
||||||
|
currentAnim.reStart()
|
||||||
|
animalState = AnimalState.Normal
|
||||||
|
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status normal")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ZhiRecordWinUi.RecordStatus.STATUS_LISTENING -> {
|
||||||
|
if(animalState==AnimalState.Normal){
|
||||||
|
currentAnim.setData(xiaozhiThinkNormal)
|
||||||
|
currentAnim.isOnce = true
|
||||||
|
currentAnim.sequence = true
|
||||||
|
currentAnim.reStart()
|
||||||
|
animalState = AnimalState.NORMAL_SPEAK
|
||||||
|
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status normal to speak")
|
||||||
|
}else{
|
||||||
|
currentAnim.setData(xiaozhiThink)
|
||||||
|
currentAnim.isOnce = false
|
||||||
|
currentAnim.sequence = true
|
||||||
|
currentAnim.reStart()
|
||||||
|
animalState = AnimalState.SPEAK
|
||||||
|
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status speak")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTANDING -> {}
|
||||||
|
ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTAND_END -> {}
|
||||||
|
ZhiRecordWinUi.RecordStatus.STATUS_SPEAKING -> {
|
||||||
|
if(animalState==AnimalState.SPEAK){
|
||||||
|
currentAnim.setData(xiaozhiThinkNormal)
|
||||||
|
currentAnim.isOnce = true
|
||||||
|
currentAnim.sequence = false
|
||||||
|
currentAnim.reStart()
|
||||||
|
animalState = AnimalState.NORMAL_SPEAK
|
||||||
|
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status speak to normal")
|
||||||
|
}else{
|
||||||
|
currentAnim.setData(xiaozhiNormal)
|
||||||
|
currentAnim.isOnce = false
|
||||||
|
currentAnim.sequence = true
|
||||||
|
currentAnim.reStart()
|
||||||
|
animalState = AnimalState.Normal
|
||||||
|
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "动画$status normal")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
listeningAnim = FrameAnimatorContainer(R.array.xiaozhi_normal, 20,this)
|
|
||||||
listeningAnim?.setOnAnimStopListener(object : FrameAnimatorContainer.OnAnimationStoppedListener{
|
|
||||||
override fun AnimationStopped() {
|
|
||||||
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "侦听动画暂停")
|
|
||||||
currentAni?.reStart()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
understandingAnim = FrameAnimatorContainer(R.array.xiaozhi_normal, 20,this)
|
|
||||||
understandingAnim?.setOnAnimStopListener(object : FrameAnimatorContainer.OnAnimationStoppedListener{
|
|
||||||
override fun AnimationStopped() {
|
|
||||||
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "理解中动画暂停")
|
|
||||||
currentAni?.reStart()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
speakingAnim = FrameAnimatorContainer(R.array.xiaozhi_normal, 20,this)
|
|
||||||
speakingAnim?.setOnAnimStopListener(object : FrameAnimatorContainer.OnAnimationStoppedListener{
|
|
||||||
override fun AnimationStopped() {
|
|
||||||
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG, "说话动画暂停")
|
|
||||||
currentAni?.reStart()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
currentAni = normalAnim
|
|
||||||
|
|
||||||
onClick {
|
onClick {
|
||||||
AvatarManager.wakeupXiaoZhi()
|
AvatarManager.wakeupXiaoZhi()
|
||||||
}
|
}
|
||||||
@@ -84,7 +111,7 @@ class ZhiView @JvmOverloads constructor(
|
|||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
AvatarManager.addDistanceListener(TAG,this)
|
AvatarManager.addDistanceListener(TAG,this)
|
||||||
normalAnim?.reStart()
|
currentAnim.reStart()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDetachedFromWindow() {
|
override fun onDetachedFromWindow() {
|
||||||
@@ -94,39 +121,26 @@ class ZhiView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun start(reason: String?) {
|
override fun start(reason: String?) {
|
||||||
CallerLogger.d(TAG,"-----start $reason")
|
CallerLogger.d(TAG,"-----start $reason")
|
||||||
val msg = VoiceMsg(
|
|
||||||
isWakeUp = true,
|
|
||||||
isWakeUpEnd = false,
|
|
||||||
msg = "",
|
|
||||||
isLastMsg = true,
|
|
||||||
isResp = true
|
|
||||||
)
|
|
||||||
pushMsgBox(msg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStatusChange(status: ZhiRecordWinUi.RecordStatus?) {
|
override fun onStatusChange(status: ZhiRecordWinUi.RecordStatus?) {
|
||||||
CallerLogger.d(TAG,"-----onStatusChange $status")
|
CallerLogger.d(TAG,"-----onStatusChange $status")
|
||||||
|
this.status = status?:ZhiRecordWinUi.RecordStatus.STATUS_SILENCE
|
||||||
|
|
||||||
when (status) {
|
when (status) {
|
||||||
ZhiRecordWinUi.RecordStatus.STATUS_SILENCE -> {}
|
ZhiRecordWinUi.RecordStatus.STATUS_SILENCE -> {}
|
||||||
ZhiRecordWinUi.RecordStatus.STATUS_LISTENING -> {
|
ZhiRecordWinUi.RecordStatus.STATUS_LISTENING -> {// 监听中
|
||||||
// 正在听取
|
currentAnim.stop()
|
||||||
currentAni?.stop()
|
|
||||||
currentAni = listeningAnim
|
|
||||||
}
|
}
|
||||||
ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTANDING -> {
|
ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTANDING -> {
|
||||||
// 正在理解
|
// 正在理解
|
||||||
currentAni?.stop()
|
CallerLogger.d(TAG,"正在理解")
|
||||||
currentAni = understandingAnim
|
|
||||||
}
|
}
|
||||||
ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTAND_END -> {
|
ZhiRecordWinUi.RecordStatus.STATUS_UNDERSTAND_END -> {
|
||||||
|
CallerLogger.d(TAG,"理解结束")
|
||||||
}
|
}
|
||||||
ZhiRecordWinUi.RecordStatus.STATUS_SPEAKING -> {
|
ZhiRecordWinUi.RecordStatus.STATUS_SPEAKING -> {
|
||||||
// 正在说话
|
// 正在说话
|
||||||
currentAni?.stop()
|
currentAnim.stop()
|
||||||
currentAni = speakingAnim
|
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
|
||||||
@@ -140,8 +154,8 @@ class ZhiView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun close(trigger: Boolean) {
|
override fun close(trigger: Boolean) {
|
||||||
CallerLogger.d(TAG,"-----close $trigger")
|
CallerLogger.d(TAG,"-----close $trigger")
|
||||||
currentAni?.stop()
|
status = ZhiRecordWinUi.RecordStatus.STATUS_SILENCE
|
||||||
currentAni = normalAnim
|
currentAnim.stop()
|
||||||
val msg = VoiceMsg(
|
val msg = VoiceMsg(
|
||||||
isWakeUp = false,
|
isWakeUp = false,
|
||||||
isWakeUpEnd = true,
|
isWakeUpEnd = true,
|
||||||
@@ -203,5 +217,12 @@ class ZhiView @JvmOverloads constructor(
|
|||||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.VOICE, msg))
|
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.VOICE, msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum class AnimalState {
|
||||||
|
Normal,
|
||||||
|
NORMAL_SPEAK,
|
||||||
|
SPEAK_NORMAL,
|
||||||
|
SPEAK,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -76,4 +76,99 @@
|
|||||||
<item>@drawable/charter_p_xiaozhi_normal_72</item>
|
<item>@drawable/charter_p_xiaozhi_normal_72</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="xiaozhi_think">
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_00</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_01</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_02</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_03</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_04</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_05</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_06</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_07</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_08</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_09</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_10</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_11</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_12</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_13</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_14</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_15</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_16</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_17</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_18</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_19</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_20</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_21</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_22</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_23</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_24</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_25</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_26</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_27</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_28</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_29</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_30</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_31</item>
|
||||||
|
<!-- <item>@drawable/charter_p_xiaozhi_think_32</item>-->
|
||||||
|
<!-- <item>@drawable/charter_p_xiaozhi_think_33</item>-->
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_34</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_35</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_36</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_37</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_38</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_39</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_40</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_41</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_42</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_43</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_44</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_45</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_46</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_47</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_48</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_49</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_50</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_51</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_52</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_53</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_54</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_55</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_56</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_57</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_58</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_59</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_60</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_61</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_62</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_63</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_64</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_65</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_66</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_67</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_68</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_69</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_70</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_71</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
|
<string-array name="xiaozhi_think_normal">
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_01</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_02</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_03</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_04</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_05</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_06</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_07</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_08</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_09</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_10</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_11</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_12</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_13</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_14</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_15</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_16</item>
|
||||||
|
<item>@drawable/charter_p_xiaozhi_think_normal_17</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -52,8 +52,6 @@ class TaxiPassengerBaseFragment() :
|
|||||||
*/
|
*/
|
||||||
private var mStartAutopilotView: WeakReference<StartAutopilotView?>? = null
|
private var mStartAutopilotView: WeakReference<StartAutopilotView?>? = null
|
||||||
|
|
||||||
private var createProgressDialogAnim: FrameAnimatorContainer?=null
|
|
||||||
|
|
||||||
override fun getLayoutId(): Int {
|
override fun getLayoutId(): Int {
|
||||||
return R.layout.taxi_p_base_fragment
|
return R.layout.taxi_p_base_fragment
|
||||||
}
|
}
|
||||||
@@ -71,13 +69,6 @@ class TaxiPassengerBaseFragment() :
|
|||||||
mapBizView!!.onCreate(savedInstanceState)
|
mapBizView!!.onCreate(savedInstanceState)
|
||||||
overMapView.onCreateView(savedInstanceState)
|
overMapView.onCreateView(savedInstanceState)
|
||||||
overMapView.hideResetView()
|
overMapView.hideResetView()
|
||||||
|
|
||||||
createProgressDialogAnim = FrameAnimatorContainer(R.array.xiaozhi_normal, 20,aciv_xiaozhi_normal)
|
|
||||||
createProgressDialogAnim?.setOnAnimStopListener(object :FrameAnimatorContainer.OnAnimationStoppedListener{
|
|
||||||
override fun AnimationStopped() {
|
|
||||||
CallerLogger.d(M_TAXI_P + TAG, "动画暂停")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initListener() {
|
private fun initListener() {
|
||||||
@@ -156,15 +147,6 @@ class TaxiPassengerBaseFragment() :
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
view?.viewTreeObserver?.addOnWindowFocusChangeListener {
|
|
||||||
if (it) {
|
|
||||||
CallerLogger.d(M_TAXI_P + TAG, "windows获取焦点")
|
|
||||||
createProgressDialogAnim?.start()
|
|
||||||
} else {
|
|
||||||
CallerLogger.d(M_TAXI_P + TAG, "window失去焦点")
|
|
||||||
createProgressDialogAnim?.stop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initCheckView() {
|
private fun initCheckView() {
|
||||||
@@ -180,8 +162,6 @@ class TaxiPassengerBaseFragment() :
|
|||||||
mapBizView!!.onResume()
|
mapBizView!!.onResume()
|
||||||
overMapView.onResume()
|
overMapView.onResume()
|
||||||
CallerLogger.d(M_TAXI_P + TAG, "onResume")
|
CallerLogger.d(M_TAXI_P + TAG, "onResume")
|
||||||
|
|
||||||
createProgressDialogAnim?.start()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createPresenter(): BaseTaxiPassengerPresenter {
|
override fun createPresenter(): BaseTaxiPassengerPresenter {
|
||||||
@@ -203,7 +183,6 @@ class TaxiPassengerBaseFragment() :
|
|||||||
mapBizView!!.onPause()
|
mapBizView!!.onPause()
|
||||||
overMapView?.onPause()
|
overMapView?.onPause()
|
||||||
CallerLogger.d(M_TAXI_P + TAG, "onPause")
|
CallerLogger.d(M_TAXI_P + TAG, "onPause")
|
||||||
createProgressDialogAnim?.stop()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
|
|||||||
@@ -3,64 +3,5 @@
|
|||||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:visible="true"
|
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:visible="true"
|
||||||
android:oneshot="false">
|
android:oneshot="false">
|
||||||
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal002" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal004" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal006" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal008" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal010" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal012" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal014" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal016" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal018" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal020" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal022" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal024" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal026" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal028" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal030" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal032" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal034" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal036" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal038" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal040" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal042" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal044" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal046" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal048" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal050" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal052" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal054" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal056" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal058" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal060" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal062" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal064" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal066" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal068" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal070" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal072" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal074" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal076" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal078" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal080" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal082" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal084" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal086" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal088" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal090" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal092" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal094" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal096" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal098" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal100" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal102" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal104" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal106" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal108" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal110" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal112" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal114" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal116" android:duration="60"/>
|
|
||||||
<item android:drawable="@drawable/xiaozhi_normal118" android:duration="60"/>
|
|
||||||
|
|
||||||
</animation-list>
|
</animation-list>
|
||||||
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 138 KiB |