| | |
| | | package com.okgoincar.slab |
| | | |
| | | import android.content.Intent |
| | | import android.content.IntentFilter |
| | | import android.os.Bundle |
| | | import android.os.Handler |
| | | import android.os.Looper |
| | | import android.widget.Toast |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import androidx.recyclerview.widget.RecyclerView |
| | |
| | | override fun setContentView() { |
| | | setContentView(R.layout.slab_activity_main) |
| | | } |
| | | |
| | | |
| | | override fun setBlackMode(b: Boolean?) { |
| | | super.setBlackMode(b) |
| | |
| | | mainFragment.autoRefresh() |
| | | } |
| | | |
| | | tv_name.clickDelay { |
| | | |
| | | } |
| | | |
| | | tv_car_num.clickDelay { |
| | | |
| | | } |
| | | |
| | | tv_star_num.clickDelay { |
| | | |
| | | } |
| | | |
| | | ll_task.clickDelay { |
| | | startActivity<SlabMineEventActivity>() |
| | |
| | | private |
| | | var mBackAppTime: Long = 0 |
| | | |
| | | |
| | | override fun onBackPressed() { |
| | | if (System.currentTimeMillis() - mBackAppTime > 2000) { |
| | | Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT) |
| | |
| | | BaseEvent.START_CAR -> { |
| | | initCall() |
| | | } |
| | | BaseEvent.REQUEST_CAR_INFO -> { |
| | | Handler(Looper.getMainLooper()).post { |
| | | toast("收到显示屏信息") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onLocationChanged(p0: AMapLocation?) { |
| | | if (p0?.errorCode == 0) { |
| | | if (p0 == null){ |
| | | toast("高德位置是空的") |
| | | return |
| | | } |
| | | if (p0.errorCode == 0) { |
| | | toast("定位成功") |
| | | MyApplication.aMapLocation = p0 |
| | | CacheKey.putKeyStr("location", Gson().toJson(p0)) |
| | | }else{ |
| | | p0.let { |
| | | toast("定位失败"+it.errorCode.toString()) |
| | | } |
| | | } |
| | | } |
| | | } |