| | |
| | | return R.layout.item_hall |
| | | } |
| | | |
| | | private val audioRecoderUtils by lazy { AudioRecoderUtils() } |
| | | |
| | | override fun onBindItem(holder: BaseViewHolder?, view: View?, item: OrderHall) { |
| | | holder?.let { |
| | |
| | | ) |
| | | it.itemView.tv_play.visible() |
| | | it.itemView.tv_play.setOnClickListener { |
| | | val intent = Intent(context, VoiceOrderFragment::class.java) |
| | | intent.putExtra("audio", item.audioLinkUrl) |
| | | intent.putExtra("orderId", item.id) |
| | | intent.putExtra("orderType", item.type.toString()) |
| | | intent.putExtra("time", item.audioTime.toInt()+3) |
| | | intent.putExtra("type", 1) |
| | | intent.putExtra("needPlayRing", false) |
| | | intent.putExtra("fromList", true) |
| | | context.startActivity(intent) |
| | | AudioRecoderUtils.getInstance().startplayMusic(context, item.audioLinkUrl) |
| | | // val intent = Intent(context, VoiceOrderFragment::class.java) |
| | | // intent.putExtra("audio", item.audioLinkUrl) |
| | | // intent.putExtra("orderId", item.id) |
| | | // intent.putExtra("orderType", item.type.toString()) |
| | | // intent.putExtra("time", item.audioTime.toInt()+3) |
| | | // intent.putExtra("type", 1) |
| | | // intent.putExtra("needPlayRing", false) |
| | | // intent.putExtra("fromList", true) |
| | | // context.startActivity(intent) |
| | | } |
| | | } |
| | | it.itemView.tv_action.setOnClickListener { |
| | | getOrder(item.id, item.type, context, !item.audioLinkUrl.isNullOrEmpty()) |
| | | getOrder(item,item.id, item.type, context, !item.audioLinkUrl.isNullOrEmpty()) |
| | | } |
| | | val l = TimeUtils.parseTimeMillisecond(item.endTime) - System.currentTimeMillis() |
| | | it.itemView.tv_timer.text = if (l>0) "%02d:%02d".format( |
| | |
| | | } |
| | | } |
| | | |
| | | private fun getOrder(orderId: String, orderType: Int, context: Context, isCall: Boolean) { |
| | | private fun getOrder( item: OrderHall,orderId: String, orderType: Int, context: Context, isCall: Boolean) { |
| | | var map = getMapByAny() |
| | | map["orderId"] = orderId |
| | | map["orderType"] = orderType |
| | |
| | | "orderId" to orderId, |
| | | "orderType" to orderType.toString() |
| | | ) |
| | | audioRecoderUtils.stopPlayMusic() |
| | | AudioRecoderUtils.getInstance().stopPlayMusic() |
| | | }else{ |
| | | when (orderType) { |
| | | 2 -> { |
| | |
| | | } |
| | | } |
| | | } |
| | | (context as OrderHallActivity).finish() |
| | | data.remove(item) |
| | | notifyDataSetChanged() |
| | | // (context as OrderHallActivity).finish() |
| | | } |
| | | } |
| | | |