声优条件过滤
This commit is contained in:
parent
210f793709
commit
1e82e8278a
|
|
@ -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.setting.model.ChatModelDialog
|
||||||
import com.remax.visualnovel.ui.chat.customui.HoldToTalkDialog
|
import com.remax.visualnovel.ui.chat.customui.HoldToTalkDialog
|
||||||
import com.remax.visualnovel.ui.chat.customui.InputPanel
|
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.LanguageUtil
|
||||||
import com.remax.visualnovel.utils.RecordHelper
|
import com.remax.visualnovel.utils.RecordHelper
|
||||||
import com.remax.visualnovel.utils.StatusBarUtil3
|
import com.remax.visualnovel.utils.StatusBarUtil3
|
||||||
|
|
@ -64,10 +65,9 @@ class ChatActivity : BaseBindingActivity<ActivityActorChatBinding>() {
|
||||||
binding.drawerMenu.openDrawer(GravityCompat.END)
|
binding.drawerMenu.openDrawer(GravityCompat.END)
|
||||||
}
|
}
|
||||||
|
|
||||||
with(binding) {
|
|
||||||
initInputPanelEvents()
|
initInputPanelEvents()
|
||||||
initCallViewEvents()
|
initCallViewEvents()
|
||||||
}
|
initSettingView()
|
||||||
|
|
||||||
mImeHelper.startImeListen()
|
mImeHelper.startImeListen()
|
||||||
}
|
}
|
||||||
|
|
@ -79,7 +79,7 @@ class ChatActivity : BaseBindingActivity<ActivityActorChatBinding>() {
|
||||||
private fun loadSoundDatas(gender: Int?) {
|
private fun loadSoundDatas(gender: Int?) {
|
||||||
launchAndCollect2({
|
launchAndCollect2({
|
||||||
val requestParam = ParamSoundList().apply {
|
val requestParam = ParamSoundList().apply {
|
||||||
this.gender = gender
|
this.gender = if (gender == 0) null else gender
|
||||||
this.language = LanguageUtil.instance().getCurrentLanguageCode()
|
this.language = LanguageUtil.instance().getCurrentLanguageCode()
|
||||||
}
|
}
|
||||||
mViewModel.loadSoundList(requestParam)
|
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() {
|
private fun initInputPanelEvents() {
|
||||||
with(binding.inputPanel) {
|
with(binding.inputPanel) {
|
||||||
holdToTalk(
|
holdToTalk(
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,22 @@ class ChatSettingView @JvmOverloads constructor(
|
||||||
|
|
||||||
private var mBinding = LayoutChatMenuViewBinding.inflate(LayoutInflater.from(context), this, true)
|
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 {
|
init {
|
||||||
with(mBinding) {
|
with(mBinding) {
|
||||||
|
|
@ -217,7 +233,7 @@ class ChatSettingView @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFiltersChanged(sexValue: Int) {
|
override fun onFiltersChanged(sexValue: Int) {
|
||||||
//TODO("Not yet implemented")
|
mEventListener.onSoundFiltersChanged(sexValue)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue