Log dismissing or launching recent tasks
We now pass the log action (e.g. SWIPE or FLING) to the pending animation, so that the end listener can log appropriately. This is used when swiping down or up on a task, for example. Bug: 73783784 Change-Id: I5c2eee24e8b23cf4af68d503d3435a6d8088dd8a
This commit is contained in:
1 parent
b3ad0edc14
commit
9bd862e588
8 files changed
+81
-45
No files matched your search
@@ -32,7 +32,7 @@ import java.util.function.Consumer;
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
public class PendingAnimation {
|
||||
|
||||
private final ArrayList<Consumer<Boolean>> mEndListeners = new ArrayList<>();
|
||||
private final ArrayList<Consumer<OnEndListener>> mEndListeners = new ArrayList<>();
|
||||
|
||||
public final AnimatorSet anim;
|
||||
|
||||
@@ -40,14 +40,24 @@ public class PendingAnimation {
|
||||
this.anim = anim;
|
||||
}
|
||||
|
||||
public void finish(boolean isSuccess) {
|
||||
for (Consumer<Boolean> listeners : mEndListeners) {
|
||||
listeners.accept(isSuccess);
|
||||
public void finish(boolean isSuccess, int logAction) {
|
||||
for (Consumer<OnEndListener> listeners : mEndListeners) {
|
||||
listeners.accept(new OnEndListener(isSuccess, logAction));
|
||||
}
|
||||
mEndListeners.clear();
|
||||
}
|
||||
|
||||
public void addEndListener(Consumer<Boolean> listener) {
|
||||
public void addEndListener(Consumer<OnEndListener> listener) {
|
||||
mEndListeners.add(listener);
|
||||
}
|
||||
|
||||
public static class OnEndListener {
|
||||
public boolean isSuccess;
|
||||
public int logAction;
|
||||
|
||||
public OnEndListener(boolean isSuccess, int logAction) {
|
||||
this.isSuccess = isSuccess;
|
||||
this.logAction = logAction;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user