声优条件过滤

This commit is contained in:
renhaoting 2025-11-06 17:16:45 +08:00
parent 210f793709
commit 1e82e8278a
2 changed files with 34 additions and 6 deletions

View File

@ -37,6 +37,7 @@ import com.remax.visualnovel.ui.chat.customui.ChatCallView
import com.remax.visualnovel.ui.chat.setting.model.ChatModelDialog
import com.remax.visualnovel.ui.chat.customui.HoldToTalkDialog
import com.remax.visualnovel.ui.chat.customui.InputPanel
import com.remax.visualnovel.ui.chat.setting.customui.ChatSettingView
import com.remax.visualnovel.utils.LanguageUtil
import com.remax.visualnovel.utils.RecordHelper
import com.remax.visualnovel.utils.StatusBarUtil3
@ -64,10 +65,9 @@ class ChatActivity : BaseBindingActivity<ActivityActorChatBinding>() {
binding.drawerMenu.openDrawer(GravityCompat.END)
}
with(binding) {
initInputPanelEvents()
initCallViewEvents()
}
initInputPanelEvents()
initCallViewEvents()
initSettingView()
mImeHelper.startImeListen()
}
@ -79,7 +79,7 @@ class ChatActivity : BaseBindingActivity<ActivityActorChatBinding>() {
private fun loadSoundDatas(gender: Int?) {
launchAndCollect2({
val requestParam = ParamSoundList().apply {
this.gender = gender
this.gender = if (gender == 0) null else gender
this.language = LanguageUtil.instance().getCurrentLanguageCode()
}
mViewModel.loadSoundList(requestParam)
@ -134,6 +134,18 @@ class ChatActivity : BaseBindingActivity<ActivityActorChatBinding>() {
}
}
private fun initSettingView() {
with(binding.settingView) {
setEventListener(object : ChatSettingView.IEventListener {
override fun onSoundFiltersChanged(sexValue: Int) {
loadSoundDatas(sexValue)
}
})
}
}
private fun initInputPanelEvents() {
with(binding.inputPanel) {
holdToTalk(

View File

@ -31,6 +31,22 @@ class ChatSettingView @JvmOverloads constructor(
private var mBinding = LayoutChatMenuViewBinding.inflate(LayoutInflater.from(context), this, true)
private lateinit var mEventListener: IEventListener
interface IEventListener {
fun onSoundFiltersChanged(sexValue: Int)
}
fun setEventListener(listener: IEventListener) {
mEventListener = listener
}
init {
with(mBinding) {
@ -217,7 +233,7 @@ class ChatSettingView @JvmOverloads constructor(
}
override fun onFiltersChanged(sexValue: Int) {
//TODO("Not yet implemented")
mEventListener.onSoundFiltersChanged(sexValue)
}
})
}