diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:25:14 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-24 21:25:14 +0200 |
commit | 00439c9923911cafb0ed06398c1a65a1871e921e (patch) | |
tree | 6b133dc8ac4678fb3d8ee647d3d5a4f85938baef /src/main/java/de/pixart/messenger/ui/util/PendingActionHelper.java | |
parent | db4ab7177d5e550dcd04ea3617cdd231d4923aa9 (diff) |
migrate the RecyclerView
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/PendingActionHelper.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/PendingActionHelper.java b/src/main/java/de/pixart/messenger/ui/util/PendingActionHelper.java new file mode 100644 index 000000000..06c291711 --- /dev/null +++ b/src/main/java/de/pixart/messenger/ui/util/PendingActionHelper.java @@ -0,0 +1,29 @@ +package de.pixart.messenger.ui.util; + +/** + * Created by mxf on 2018/4/3. + */ + +public class PendingActionHelper { + + private PendingAction pendingAction; + + public void push(PendingAction pendingAction) { + this.pendingAction = pendingAction; + } + + public void execute() { + if (pendingAction != null) { + pendingAction.execute(); + pendingAction = null; + } + } + + public void undo() { + pendingAction = null; + } + + public interface PendingAction { + void execute(); + } +}
\ No newline at end of file |