| | |
| | | import com.okgoincar.base.BaseViewHolder |
| | | import com.okgoincar.base.MyApplication |
| | | import com.okgoincar.bean.OrderListBean |
| | | import com.okgoincar.slab.SlabMainActivity |
| | | import com.okgoincar.slab.SlabTripActivity |
| | | import com.okgoincar.slab.util.DialogUtil |
| | | import kotlinx.android.synthetic.main.item_main_list_slab.view.* |
| | | import kotlinx.android.synthetic.main.item_main_list_slab.view.tv_end |
| | | import kotlinx.android.synthetic.main.item_main_list_slab.view.tv_start |
| | | import kotlinx.android.synthetic.main.item_main_list_slab.view.tv_time |
| | | import kotlinx.android.synthetic.main.order_detail.view.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class SlabMainAdapter : BaseRvAdapter<OrderListBean.DataBean>() { |
| | |
| | | it.itemView.clickDelay { |
| | | when(item.state){ |
| | | 2,3,4,5 -> { |
| | | context.startActivity<SlabTripActivity>("orderId" to item.id.toString() , "orderType" to item.type.toString()) |
| | | context.startActivity<SlabTripActivity>( |
| | | "orderId" to item.id.toString(), |
| | | "orderType" to item.type.toString() |
| | | ) |
| | | } |
| | | 6 ->{ |
| | | context.startActivity<SlabFillOutActivity>("orderId" to item.id.toString() , "orderType" to item.type.toString()) |
| | | context.startActivity<SlabFillOutActivity>( |
| | | "orderId" to item.id.toString(), |
| | | "orderType" to item.type.toString() |
| | | ) |
| | | } |
| | | 7->{ |
| | | context.startActivity<SlabOrderOverActivity>("orderId" to item.id.toString() , "orderType" to item.type.toString()) |
| | | context.startActivity<SlabOrderOverActivity>( |
| | | "orderId" to item.id.toString(), |
| | | "orderType" to item.type.toString() |
| | | ) |
| | | } |
| | | 8,9,10 -> { |
| | | context.startActivity<SlabOrderOverActivity>("orderId" to item.id.toString() , "orderType" to item.type.toString()) |
| | | 8, 9, 10,11 -> { |
| | | var pop = DialogUtil.getPopupwindow(context, R.layout.order_detail) |
| | | var view = pop.contentView |
| | | view.iv_close.clickDelay { |
| | | pop.dismiss() |
| | | } |
| | | view.tv_time.text = item.time |
| | | view.tv_start.text = item.startAddress |
| | | view.tv_end.text = item.endAddress |
| | | view.tv_money.text = item.redMoney.toString() + "元红包" |
| | | view.tv_money_num.text = item.orderMoney.toString() + "元" |
| | | setBlack(getNowTimeBlack(), view) |
| | | pop.showCenter((context as SlabMainActivity).window.decorView) |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private fun setBlack(nowTimeBlack: Boolean, view: View?) { |
| | | view?.let { |
| | | if (nowTimeBlack){ //黑 |
| | | view.rl_back.setBackgroundResource(R.drawable.bg_slab_gray_4_gray) |
| | | view.tv_title.textColor(context,R.color.slab_yellow_zhong) |
| | | view.tv_money_num.textColor(context,R.color.slab_yellow_zhong) |
| | | view.iv_close.setImageResource(R.mipmap.close_write_c) |
| | | view.tv_time.textColor(context,R.color.write) |
| | | view.tv_start.textColor(context,R.color.write) |
| | | view.tv_end.textColor(context,R.color.write) |
| | | view.tv_money.textColor(context,R.color.write) |
| | | view.tv_money_order.textColor(context,R.color.write) |
| | | }else{ |
| | | view.rl_back.setBackgroundResource(R.drawable.bg_white_6) |
| | | view.tv_title.textColor(context,R.color.sdsdf) |
| | | view.tv_money_num.textColor(context,R.color.sdsdf) |
| | | view.iv_close.setImageResource(R.mipmap.close_big) |
| | | view.tv_time.textColor(context,R.color.black) |
| | | view.tv_start.textColor(context,R.color.black) |
| | | view.tv_end.textColor(context,R.color.black) |
| | | view.tv_money.textColor(context,R.color.black) |
| | | view.tv_money_order.textColor(context,R.color.black) |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |