lmw
2025-01-10 601f14db94013373df700e007095f7f2f5ecbe24
app/src/main/java/com/sinata/xqmuse/ui/BGMSettingActivity.kt
@@ -51,15 +51,20 @@
        })
        tv_action.setOnClickListener {
            //存音量
            SPUtils.instance().put(Const.User.VOLUME,sb_voice.progress).apply()
            if (list.isNotEmpty()){ //存bgm和bg
                SPUtils.instance().put(Const.User.BG,list[banner_landscape.currentItem].imageUrl)
                    .put(Const.User.BGM,list[banner_landscape.currentItem].audioFile).apply()
                EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_BGM))
                tv_action.isEnabled = false
                HttpManager.saveUserHomeBackgroundMusic(list[banner_landscape.currentItem].id).request(this,success = {_,_->
                    //存音量
                    SPUtils.instance().put(Const.User.VOLUME,sb_voice.progress).apply()
                    SPUtils.instance().put(Const.User.BG,list[banner_landscape.currentItem].imageUrl)
                        .put(Const.User.BGM,list[banner_landscape.currentItem].audioFile).apply()
                    EventBus.getDefault().post(EmptyEvent(Const.EventCode.CHANGE_BGM))
                    toast("保存成功")
                    startActivity<MainActivity>()
                }){_,_->
                    tv_action.isEnabled = true
                }
            }
            toast("保存成功")
            startActivity<MainActivity>()
            if (fromPrivacy)
                EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO))
        }