bh$a.java 2.69 KB
import android.support.transition.TransitionPort;
import android.support.transition.TransitionPort.TransitionListenerAdapter;
import android.support.v4.util.ArrayMap;
import android.view.View;
import android.view.View.OnAttachStateChangeListener;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver.OnPreDrawListener;
import java.util.ArrayList;
import java.util.Iterator;

final class bh$a
  implements View.OnAttachStateChangeListener, ViewTreeObserver.OnPreDrawListener
{
  TransitionPort a;
  ViewGroup b;
  
  bh$a(TransitionPort paramTransitionPort, ViewGroup paramViewGroup)
  {
    this.a = paramTransitionPort;
    this.b = paramViewGroup;
  }
  
  private void a()
  {
    this.b.getViewTreeObserver().removeOnPreDrawListener(this);
    this.b.removeOnAttachStateChangeListener(this);
  }
  
  public final boolean onPreDraw()
  {
    a();
    bh.b.remove(this.b);
    final ArrayMap localArrayMap = bh.a();
    ArrayList localArrayList = (ArrayList)localArrayMap.get(this.b);
    Object localObject;
    if (localArrayList == null)
    {
      localArrayList = new ArrayList();
      localArrayMap.put(this.b, localArrayList);
      localObject = null;
    }
    for (;;)
    {
      localArrayList.add(this.a);
      this.a.a(new TransitionPort.TransitionListenerAdapter()
      {
        public final void onTransitionEnd(TransitionPort paramAnonymousTransitionPort)
        {
          ((ArrayList)localArrayMap.get(bh.a.this.b)).remove(paramAnonymousTransitionPort);
        }
      });
      this.a.a(this.b, false);
      if (localObject != null)
      {
        localObject = ((ArrayList)localObject).iterator();
        for (;;)
        {
          if (((Iterator)localObject).hasNext())
          {
            ((TransitionPort)((Iterator)localObject).next()).d(this.b);
            continue;
            if (localArrayList.size() <= 0) {
              break label162;
            }
            localObject = new ArrayList(localArrayList);
            break;
          }
        }
      }
      this.a.a(this.b);
      return true;
      label162:
      localObject = null;
    }
  }
  
  public final void onViewAttachedToWindow(View paramView) {}
  
  public final void onViewDetachedFromWindow(View paramView)
  {
    a();
    bh.b.remove(this.b);
    paramView = (ArrayList)bh.a().get(this.b);
    if ((paramView != null) && (paramView.size() > 0))
    {
      paramView = paramView.iterator();
      while (paramView.hasNext()) {
        ((TransitionPort)paramView.next()).d(this.b);
      }
    }
    this.a.a(true);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/bh$a.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */