优化显示逻辑
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user