Skip to content
This repository was archived by the owner on Apr 26, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ public void onClick(View v) {

// Dismiss dialog or change text
if(mUndoActions.isEmpty()) {
mUndoPopup.dismiss();
if(mUndoPopup.isShowing()) {
mUndoPopup.dismiss();
}
} else {
changePopupText();
changeButtonLabel();
Expand Down Expand Up @@ -553,7 +555,9 @@ public void discardUndo() {
undoable.discard();
}
mUndoActions.clear();
mUndoPopup.dismiss();
if(mUndoPopup.isShowing()) {
mUndoPopup.dismiss();
}
}

/**
Expand Down Expand Up @@ -942,4 +946,18 @@ private boolean isSwipeDirectionValid(float deltaX) {
}

}

@Override
protected void onWindowVisibilityChanged(int visibility) {
super.onWindowVisibilityChanged(visibility);

/*
* If the container window no longer visiable,
* dismiss visible undo popup window so it won't leak,
* cos the container window will be destroyed before dismissing the popup window.
*/
if(visibility != View.VISIBLE) {
discardUndo();
}
}
}