优化显示逻辑

This commit is contained in:
wangcongtao
2021-03-16 16:25:44 +08:00
parent 5e0d18dbc2
commit 71e809a8ba
15 changed files with 277 additions and 27343 deletions

View File

@@ -768,6 +768,7 @@ public class AMapViewWrapper implements IMogoMapView,
}
private TextView mSpeedView = null;
private int mLastYOffset = 40;
private void showSelfSpeed(float speed) {
@@ -791,6 +792,14 @@ public class AMapViewWrapper implements IMogoMapView,
String speedVal = String.valueOf(speedIntVal);
String infoResName = ResIdCache.getVal(speedVal);
int offset = 40;
if ( !mMapView.getMapAutoViewHelper().getLockMode() ) {
offset = 10;
}
if ( offset != mLastYOffset ) {
mLastYOffset = offset;
mSelfMarker.setInfoWindowOffset( 0, offset );
}
if (TextUtils.isEmpty(infoResName)) {
if (mSpeedView == null) {
mSpeedView = new TextView(mMapView.getContext());
@@ -799,7 +808,6 @@ public class AMapViewWrapper implements IMogoMapView,
mSpeedView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
}
mSpeedView.setText(speedVal);
mSelfMarker.setInfoWindowOffset(0, 20);
mSelfMarker.setInfoWindowView(mSpeedView);
ResIdCache.putVal(speedVal, mSelfMarker.getMarkeOptions().getMarkerInfoName());
} else {