Merge branch 'dev_robobus_network_weak_230323' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robobus_network_weak_230323
# Conflicts: # OCH/mogo-och-common-module/build.gradle # OCH/mogo-och-shuttle/src/main/java/com/mogo/och/bus/model/OrderModel.java
This commit is contained in:
@@ -8,6 +8,7 @@ package com.mogo.och.bus.bean;
|
||||
public class BusStationBean {
|
||||
private int siteId;
|
||||
private String name;
|
||||
private String nameKr;
|
||||
private int seq;
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
@@ -21,6 +22,10 @@ public class BusStationBean {
|
||||
private int status;
|
||||
private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠
|
||||
|
||||
public String getNameKr() {
|
||||
return nameKr;
|
||||
}
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
}
|
||||
|
||||
@@ -581,11 +581,12 @@ public class OrderModel {
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
|
||||
*/
|
||||
private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) {
|
||||
private void leaveStationSuccess(int leaveIndex, String leaveStation,
|
||||
String nextStation, String nextStationKr) {
|
||||
|
||||
onStartAutopilot(leaveIndex);
|
||||
|
||||
leaveTTSTips(nextStation);
|
||||
leaveTTSTips(nextStation,nextStationKr);
|
||||
|
||||
if (busRoutesResult != null) {
|
||||
boolean isLastStop = false;
|
||||
@@ -657,6 +658,7 @@ public class OrderModel {
|
||||
}
|
||||
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
String arriveStation = stationList.get(arrivedStationIndex).getName();
|
||||
String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr();
|
||||
String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
|
||||
|
||||
@@ -672,7 +674,8 @@ public class OrderModel {
|
||||
queryBusRoutes();
|
||||
isArrivedStation = true;
|
||||
isGoingToNextStation = false;
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation);
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName,
|
||||
arriveStation,arriveStationKr);
|
||||
}
|
||||
//5s轮询核销乘客
|
||||
// startOrStopQueryPassengerWriteOff(true);
|
||||
@@ -701,7 +704,8 @@ public class OrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) {
|
||||
private void arriveStationSuccess(int arrivedStationIndex, String departureStopName,
|
||||
String arriveStation, String arriveStationKr) {
|
||||
if (busRoutesResult != null) {
|
||||
boolean isLastStop = false;
|
||||
if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) {
|
||||
@@ -714,7 +718,7 @@ public class OrderModel {
|
||||
, arriveStation
|
||||
, isLastStop);
|
||||
}
|
||||
VoiceManager.INSTANCE.arrivedStation(arriveStation);
|
||||
VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -723,11 +727,14 @@ public class OrderModel {
|
||||
public void leaveStation() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
|
||||
String nextStationName = "";
|
||||
String nextStationNameKr = "";
|
||||
if (backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName();
|
||||
nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr();
|
||||
}
|
||||
final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
String finalNextStationName = nextStationName;
|
||||
String finalNextStationNameKr = nextStationNameKr;
|
||||
OrderServiceManager.leaveStation(mContext,
|
||||
stationList.get(backgroundCurrentStationIndex).getSeq(),
|
||||
stationList.get(backgroundCurrentStationIndex).getSiteId(),
|
||||
@@ -740,7 +747,8 @@ public class OrderModel {
|
||||
//需要更改当前站和下一站的状态 然后渲染
|
||||
//startOrStopQueryPassengerWriteOff(false);
|
||||
queryBusRoutes();
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName);
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName,
|
||||
finalNextStationName,finalNextStationNameKr);
|
||||
}
|
||||
|
||||
|
||||
@@ -765,12 +773,12 @@ public class OrderModel {
|
||||
}
|
||||
|
||||
//车站10s后播报
|
||||
private void leaveTTSTips(String nextStation) {
|
||||
private void leaveTTSTips(String nextStation,String nextStationKr) {
|
||||
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
VoiceManager.INSTANCE.leaveStation(nextStation);
|
||||
VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr);
|
||||
}
|
||||
},DELAY_10S);
|
||||
}
|
||||
|
||||
@@ -14,8 +14,10 @@ data class OrderInfoResponse(val data: OrderInfo?) : BaseData() {
|
||||
val lineName: String?,//线路名称
|
||||
var startSiteId: Int?,
|
||||
var startSiteName: String?,
|
||||
var startSiteNameKr: String?,
|
||||
val siteId: Long?,//站点id
|
||||
val siteName: String?,//站点名称
|
||||
val siteNameKr: String?,//站点名称
|
||||
val wgs84Lat: Double?,
|
||||
val wgs84Lon: Double?,
|
||||
var gcj02Lat: Double?,
|
||||
|
||||
@@ -548,11 +548,7 @@ object CharterPassengerModel {
|
||||
AbsMogoApplication.getApp()
|
||||
.getString(R.string.m1_end_order_5min), 2
|
||||
)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
VoiceManager.surplus5min(VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}else{
|
||||
VoiceManager.surplus5min()
|
||||
}
|
||||
VoiceManager.surplus5min(VoiceFocusManager.getVoiceCmdCallBack())
|
||||
CallerLogger.d(M_BUS_P+ TAG,"倒计时5分钟${it.orderNo}")
|
||||
SharedPrefs.getInstance(mContext).putBoolean("${it.orderNo}$min5Speak",true)
|
||||
}
|
||||
@@ -858,12 +854,11 @@ object CharterPassengerModel {
|
||||
mContext, lindId = it, object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (null != data && 0 == data.code) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
VoiceManager.arrivedStation(orderInfo!!.siteName!!,
|
||||
VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}else{
|
||||
VoiceManager.arrivedStation(orderInfo!!.siteName!!,)
|
||||
}
|
||||
VoiceManager.arrivedStation(
|
||||
orderInfo!!.siteName!!,
|
||||
orderInfo!!.siteNameKr!!,
|
||||
VoiceFocusManager.getVoiceCmdCallBack()
|
||||
)
|
||||
broadcastList["${it}$endKey"] = true
|
||||
// 到站结束自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
@@ -883,13 +878,12 @@ object CharterPassengerModel {
|
||||
}
|
||||
}
|
||||
|
||||
fun leaveStation(){
|
||||
orderInfo?.siteName?.let {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
VoiceManager.leaveStation(it,VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}else{
|
||||
VoiceManager.leaveStation(it)
|
||||
fun leaveStation() {
|
||||
orderInfo?.siteName?.let {cn->
|
||||
orderInfo?.siteNameKr?.let {kr->
|
||||
VoiceManager.leaveStation(cn,kr, VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
|
||||
object VoiceFocusManager {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
|
||||
fun getVoiceCmdCallBack():IMogoVoiceCmdCallBack{
|
||||
UiThreadHandler.post {
|
||||
GSYVideoManager.onPause()
|
||||
|
||||
@@ -57,6 +57,8 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.litezxing
|
||||
|
||||
api project(":OCH:mogo-och-data")
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.mogo.och.common.module.utils
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import com.google.zxing.BarcodeFormat
|
||||
import com.google.zxing.EncodeHintType
|
||||
import com.google.zxing.common.BitMatrix
|
||||
import com.google.zxing.qrcode.QRCodeWriter
|
||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel
|
||||
import java.util.*
|
||||
|
||||
|
||||
/**
|
||||
* isDeleteWhite 是否删除白边
|
||||
*/
|
||||
fun createQRCode(address: String, width: Int, height: Int,isDeleteWhite: Boolean): Bitmap? {
|
||||
val hints = Hashtable<EncodeHintType, Any>()
|
||||
hints[EncodeHintType.CHARACTER_SET] = "utf-8"
|
||||
hints[EncodeHintType.ERROR_CORRECTION] = ErrorCorrectionLevel.H
|
||||
hints[EncodeHintType.MARGIN] = if (isDeleteWhite) 1 else 0
|
||||
var bitMatrix = QRCodeWriter().encode(
|
||||
address,
|
||||
BarcodeFormat.QR_CODE, width, height, hints
|
||||
)
|
||||
|
||||
if (isDeleteWhite) {
|
||||
//删除白边
|
||||
bitMatrix = deleteWhite(bitMatrix)
|
||||
}
|
||||
val widthNew = bitMatrix.width
|
||||
val heightNew = bitMatrix.height
|
||||
|
||||
val pixels = IntArray(widthNew * heightNew)
|
||||
//下面这里按照二维码的算法,逐个生成二维码的图片,
|
||||
//两个for循环是图片横列扫描的结果
|
||||
for (y in 0 until heightNew) {
|
||||
for (x in 0 until widthNew) {
|
||||
if (bitMatrix.get(x, y)) {
|
||||
pixels[y * widthNew + x] = -0x1000000
|
||||
} else {
|
||||
pixels[y * widthNew + x] = -0x1
|
||||
}
|
||||
}
|
||||
}
|
||||
//生成二维码图片的格式,使用ARGB_8888
|
||||
var bitmap = Bitmap.createBitmap(widthNew, heightNew, Bitmap.Config.ARGB_8888)
|
||||
bitmap.setPixels(pixels, 0, widthNew, 0, 0, widthNew, heightNew)
|
||||
return bitmap
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除白色边框
|
||||
*
|
||||
* @param matrix matrix
|
||||
* @return BitMatrix
|
||||
*/
|
||||
private fun deleteWhite(matrix: BitMatrix): BitMatrix? {
|
||||
val rec = matrix.enclosingRectangle
|
||||
val resWidth = rec[2] + 1
|
||||
val resHeight = rec[3] + 1
|
||||
val resMatrix = BitMatrix(resWidth, resHeight)
|
||||
resMatrix.clear()
|
||||
for (i in 0 until resWidth) {
|
||||
for (j in 0 until resHeight) {
|
||||
if (matrix[i + rec[0], j + rec[1]]) resMatrix[i] = j
|
||||
}
|
||||
}
|
||||
return resMatrix
|
||||
}
|
||||
|
||||
fun createQRCodeWithPicture(bmCenter: Bitmap,address: String, width: Int, height: Int,isDeleteWhite: Boolean): Bitmap?{
|
||||
var qrCode = createQRCode(address,width,height,isDeleteWhite)
|
||||
//8,创建一个bitmap对象用于作为其图标
|
||||
qrCode?.let {
|
||||
val resultBitmap = addLogo(it,bmCenter)
|
||||
if (resultBitmap != null){
|
||||
return resultBitmap
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于向创建的二维码中添加一个logo
|
||||
* @param bmQr
|
||||
* @param bmCenter
|
||||
* @return
|
||||
*/
|
||||
fun addLogo(bmQr: Bitmap, bmCenter:Bitmap) :Bitmap?{
|
||||
if (bmQr == null) {
|
||||
return null
|
||||
}
|
||||
if (bmCenter == null) {
|
||||
return bmQr
|
||||
}
|
||||
|
||||
//获取图片的宽高
|
||||
val bmQrWidth = bmQr.width
|
||||
val bmQrHeight = bmQr.height
|
||||
val bmCenterWidth = bmCenter.width
|
||||
val bmCenterHeight = bmCenter.height
|
||||
|
||||
var bitmap = Bitmap.createBitmap(bmQrWidth, bmQrHeight, Bitmap.Config.ARGB_8888)
|
||||
try {
|
||||
var canvas = Canvas(bitmap)
|
||||
canvas.drawBitmap(bmQr, 0f, 0f, null)
|
||||
canvas.drawBitmap(bmCenter, ((bmQrWidth-bmCenterWidth)/2-bmCenterWidth/2).toFloat(),
|
||||
((bmQrHeight-bmCenterHeight)/2-bmCenterHeight/2).toFloat(), null)
|
||||
|
||||
canvas.save()
|
||||
canvas.restore()
|
||||
} catch (e: Exception) {
|
||||
bitmap = null
|
||||
e.stackTrace
|
||||
}
|
||||
return bitmap
|
||||
}
|
||||
@@ -10,22 +10,26 @@ import java.util.ArrayList
|
||||
|
||||
object VoiceManager {
|
||||
|
||||
fun arrivedStation(siteName: String) {
|
||||
arrivedStation(siteName,null)
|
||||
fun arrivedStation(siteNameCN: String) {
|
||||
arrivedStation(siteNameCN,"")
|
||||
}
|
||||
fun arrivedStation(siteName: String,callBack: IMogoTTSCallback?=null) {
|
||||
fun arrivedStation(siteNameCN: String,siteNameKR: String) {
|
||||
arrivedStation(siteNameCN,siteNameKR,null)
|
||||
}
|
||||
|
||||
fun arrivedStation(siteNameCN: String, siteNameKR: String,callBack: IMogoTTSCallback?=null) {
|
||||
val contenxt = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val chineseTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.arrived_station_zh, siteName),
|
||||
contenxt.getString(R.string.arrived_station_zh, siteNameCN),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.arrived_station_en, siteName),
|
||||
contenxt.getString(R.string.arrived_station_en, siteNameCN),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
val koreanTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.arrived_station_ko, siteName),
|
||||
contenxt.getString(R.string.arrived_station_ko, siteNameKR.ifEmpty { siteNameCN }),
|
||||
LanguageType.KOREAN
|
||||
)
|
||||
list.add(chineseTTS)
|
||||
@@ -33,22 +37,28 @@ object VoiceManager {
|
||||
list.add(koreanTTS)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1,callBack)
|
||||
}
|
||||
fun leaveStation(siteName: String){
|
||||
leaveStation(siteName,null)
|
||||
|
||||
fun leaveStation(siteNameCN: String){
|
||||
leaveStation(siteNameCN,"")
|
||||
}
|
||||
fun leaveStation(siteName: String,callBack: IMogoTTSCallback?=null) {
|
||||
|
||||
fun leaveStation(siteNameCN: String,siteNameKR: String){
|
||||
leaveStation(siteNameCN,siteNameKR,null)
|
||||
}
|
||||
|
||||
fun leaveStation(siteNameCN: String, siteNameKR: String,callBack: IMogoTTSCallback?=null) {
|
||||
val contenxt = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val chineseTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.leave_station_zh, siteName),
|
||||
contenxt.getString(R.string.leave_station_zh, siteNameCN),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
val engTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.leave_station_en, siteName),
|
||||
contenxt.getString(R.string.leave_station_en, siteNameCN),
|
||||
LanguageType.CHINESE
|
||||
)
|
||||
val koreanTTS = LangTtsEntity(
|
||||
contenxt.getString(R.string.leave_station_ko, siteName),
|
||||
contenxt.getString(R.string.leave_station_ko, siteNameKR.ifEmpty { siteNameCN }),
|
||||
LanguageType.KOREAN
|
||||
)
|
||||
list.add(chineseTTS)
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.mogo.och.common.module.wigets
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.appcompat.widget.AppCompatTextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.och.common.module.R
|
||||
|
||||
/**
|
||||
* 带有title, tip,confirm,cancel的dialog
|
||||
*/
|
||||
class BindQRCodeDialog: BaseFloatDialog, LifecycleObserver {
|
||||
|
||||
private var qrBm : AppCompatImageView? = null
|
||||
private var qrCancel: AppCompatTextView? = null
|
||||
private var qrTitle: AppCompatTextView? = null
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
constructor(builder: Builder,context: Context) : super(context) {
|
||||
qrTitle?.text = builder.titleStr
|
||||
qrCancel?.text = builder.cancelStr
|
||||
qrBm?.setImageBitmap(builder.qrBm)
|
||||
}
|
||||
|
||||
init{
|
||||
setContentView(R.layout.bind_driver_qr_view)
|
||||
|
||||
setCanceledOnTouchOutside(true)
|
||||
|
||||
qrTitle = findViewById(R.id.qr_title)
|
||||
qrBm = findViewById(R.id.qr_bm)
|
||||
qrCancel = findViewById(R.id.bind_qr_cancel)
|
||||
|
||||
qrCancel?.setOnClickListener {
|
||||
clickListener?.cancel()
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun cancel()
|
||||
}
|
||||
|
||||
class Builder{
|
||||
var titleStr:String = ""
|
||||
var cancelStr:String = ""
|
||||
var qrBm: Bitmap? = null
|
||||
|
||||
fun title(title: String) : Builder{
|
||||
this.titleStr = title
|
||||
return this
|
||||
}
|
||||
|
||||
fun cancelStr(cancel: String) : Builder{
|
||||
this.cancelStr = cancel
|
||||
return this
|
||||
}
|
||||
|
||||
fun qrBm(bm: Bitmap) : Builder{
|
||||
this.qrBm = bm
|
||||
return this
|
||||
}
|
||||
|
||||
fun build(context: Context): BindQRCodeDialog? {
|
||||
return BindQRCodeDialog(this,context)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,13 +49,6 @@ class OCHCommitDialog: BaseFloatDialog, LifecycleObserver {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(){
|
||||
if(isShowing){
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun confirm()
|
||||
fun cancel()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_32"/>
|
||||
<solid android:color="@color/qr_bg_color"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_890"
|
||||
android:layout_height="@dimen/dp_780"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
tools:ignore="MissingDefaultResource"
|
||||
android:background="@drawable/bind_driver_qr_bg">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/qr_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bind_driver_qr_title"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/dp_56"
|
||||
android:layout_marginTop="@dimen/dp_48"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/qr_bm"
|
||||
android:layout_width="@dimen/dp_357"
|
||||
android:layout_height="@dimen/dp_357"
|
||||
android:padding="8dp"
|
||||
android:background="@android:color/white"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qr_title"
|
||||
app:layout_constraintBottom_toTopOf="@+id/line"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:background="@color/qr_line_bg_color"
|
||||
app:layout_constraintBottom_toTopOf="@+id/bind_qr_cancel"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bind_qr_cancel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_162"
|
||||
android:gravity="center"
|
||||
android:text="@string/qr_cancel"
|
||||
android:textSize="@dimen/dp_52"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -11,4 +11,7 @@
|
||||
<color name="taxi_4D000000">#4D000000</color>
|
||||
|
||||
<color name="och_dialog_bg_color">#3B4577</color>
|
||||
|
||||
<color name="qr_line_bg_color">#66B8BFE8</color>
|
||||
<color name="qr_bg_color">#3B4577</color>
|
||||
</resources>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<string name="module_och_taxi_login_title">欢迎您登录</string>
|
||||
<string name="module_och_taxi_login_btn">登录</string>
|
||||
@@ -30,4 +30,7 @@
|
||||
<string name="end_order_zh">感谢您体验\'蘑菇车联\'自动驾驶小巴车,本次旅程已结束,我们下次乘车再见</string>
|
||||
<string name="end_order_en">Thank you for experiencing the self-driving minibus. See you next time</string>
|
||||
<string name="end_order_ko">자율주행 버스를 체험해 주셔서 감사합니다. 다음에 또 뵙겠습니다</string>
|
||||
|
||||
<string name="qr_cancel">取消</string>
|
||||
<string name="bind_driver_qr_title">扫描二维码完成车辆绑定</string>
|
||||
</resources>
|
||||
@@ -8,6 +8,7 @@ package com.mogo.och.data.bean;
|
||||
public class BusStationBean {
|
||||
private int siteId;
|
||||
private String name;
|
||||
private String nameKr;
|
||||
private int seq;
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
@@ -16,6 +17,10 @@ public class BusStationBean {
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private boolean leaving;
|
||||
|
||||
public String getNameKr() {
|
||||
return nameKr;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.mogo.och.bus.constant
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
|
||||
/**
|
||||
* Created on 2021/12/6
|
||||
*/
|
||||
class URLConst {
|
||||
companion object {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.mogo.och.bus.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
@@ -13,7 +14,9 @@ import androidx.constraintlayout.widget.Group;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
@@ -36,6 +39,8 @@ import com.mogo.och.common.module.biz.constant.OchCommonConst;
|
||||
import com.mogo.och.common.module.biz.provider.LoginService;
|
||||
import com.mogo.och.common.module.utils.BlinkAnimationUtil;
|
||||
import com.mogo.och.common.module.utils.OCHThreadPoolManager;
|
||||
import com.mogo.och.common.module.utils.QRUtilsKt;
|
||||
import com.mogo.och.common.module.wigets.BindQRCodeDialog;
|
||||
import com.mogo.och.common.module.wigets.MarqueeTextView;
|
||||
import com.mogo.och.common.module.wigets.OCHCommitDialog;
|
||||
|
||||
@@ -45,6 +50,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
|
||||
/**
|
||||
* 网约车小巴界面
|
||||
@@ -124,6 +131,22 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出");
|
||||
mPresenter.logout();
|
||||
}else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE){ //显示二维码
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event qrcode");
|
||||
String qrUrl = String.format(FunctionBuildConfig.urlJson.getBindDriverQRUrl(),
|
||||
MoGoAiCloudClientConfig.getInstance().getSn());
|
||||
Bitmap bmQr = QRUtilsKt.createQRCodeWithPicture(
|
||||
BitmapFactory.decodeResource(getResources(), R.drawable.icon_qr_center_logo)
|
||||
,qrUrl, AutoSizeUtils.dp2px(getContext(),340f),
|
||||
AutoSizeUtils.dp2px(getContext(),340f),true);
|
||||
if (bmQr != null){
|
||||
BindQRCodeDialog.Builder builder = new BindQRCodeDialog.Builder();
|
||||
builder.title(getString(R.string.bind_driver_qr_title))
|
||||
.cancelStr(getString(R.string.qr_cancel))
|
||||
.qrBm(bmQr).build(getContext()).show();
|
||||
}else {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG,"bmQr = null ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -606,11 +606,12 @@ public class OrderModel {
|
||||
* 服务端返回的OchBusRoutesResult逻辑, 离开站为当前站, 到达下一站后才会将下一站置为当前站,
|
||||
* 车机端展示是离开当前站,下一站设置为当前站, 所以服务端数据回来要做处理,不能直接渲染
|
||||
*/
|
||||
private void leaveStationSuccess(int leaveIndex, String leaveStation, String nextStation) {
|
||||
private void leaveStationSuccess(int leaveIndex, String leaveStation,
|
||||
String nextStation,String nextStationKr) {
|
||||
|
||||
onStartAutopilot(leaveIndex);
|
||||
|
||||
leaveTTSTips(nextStation);
|
||||
leaveTTSTips(nextStation,nextStationKr);
|
||||
|
||||
sendStartStationToClient(nextStation);
|
||||
|
||||
@@ -708,12 +709,14 @@ public class OrderModel {
|
||||
}
|
||||
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
|
||||
String arriveStation = stationList.get(arrivedStationIndex).getName();
|
||||
String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr();
|
||||
String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
|
||||
|
||||
isArrivedStation = true;
|
||||
isGoingToNextStation = false;
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName, arriveStation);
|
||||
arriveStationSuccess(arrivedStationIndex, departureStopName,
|
||||
arriveStation,arriveStationKr);
|
||||
|
||||
OrderServiceManager.arriveSiteStation(mContext,
|
||||
stationList.get(arrivedStationIndex).getSeq(),
|
||||
@@ -756,7 +759,8 @@ public class OrderModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void arriveStationSuccess(int arrivedStationIndex, String departureStopName, String arriveStation) {
|
||||
private void arriveStationSuccess(int arrivedStationIndex, String departureStopName,
|
||||
String arriveStation,String arriveStationKr) {
|
||||
if (busRoutesResult != null) {
|
||||
boolean isLastStop = false;
|
||||
if (arrivedStationIndex == busRoutesResult.getSites().size() - 1) {
|
||||
@@ -770,7 +774,7 @@ public class OrderModel {
|
||||
, isLastStop);
|
||||
}
|
||||
|
||||
VoiceManager.INSTANCE.arrivedStation(arriveStation);
|
||||
VoiceManager.INSTANCE.arrivedStation(arriveStation,arriveStationKr);
|
||||
|
||||
sendArrivedStationToClient(arriveStation);
|
||||
|
||||
@@ -825,16 +829,19 @@ public class OrderModel {
|
||||
public void leaveStation() {
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
|
||||
String nextStationName = "";
|
||||
String nextStationNameKr = "";
|
||||
if (backgroundCurrentStationIndex < stationList.size() - 1) {
|
||||
nextStationName = stationList.get(backgroundCurrentStationIndex + 1).getName();
|
||||
nextStationNameKr = stationList.get(backgroundCurrentStationIndex + 1).getNameKr();
|
||||
}
|
||||
final String currentStationName = stationList.get(backgroundCurrentStationIndex).getName();
|
||||
String finalNextStationName = nextStationName;
|
||||
String finalNextStationNameKr = nextStationNameKr;
|
||||
|
||||
isArrivedStation = false;
|
||||
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName, finalNextStationName);
|
||||
|
||||
leaveStationSuccess(backgroundCurrentStationIndex, currentStationName,
|
||||
finalNextStationName,finalNextStationNameKr);
|
||||
OrderServiceManager.leaveStation(mContext,
|
||||
stationList.get(backgroundCurrentStationIndex).getSeq(),
|
||||
stationList.get(backgroundCurrentStationIndex).getSiteId(),
|
||||
@@ -872,11 +879,11 @@ public class OrderModel {
|
||||
}
|
||||
|
||||
//车站10s后播报
|
||||
private void leaveTTSTips(String nextStation) {
|
||||
private void leaveTTSTips(String nextStation,String nextStationKr) {
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {//延迟10s播报
|
||||
VoiceManager.INSTANCE.leaveStation(nextStation);
|
||||
VoiceManager.INSTANCE.leaveStation(nextStation,nextStationKr);
|
||||
}
|
||||
},DELAY_10S);
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
"socket_base_url": "",
|
||||
"socket_tech_url": "",
|
||||
"eagle_mis_url": "",
|
||||
"eagle_dns_url": ""
|
||||
"eagle_dns_url": "",
|
||||
"bind_driver_qr_url": ""
|
||||
},
|
||||
"online": {
|
||||
"och_url": "https://tech.zhidaohulian.com",
|
||||
@@ -16,7 +17,8 @@
|
||||
"socket_base_url": "",
|
||||
"socket_tech_url": "",
|
||||
"eagle_mis_url": "",
|
||||
"eagle_dns_url": ""
|
||||
"eagle_dns_url": "",
|
||||
"bind_driver_qr_url": ""
|
||||
},
|
||||
"demo": {
|
||||
"och_url": "http://tech-dev.zhidaohulian.com",
|
||||
@@ -25,7 +27,8 @@
|
||||
"socket_base_url": "",
|
||||
"socket_tech_url": "",
|
||||
"eagle_mis_url": "",
|
||||
"eagle_dns_url": ""
|
||||
"eagle_dns_url": "",
|
||||
"bind_driver_qr_url": ""
|
||||
}
|
||||
},
|
||||
"dali": {
|
||||
@@ -36,7 +39,8 @@
|
||||
"socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/",
|
||||
"socket_tech_url": "https://och-a.zhidaozhixing.com/arch/",
|
||||
"eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/",
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/"
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s"
|
||||
},
|
||||
"online": {
|
||||
"och_url": "https://och-driver-eh.zhidaozhixing.com:18182",
|
||||
@@ -45,7 +49,8 @@
|
||||
"socket_base_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/push/",
|
||||
"socket_tech_url": "https://och-driver-eh.zhidaozhixing.com:18182/arch/",
|
||||
"eagle_mis_url": "https://och-hailing-eh.zhidaozhixing.com:18182/",
|
||||
"eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com:18182/"
|
||||
"eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com:18182/",
|
||||
"bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ehsafety&sn=%1$s"
|
||||
},
|
||||
"demo": {
|
||||
"och_url": "https://och-a.zhidaozhixing.com",
|
||||
@@ -54,7 +59,8 @@
|
||||
"socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/",
|
||||
"socket_tech_url": "https://och-a.zhidaozhixing.com/arch/",
|
||||
"eagle_mis_url": "http://och-hailing-eh.zhidaozhixing.com:18181/",
|
||||
"eagle_dns_url": "http://och-hailing-eh.zhidaozhixing.com:18181/"
|
||||
"eagle_dns_url": "http://och-hailing-eh.zhidaozhixing.com:18181/",
|
||||
"bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ehsafety&sn=%1$s"
|
||||
}
|
||||
},
|
||||
"yantai": {
|
||||
@@ -65,7 +71,8 @@
|
||||
"socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/",
|
||||
"socket_tech_url": "https://och-a.zhidaozhixing.com/arch/",
|
||||
"eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/",
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/"
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=asafety&sn=%1$s"
|
||||
},
|
||||
"online": {
|
||||
"och_url": "https://och-driver-yt.zhidaozhixing.com",
|
||||
@@ -74,7 +81,8 @@
|
||||
"socket_base_url": "https://och-driver-yt.zhidaozhixing.com/arch/push/",
|
||||
"socket_tech_url": "https://och-driver-yt.zhidaozhixing.com/arch/",
|
||||
"eagle_mis_url": "https://och-hailing-yt.zhidaozhixing.com/",
|
||||
"eagle_dns_url": "https://och-hailing-yt.zhidaozhixing.com/"
|
||||
"eagle_dns_url": "https://och-hailing-yt.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ytsafety&sn=%1$s"
|
||||
},
|
||||
"demo": {
|
||||
"och_url": "https://och-a.zhidaozhixing.com",
|
||||
@@ -83,7 +91,8 @@
|
||||
"socket_base_url": "https://och-a.zhidaozhixing.com/arch/push/",
|
||||
"socket_tech_url": "https://och-a.zhidaozhixing.com/arch/",
|
||||
"eagle_mis_url": "http://eagle-mis-a.zhidaozhixing.com/",
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/"
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://tech.zhidaohulian.com?pipe=ytsafety&sn=%1$s"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,11 +314,11 @@ class DispatchAutoPilotManager private constructor() :
|
||||
receiverBean?.let {
|
||||
//调度完成,同步云端,并且吐司提示
|
||||
dispatchServiceModel.dispatchResultUpload(DISPATCH_COMPLETED, it.taskId)
|
||||
ToastUtils.showLong("云调度完成,车辆即将到达${it.endLocAddress}")
|
||||
ToastUtils.showLong("云调度完成,车辆已到达${it.endLocAddress}")
|
||||
//取消自动驾驶
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
//语音提示到站
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("云调度完成,车辆即将到达${it.endLocAddress}")
|
||||
AIAssist.getInstance(mContext).speakTTSVoice("云调度完成,车辆已到达${it.endLocAddress}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,14 +31,27 @@ class BusOperationView @JvmOverloads constructor(
|
||||
actvAccountPhone.text = phoneMask(SharedPrefs.getInstance(it).getString("och_account",""))
|
||||
}
|
||||
clickPersonalRightView()
|
||||
clickQRBtn()
|
||||
}
|
||||
|
||||
private fun clickQRBtn() {
|
||||
actvAccountQR.onClick {
|
||||
EventBus.getDefault().post(EventLogout(EventLogout.SHOW_QR_TYPE))
|
||||
}
|
||||
}
|
||||
|
||||
private fun initPersonalIcon() {
|
||||
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
ivGotoPersonalInfo.visibility = VISIBLE
|
||||
}else{
|
||||
ivGotoPersonalInfo.visibility = GONE
|
||||
}
|
||||
|
||||
if (AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
|
||||
actvAccountQR.visibility = VISIBLE
|
||||
}else{
|
||||
actvAccountQR.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun clickPersonalRightView() {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@@ -60,6 +60,16 @@
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/actvAccountQR"
|
||||
android:layout_width="@dimen/dp_84"
|
||||
android:layout_height="@dimen/dp_84"
|
||||
android:src="@drawable/icon_bind_driver_qrcode"
|
||||
android:layout_marginLeft="@dimen/dp_32"
|
||||
app:layout_constraintLeft_toRightOf="@+id/actvAccountPhone"
|
||||
app:layout_constraintTop_toTopOf="@+id/actvAccountPhone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/actvAccountPhone"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/ivGotoPersonalInfo"
|
||||
|
||||
@@ -16,5 +16,7 @@ data class UrlConfig(
|
||||
@SerializedName("eagle_mis_url")
|
||||
val eagleMisUrl: String,
|
||||
@SerializedName("eagle_dns_url")
|
||||
val eagleDnsUrl: String
|
||||
val eagleDnsUrl: String,
|
||||
@SerializedName("bind_driver_qr_url")
|
||||
val bindDriverQRUrl: String
|
||||
)
|
||||
@@ -5,6 +5,7 @@ public class EventLogout {
|
||||
private int messgaeType;
|
||||
public final static int LOGOUT_TYPE = 100001;
|
||||
public final static int PERSONAL_TYPE = 100002;
|
||||
public final static int SHOW_QR_TYPE = 100003;
|
||||
|
||||
public EventLogout(int messgaeType) {
|
||||
this.messgaeType = messgaeType;
|
||||
|
||||
Reference in New Issue
Block a user