File tree 2 files changed +15
-7
lines changed
fragmentation_core/src/main/java/me/yokeyword/fragmentation/queue
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,6 @@ public Action() {
24
24
25
25
public Action (int action ) {
26
26
this .action = action ;
27
- if (action == ACTION_POP_MOCK ) {
28
- duration = BUFFER_TIME ;
29
- }
30
27
}
31
28
32
29
public Action (int action , FragmentManager fragmentManager ) {
Original file line number Diff line number Diff line change @@ -59,15 +59,26 @@ private void executeNextAction(Action action) {
59
59
if (action .action == Action .ACTION_POP ) {
60
60
ISupportFragment top = SupportHelper .getTopFragment (action .fragmentManager );
61
61
if (top == null ) return ;
62
- long duration = top .getSupportDelegate ().getExitAnimDuration ();
63
- action .duration = duration + Action .BUFFER_TIME ;
62
+ action .duration = top .getSupportDelegate ().getExitAnimDuration () + Action .BUFFER_TIME ;
64
63
}
65
64
65
+ final int currentAction = action .action ;
66
66
mMainHandler .postDelayed (new Runnable () {
67
67
@ Override
68
68
public void run () {
69
- mQueue .poll ();
70
- handleAction ();
69
+ if (currentAction == Action .ACTION_POP || currentAction == Action .ACTION_POP_MOCK ) {
70
+ // For compatibility with v4-27+, see #653
71
+ mMainHandler .post (new Runnable () {
72
+ @ Override
73
+ public void run () {
74
+ mQueue .poll ();
75
+ handleAction ();
76
+ }
77
+ });
78
+ } else {
79
+ mQueue .poll ();
80
+ handleAction ();
81
+ }
71
82
}
72
83
}, action .duration );
73
84
}
You can’t perform that action at this time.
0 commit comments