[1.0.2]
[车模、地图定位]
This commit is contained in:
yangyakun
2023-02-16 15:43:10 +08:00
parent 2cd8e27f75
commit aaf16795cb
10 changed files with 31 additions and 5 deletions

View File

@@ -53,7 +53,6 @@ class BusPassengerRouteFragment :
ToggleDebugView.toggleDebugView.toggle(requireContext())
true
}
omvOverMap.hideResetView()
viewBusPM1MsgBoxButton.setClickListener(object : MMsgBoxButtonView.ClickListener {
override fun showMsgBoxList(show: Boolean) {
if (show) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 251 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/bus_p_overmap_reset"
android:width="@dimen/dp_66"
android:height="@dimen/dp_66"/>
</layer-list >

View File

@@ -20,6 +20,10 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/mapBizView"
app:resetDrawable="@drawable/bus_p_overmap_reset_size"
app:carDrawable="@drawable/bug_p_overmap_car_model"
app:resetDrawableMarginRight="34dp"
app:resetDrawableMarginBottom="54dp"
android:layout_width="0dp"
android:layout_height="match_parent"/>

View File

@@ -66,6 +66,8 @@ class OverMapView @JvmOverloads constructor(
private var arrivedDrawable: Int = -1
private var unArrivedDrawable: Int = -1
private var resetDrawable: Int = -1
private var resetDrawableMarginRight: Int = -1
private var resetDrawableMarginBottom: Int = -1
private var mMapView: TextureMapView? = null
private var mAMap: AMap? = null
@@ -121,6 +123,8 @@ class OverMapView @JvmOverloads constructor(
unArrivedDrawable =
typedArray.getResourceId(R.styleable.OverMapView_unArrivedDrawable, -1)
resetDrawable = typedArray.getResourceId(R.styleable.OverMapView_resetDrawable, -1)
resetDrawableMarginRight = typedArray.getResourceId(R.styleable.OverMapView_resetDrawableMarginRight, AutoSizeUtils.dp2px(context,40f))
resetDrawableMarginBottom = typedArray.getResourceId(R.styleable.OverMapView_resetDrawableMarginBottom, AutoSizeUtils.dp2px(context,40f))
typedArray.recycle()
initView(context)
} catch (e: Exception) {
@@ -215,8 +219,16 @@ class OverMapView @JvmOverloads constructor(
val smpView = LayoutInflater.from(context).inflate(R.layout.module_overview_map_view, this)
mMapView = smpView.findViewById(R.id.aMapView)
overLayerView = findViewById(R.id.overLayer)
overLayerView?.background =
resources.getDrawable(if (resetDrawable != -1) resetDrawable else R.drawable.amap_reset)
overLayerView?.let {
it.background =
resources.getDrawable(if (resetDrawable != -1) resetDrawable else R.drawable.amap_reset)
val layoutParams = it.layoutParams
layoutParams as RelativeLayout.LayoutParams
layoutParams.rightMargin =resetDrawableMarginRight
layoutParams.bottomMargin =resetDrawableMarginBottom
it.layoutParams = layoutParams
}
arrivedBitmap =
BitmapDescriptorFactory.fromResource(if (arrivedDrawable != -1) arrivedDrawable else R.drawable.taxi_map_arrow_arrived)
unArrivedBitmap =

View File

@@ -25,8 +25,8 @@
<TextView
android:id="@+id/overLayer"
android:layout_width="@dimen/dp_116"
android:layout_height="@dimen/dp_116"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"

View File

@@ -18,5 +18,9 @@
<attr name="unArrivedDrawable" format="reference" />
<!-- 重置位置图片 -->
<attr name="resetDrawable" format="reference" />
<!-- 重置位置图片右面margin -->
<attr name="resetDrawableMarginRight" format="dimension" />
<!-- 重置位置图片下面margin -->
<attr name="resetDrawableMarginBottom" format="dimension" />
</declare-styleable>
</resources>