app/src/main/AndroidManifest.xml
@@ -92,6 +92,9 @@ <action android:name="wisdom.intent.action.ledLight" /> <!-- //计价器--> <action android:name="wisdom.intent.action.priceDevice" /> <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> <action android:name="android.net.conn.CONNECTIVITY_SUCCESS" /> <action android:name="android.net.conn.CONNECTIVITY_FAILURE" /> </intent-filter> </receiver> app/src/main/java/com/okgoincar/base/AMapKit.kt
@@ -33,6 +33,7 @@ //设置为高精度定位模式 // mLocationOption.isNeedAddress = true mLocationOption.interval = 5000 // mLocationOption.locationMode = AMapLocationClientOption.AMapLocationMode.Hight_Accuracy mLocationOption.locationMode = AMapLocationClientOption.AMapLocationMode.Device_Sensors //设置定位参数 mlocationClient.setLocationOption(mLocationOption) app/src/main/java/com/okgoincar/base/BaseEvent.java
@@ -35,6 +35,9 @@ public static final int UP_TRIP = 11025; //收到重车指令 刷新出行页面 public static final int SURE_MONEY= 11026; //收到价格 结束行程 public static final int ERROR_INFO= 11027; //上传了错误订单 private String msg; private int code; private int type; app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt
@@ -66,6 +66,7 @@ callNet(context!!,Api.loginByIdentification,map){ toast("登录成功") var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) CacheKey.putKeyStr("identification",driverCertificate!!) CacheKey.putKeyStr("appid", bean.data.appid) CacheKey.putKeyStr("token", bean.data.token) CacheKey.putKeyStr("userId", bean.data.id.toString()) app/src/main/java/com/okgoincar/base/MoneyBroadCastReceiver.kt
@@ -12,6 +12,7 @@ import com.okgoincar.netUtls.Api import com.okgoincar.netUtls.callNet import com.okgoincar.netUtls.getMapByAny import com.okgoincar.slab.util.DialogUtil import com.okgoincar.utils.Cache.CacheKey import io.netty.util.NetUtil import org.greenrobot.eventbus.EventBus @@ -38,104 +39,133 @@ var mileage = intent.getDoubleExtra("mileage", 0.0) //里程,单位为km callOver(contexts!!, price) } ConnectivityManager.CONNECTIVITY_ACTION -> { if (NetUtils.isNetworkConnected(MyApplication.getInstance())){ callErrorOrder() "android.net.conn.CONNECTIVITY_SUCCESS", "android.net.conn.CONNECTIVITY_FAILURE", "android.net.conn.CONNECTIVITY_CHANGE" -> { toast("收到网络变化") if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { callErrorOrder(contexts!!) } } } } } catch (e: Exception) { } } private fun callStatue(contexts: Context, i: Int) { if (MyApplication.currentOrderId.isEmpty()) { toast("没有进行中的订单,无法开始") return } if (CacheKey.getLocalOrderBean() == null) { //没有数据 代表没有异常订单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { //有网络直接处理 callStartOrder(contexts, i) } else { //无网络 存本地 var bean = LocalOrderBean() bean.orderId = MyApplication.currentOrderId bean.startTime = System.currentTimeMillis() CacheKey.saveLocalOrderBean(bean) companion object { fun callStatue(contexts: Context, i: Int) { if (MyApplication.currentOrderId.isEmpty()) { toast("没有进行中的订单,无法开始") return } } else { //有数据存着,并且有网络上传异常订单 如果没有网络就不处理,这个肯定是线下的单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())){ callErrorOrder() } } } private fun callOver(contexts: Context, travelFee: Double) { if (MyApplication.currentOrderId.isEmpty()) { toast("没有进行中的订单,无法结束") return } if (CacheKey.getLocalOrderBean() == null) { //没有数据 代表没有异常订单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { //有网络直接处理 callEndOrder(contexts, travelFee) } else { //无网络 存本地 var bean = LocalOrderBean() bean.orderId = MyApplication.currentOrderId bean.endTime = System.currentTimeMillis() CacheKey.saveLocalOrderBean(bean) } } else { //有数据存着,并且有网络上传异常订单 如果没有网络就不处理,这个肯定是线下的单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())){ callErrorOrder() }else{ val bean = CacheKey.getLocalOrderBean() bean?.let { bean.endTime = System.currentTimeMillis() bean.money = travelFee if (CacheKey.getLocalOrderBean() == null) { //没有数据 代表没有异常订单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { //有网络直接处理 callStartOrder(contexts, i) } else { //无网络 存本地 var bean = LocalOrderBean() bean.orderId = MyApplication.currentOrderId bean.startTime = System.currentTimeMillis() CacheKey.saveLocalOrderBean(bean) } } else { //有数据存着,并且有网络上传异常订单 如果没有网络就不处理,这个肯定是线下的单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { callErrorOrder(contexts) } } } } /*** * 上传异常订单 */ private fun callErrorOrder() { } fun callStartOrder(contexts: Context, i: Int) { var map = getMapByAny() map["orderId"] = MyApplication.currentOrderId map["orderType"] = MyApplication.currentOrderType map["state"] = i map["lat"] = MyApplication.getLocation().latitude map["lon"] = MyApplication.getLocation().longitude callNet(contexts, Api.process, map) { EventBus.getDefault().post(BaseEvent(BaseEvent.UP_TRIP)) fun callOver(contexts: Context, travelFee: Double) { if (MyApplication.currentOrderId.isEmpty()) { toast("没有进行中的订单,无法结束") return } if (CacheKey.getLocalOrderBean() == null) { //没有数据 代表没有异常订单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { //有网络直接处理 callEndOrder(contexts, travelFee) } else { //无网络 存本地 var bean = LocalOrderBean() bean.orderId = MyApplication.currentOrderId bean.endTime = System.currentTimeMillis() CacheKey.saveLocalOrderBean(bean) } } else { //有数据存着,并且有网络上传异常订单 如果没有网络就不处理,这个肯定是线下的单 if (NetUtils.isNetworkConnected(MyApplication.getInstance())) { var bean = CacheKey.getLocalOrderBean() bean?.let { if (bean.money <= 0.0) { bean.money = travelFee bean.orderId = MyApplication.currentOrderId bean.endTime = System.currentTimeMillis() CacheKey.saveLocalOrderBean(bean) } callErrorOrder(contexts) } } else { val bean = CacheKey.getLocalOrderBean() bean?.let { if (bean.money >= 0.0) { return@callOver } bean.endTime = System.currentTimeMillis() bean.money = travelFee bean.orderId = MyApplication.currentOrderId CacheKey.saveLocalOrderBean(bean) } } } } } /*** * 上传异常订单 */ private fun callErrorOrder(contexts: Context) { var bean = CacheKey.getLocalOrderBean() bean?.let { if (bean.money <= 0.0) { return@let } val map = getMapByAny() map["orderId"] = bean.orderId map["orderType"] = bean.orderType map["type"] = "1" map["travelFee"] = bean.money callNet(contexts, "api/order/confirmFees$", map) { toast("上传异常订单成功") EventBus.getDefault().post(BaseEvent(BaseEvent.ERROR_INFO)) } } fun callEndOrder(contexts: Context, travelFee: Double) { var map = getMapByAny() map["orderId"] = MyApplication.currentOrderId map["orderType"] = MyApplication.currentOrderType map["travelFee"] = travelFee map["lat"] = MyApplication.getLocation().latitude map["lon"] = MyApplication.getLocation().longitude map["type"] = 1 callNet(contexts, Api.confirmFees_, map) { EventBus.getDefault().post(BaseEvent(BaseEvent.SURE_MONEY)) } private fun callStartOrder(contexts: Context, i: Int) { var map = getMapByAny() map["orderId"] = MyApplication.currentOrderId map["orderType"] = MyApplication.currentOrderType map["state"] = i map["lat"] = MyApplication.getLocation().latitude map["lon"] = MyApplication.getLocation().longitude callNet(contexts, Api.process, map) { EventBus.getDefault().post(BaseEvent(BaseEvent.UP_TRIP)) } } private fun callEndOrder(contexts: Context, travelFee: Double) { var map = getMapByAny() map["orderId"] = MyApplication.currentOrderId map["orderType"] = MyApplication.currentOrderType map["travelFee"] = travelFee map["lat"] = MyApplication.getLocation().latitude map["lon"] = MyApplication.getLocation().longitude map["type"] = 1 callNet(contexts, Api.confirmFees_, map) { EventBus.getDefault().post(BaseEvent(BaseEvent.SURE_MONEY)) } } } } app/src/main/java/com/okgoincar/bean/LocalOrderBean.java
@@ -6,7 +6,7 @@ private Long endTime; private String orderId; private String orderType = "2"; private double money; private double money = 0.0; public Long getStartTime() { return startTime; app/src/main/java/com/okgoincar/netUtls/Api.java
@@ -62,6 +62,7 @@ public static String confirmFees = "api/order/confirmFees"; //api/order/confirmFees 司机确认费用 public static String orderStateSocket = "api/netty/orderStateSocket"; ///api/netty/orderStateSocket 主动调用获取订单状态 public static String confirmFees_ = "api/order/confirmFees_"; ///api/order/confirmFees_ 司机确认费用(车载端) public static String confirmFees$ = "api/order/confirmFees$"; ///api/order/confirmFees$ 司机确认费用(车载端)不管之前数据状态直接修改到待支付(流程断网情况的处理流程) /*** * 消息 app/src/main/java/com/okgoincar/slab/SlabLoginActivity.kt
@@ -38,6 +38,7 @@ callNet(true, Api.loginByJobNumber, map) { toast("登录成功") var bean = gson.fromJson<LoginBean>(it, LoginBean::class.java) CacheKey.putKeyStr("jobNum",et_number.getContent().trim()) CacheKey.putKeyStr("appid", bean.data.appid) CacheKey.putKeyStr("token", bean.data.token) CacheKey.putKeyStr("userId", bean.data.id.toString()) app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt
@@ -10,10 +10,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import cn.sinata.rxnetty.NettyClient import cn.sinata.xldutils.utils.Utils import cn.sinata.xldutils.utils.clickDelay import cn.sinata.xldutils.utils.getNowTimeBlack import cn.sinata.xldutils.utils.textColor import cn.sinata.xldutils.utils.* import com.amap.api.location.AMapLocation import com.amap.api.location.AMapLocationListener import com.okgoincar.netUtls.callNet @@ -33,10 +30,13 @@ import com.okgoincar.utils.DateUtil import com.okgoincar.utils.download.DownloadUtil import com.okgoincar.utils.glide.GlideUtil import kotlinx.android.synthetic.main.slab_activity_login.* import kotlinx.android.synthetic.main.slab_activity_main.* import kotlinx.android.synthetic.main.slab_activity_main.tv_name import org.greenrobot.eventbus.EventBus import org.jetbrains.anko.startActivity import org.jetbrains.anko.toast import java.lang.Exception class SlabMainActivity : MySlabBaseActivity(), AMapLocationListener { @@ -91,14 +91,17 @@ setTitleText("OK出行司机") showHeader(false) showTitle(false) addFragment(mainFragment, R.id.rl_container) AMapKit.initLocation(this, this) initCall() NettyClient.getInstance().startService() callPersion() callLogin { view_mode.isSelected = !getNowTimeBlack() addFragment(mainFragment, R.id.rl_container) AMapKit.initLocation(this, this) initCall() NettyClient.getInstance().startService() callPersion() // showOrder("2221", "2", 100, 2) callVersion() view_mode.isSelected = !getNowTimeBlack() callVersion() } //重重新登录 用来上线 } @@ -112,7 +115,11 @@ override fun onResume() { super.onResume() mainFragment.refresh() try { mainFragment.refresh() }catch (e:Exception){ } } private fun showUI(data: UserInfoBean?) { @@ -221,13 +228,13 @@ view_mode.clickDelay { view_mode.isSelected = !view_mode.isSelected if (getNowTimeBlack()){ CacheKey.putKeyStr("date_mode",System.currentTimeMillis().toString()) CacheKey.putKeyStr("mode_now_time","1")//记录为点击切换的颜色 1 白色 2 黑色 if (getNowTimeBlack()) { CacheKey.putKeyStr("date_mode", System.currentTimeMillis().toString()) CacheKey.putKeyStr("mode_now_time", "1")//记录为点击切换的颜色 1 白色 2 黑色 setBlackMode(false) }else{ CacheKey.putKeyStr("date_mode",System.currentTimeMillis().toString()) CacheKey.putKeyStr("mode_now_time","2") } else { CacheKey.putKeyStr("date_mode", System.currentTimeMillis().toString()) CacheKey.putKeyStr("mode_now_time", "2") setBlackMode(true) } @@ -256,8 +263,6 @@ } private var mBackAppTime: Long = 0 @@ -280,6 +285,13 @@ BaseEvent.REQUEST_CAR_INFO -> { Handler(Looper.getMainLooper()).post { toast("收到显示屏信息") } } BaseEvent.ERROR_INFO -> { try { mainFragment.refresh() }catch (e:Exception){ } } } @@ -307,12 +319,18 @@ var bean = gson.fromJson<VersionBean>(it, VersionBean::class.java) if (bean.data.version != "" && bean.data.version != Utils.getAppVersion(this)) { if (bean.data.mandatory == 0) { var pop = DialogUtil.getSlabDelAndSurePopWindow(this, "确定" ,"取消","有新版本是否更新", {}) { DownloadUtil(this).downloadAPK(bean.data.url, "ok出行车载端") } var pop = DialogUtil.getSlabDelAndSurePopWindow(this, "确定", "取消", "有新版本是否更新", {}) { DownloadUtil(this).downloadAPK(bean.data.url, "ok出行车载端") } pop.showCenter(window.decorView) } else { var pop = DialogUtil.getSlabDelAndSurePopWindow(this,"确定" ,"取消","版本已过时,是否强制升级?", {}) { var pop = DialogUtil.getSlabDelAndSurePopWindow( this, "确定", "取消", "版本已过时,是否强制升级?", {}) { DownloadUtil(this).downloadAPK(bean.data.url, "ok出行车载端") toast("后台开始下载,请等待") } @@ -324,4 +342,39 @@ } } } private fun callLogin(ok: () -> Unit) { var jobNum = CacheKey.getKeyStr("jobNum") var identification = CacheKey.getKeyStr("identification") if (jobNum.isNotEmpty()) { var map = getMapByAny() map["jobNum"] = jobNum callNet(true, Api.loginByJobNumber, map) { var bean = gson.fromJson<LoginBean>(it, LoginBean::class.java) CacheKey.putKeyStr("jobNum", jobNum) CacheKey.putKeyStr("appid", bean.data.appid) CacheKey.putKeyStr("token", bean.data.token) CacheKey.putKeyStr("userId", bean.data.id.toString()) CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) ok() } } else if (identification.isNotEmpty()) { var map = getMapByAny() map["identification"] = identification callNet(true, Api.loginByIdentification, map) { var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) CacheKey.putKeyStr("identification", identification) CacheKey.putKeyStr("appid", bean.data.appid) CacheKey.putKeyStr("token", bean.data.token) CacheKey.putKeyStr("userId", bean.data.id.toString()) CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) ok() } } else { ok() } } } app/src/main/java/com/okgoincar/slab/SlabOrderOverActivity.kt
@@ -1,6 +1,7 @@ package com.okgoincar.slab import android.os.CountDownTimer import android.os.Handler import android.os.Looper import cn.sinata.xldutils.utils.* import com.okgoincar.netUtls.callNet @@ -96,17 +97,14 @@ callNet(this, Api.queryOrderInfo, map) { orderBean = gson.fromJson(it, OrderBean::class.java) showUi(orderBean) time = timeOver (5000){ tv_title_slab.text = "已完成($it)" if (it == 0){ onBackPressed() } } addSocketLisener() } } private fun showUi(orderBean: OrderBean?) { orderBean?.let { tv_title_slab.text = "待支付" tv_name.text = it.data.nickName tv_car_num.text = it.data.historyNum.toString() + "次乘车" tv_phone.clickDelay { @@ -147,11 +145,21 @@ MyApplication.addOrderView(object : MyApplication.OrderStatueView { override fun orderInfo(data: OrderSimpleData?) { data?.let { if (it.status == 8) { android.os.Handler(Looper.getMainLooper()).post { orderBean.data.orderState = 8 showUi(orderBean) if (it.status == 8||it.status == 7) { tv_pay_result_money.textColor(this@SlabOrderOverActivity,R.color.slab_green_over) Handler(Looper.getMainLooper()).post { time = timeOver (5000){ tv_title_slab.text = "已完成($it)" if (it == 0){ onBackPressed() } } } // android.os.Handler(Looper.getMainLooper()).post { // orderBean.data.orderState = 8 // showUi(orderBean) // } } } } app/src/main/java/com/okgoincar/slab/SlabTripActivity.kt
@@ -26,6 +26,7 @@ import com.okgoincar.base.AMapKit.initMap import com.okgoincar.base.AMapKit.moveCamera import com.okgoincar.base.BaseEvent import com.okgoincar.base.MoneyBroadCastReceiver import com.okgoincar.base.MyApplication import com.okgoincar.base.gpsnav.GPSNaviActivity import com.okgoincar.bean.OrderBean @@ -47,43 +48,18 @@ import org.greenrobot.eventbus.EventBus import org.jetbrains.anko.startActivity import org.jetbrains.anko.toast import java.lang.Exception import java.util.concurrent.TimeUnit class SlabTripActivity : MySlabBaseActivity() { private fun callOver(contexts: Context, travelFee:Double){ if (MyApplication.currentOrderId.isEmpty()){ cn.sinata.xldutils.utils.toast("没有进行中的订单,无法结束") return } var map = getMapByAny() map["orderId"] = MyApplication.currentOrderId map["orderType"] = MyApplication.currentOrderType map["travelFee"] = travelFee map["lat"] = MyApplication.getLocation().latitude map["lon"] = MyApplication.getLocation().longitude map["type"] = 1 callNet(contexts,Api.confirmFees_,map){ EventBus.getDefault().post(BaseEvent(BaseEvent.SURE_MONEY)) } private fun callOver(contexts: Context, travelFee: Double) { MoneyBroadCastReceiver.callOver(contexts, travelFee) } private fun callStatue(contexts: Context, i: Int) { if (MyApplication.currentOrderId.isEmpty()){ cn.sinata.xldutils.utils.toast("没有进行中的订单,无法开始") return } var map = getMapByAny() map["orderId"] = MyApplication.currentOrderId map["orderType"] = MyApplication.currentOrderType map["state"] = i map["lat"] = MyApplication.getLocation().latitude map["lon"] = MyApplication.getLocation().longitude callNet(contexts, Api.process, map) { EventBus.getDefault().post(BaseEvent(BaseEvent.UP_TRIP)) } MoneyBroadCastReceiver.callStatue(contexts, i) } @@ -121,47 +97,47 @@ ll_info_top.setBackgroundResource(R.drawable.bg_slab_main_8_black) rl_back.setBackgroundResource(R.color.black_191919) iv_back_slab.setImageResource(R.mipmap.icon_back_slab) tv_title_slab.textColor(this,R.color.write) tv_name.textColor(this,R.color.write) tv_car_num.textColor(this,R.color.write) tv_phone.textColor(this,R.color.write) tv_title_slab.textColor(this, R.color.write) tv_name.textColor(this, R.color.write) tv_car_num.textColor(this, R.color.write) tv_phone.textColor(this, R.color.write) tv_phone.setDrawableLeft(R.mipmap.icon_dial_slab) tv_time.textColor(this,R.color.write) tv_start_address.textColor(this,R.color.write) tv_end_address.textColor(this,R.color.write) tv_red_money.textColor(this,R.color.write) tv_end_address.textColor(this,R.color.write) tv_time.textColor(this, R.color.write) tv_start_address.textColor(this, R.color.write) tv_end_address.textColor(this, R.color.write) tv_red_money.textColor(this, R.color.write) tv_end_address.textColor(this, R.color.write) tv_code_num.textColor(this,R.color.write) tv_name_car_man.textColor(this,R.color.write) tv_car_num_var.textColor(this,R.color.write) tv_star_num.textColor(this,R.color.write) tv_company.textColor(this,R.color.write) tv_time_send_prove.textColor(this,R.color.write) tv_current_time.textColor(this,R.color.write) tv_code_num.textColor(this, R.color.write) tv_name_car_man.textColor(this, R.color.write) tv_car_num_var.textColor(this, R.color.write) tv_star_num.textColor(this, R.color.write) tv_company.textColor(this, R.color.write) tv_time_send_prove.textColor(this, R.color.write) tv_current_time.textColor(this, R.color.write) } else { ll_order_top.setBackgroundResource(R.drawable.write_bottom_10) ll_info_top.setBackgroundResource(R.drawable.write_top_10) rl_back.setBackgroundResource(R.drawable.write) iv_back_slab.setImageResource(R.mipmap.icon_back_black) tv_title_slab.textColor(this,R.color.black) tv_name.textColor(this,R.color.black) tv_car_num.textColor(this,R.color.black) tv_phone.textColor(this,R.color.black) tv_title_slab.textColor(this, R.color.black) tv_name.textColor(this, R.color.black) tv_car_num.textColor(this, R.color.black) tv_phone.textColor(this, R.color.black) tv_phone.setDrawableNull() tv_time.textColor(this,R.color.black) tv_start_address.textColor(this,R.color.black) tv_end_address.textColor(this,R.color.black) tv_red_money.textColor(this,R.color.black) tv_end_address.textColor(this,R.color.black) tv_time.textColor(this, R.color.black) tv_start_address.textColor(this, R.color.black) tv_end_address.textColor(this, R.color.black) tv_red_money.textColor(this, R.color.black) tv_end_address.textColor(this, R.color.black) tv_code_num.textColor(this,R.color.black) tv_name_car_man.textColor(this,R.color.black) tv_car_num_var.textColor(this,R.color.black) tv_star_num.textColor(this,R.color.black) tv_company.textColor(this,R.color.black) tv_time_send_prove.textColor(this,R.color.black) tv_current_time.textColor(this,R.color.black) tv_code_num.textColor(this, R.color.black) tv_name_car_man.textColor(this, R.color.black) tv_car_num_var.textColor(this, R.color.black) tv_star_num.textColor(this, R.color.black) tv_company.textColor(this, R.color.black) tv_time_send_prove.textColor(this, R.color.black) tv_current_time.textColor(this, R.color.black) } } @@ -186,6 +162,7 @@ if (it.status == 10 || it.status == 12) { Handler(Looper.getMainLooper()).post { toast("用户已取消订单") MyApplication.getTTsManager().setVideoText("用户已取消订单") MyApplication.currentOrderType = "" MyApplication.currentOrderId = "" finish() @@ -200,7 +177,7 @@ super.onBackPressed() } fun changeMode(){ fun changeMode() { if (tv_change.text == "收起") { rl_map.invisible() rl_persion_info.visible() @@ -217,18 +194,17 @@ } private fun onclick() { btn_start.clickDelay { callStatue(this,5) callStatue(this, 5) } btn_end.clickDelay { callOver(this,10.0) callOver(this, 10.0) } tv_change.clickDelay { changeMode() changeMode() } iv_move.setOnClickListener { orderBean.let { @@ -320,12 +296,12 @@ var payType = 1 //支付方式(1=OK平台收款,2=其他方式收款) if (getNowTimeBlack()) { pop.contentView.rl_back_pop.setBackgroundResource(R.drawable.bg_slab_main_8_black) pop.contentView.tv_cancel.textColor(this,R.color.white) pop.contentView.tv_ok.textColor(this,R.color.white) pop.contentView.tv_cancel.textColor(this, R.color.white) pop.contentView.tv_ok.textColor(this, R.color.white) } else { pop.contentView.rl_back_pop.setBackgroundResource(R.drawable.bg_white_round_2) pop.contentView.tv_cancel.textColor(this,R.color.black) pop.contentView.tv_ok.textColor(this,R.color.black) pop.contentView.tv_cancel.textColor(this, R.color.black) pop.contentView.tv_ok.textColor(this, R.color.black) } pop.showDown(window.decorView) pop.contentView.tv_cancel.setOnClickListener { @@ -360,10 +336,10 @@ }) if (getNowTimeBlack()) { pop.contentView.rl_top_slab.setBackgroundResource(R.drawable.bg_green_4_black) pop.contentView.tv_view_two_base.textColor(this,R.color.white) pop.contentView.tv_view_two_base.textColor(this, R.color.white) } else { pop.contentView.rl_top_slab.setBackgroundResource(R.drawable.bg_white_round_2) pop.contentView.tv_view_two_base.textColor(this,R.color.black) pop.contentView.tv_view_two_base.textColor(this, R.color.black) } pop.showCenter(window.decorView) } @@ -603,11 +579,11 @@ } } fun clickBroad(){ var intent = Intent(); fun clickBroad() { var intent = Intent(); intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK; intent.action = "wisdom.intent.action.topLight"; intent.putExtra("state",0) intent.putExtra("state", 0) sendBroadcast(intent); } @@ -692,14 +668,20 @@ MyApplication.currentOrderType = "" finish() } BaseEvent.UP_TRIP ->{ BaseEvent.UP_TRIP -> { callOrder() } BaseEvent.SURE_MONEY -> { startActivity<SlabOrderOverActivity>("orderId" to orderBean.data.orderId.toString() , "orderType" to "2") startActivity<SlabOrderOverActivity>( "orderId" to orderBean.data.orderId.toString(), "orderType" to "2" ) finish() } BaseEvent.ERROR_INFO -> { onBackPressed() } } } } app/src/main/res/drawable/mode_write_and_black.xml
@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@mipmap/close_big" android:state_selected="true" /> <item android:drawable="@mipmap/close_write_c" android:state_selected="false" /> <item android:drawable="@mipmap/mode_black_config" android:state_selected="true" /> <item android:drawable="@mipmap/mode_write_config" android:state_selected="false" /> </selector> app/src/main/res/layout/activity_trip_slab.xml
@@ -16,14 +16,12 @@ android:id="@+id/btn_start" android:layout_width="wrap_content" android:layout_marginStart="150dp" android:visibility="gone" android:text="开始行程" android:layout_height="match_parent"/> <Button android:id="@+id/btn_end" android:layout_width="wrap_content" android:visibility="gone" android:layout_marginStart="300dp" android:text="结束行程" android:layout_height="match_parent"/> app/src/main/res/mipmap-xxhdpi/mode_black_config.png
app/src/main/res/mipmap-xxhdpi/mode_write_config.png
app/src/main/res/values/colors.xml
@@ -89,6 +89,7 @@ <color name="yellow_FFA72D">#FFA72D</color> <color name="slab_yellow_zhong">#ED5F08</color> <color name="slab_green_over">#7FC015</color> <color name="black_mode_383838">#383838</color> <color name="black_191919">#191919</color>