Merge remote-tracking branch 'origin/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.0

# Conflicts:
#	OCH/shuttle/driver_weaknet/src/main/java/com/mogo/och/weaknet/ui/fragment/ShuttleFragment.kt
#	OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java
#	OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/unmanned/taxi/ui/base/BaseTaxiTabFragment.kt
This commit is contained in:
yangyakun
2024-09-27 15:38:31 +08:00
8 changed files with 106 additions and 55 deletions

View File

@@ -61,8 +61,10 @@ class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>() {
CallerEagleBaseFunctionCall4OchManager.addToolKitDefaultItemClickListener(runningTaskGateWay,object :
IToolKitItemClickListener{
override fun onItemClick(toolTag: String, ctx: Context?) {
if(toolTag==runningTaskGateWay) {
RunningTaskManager.showBadCaseConfigWindow(it)
when (toolTag) {
runningTaskGateWay -> {
RunningTaskManager.showBadCaseConfigWindow(it)
}
}
}
})

View File

@@ -191,7 +191,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
CallerEagleBaseFunctionCall4OchManager.INSTANCE.addToolKitDefaultItemClickListener(runningTaskGateWay, new IToolKitItemClickListener() {
@Override
public void onItemClick(@NonNull String toolTag, @Nullable Context ctx) {
if(toolTag==runningTaskGateWay) {
if (runningTaskGateWay.equals(toolTag)) {
personalDialogFragment = new WeakReference<>(new TaxiPersonalDialogFragment());
FragmentActivity activity = getActivity();
if (activity != null) {

View File

@@ -202,11 +202,13 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
CallerEagleBaseFunctionCall4OchManager.addToolKitDefaultItemClickListener(runningTaskGateWay,object :
IToolKitItemClickListener {
override fun onItemClick(toolTag: String, ctx: Context?) {
if(toolTag==runningTaskGateWay) {
personalDialogFragment = WeakReference(TaxiOperationalDialogFragment())
activity?.supportFragmentManager?.let {
personalDialogFragment!!.get()
?.show(it, "service_data")
when(toolTag) {
runningTaskGateWay -> {
personalDialogFragment = WeakReference(TaxiOperationalDialogFragment())
activity?.supportFragmentManager?.let {
personalDialogFragment!!.get()
?.show(it, "service_data")
}
}
}
}

View File

@@ -9,7 +9,10 @@ import android.os.Bundle
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.view.animation.AccelerateDecelerateInterpolator
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.marginStart
import androidx.core.view.marginTop
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.api.order.IOrderListener
import com.mogo.eagle.core.function.call.order.CallerOrderListenerManager
@@ -31,6 +34,14 @@ class MapContainerLayout @JvmOverloads constructor(
@Volatile
private var isScaled = false
private var isPlayingAnim = false
private var mapMinWidth = 0
private var mapMinHeight = 0
private var mapMaxWidth = 0
private var mapMaxHeight = 0
private var maxMarginStart = 0
private var maxMarginTop = 0
private var valueAnimator: ValueAnimator? = null
init {
LayoutInflater.from(context).inflate(R.layout.view_map_container, this, true)
@@ -69,15 +80,37 @@ class MapContainerLayout @JvmOverloads constructor(
overMapView.onDestroy()
}
override fun onWindowFocusChanged(hasWindowFocus: Boolean) {
super.onWindowFocusChanged(hasWindowFocus)
if (hasWindowFocus) {
if (mapMaxWidth == 0 && maxMarginStart == 0) {
calculate()
}
}
}
private fun calculate() {
mapMaxWidth = width
mapMaxHeight = height
mapMinWidth = overMapView.width
mapMinHeight = overMapView.height
maxMarginStart = overMapView.marginStart
maxMarginTop = overMapView.marginTop
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener("${TAG}${this.hashCode()}",this)
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(
"${TAG}${this.hashCode()}",
this
)
CallerOrderListenerManager.addListener("${TAG}${this.hashCode()}", this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
MogoMapListenerHandler.mogoMapListenerHandler.unregisterHostMapListener("${TAG}${this.hashCode()}")
valueAnimator?.removeAllListeners()
}
private fun initView() {
@@ -103,38 +136,45 @@ class MapContainerLayout @JvmOverloads constructor(
private fun scaleMapWithAnim() {
if (isPlayingAnim) return
if (mapMaxWidth == 0 && maxMarginStart == 0 && !isScaled) {
calculate()
}
if (!isScaled) {
val valueAnimator = ValueAnimator.ofInt(270, 1560)
valueAnimator = ValueAnimator.ofInt(mapMinWidth, mapMaxWidth)
val evaluator = IntEvaluator()
valueAnimator.addUpdateListener {
overMapView.layoutParams = (overMapView.layoutParams as LayoutParams).also { layoutParams ->
layoutParams.width = it.animatedValue as Int
layoutParams.height = evaluator.evaluate(it.animatedFraction, 270, 1534)
layoutParams.leftMargin = evaluator.evaluate(it.animatedFraction, 1230, 0)
layoutParams.topMargin = evaluator.evaluate(it.animatedFraction, 1204, 0)
}
valueAnimator?.addUpdateListener {
overMapView.layoutParams =
(overMapView.layoutParams as LayoutParams).also { layoutParams ->
layoutParams.width = it.animatedValue as Int
layoutParams.height = evaluator.evaluate(it.animatedFraction, mapMinHeight, mapMaxHeight)
layoutParams.leftMargin = evaluator.evaluate(it.animatedFraction, maxMarginStart, 0)
layoutParams.topMargin = evaluator.evaluate(it.animatedFraction, maxMarginTop, 0)
}
}
valueAnimator.addListener(listenerAdapter)
valueAnimator.duration = 350
valueAnimator.start()
valueAnimator?.interpolator = AccelerateDecelerateInterpolator()
valueAnimator?.addListener(listenerAdapter)
valueAnimator?.duration = 400
valueAnimator?.start()
} else {
val valueAnimator = ValueAnimator.ofInt(1560, 270)
valueAnimator = ValueAnimator.ofInt(mapMaxWidth, mapMinWidth)
val evaluator = IntEvaluator()
valueAnimator.addUpdateListener {
overMapView.layoutParams = (overMapView.layoutParams as LayoutParams).also { layoutParams ->
layoutParams.width = it.animatedValue as Int
layoutParams.height = evaluator.evaluate(it.animatedFraction, 1534, 270)
layoutParams.leftMargin = evaluator.evaluate(it.animatedFraction, 0, 1230)
layoutParams.topMargin = evaluator.evaluate(it.animatedFraction, 0, 1204)
}
valueAnimator?.addUpdateListener {
overMapView.layoutParams =
(overMapView.layoutParams as LayoutParams).also { layoutParams ->
layoutParams.width = it.animatedValue as Int
layoutParams.height = evaluator.evaluate(it.animatedFraction, mapMaxHeight, mapMinHeight)
layoutParams.leftMargin = evaluator.evaluate(it.animatedFraction, 0, maxMarginStart)
layoutParams.topMargin = evaluator.evaluate(it.animatedFraction, 0, maxMarginTop)
}
}
valueAnimator.addListener(listenerAdapter)
valueAnimator.duration = 350
valueAnimator.start()
valueAnimator?.interpolator = AccelerateDecelerateInterpolator()
valueAnimator?.addListener(listenerAdapter)
valueAnimator?.duration = 400
valueAnimator?.start()
}
}
private val listenerAdapter = object : AnimatorListenerAdapter() {
private val listenerAdapter = object : AnimatorListenerAdapter() {
override fun onAnimationStart(animation: Animator) {
super.onAnimationStart(animation)
isPlayingAnim = true
@@ -150,7 +190,8 @@ class MapContainerLayout @JvmOverloads constructor(
if (isScaled) {
visualAngleToggle?.takeIf { it.visibility == View.VISIBLE }?.visibility = View.GONE
} else {
visualAngleToggle?.takeIf { it.visibility != View.VISIBLE }?.visibility = View.VISIBLE
visualAngleToggle?.takeIf { it.visibility != View.VISIBLE }?.visibility =
View.VISIBLE
}
}
@@ -163,7 +204,8 @@ class MapContainerLayout @JvmOverloads constructor(
if (isScaled) {
visualAngleToggle?.takeIf { it.visibility == View.VISIBLE }?.visibility = View.GONE
} else {
visualAngleToggle?.takeIf { it.visibility != View.VISIBLE }?.visibility = View.VISIBLE
visualAngleToggle?.takeIf { it.visibility != View.VISIBLE }?.visibility =
View.VISIBLE
}
}
}

View File

@@ -225,6 +225,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
}
private fun setB2PassengerScreenView() {
// 对比taxi乘客屏 按比例缩放
// 25 = 390/580 * 37
val layoutParam =
roundRoadV2NEventContainer.layoutParams as ConstraintLayout.LayoutParams
layoutParam.width = AutoSizeUtils.dp2px(
@@ -234,7 +236,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
layoutParam.setMargins(
0,
0,
AutoSizeUtils.dp2px(context, 39f - 37f),
AutoSizeUtils.dp2px(context, 39f - 25f),
0
)
roundRoadV2NEventContainer.layoutParams = layoutParam
@@ -242,8 +244,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
context,
R.drawable.hmi_v2n_event_bg_passenger
)
//乘客屏 背景图 右边带了 37px 渐变
val padding = AutoSizeUtils.dp2px(context, 37f)
//乘客屏 背景图 右边带了 25px 渐变
val padding = AutoSizeUtils.dp2px(context, 25f)
roundRoadV2NEventContainer.setPadding(padding, padding, padding, padding)
val containerIconHintLayoutParams =
@@ -251,8 +253,8 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
containerIconHintLayoutParams.width = LayoutParams.MATCH_PARENT
containerIconHintLayoutParams.height = LayoutParams.WRAP_CONTENT
containerIconHintLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 20f - 19.4f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(context, 27f - 10.7f),
AutoSizeUtils.dp2px(context, 20f - 19.4f * (54f / 69f)), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(context, 27f - 10.7f * (54f / 69f)),
AutoSizeUtils.dp2px(context, 20f),
0
)
@@ -262,20 +264,20 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
ivV2XImageLayoutParams.width =
AutoSizeUtils.dp2px(
context,
56f + 14f + 14f
56f + (14f + 14f) * (54f / 69f) // 对比taxi乘客屏 按比例缩放
) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
ivV2XImageLayoutParams.height =
AutoSizeUtils.dp2px(
context,
56f + 14f + 14f
56f + (14f + 14f) * (54f / 69f) // 对比taxi乘客屏 按比例缩放
) //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
ivV2XImage.layoutParams = ivV2XImageLayoutParams
val tvV2XHintContentLayoutParams =
tvV2XHintContent.layoutParams as RelativeLayout.LayoutParams
tvV2XHintContentLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 21f - 19.7f), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(context, (28f + 14f) - (40f / 2f)),
AutoSizeUtils.dp2px(context, 21f - 19.7f * (54f / 69f)), //乘客屏icon ivV2XImage带了白边, 高度、margin需要计算调整
AutoSizeUtils.dp2px(context, (20f + 14f * (54f / 69f)) - (40f / 2f)),
AutoSizeUtils.dp2px(context, 5f),
0
)
@@ -290,11 +292,11 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
val containerImageAndLiveVideoLayoutParams =
containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 350f + 18f) //乘客屏视频加载里面背景切图包含了白边
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 350f + 18f * (350f / 480f)) //乘客屏视频加载里面背景切图包含了白边
containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 197f)
containerImageAndLiveVideoLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 20f),
AutoSizeUtils.dp2px(context, 23f - 14f), //乘客屏icon ivV2XImage带了白边
AutoSizeUtils.dp2px(context, 23f - 14f * (54f / 69f)), //乘客屏icon ivV2XImage带了白边
AutoSizeUtils.dp2px(context, 20f),
0
)
@@ -307,9 +309,9 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
tvV2XTimeStrLayoutParams.width = LayoutParams.MATCH_PARENT
tvV2XTimeStrLayoutParams.height = LayoutParams.WRAP_CONTENT
tvV2XTimeStrLayoutParams.setMargins(
AutoSizeUtils.dp2px(context, 20f),
AutoSizeUtils.dp2px(context, 16f),
AutoSizeUtils.dp2px(context, 20f),
AutoSizeUtils.dp2px(context, 19f),
AutoSizeUtils.dp2px(context, 16.6f),
AutoSizeUtils.dp2px(context, 19f),
AutoSizeUtils.dp2px(context, 26f)
)
tvV2XTimeStr.layoutParams = tvV2XTimeStrLayoutParams

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

@@ -89,10 +89,11 @@
<View
android:id="@+id/shadowView"
android:layout_width="270dp"
android:layout_height="270dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="60dp"
android:layout_width="310dp"
android:layout_height="310dp"
android:layout_marginEnd="40dp"
android:layout_marginBottom="40dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
app:layout_constraintEnd_toEndOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -447,6 +447,8 @@ class TravelRealityView @JvmOverloads constructor(
)
// 设置自定义样式
mAMap?.setCustomMapStyle(customMapStyleOptions1)
mAMap?.uiSettings?.isZoomControlsEnabled = false
mAMap?.uiSettings?.setLogoBottomMargin(-150)
}
mAMap?.setAMapGestureListener(gestListener)
}
@@ -468,7 +470,7 @@ class TravelRealityView @JvmOverloads constructor(
//设置希望展示的地图缩放级别
val loc = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
if (loc.latitude.toInt() == 0 || loc.longitude.toInt() == 0) {
moveMapCamera(CameraUpdateFactory.zoomTo(14f))
moveMapCamera(CameraUpdateFactory.zoomTo(17f))
} else {
moveMapCamera(CameraUpdateFactory.newLatLngZoom(
coordinateConverterWgsToGcj(
@@ -540,7 +542,7 @@ class TravelRealityView @JvmOverloads constructor(
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
if (isSmallMap) {
this.outlineProvider = TextureVideoViewOutlineProvider(
AutoSizeUtils.dp2px(context, 32f)
AutoSizeUtils.dp2px(context, 38f)
.toFloat()
)
this.clipToOutline = true