callchat replace

This commit is contained in:
unknown
2020-11-15 14:22:18 +08:00
parent d9492f221b
commit 4172a965f9
21 changed files with 76 additions and 83 deletions

View File

@@ -52,14 +52,14 @@ class FloatView constructor(
abstract inner class PushView(context: Context) : FrameLayout(context),
PushViewController {
lateinit var appIcon: ImageView
lateinit var titleIconContainer: View
lateinit var pushTitle: TextView
lateinit var pushImage: RoundedImageView
lateinit var pushContent: TextView
lateinit var pushTimer: TextView
lateinit var pushButtonLeft: TextView
lateinit var pushButtonRight: TextView
private lateinit var appIcon: ImageView
private lateinit var titleIconContainer: View
private lateinit var pushTitle: TextView
private lateinit var pushImage: RoundedImageView
private lateinit var pushContent: TextView
private lateinit var pushTimer: TextView
private lateinit var pushButtonLeft: TextView
private lateinit var pushButtonRight: TextView
lateinit var pushButton: View
override fun inflateView(layoutId: Int) {
@@ -96,7 +96,7 @@ class FloatView constructor(
fun hasButtons(bean: PushBean?): Boolean {
bean?.buttons?.forEach {
if (!it.text?.isNullOrEmpty()) {
if (it.text.isNotEmpty()) {
return true
}
}
@@ -104,13 +104,13 @@ class FloatView constructor(
}
fun hasTextContent(bean: PushBean?): Boolean =
bean?.content?.isNullOrEmpty()?.not() ?: false
bean?.content?.isEmpty()?.not() ?: false
fun hasImgContent(bean: PushBean?): Boolean = bean?.QRCode?.isNullOrEmpty()?.not() ?: false
fun hasImgContent(bean: PushBean?): Boolean = bean?.QRCode?.isEmpty()?.not() ?: false
open fun setBean(bean: PushBean) {
// app icon
if (!bean.appIcon.isNullOrEmpty()) {
if (bean.appIcon.isNotEmpty()) {
appIcon.visible()
GlideApp.with(this).load(bean.appIcon).into(appIcon)
} else {
@@ -274,6 +274,7 @@ class FloatView constructor(
init {
@Suppress("DEPRECATION")
params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT
params.flags = (WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
or WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION
@@ -282,7 +283,7 @@ class FloatView constructor(
or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE)
params.width = WindowManager.LayoutParams.WRAP_CONTENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity = Gravity.LEFT or Gravity.BOTTOM
params.gravity = Gravity.START or Gravity.BOTTOM
params.format = PixelFormat.TRANSLUCENT
params.x = context.resources.getDimensionPixelSize(R.dimen.module_push_window_x)
params.y = context.resources.getDimensionPixelSize(R.dimen.module_push_window_x)

View File

@@ -58,7 +58,7 @@ class PushViewModel(
if (isClick == "2") {
mVoiceClient.speakTTSVoice("好的", voiceCmdCallback)
}
if (!it.mainSchema.isNullOrEmpty()) {
if (it.mainSchema.isNotEmpty()) {
dealSchema(it.mainSchema, mContext)
}
}
@@ -74,7 +74,7 @@ class PushViewModel(
if (isClick == "2") {
mVoiceClient.speakTTSVoice("好的", voiceCmdCallback)
}
if (!it.buttons[0].action.isNullOrEmpty()) {
if (it.buttons[0].action.isNotEmpty()) {
dealSchema(it.buttons[0].action, mContext)
}
}
@@ -90,7 +90,7 @@ class PushViewModel(
if (isClick == "2") {
mVoiceClient.speakTTSVoice("好的", voiceCmdCallback)
}
if (!it.buttons[1].action.isNullOrEmpty()) {
if (it.buttons[1].action.isNotEmpty()) {
dealSchema(it.buttons[1].action, mContext)
}
}
@@ -162,7 +162,7 @@ class PushViewModel(
}
pushBean?.buttons?.forEach {
it?.voiceCmd?.apply {
it.voiceCmd?.apply {
mVoiceClient.registerUnWakeupCommand(
VOICE_ACTION_PUSH_RIGHT,
toTypedArray(),