| | |
| | | import com.google.android.exoplayer2.upstream.RawResourceDataSource |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ThinkAudioService |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.* |
| | | import com.sinata.xqmuse.network.requestByF |
| | |
| | | if (today!=null){ |
| | | if (today?.isShow == 1){ //跳转播放微电影 |
| | | startActivity<MicroVideoActivity>("url" to today?.meditationVideo?.videoUrl,"title" to today?.meditationVideo?.title) |
| | | }else if (MainActivity.voice?.id == today?.meditationId){ |
| | | }else if (ThinkAudioService.voice?.id == today?.meditationId){ |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.PAUSE_OR_RESUME_THINK)) |
| | | if (MainActivity.playing) //播放中 |
| | | if (ThinkAudioService.playing) //播放中 |
| | | iv_play_today.setImageResource(R.mipmap.player_pause) |
| | | else |
| | | iv_play_today.setImageResource(R.mipmap.play) |
| | |
| | | }else if (data?.chargeType == 3&&data.isBuy != 1){ //单独收费且未购买 |
| | | startActivity<BuyVoiceActivity>("id" to data.id) |
| | | }else{ |
| | | if (MainActivity.playing) |
| | | if (ThinkAudioService.playing) |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.FINISH_THINK)) |
| | | MainActivity.voice = data |
| | | ThinkAudioService.voice = data |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.START_THINK)) |
| | | } |
| | | }){_,_-> |
| | |
| | | } |
| | | |
| | | fun refreshTodayPlayingState(){ |
| | | if (MainActivity.voice?.id == today?.meditationId&&MainActivity.playing) |
| | | if (ThinkAudioService.voice?.id == today?.meditationId&&ThinkAudioService.playing) |
| | | iv_play_today.setImageResource(R.mipmap.player_pause) |
| | | else |
| | | iv_play_today.setImageResource(R.mipmap.play) |