class InTheVehicleFragment : FragmentCompat() { private val presenter = InTheVehiclePresenter(this)
companion object {
fun newInstance(): InTheVehicleFragment {
return InTheVehicleFragment()
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.fragment_in_the_vehicle, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
presenter.setup()
initView()
initListener()
}
private fun initView() {
//setInCarNum(25)
}
private fun initListener() {
container_add_car_plate_num.setOnClickListener { presenter.gotoAddCarPlate() }
container_car_open_order.setOnClickListener { presenter.gotoSerOrder("") }
}
fun httpError() {
rcv_today_cars.visibility = View.GONE
container_loading.visibility = View.GONE
container_fail.visibility = View.VISIBLE
container_fail.setOnClickListener({
presenter.fetchHistoryCars()
})
}
fun httpSuccess() {
rcv_today_cars.visibility = View.VISIBLE
container_fail.visibility = View.GONE
container_loading.visibility = View.GONE
}
fun setTodayRv(mAdapter: InTheVehicleAdapter) {
rcv_today_cars.setupVertical()
rcv_today_cars.adapter = mAdapter
}
fun nodify() {
rcv_today_cars.post {
rcv_today_cars.adapter.notifyDataSetChanged()
}
}
}
写的我好难受啊
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.