PopupWindowCompat.java 4.95 KB
package android.support.v4.widget;

import android.os.Build.VERSION;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewCompat;
import android.view.View;
import android.widget.PopupWindow;
import ez;
import java.lang.reflect.Method;

public final class PopupWindowCompat
{
  static final e a = new c();
  
  static
  {
    int i = Build.VERSION.SDK_INT;
    if (i >= 23)
    {
      a = new b();
      return;
    }
    if (i >= 21)
    {
      a = new a();
      return;
    }
    if (i >= 19)
    {
      a = new d();
      return;
    }
  }
  
  public static boolean getOverlapAnchor(PopupWindow paramPopupWindow)
  {
    return a.a(paramPopupWindow);
  }
  
  public static int getWindowLayoutType(PopupWindow paramPopupWindow)
  {
    return a.b(paramPopupWindow);
  }
  
  public static void setOverlapAnchor(PopupWindow paramPopupWindow, boolean paramBoolean)
  {
    a.a(paramPopupWindow, paramBoolean);
  }
  
  public static void setWindowLayoutType(PopupWindow paramPopupWindow, int paramInt)
  {
    a.a(paramPopupWindow, paramInt);
  }
  
  public static void showAsDropDown(PopupWindow paramPopupWindow, View paramView, int paramInt1, int paramInt2, int paramInt3)
  {
    a.a(paramPopupWindow, paramView, paramInt1, paramInt2, paramInt3);
  }
  
  static class a
    extends PopupWindowCompat.d
  {
    public void a(PopupWindow paramPopupWindow, boolean paramBoolean)
    {
      ez.a(paramPopupWindow, paramBoolean);
    }
    
    public boolean a(PopupWindow paramPopupWindow)
    {
      return ez.a(paramPopupWindow);
    }
  }
  
  static final class b
    extends PopupWindowCompat.a
  {
    public final void a(PopupWindow paramPopupWindow, int paramInt)
    {
      paramPopupWindow.setWindowLayoutType(paramInt);
    }
    
    public final void a(PopupWindow paramPopupWindow, boolean paramBoolean)
    {
      paramPopupWindow.setOverlapAnchor(paramBoolean);
    }
    
    public final boolean a(PopupWindow paramPopupWindow)
    {
      return paramPopupWindow.getOverlapAnchor();
    }
    
    public final int b(PopupWindow paramPopupWindow)
    {
      return paramPopupWindow.getWindowLayoutType();
    }
  }
  
  static class c
    implements PopupWindowCompat.e
  {
    private static Method a;
    private static boolean b;
    private static Method c;
    private static boolean d;
    
    public void a(PopupWindow paramPopupWindow, int paramInt)
    {
      if (!b) {}
      try
      {
        Method localMethod = PopupWindow.class.getDeclaredMethod("setWindowLayoutType", new Class[] { Integer.TYPE });
        a = localMethod;
        localMethod.setAccessible(true);
        b = true;
        if (a != null) {}
        try
        {
          a.invoke(paramPopupWindow, new Object[] { Integer.valueOf(paramInt) });
          return;
        }
        catch (Exception paramPopupWindow) {}
      }
      catch (Exception localException)
      {
        for (;;) {}
      }
    }
    
    public void a(PopupWindow paramPopupWindow, View paramView, int paramInt1, int paramInt2, int paramInt3)
    {
      int i = paramInt1;
      if ((GravityCompat.getAbsoluteGravity(paramInt3, ViewCompat.getLayoutDirection(paramView)) & 0x7) == 5) {
        i = paramInt1 - (paramPopupWindow.getWidth() - paramView.getWidth());
      }
      paramPopupWindow.showAsDropDown(paramView, i, paramInt2);
    }
    
    public void a(PopupWindow paramPopupWindow, boolean paramBoolean) {}
    
    public boolean a(PopupWindow paramPopupWindow)
    {
      return false;
    }
    
    public int b(PopupWindow paramPopupWindow)
    {
      if (!d) {}
      try
      {
        Method localMethod = PopupWindow.class.getDeclaredMethod("getWindowLayoutType", new Class[0]);
        c = localMethod;
        localMethod.setAccessible(true);
        d = true;
        if (c != null) {
          try
          {
            int i = ((Integer)c.invoke(paramPopupWindow, new Object[0])).intValue();
            return i;
          }
          catch (Exception paramPopupWindow) {}
        }
        return 0;
      }
      catch (Exception localException)
      {
        for (;;) {}
      }
    }
  }
  
  static class d
    extends PopupWindowCompat.c
  {
    public final void a(PopupWindow paramPopupWindow, View paramView, int paramInt1, int paramInt2, int paramInt3)
    {
      paramPopupWindow.showAsDropDown(paramView, paramInt1, paramInt2, paramInt3);
    }
  }
  
  static abstract interface e
  {
    public abstract void a(PopupWindow paramPopupWindow, int paramInt);
    
    public abstract void a(PopupWindow paramPopupWindow, View paramView, int paramInt1, int paramInt2, int paramInt3);
    
    public abstract void a(PopupWindow paramPopupWindow, boolean paramBoolean);
    
    public abstract boolean a(PopupWindow paramPopupWindow);
    
    public abstract int b(PopupWindow paramPopupWindow);
  }
}


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