Offset 1, 13 lines modifiedOffset 1, 13 lines modified
  
1 package·androidx.fragment.app;1 package·androidx.fragment.app;
  
2 import·java.util.Iterator; 
3 import·java.util.Collection;2 import·java.util.Collection;
4 import·java.util.List;3 import·java.util.List;
 4 import·java.util.Iterator;
5 import·androidx.fragment.R$id;5 import·androidx.fragment.R$id;
6 import·androidx.core.os.CancellationSignal$OnCancelListener;6 import·androidx.core.os.CancellationSignal$OnCancelListener;
7 import·androidx.core.os.CancellationSignal;7 import·androidx.core.os.CancellationSignal;
8 import·java.util.ArrayList;8 import·java.util.ArrayList;
9 import·android.view.ViewGroup;9 import·android.view.ViewGroup;
10 import·java.util.HashMap;10 import·java.util.HashMap;
  
Offset 23, 26 lines modifiedOffset 23, 21 lines modified
23 ········this.mPendingOperations·=·new·ArrayList();23 ········this.mPendingOperations·=·new·ArrayList();
24 ········this.mAwaitingCompletionOperations·=·new·HashMap();24 ········this.mAwaitingCompletionOperations·=·new·HashMap();
25 ········this.mOperationDirectionIsPop·=·false;25 ········this.mOperationDirectionIsPop·=·false;
26 ········this.mIsContainerPostponed·=·false;26 ········this.mIsContainerPostponed·=·false;
27 ········this.mContainer·=·mContainer;27 ········this.mContainer·=·mContainer;
28 ····}28 ····}
29 ····29 ····
30 ····private·void·enqueue(final·SpecialEffectsController$Operation$State·specialEffectsController$Operation$State,·final·SpecialEffectsController$Operation$LifecycleImpact·specialEffectsController$Operation$LifecycleImpact,·final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{30 ····private·void·enqueue(final·SpecialEffectsController$Operation$Type·specialEffectsController$Operation$Type,·final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{
31 ········if·(cancellationSignal.isCanceled())·{31 ········if·(cancellationSignal.isCanceled())·{
32 ············return;32 ············return;
33 ········}33 ········}
34 ········synchronized·(this.mPendingOperations)·{34 ········synchronized·(this.mPendingOperations)·{
35 ············final·CancellationSignal·cancellationSignal2·=·new·CancellationSignal();35 ············final·CancellationSignal·cancellationSignal2·=·new·CancellationSignal();
36 ············final·SpecialEffectsController$Operation·specialEffectsController$Operation·=·(SpecialEffectsController$Operation)this.mAwaitingCompletionOperations.get(fragmentStateManager.getFragment()); 
37 ············if·(specialEffectsController$Operation·!=·null)·{ 
38 ················specialEffectsController$Operation.mergeWith(specialEffectsController$Operation$State,·specialEffectsController$Operation$LifecycleImpact,·cancellationSignal); 
39 ················return; 
40 ············} 
41 ············final·SpecialEffectsController$FragmentStateManagerOperation·specialEffectsController$FragmentStateManagerOperation·=·new·SpecialEffectsController$FragmentStateManagerOperation(specialEffectsController$Operation$State,·specialEffectsController$Operation$LifecycleImpact,·fragmentStateManager,·cancellationSignal2);36 ············final·SpecialEffectsController$FragmentStateManagerOperation·specialEffectsController$FragmentStateManagerOperation·=·new·SpecialEffectsController$FragmentStateManagerOperation(specialEffectsController$Operation$Type,·fragmentStateManager,·cancellationSignal2);
42 ············this.mPendingOperations.add(specialEffectsController$FragmentStateManagerOperation);37 ············this.mPendingOperations.add(specialEffectsController$FragmentStateManagerOperation);
43 ············this.mAwaitingCompletionOperations.put(((SpecialEffectsController$Operation)specialEffectsController$FragmentStateManagerOperation).getFragment(),·specialEffectsController$FragmentStateManagerOperation);38 ············this.mAwaitingCompletionOperations.put(((SpecialEffectsController$Operation)specialEffectsController$FragmentStateManagerOperation).getFragment(),·specialEffectsController$FragmentStateManagerOperation);
44 ············cancellationSignal.setOnCancelListener((CancellationSignal$OnCancelListener)new·SpecialEffectsController$1(this,·specialEffectsController$FragmentStateManagerOperation,·cancellationSignal2));39 ············cancellationSignal.setOnCancelListener((CancellationSignal$OnCancelListener)new·SpecialEffectsController$1(this,·specialEffectsController$FragmentStateManagerOperation,·cancellationSignal2));
45 ············((SpecialEffectsController$Operation)specialEffectsController$FragmentStateManagerOperation).addCompletionListener((Runnable)new·SpecialEffectsController$2(this,·specialEffectsController$FragmentStateManagerOperation));40 ············((SpecialEffectsController$Operation)specialEffectsController$FragmentStateManagerOperation).addCompletionListener((Runnable)new·SpecialEffectsController$2(this,·specialEffectsController$FragmentStateManagerOperation));
46 ········}41 ········}
47 ····}42 ····}
48 ····43 ····
Offset 56, 84 lines modifiedOffset 51, 80 lines modified
56 ············return·(SpecialEffectsController)tag;51 ············return·(SpecialEffectsController)tag;
57 ········}52 ········}
58 ········final·SpecialEffectsController·controller·=·specialEffectsControllerFactory.createController(viewGroup);53 ········final·SpecialEffectsController·controller·=·specialEffectsControllerFactory.createController(viewGroup);
59 ········viewGroup.setTag(R$id.special_effects_controller_view_tag,·(Object)controller);54 ········viewGroup.setTag(R$id.special_effects_controller_view_tag,·(Object)controller);
60 ········return·controller;55 ········return·controller;
61 ····}56 ····}
62 ····57 ····
63 ····void·enqueueAdd(final·SpecialEffectsController$Operation$State·specialEffectsController$Operation$State,·final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{58 ····void·cancelAllOperations()·{
 59 ········synchronized·(this.mPendingOperations)·{
 60 ············final·Iterator<SpecialEffectsController$Operation>·iterator·=·this.mAwaitingCompletionOperations.values().iterator();
 61 ············while·(iterator.hasNext())·{
 62 ················((SpecialEffectsController$Operation)iterator.next()).getCancellationSignal().cancel();
 63 ············}
 64 ············this.mAwaitingCompletionOperations.clear();
 65 ············this.mPendingOperations.clear();
 66 ········}
 67 ····}
 68 ····
 69 ····void·enqueueAdd(final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{
64 ········this.enqueue(specialEffectsController$Operation$State,·SpecialEffectsController$Operation$LifecycleImpact.ADDING,·fragmentStateManager,·cancellationSignal);70 ········this.enqueue(SpecialEffectsController$Operation$Type.ADD,·fragmentStateManager,·cancellationSignal);
65 ····}71 ····}
66 ····72 ····
67 ····void·enqueueHide(final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{73 ····void·enqueueHide(final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{
68 ········this.enqueue(SpecialEffectsController$Operation$State.GONE,·SpecialEffectsController$Operation$LifecycleImpact.NONE,·fragmentStateManager,·cancellationSignal);74 ········this.enqueue(SpecialEffectsController$Operation$Type.HIDE,·fragmentStateManager,·cancellationSignal);
69 ····}75 ····}
70 ····76 ····
71 ····void·enqueueRemove(final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{77 ····void·enqueueRemove(final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{
72 ········this.enqueue(SpecialEffectsController$Operation$State.REMOVED,·SpecialEffectsController$Operation$LifecycleImpact.REMOVING,·fragmentStateManager,·cancellationSignal);78 ········this.enqueue(SpecialEffectsController$Operation$Type.REMOVE,·fragmentStateManager,·cancellationSignal);
73 ····}79 ····}
74 ····80 ····
75 ····void·enqueueShow(final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{81 ····void·enqueueShow(final·FragmentStateManager·fragmentStateManager,·final·CancellationSignal·cancellationSignal)·{
76 ········this.enqueue(SpecialEffectsController$Operation$State.VISIBLE,·SpecialEffectsController$Operation$LifecycleImpact.NONE,·fragmentStateManager,·cancellationSignal);82 ········this.enqueue(SpecialEffectsController$Operation$Type.SHOW,·fragmentStateManager,·cancellationSignal);
77 ····}83 ····}
78 ····84 ····
79 ····abstract·void·executeOperations(final·List·p0,·final·boolean·p1);85 ····abstract·void·executeOperations(final·List·p0,·final·boolean·p1);
80 ····86 ····
81 ····void·executePendingOperations()·{87 ····void·executePendingOperations()·{
82 ········if·(this.mIsContainerPostponed)·{88 ········if·(this.mIsContainerPostponed)·{
83 ············return;89 ············return;
84 ········}90 ········}
85 ········synchronized·(this.mPendingOperations)·{91 ········synchronized·(this.mPendingOperations)·{
86 ············if·(!this.mPendingOperations.isEmpty())·{ 
87 ················this.executeOperations(new·ArrayList(this.mPendingOperations),·this.mOperationDirectionIsPop);92 ············this.executeOperations(new·ArrayList(this.mPendingOperations),·this.mOperationDirectionIsPop);
88 ················this.mPendingOperations.clear(); 
89 ················this.mOperationDirectionIsPop·=·false; 
90 ············} 
91 ········} 
92 ····} 
93 ···· 
94 ····void·forceCompleteAllOperations()·{ 
95 ········synchronized·(this.mPendingOperations)·{ 
96 ············for·(final·SpecialEffectsController$Operation·specialEffectsController$Operation·:·this.mAwaitingCompletionOperations.values())·{ 
97 ················specialEffectsController$Operation.getCancellationSignal().cancel(); 
98 ················specialEffectsController$Operation.getFinalState().applyState(specialEffectsController$Operation.getFragment().mView); 
99 ················specialEffectsController$Operation.complete(); 
100 ············} 
101 ············this.mAwaitingCompletionOperations.clear(); 
102 ············this.mPendingOperations.clear();93 ············this.mPendingOperations.clear();
 94 ············this.mOperationDirectionIsPop·=·false;
103 ········}95 ········}
104 ····}96 ····}
105 ····97 ····
106 ····void·forcePostponedExecutePendingOperations()·{98 ····void·forcePostponedExecutePendingOperations()·{
107 ········if·(this.mIsContainerPostponed)·{99 ········if·(this.mIsContainerPostponed)·{
108 ············this.mIsContainerPostponed·=·false;100 ············this.mIsContainerPostponed·=·false;
109 ············this.executePendingOperations();101 ············this.executePendingOperations();
110 ········}102 ········}
111 ····}103 ····}
112 ····104 ····
113 ····SpecialEffectsController$Operation$LifecycleImpact·getAwaitingCompletionLifecycleImpact(final·FragmentStateManager·fragmentStateManager)·{105 ····SpecialEffectsController$Operation$Type·getAwaitingCompletionType(final·FragmentStateManager·fragmentStateManager)·{
114 ········final·SpecialEffectsController$Operation·specialEffectsController$Operation·=·(SpecialEffectsController$Operation)this.mAwaitingCompletionOperations.get(fragmentStateManager.getFragment());106 ········final·SpecialEffectsController$Operation·specialEffectsController$Operation·=·(SpecialEffectsController$Operation)this.mAwaitingCompletionOperations.get(fragmentStateManager.getFragment());
115 ········if·(specialEffectsController$Operation·!=·null·&&·!specialEffectsController$Operation.getCancellationSignal().isCanceled())·{107 ········if·(specialEffectsController$Operation·!=·null)·{
116 ············return·specialEffectsController$Operation.getLifecycleImpact();108 ············return·specialEffectsController$Operation.getType();
117 ········}109 ········}
118 ········return·null;110 ········return·null;
119 ····}111 ····}
120 ····112 ····
121 ····public·ViewGroup·getContainer()·{113 ····public·ViewGroup·getContainer()·{
122 ········return·this.mContainer;114 ········return·this.mContainer;
123 ····}115 ····}
124 ····116 ····
125 ····void·markPostponedState()·{117 ····void·markPostponedState()·{
126 ········final·ArrayList·mPendingOperations·=·this.mPendingOperations;118 ········final·ArrayList·mPendingOperations·=·this.mPendingOperations;
127 ········synchronized·(mPendingOperations)·{119 ········synchronized·(mPendingOperations)·{
128 ············this.mIsContainerPostponed·=·false;120 ············this.mIsContainerPostponed·=·false;
129 ············for·(int·i·=·this.mPendingOperations.size()·-·1;·i·>=·0;·--i)·{121 ············for·(int·i·=·this.mPendingOperations.size()·-·1;·i·>=·0;·--i)·{
130 ················final·SpecialEffectsController$Operation·specialEffectsController$Operation·=·(SpecialEffectsController$Operation)this.mPendingOperations.get(i);122 ················final·SpecialEffectsController$Operation·specialEffectsController$Operation·=·(SpecialEffectsController$Operation)this.mPendingOperations.get(i);
 123 ················if·(specialEffectsController$Operation.getType()·==·SpecialEffectsController$Operation$Type.ADD·||·specialEffectsController$Operation.getType()·==·SpecialEffectsController$Operation$Type.SHOW)·{
131 ················final·SpecialEffectsController$Operation$State·from·=·SpecialEffectsController$Operation$State.from(specialEffectsController$Operation.getFragment().mView); 
132 ················if·(specialEffectsController$Operation.getFinalState()·==·SpecialEffectsController$Operation$State.VISIBLE·&&·from·!=·SpecialEffectsController$Operation$State.VISIBLE)·{ 
133 ····················this.mIsContainerPostponed·=·specialEffectsController$Operation.getFragment().isPostponed();124 ····················this.mIsContainerPostponed·=·specialEffectsController$Operation.getFragment().isPostponed();
134 ····················break;125 ····················break;
135 ················}126 ················}
136 ············}127 ············}
137 ········}128 ········}
138 ····}129 ····}
139 ····130 ····