| | |
| | | |
| | | private val list = arrayListOf<BGMBean>() |
| | | private val cardBannerAdapter by lazy { BgmBannerAdapter(list,this) } |
| | | private val fromPrivacy by lazy { intent.getBooleanExtra("fromPrivacy",false) } //从私人定制过来,设置完成需要发送停止引导的事件 |
| | | private val player by lazy { AudioUtils() } |
| | | |
| | | override fun initClick() { |
| | |
| | | } |
| | | banner_landscape.setOnBannerListener { data, position -> |
| | | cardBannerAdapter.playPosition = position |
| | | cardBannerAdapter.notifyItemChanged(position) |
| | | cardBannerAdapter.notifyDataSetChanged() |
| | | player.startPlayMusic(this,list[position].audioFile) |
| | | if (banner_landscape.currentItem != position){ |
| | | banner_landscape.setCurrentItem(position,true) |
| | | } |
| | | } |
| | | sb_voice.setOnSeekBarChangeListener(object :SeekBar.OnSeekBarChangeListener{ |
| | | override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { |
| | |
| | | } |
| | | toast("保存成功") |
| | | startActivity<MainActivity>() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | if (fromPrivacy) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_GUIDE_AUDIO)) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | override fun onPause() { |
| | | super.onPause() |
| | | player.stopPlayMusic() |
| | | player.stopPlayMusic(true) |
| | | } |
| | | } |