|
|
@@ -27,6 +27,7 @@ import com.atmob.keyboard_android.util.recyclerview.GridDivider
|
|
|
import com.atmob.keyboard_android.widget.LongTouchContainer
|
|
|
import com.atmob.keyboard_android.widget.indicator.TabPagerTitleView
|
|
|
import com.blankj.utilcode.util.ConvertUtils
|
|
|
+import com.blankj.utilcode.util.ToastUtils
|
|
|
import me.drakeet.multitype.Items
|
|
|
import me.drakeet.multitype.MultiTypeAdapter
|
|
|
import net.lucode.hackware.magicindicator.MagicIndicator
|
|
|
@@ -281,21 +282,21 @@ class AiKeyboardComponent @JvmOverloads constructor(
|
|
|
*/
|
|
|
@SuppressLint("NotifyDataSetChanged")
|
|
|
private fun loadKeyListByTab(tab: Tab) {
|
|
|
- val newList = mutableListOf<AiKeyboardKeyModel>().apply {
|
|
|
- add(AiKeyboardKeyModel("暧昧推拉"))
|
|
|
- add(AiKeyboardKeyModel("欲拒还迎"))
|
|
|
- add(AiKeyboardKeyModel("哄女友"))
|
|
|
- add(AiKeyboardKeyModel("暧昧推拉"))
|
|
|
- add(AiKeyboardKeyModel("甜蜜暴击"))
|
|
|
- add(AiKeyboardKeyModel("暧昧推拉"))
|
|
|
- add(AiKeyboardKeyModel("彩虹屁专家"))
|
|
|
- add(AiKeyboardKeyModel("恋爱脑"))
|
|
|
- add(AiKeyboardKeyModel("调皮回复"))
|
|
|
- }
|
|
|
- mKeyListItems.clear()
|
|
|
- // 随机打乱顺序
|
|
|
- mKeyListItems.addAll(newList.shuffled())
|
|
|
- mKeyListAdapter.notifyDataSetChanged()
|
|
|
+ KeyboardHolder.getKeyboardService()?.getKeyboardViewModel()?.getCharacterList(onSuccess = {
|
|
|
+ val newList = (it.characterInfos ?: listOf()).map {
|
|
|
+ AiKeyboardKeyModel(
|
|
|
+ // 显示的文本 = 表情 + 名字
|
|
|
+ text = "${it.emoji} ${it.name}",
|
|
|
+ // 是否需要VIP
|
|
|
+ isVip = it.isVip
|
|
|
+ )
|
|
|
+ }
|
|
|
+ mKeyListItems.clear()
|
|
|
+ mKeyListItems.addAll(newList)
|
|
|
+ mKeyListAdapter.notifyDataSetChanged()
|
|
|
+ }, onFail = {
|
|
|
+ ToastUtils.showShort(it)
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -314,6 +315,11 @@ class AiKeyboardComponent @JvmOverloads constructor(
|
|
|
}
|
|
|
// 隐藏AI生成内容面板
|
|
|
controlAiChatPageShowing(false)
|
|
|
+
|
|
|
+ // 重新加载人设列表
|
|
|
+ KeyboardHolder.getKeyboardService()?.getKeyboardViewModel()?.tab?.value?.let {
|
|
|
+ loadKeyListByTab(it)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|