From 6bed01a5a2468cd389d4e483dbeb90347b701310 Mon Sep 17 00:00:00 2001 From: 唐浩 <15928265276@163.com> Date: 星期六, 18 七月 2020 15:31:42 +0800 Subject: [PATCH] commit --- app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git a/app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt b/app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt index d83bfbf..908a8a6 100644 --- a/app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt +++ b/app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt @@ -1,5 +1,10 @@ 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 @@ -40,6 +45,7 @@ override fun setContentView() { setContentView(R.layout.slab_activity_main) } + override fun setBlackMode(b: Boolean?) { super.setBlackMode(b) @@ -142,8 +148,17 @@ mainFragment.autoRefresh() } + tv_name.clickDelay { + } + tv_car_num.clickDelay { + + } + + tv_star_num.clickDelay { + + } ll_task.clickDelay { startActivity<SlabMineEventActivity>() @@ -174,6 +189,7 @@ private var mBackAppTime: Long = 0 + override fun onBackPressed() { if (System.currentTimeMillis() - mBackAppTime > 2000) { Toast.makeText(this, "再按一次退出程序", Toast.LENGTH_SHORT) @@ -190,13 +206,27 @@ 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()) + } } } } \ No newline at end of file -- Gitblit v1.7.1