停止线绘制避免重复,绘制前先清除
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import android.util.Log;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -21,6 +22,9 @@ import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_STOP_LINE_DATA;
|
||||
import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_WARN_DATA;
|
||||
|
||||
@@ -33,6 +37,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
private static final String TAG = "V2XWarnDataDrawer";
|
||||
private static volatile V2XWarnDataDrawer sInstance;
|
||||
private boolean mChangeCarModeStatus;
|
||||
private List<IMogoMarker> stopLineMarker = new ArrayList();
|
||||
|
||||
private V2XWarnDataDrawer() {
|
||||
super();
|
||||
@@ -164,6 +169,11 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
* @param data
|
||||
*/
|
||||
public void renderStopLineData(V2XWarningEntity data) {
|
||||
if (stopLineMarker.size() > 0) {
|
||||
for (int i = 0; i < stopLineMarker.size(); i++) {
|
||||
stopLineMarker.get(i).remove();
|
||||
}
|
||||
}
|
||||
MarkerLocation location = new MarkerLocation();
|
||||
location.setLat(data.getLat());
|
||||
location.setLon(data.getLon());
|
||||
|
||||
@@ -237,6 +237,7 @@
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTriggerWarningEvent"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -432,6 +433,20 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAdasDataWarn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="#8BC34A"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="车路云场景预警-右侧"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTriggerPedestrianWarning"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -473,21 +488,6 @@
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAdasDataWarn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="#8BC34A"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="车路云场景预警-右侧"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user