Scene.java 2.43 KB
package android.support.transition;

import android.content.Context;
import android.os.Build.VERSION;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import ao;
import ap;
import aq;
import ar;
import at;
import au;
import av;
import aw;

public class Scene
{
  private static av b = new au();
  aq a;
  
  static
  {
    if (Build.VERSION.SDK_INT >= 21)
    {
      b = new at();
      return;
    }
    if (Build.VERSION.SDK_INT >= 19)
    {
      b = new aw();
      return;
    }
  }
  
  public Scene(@NonNull ViewGroup paramViewGroup)
  {
    this.a = a();
    this.a.a(paramViewGroup);
  }
  
  public Scene(@NonNull ViewGroup paramViewGroup, @NonNull View paramView)
  {
    this.a = a();
    this.a.a(paramViewGroup, paramView);
  }
  
  private Scene(aq paramaq)
  {
    this.a = paramaq;
  }
  
  private static aq a()
  {
    if (Build.VERSION.SDK_INT >= 21) {
      return new ao();
    }
    if (Build.VERSION.SDK_INT >= 19) {
      return new ar();
    }
    return new ap();
  }
  
  @NonNull
  public static Scene getSceneForLayout(@NonNull ViewGroup paramViewGroup, @LayoutRes int paramInt, @NonNull Context paramContext)
  {
    SparseArray localSparseArray = (SparseArray)paramViewGroup.getTag(R.id.transition_scene_layoutid_cache);
    if (localSparseArray == null)
    {
      localSparseArray = new SparseArray();
      paramViewGroup.setTag(R.id.transition_scene_layoutid_cache, localSparseArray);
    }
    for (;;)
    {
      Scene localScene = (Scene)localSparseArray.get(paramInt);
      if (localScene != null) {
        return localScene;
      }
      paramViewGroup = new Scene(b.a(paramViewGroup, paramInt, paramContext));
      localSparseArray.put(paramInt, paramViewGroup);
      return paramViewGroup;
    }
  }
  
  public void enter()
  {
    this.a.a();
  }
  
  public void exit()
  {
    this.a.b();
  }
  
  @NonNull
  public ViewGroup getSceneRoot()
  {
    return this.a.c();
  }
  
  public void setEnterAction(@Nullable Runnable paramRunnable)
  {
    this.a.a(paramRunnable);
  }
  
  public void setExitAction(@Nullable Runnable paramRunnable)
  {
    this.a.b(paramRunnable);
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/android/support/transition/Scene.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */