package com.fangxinxing.xxfxx.ui.mine import android.view.View import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.fangxinxing.xxfxx.utils.textColor import com.fangxinxing.xxfxx.R import com.fangxinxing.xxfxx.base.BaseRecyclerActivity import com.fangxinxing.xxfxx.base.BaseRvAdapter import com.fangxinxing.xxfxx.bean.LineClassBean import com.fangxinxing.xxfxx.netUtls.Api import com.fangxinxing.xxfxx.netUtls.createView import com.fangxinxing.xxfxx.netUtls.getMapByAny import com.fangxinxing.xxfxx.ui.adapter.LineClassAdapter import com.fangxinxing.xxfxx.ui.adapter.TimeSelectMineAdapter import com.fangxinxing.xxfxx.utils.DateUtil import kotlinx.android.synthetic.main.view_line_class.view.* import java.util.* /** * @ClassName LineClassManagerDetActivity * @Description 线路班次管理详情 * @Author Administrator * @Date 2020/10/22 11:38 * @Version 1.0 */ class LineClassManagerDetActivity:BaseRecyclerActivity() { val lineId by lazy { intent.getStringExtra("lineId") } var time = DateUtil.getTime(DateUtil.TYPE1,Calendar.getInstance().timeInMillis) val lineClassAdapter by lazy { LineClassAdapter() } override fun getDatas(t: String?): List { return gson.fromJson(t,LineClassBean::class.java).data } override fun pathUrl(): String? { return Api.queryLineShiftInfo } override fun mapObject(): HashMap? { var map = getMapByAny() map["lineId"] = lineId map["time"] = time return map } override fun getAdapter(): BaseRvAdapter? { return lineClassAdapter } override fun getlayoutManager(): RecyclerView.LayoutManager? { return LinearLayoutManager(this) } override fun setOnItemClickListener(view: View?, position: Int) { } var list = mutableListOf() override fun initView() { time = intent.getStringExtra("time") setTitleText("线路班次管理") var view = createView(R.layout.view_line_class,this) addTopView(view) view.recycler_view_top.layoutManager = LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false) view.recycler_view_top.adapter = timeSelectAdapter timeSelectAdapter.data.addAll(timeSelectAdapter.getAllDate(Calendar.getInstance())) timeSelectAdapter.setOnItemClickListener { view, position -> timeSelectAdapter.selectPosition = position timeSelectAdapter.notifyDataSetChanged() lineClassAdapter.calendar = timeSelectAdapter.data[position] time = DateUtil.getTime(DateUtil.TYPE1,timeSelectAdapter.data[position].timeInMillis) callRefresh() } } val timeSelectAdapter by lazy { TimeSelectMineAdapter() } fun allGray(view: View,type:Int){ view.tv_now_day.textColor(this,R.color.select_gray_line) view.tv_more_day.textColor(this,R.color.select_gray_line) view.tv_next_day.textColor(this,R.color.select_gray_line) if (type == 0){ view.tv_now_day.textColor(this,R.color.main_item_orange) } if (type == 1){ view.tv_next_day.textColor(this,R.color.main_item_orange) } if (type == 2){ view.tv_more_day.textColor(this,R.color.main_item_orange) } } override fun setOnclick() { } }