From 92f8f45e9acd49124d9efaf017438781795c7439 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 28 Feb 2023 20:55:15 +0800 Subject: [PATCH] =?UTF-8?q?[Opt3.0]=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=AB=98=E5=BE=B7=E5=9C=B0=E5=9B=BE=E5=8F=AF=E9=80=89=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E7=9A=84padding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mogo/eagle/core/function/view/OverMapView.kt | 16 ++++++++++++---- .../src/main/res/values/attrs.xml | 5 +++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt index 7470a9932c..9e1bbe7601 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/OverMapView.kt @@ -71,6 +71,10 @@ class OverMapView @JvmOverloads constructor( private var resetDrawableMarginRight: Int = -1 private var resetDrawableMarginBottom: Int = -1 private var isClearArrived: Boolean = false + private var leftPadding: Int = 100 + private var topPadding: Int = 100 + private var rightPadding: Int = 100 + private var bottomPadding: Int = 100 private var mMapView: TextureMapView? = null private var mAMap: AMap? = null @@ -136,6 +140,10 @@ class OverMapView @JvmOverloads constructor( AutoSizeUtils.dp2px(context, 40f) ) isClearArrived = typedArray.getBoolean(R.styleable.OverMapView_isClearArrived, false) + leftPadding = typedArray.getInt(R.styleable.OverMapView_leftPadding, 100) + topPadding = typedArray.getInt(R.styleable.OverMapView_topPadding, 100) + rightPadding = typedArray.getInt(R.styleable.OverMapView_rightPadding, 100) + bottomPadding = typedArray.getInt(R.styleable.OverMapView_bottomPadding, 100) typedArray.recycle() initView(context) } catch (e: Exception) { @@ -559,10 +567,10 @@ class OverMapView @JvmOverloads constructor( mAMap!!.moveCamera( CameraUpdateFactory.newLatLngBoundsRect( boundsBuilder.build(), - 100, - 100, - 100, - 100 + leftPadding, + rightPadding, + topPadding, + bottomPadding ) ) mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition)) diff --git a/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml b/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml index 0d3349fc35..15a5585362 100644 --- a/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml +++ b/core/function-impl/mogo-core-function-map/src/main/res/values/attrs.xml @@ -24,5 +24,10 @@ + + + + + \ No newline at end of file