Skip to content

Commit

Permalink
上传
Browse files Browse the repository at this point in the history
  • Loading branch information
puyang1017 committed Jul 22, 2021
1 parent dc3f09c commit fdc965e
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
* dialog 管理器
Expand Down Expand Up @@ -188,6 +189,26 @@ public void removeDialog(DialogParam dialogParam) {
}
}

/**
* 移除dialog
*
* @param priorityDialog
*/
public void removeDialog(PriorityDialog priorityDialog) {
if (priorityDialog != null) {
if (mDialogs == null) return;
CopyOnWriteArrayList<DialogParam> mDialogsBuffer = new CopyOnWriteArrayList<>();
mDialogsBuffer.addAll(mDialogs);
for (DialogParam dialogParam : mDialogsBuffer) {
if (dialogParam.getPriorityDialog().equals(priorityDialog)) {
mDialogsBuffer.remove(dialogParam);
}
}
mDialogs.clear();
mDialogs.addAll(mDialogsBuffer);
}
}

/**
* 展示下一个优先级最大的Dialog(非自行调用dismiss而是被优先级高的弹窗show后挤掉)
*/
Expand Down

0 comments on commit fdc965e

Please sign in to comment.