Exemplo n.º 1
0
 public final UpdateOp obtainUpdateOp(int paramInt1, int paramInt2, int paramInt3, Object paramObject)
 {
   UpdateOp localUpdateOp = (UpdateOp)this.mUpdateOpPool.acquire();
   if (localUpdateOp == null) {
     return new UpdateOp(paramInt1, paramInt2, paramInt3, paramObject);
   }
   localUpdateOp.cmd = paramInt1;
   localUpdateOp.positionStart = paramInt2;
   localUpdateOp.itemCount = paramInt3;
   localUpdateOp.payload = paramObject;
   return localUpdateOp;
 }
Exemplo n.º 2
0
 final void preProcess()
 {
   OpReorderer localOpReorderer = this.mOpReorderer;
   ArrayList localArrayList = this.mPendingUpdates;
   int i;
   int j;
   label22:
   int k;
   label54:
   int i24;
   UpdateOp localUpdateOp2;
   UpdateOp localUpdateOp3;
   for (;;)
   {
     i = 0;
     j = -1 + localArrayList.size();
     if (j < 0) {
       break label282;
     }
     if (((UpdateOp)localArrayList.get(j)).cmd != 8) {
       break;
     }
     if (i == 0) {
       break label1914;
     }
     k = j;
     if (k == -1) {
       break label1301;
     }
     i24 = k + 1;
     localUpdateOp2 = (UpdateOp)localArrayList.get(k);
     localUpdateOp3 = (UpdateOp)localArrayList.get(i24);
     switch (localUpdateOp3.cmd)
     {
     case 3: 
     default: 
       break;
     case 1: 
       int i43 = localUpdateOp2.itemCount;
       int i44 = localUpdateOp3.positionStart;
       int i45 = 0;
       if (i43 < i44) {
         i45 = -1;
       }
       if (localUpdateOp2.positionStart < localUpdateOp3.positionStart) {
         i45++;
       }
       if (localUpdateOp3.positionStart <= localUpdateOp2.positionStart) {
         localUpdateOp2.positionStart += localUpdateOp3.itemCount;
       }
       if (localUpdateOp3.positionStart <= localUpdateOp2.itemCount) {
         localUpdateOp2.itemCount += localUpdateOp3.itemCount;
       }
       localUpdateOp3.positionStart = (i45 + localUpdateOp3.positionStart);
       localArrayList.set(k, localUpdateOp3);
       localArrayList.set(i24, localUpdateOp2);
     }
   }
   label282:
   label367:
   label1914:
   for (int i46 = 1;; i46 = i)
   {
     j--;
     i = i46;
     break label22;
     k = -1;
     break label54;
     UpdateOp localUpdateOp4 = null;
     int i30;
     int i33;
     if (localUpdateOp2.positionStart < localUpdateOp2.itemCount)
     {
       int i39 = localUpdateOp3.positionStart;
       int i40 = localUpdateOp2.positionStart;
       i30 = 0;
       i33 = 0;
       if (i39 == i40)
       {
         int i41 = localUpdateOp3.itemCount;
         int i42 = localUpdateOp2.itemCount - localUpdateOp2.positionStart;
         i30 = 0;
         i33 = 0;
         if (i41 == i42) {
           i33 = 1;
         }
       }
       if (localUpdateOp2.itemCount >= localUpdateOp3.positionStart) {
         break label521;
       }
       localUpdateOp3.positionStart = (-1 + localUpdateOp3.positionStart);
       if (localUpdateOp2.positionStart > localUpdateOp3.positionStart) {
         break label595;
       }
       localUpdateOp3.positionStart = (1 + localUpdateOp3.positionStart);
     }
     for (;;)
     {
       if (i33 == 0) {
         break label685;
       }
       localArrayList.set(k, localUpdateOp3);
       localArrayList.remove(i24);
       localOpReorderer.mCallback.recycleUpdateOp(localUpdateOp2);
       break;
       i30 = 1;
       int i31 = localUpdateOp3.positionStart;
       int i32 = 1 + localUpdateOp2.itemCount;
       i33 = 0;
       if (i31 != i32) {
         break label367;
       }
       int i34 = localUpdateOp3.itemCount;
       int i35 = localUpdateOp2.positionStart - localUpdateOp2.itemCount;
       i33 = 0;
       if (i34 != i35) {
         break label367;
       }
       i33 = 1;
       break label367;
       if (localUpdateOp2.itemCount >= localUpdateOp3.positionStart + localUpdateOp3.itemCount) {
         break label392;
       }
       localUpdateOp3.itemCount = (-1 + localUpdateOp3.itemCount);
       localUpdateOp2.cmd = 2;
       localUpdateOp2.itemCount = 1;
       if (localUpdateOp3.itemCount != 0) {
         break;
       }
       localArrayList.remove(i24);
       localOpReorderer.mCallback.recycleUpdateOp(localUpdateOp3);
       break;
       int i36 = localUpdateOp2.positionStart;
       int i37 = localUpdateOp3.positionStart + localUpdateOp3.itemCount;
       localUpdateOp4 = null;
       if (i36 < i37)
       {
         int i38 = localUpdateOp3.positionStart + localUpdateOp3.itemCount - localUpdateOp2.positionStart;
         localUpdateOp4 = localOpReorderer.mCallback.obtainUpdateOp(2, 1 + localUpdateOp2.positionStart, i38, null);
         localUpdateOp3.itemCount = (localUpdateOp2.positionStart - localUpdateOp3.positionStart);
       }
     }
     if (i30 != 0)
     {
       if (localUpdateOp4 != null)
       {
         if (localUpdateOp2.positionStart > localUpdateOp4.positionStart) {
           localUpdateOp2.positionStart -= localUpdateOp4.itemCount;
         }
         if (localUpdateOp2.itemCount > localUpdateOp4.positionStart) {
           localUpdateOp2.itemCount -= localUpdateOp4.itemCount;
         }
       }
       if (localUpdateOp2.positionStart > localUpdateOp3.positionStart) {
         localUpdateOp2.positionStart -= localUpdateOp3.itemCount;
       }
       if (localUpdateOp2.itemCount > localUpdateOp3.positionStart) {
         localUpdateOp2.itemCount -= localUpdateOp3.itemCount;
       }
       localArrayList.set(k, localUpdateOp3);
       if (localUpdateOp2.positionStart == localUpdateOp2.itemCount) {
         break label988;
       }
       localArrayList.set(i24, localUpdateOp2);
     }
     while (localUpdateOp4 != null)
     {
       localArrayList.add(k, localUpdateOp4);
       break;
       if (localUpdateOp4 != null)
       {
         if (localUpdateOp2.positionStart >= localUpdateOp4.positionStart) {
           localUpdateOp2.positionStart -= localUpdateOp4.itemCount;
         }
         if (localUpdateOp2.itemCount >= localUpdateOp4.positionStart) {
           localUpdateOp2.itemCount -= localUpdateOp4.itemCount;
         }
       }
       if (localUpdateOp2.positionStart >= localUpdateOp3.positionStart) {
         localUpdateOp2.positionStart -= localUpdateOp3.itemCount;
       }
       if (localUpdateOp2.itemCount < localUpdateOp3.positionStart) {
         break label811;
       }
       localUpdateOp2.itemCount -= localUpdateOp3.itemCount;
       break label811;
       localArrayList.remove(i24);
     }
     Object localObject2 = null;
     Object localObject3 = null;
     if (localUpdateOp2.itemCount < localUpdateOp3.positionStart)
     {
       localUpdateOp3.positionStart = (-1 + localUpdateOp3.positionStart);
       if (localUpdateOp2.positionStart > localUpdateOp3.positionStart) {
         break label1187;
       }
       localUpdateOp3.positionStart = (1 + localUpdateOp3.positionStart);
       localArrayList.set(i24, localUpdateOp2);
       if (localUpdateOp3.itemCount <= 0) {
         break label1278;
       }
       localArrayList.set(k, localUpdateOp3);
     }
     for (;;)
     {
       if (localObject2 != null) {
         localArrayList.add(k, localObject2);
       }
       if (localObject3 == null) {
         break;
       }
       localArrayList.add(k, localObject3);
       break;
       int i25 = localUpdateOp2.itemCount;
       int i26 = localUpdateOp3.positionStart + localUpdateOp3.itemCount;
       localObject2 = null;
       if (i25 >= i26) {
         break label1031;
       }
       localUpdateOp3.itemCount = (-1 + localUpdateOp3.itemCount);
       localObject2 = localOpReorderer.mCallback.obtainUpdateOp(4, localUpdateOp2.positionStart, 1, localUpdateOp3.payload);
       break label1031;
       int i27 = localUpdateOp2.positionStart;
       int i28 = localUpdateOp3.positionStart + localUpdateOp3.itemCount;
       localObject3 = null;
       if (i27 >= i28) {
         break label1056;
       }
       int i29 = localUpdateOp3.positionStart + localUpdateOp3.itemCount - localUpdateOp2.positionStart;
       localObject3 = localOpReorderer.mCallback.obtainUpdateOp(4, 1 + localUpdateOp2.positionStart, i29, localUpdateOp3.payload);
       localUpdateOp3.itemCount -= i29;
       break label1056;
       label1278:
       localArrayList.remove(k);
       localOpReorderer.mCallback.recycleUpdateOp(localUpdateOp3);
     }
     int m = this.mPendingUpdates.size();
     int n = 0;
     if (n < m)
     {
       UpdateOp localUpdateOp1 = (UpdateOp)this.mPendingUpdates.get(n);
       switch (localUpdateOp1.cmd)
       {
       }
       for (;;)
       {
         if (this.mOnItemProcessedCallback != null) {
           this.mOnItemProcessedCallback.run();
         }
         n++;
         break;
         postponeAndUpdateViewHolders(localUpdateOp1);
         continue;
         int i12 = localUpdateOp1.positionStart;
         int i13 = localUpdateOp1.positionStart + localUpdateOp1.itemCount;
         int i14 = -1;
         int i15 = localUpdateOp1.positionStart;
         int i16 = 0;
         if (i15 < i13)
         {
           int i17;
           int i22;
           int i20;
           int i21;
           if ((this.mCallback.findViewHolder(i15) != null) || (canFindInPreLayout(i15)))
           {
             i17 = 0;
             if (i14 == 0)
             {
               dispatchAndUpdateViewHolders(obtainUpdateOp(2, i12, i16, null));
               i17 = 1;
             }
             i14 = 1;
             if (i17 == 0) {
               break label1581;
             }
             i22 = i15 - i16;
             i20 = i13 - i16;
             i21 = 1;
           }
           for (;;)
           {
             int i23 = i22 + 1;
             i16 = i21;
             i13 = i20;
             i15 = i23;
             break;
             i17 = 0;
             if (i14 == 1)
             {
               postponeAndUpdateViewHolders(obtainUpdateOp(2, i12, i16, null));
               i17 = 1;
             }
             i14 = 0;
             break label1506;
             int i18 = i16 + 1;
             int i19 = i15;
             i20 = i13;
             i21 = i18;
             i22 = i19;
           }
         }
         if (i16 != localUpdateOp1.itemCount)
         {
           recycleUpdateOp(localUpdateOp1);
           localUpdateOp1 = obtainUpdateOp(2, i12, i16, null);
         }
         if (i14 == 0)
         {
           dispatchAndUpdateViewHolders(localUpdateOp1);
         }
         else
         {
           postponeAndUpdateViewHolders(localUpdateOp1);
           continue;
           int i1 = localUpdateOp1.positionStart;
           int i2 = localUpdateOp1.positionStart + localUpdateOp1.itemCount;
           int i3 = localUpdateOp1.positionStart;
           int i4 = 0;
           int i5 = i1;
           int i6 = -1;
           if (i3 < i2)
           {
             int i7;
             int i8;
             if ((this.mCallback.findViewHolder(i3) != null) || (canFindInPreLayout(i3)))
             {
               if (i6 == 0)
               {
                 dispatchAndUpdateViewHolders(obtainUpdateOp(4, i5, i4, localUpdateOp1.payload));
                 i4 = 0;
                 i5 = i3;
               }
               i7 = i5;
               i8 = i4;
             }
             for (int i9 = 1;; i9 = 0)
             {
               int i10 = i8 + 1;
               i3++;
               int i11 = i9;
               i4 = i10;
               i5 = i7;
               i6 = i11;
               break;
               if (i6 == 1)
               {
                 postponeAndUpdateViewHolders(obtainUpdateOp(4, i5, i4, localUpdateOp1.payload));
                 i4 = 0;
                 i5 = i3;
               }
               i7 = i5;
               i8 = i4;
             }
           }
           if (i4 != localUpdateOp1.itemCount)
           {
             Object localObject1 = localUpdateOp1.payload;
             recycleUpdateOp(localUpdateOp1);
             localUpdateOp1 = obtainUpdateOp(4, i5, i4, localObject1);
           }
           if (i6 == 0)
           {
             dispatchAndUpdateViewHolders(localUpdateOp1);
           }
           else
           {
             postponeAndUpdateViewHolders(localUpdateOp1);
             continue;
             postponeAndUpdateViewHolders(localUpdateOp1);
           }
         }
       }
     }
     this.mPendingUpdates.clear();
     return;
   }
 }
Exemplo n.º 3
0
 private int updatePositionWithPostponed(int paramInt1, int paramInt2)
 {
   int i = -1 + this.mPostponedList.size();
   if (i >= 0)
   {
     UpdateOp localUpdateOp2 = (UpdateOp)this.mPostponedList.get(i);
     int k;
     int m;
     if (localUpdateOp2.cmd == 8) {
       if (localUpdateOp2.positionStart < localUpdateOp2.itemCount)
       {
         k = localUpdateOp2.positionStart;
         m = localUpdateOp2.itemCount;
         label64:
         if ((paramInt1 < k) || (paramInt1 > m)) {
           break label192;
         }
         if (k != localUpdateOp2.positionStart) {
           break label149;
         }
         if (paramInt2 != 1) {
           break label129;
         }
         localUpdateOp2.itemCount = (1 + localUpdateOp2.itemCount);
         label103:
         paramInt1++;
       }
     }
     for (;;)
     {
       i--;
       break;
       k = localUpdateOp2.itemCount;
       m = localUpdateOp2.positionStart;
       break label64;
       label129:
       if (paramInt2 != 2) {
         break label103;
       }
       localUpdateOp2.itemCount = (-1 + localUpdateOp2.itemCount);
       break label103;
       label149:
       if (paramInt2 == 1) {
         localUpdateOp2.positionStart = (1 + localUpdateOp2.positionStart);
       }
       for (;;)
       {
         paramInt1--;
         break;
         if (paramInt2 == 2) {
           localUpdateOp2.positionStart = (-1 + localUpdateOp2.positionStart);
         }
       }
       label192:
       if (paramInt1 < localUpdateOp2.positionStart) {
         if (paramInt2 == 1)
         {
           localUpdateOp2.positionStart = (1 + localUpdateOp2.positionStart);
           localUpdateOp2.itemCount = (1 + localUpdateOp2.itemCount);
         }
         else if (paramInt2 == 2)
         {
           localUpdateOp2.positionStart = (-1 + localUpdateOp2.positionStart);
           localUpdateOp2.itemCount = (-1 + localUpdateOp2.itemCount);
           continue;
           if (localUpdateOp2.positionStart <= paramInt1)
           {
             if (localUpdateOp2.cmd == 1) {
               paramInt1 -= localUpdateOp2.itemCount;
             } else if (localUpdateOp2.cmd == 2) {
               paramInt1 += localUpdateOp2.itemCount;
             }
           }
           else if (paramInt2 == 1) {
             localUpdateOp2.positionStart = (1 + localUpdateOp2.positionStart);
           } else if (paramInt2 == 2) {
             localUpdateOp2.positionStart = (-1 + localUpdateOp2.positionStart);
           }
         }
       }
     }
   }
   int j = -1 + this.mPostponedList.size();
   if (j >= 0)
   {
     UpdateOp localUpdateOp1 = (UpdateOp)this.mPostponedList.get(j);
     if (localUpdateOp1.cmd == 8) {
       if ((localUpdateOp1.itemCount == localUpdateOp1.positionStart) || (localUpdateOp1.itemCount < 0))
       {
         this.mPostponedList.remove(j);
         recycleUpdateOp(localUpdateOp1);
       }
     }
     for (;;)
     {
       j--;
       break;
       if (localUpdateOp1.itemCount <= 0)
       {
         this.mPostponedList.remove(j);
         recycleUpdateOp(localUpdateOp1);
       }
     }
   }
   return paramInt1;
 }