fix bug of delay time problem and invisible marker when change visual problem

This commit is contained in:
zhongchao
2021-07-10 14:13:12 +08:00
parent c84646906b
commit 822e536c2b
10 changed files with 44 additions and 61 deletions

View File

@@ -56,6 +56,12 @@ public interface IMogoMarkerManager {
*/
void inVisibleAllMarkers();
/**
* 隐藏除了某些类别的所有marker {@link MogoMarkerOptions Owner}
* @param owner
*/
void inVisibleWithoutMarkers(String owner); //todo 后续需要把Owner类别统一起来基类下沉此接口为临时方案应该设计为隐藏某一类元素
/**
* 获取某种类型的全部marker。
*

View File

@@ -61,6 +61,17 @@ public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarker
.forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> mogoMarker.setVisible(false)));
}
@SuppressLint("NewApi")
public synchronized void inVisibleMarkers(String owner){
mServicesMarkers.values().stream()
.filter(mogoMarkerList -> mogoMarkerList != null && !mogoMarkerList.isEmpty())
.forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> {
if(TextUtils.isEmpty(mogoMarker.getOwner()) || !mogoMarker.getOwner().equals(owner)){
mogoMarker.setVisible(false);
}
}));
}
public synchronized void removeAll() {
final Collection< List< IMogoMarker > > mogoMarkers = mServicesMarkers.values();
for ( List< IMogoMarker > mogoMarkerList : mogoMarkers ) {