| | |
| | | @IBOutlet weak var view_container: UIView! |
| | | @IBOutlet weak var btn_play: UIButton! |
| | | @IBOutlet weak var btn_playing: UIButton! |
| | | |
| | | @IBOutlet weak var view_playHandle: UIView! |
| | | @IBOutlet weak var img_playing: UIImageView! |
| | | |
| | | private var model:Listen1SubModel! |
| | | private var playAtClouse:((IndexPath)->Void)? |
| | | var indexPath:IndexPath! |
| | |
| | | func setModel(_ model:Listen1SubModel,isplaying:Bool){ |
| | | self.model = model |
| | | self.btn_play.alpha = (isplaying ? 0:1) |
| | | self.btn_playing.alpha = (isplaying ? 0:1) |
| | | self.img_playing.alpha = (isplaying ? 1:0) |
| | | } |
| | | |
| | | func palyVoiceAt(_ clouse:@escaping(IndexPath)->Void){ |
| | | self.playAtClouse = clouse |
| | | } |
| | | |
| | | func canClick(_ state:Bool){ |
| | | btn_play.isEnabled = state |
| | | view_playHandle.backgroundColor = state == true ? UIColor(hexString: "#41A2EB") : .gray |
| | | } |
| | | |
| | | |
| | | @IBAction func playAction(_ sender: Any) { |
| | | VoicePlayer.share().playerAt(url: model.correct) |
| | | playAtClouse?(indexPath) |
| | | } |
| | | } |