|
|
@@ -9,7 +9,6 @@ import android.view.View
|
|
|
import androidx.recyclerview.widget.GridLayoutManager
|
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
import com.atmob.keyboard_android.R
|
|
|
-import com.atmob.keyboard_android.component.ComponentMediator
|
|
|
import com.atmob.keyboard_android.component.base.BaseUIComponent
|
|
|
import com.atmob.keyboard_android.component.base.FakeComponent
|
|
|
import com.atmob.keyboard_android.component.base.RouteComponent
|
|
|
@@ -18,7 +17,6 @@ import com.atmob.keyboard_android.component.child.IAiKeyboardCommonPanelComponen
|
|
|
import com.atmob.keyboard_android.component.child.impl.ai.SuperSpeakAiChatComponent
|
|
|
import com.atmob.keyboard_android.component.item.AddCharacterViewBinder
|
|
|
import com.atmob.keyboard_android.component.item.AiKeyboardKeyViewBinder
|
|
|
-import com.atmob.keyboard_android.component.root.IKeyboardRootComponent
|
|
|
import com.atmob.keyboard_android.constant.Constants
|
|
|
import com.atmob.keyboard_android.enums.HelpMode
|
|
|
import com.atmob.keyboard_android.ext.click
|
|
|
@@ -116,38 +114,29 @@ class AiKeyboardCommonPanelComponent @JvmOverloads constructor(
|
|
|
mKeyListAdapter = MultiTypeAdapter(mKeyListItems).apply {
|
|
|
// 键盘按键条目
|
|
|
register(AiKeyboardKeyModel::class.java, AiKeyboardKeyViewBinder { itemView, item ->
|
|
|
- UserInfoHelper.isLogin { isLogin ->
|
|
|
- if (!isLogin) {
|
|
|
- // 未登录,跳到登录页
|
|
|
- val keyboardRootComponent =
|
|
|
- ComponentMediator.findComponent(IKeyboardRootComponent::class.java)
|
|
|
- keyboardRootComponent?.switchLoginPage()
|
|
|
- } else {
|
|
|
- // 当前点击的条目,正在加载中,忽略点击
|
|
|
- if (item.isLoading) {
|
|
|
- return@isLogin
|
|
|
- }
|
|
|
- // 其他条目正在加载中,忽略点击
|
|
|
- val hasItemLoading =
|
|
|
- mKeyListItems.filterIsInstance<AiKeyboardKeyModel>().filter {
|
|
|
- it.isLoading
|
|
|
- }.toList().isNotEmpty()
|
|
|
- if (hasItemLoading) {
|
|
|
- return@isLogin
|
|
|
- }
|
|
|
- // 点击键盘按键,打开AI生成内容面板
|
|
|
- if (item.isVip) {
|
|
|
- // 检查是否VIP
|
|
|
- UserInfoHelper.checkVip {
|
|
|
- handleItemClickLogic(item)
|
|
|
- LogUtil.d("Ai键盘,已经是VIP,打开Ai内容面板")
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 不需要VIP,直接打开
|
|
|
- handleItemClickLogic(item)
|
|
|
- LogUtil.d("Ai键盘,不需要VIP,直接进行下一步")
|
|
|
- }
|
|
|
+ // 当前点击的条目,正在加载中,忽略点击
|
|
|
+ if (item.isLoading) {
|
|
|
+ return@AiKeyboardKeyViewBinder
|
|
|
+ }
|
|
|
+ // 其他条目正在加载中,忽略点击
|
|
|
+ val hasItemLoading =
|
|
|
+ mKeyListItems.filterIsInstance<AiKeyboardKeyModel>().filter {
|
|
|
+ it.isLoading
|
|
|
+ }.toList().isNotEmpty()
|
|
|
+ if (hasItemLoading) {
|
|
|
+ return@AiKeyboardKeyViewBinder
|
|
|
+ }
|
|
|
+ // 点击键盘按键,打开AI生成内容面板
|
|
|
+ if (item.isVip) {
|
|
|
+ // 检查是否VIP
|
|
|
+ UserInfoHelper.checkVip {
|
|
|
+ handleItemClickLogic(item)
|
|
|
+ LogUtil.d("Ai键盘,已经是VIP,打开Ai内容面板")
|
|
|
}
|
|
|
+ } else {
|
|
|
+ // 不需要VIP,直接打开
|
|
|
+ handleItemClickLogic(item)
|
|
|
+ LogUtil.d("Ai键盘,不需要VIP,直接进行下一步")
|
|
|
}
|
|
|
})
|
|
|
// 添加人设按键
|