KeyEventCompat.java 4.11 KB
package android.support.v4.view;

import android.os.Build.VERSION;
import android.view.KeyEvent;
import android.view.KeyEvent.Callback;
import android.view.KeyEvent.DispatcherState;
import android.view.View;

public final class KeyEventCompat
{
  static final c a = new a();
  
  static
  {
    if (Build.VERSION.SDK_INT >= 11)
    {
      a = new b();
      return;
    }
  }
  
  @Deprecated
  public static boolean dispatch(KeyEvent paramKeyEvent, KeyEvent.Callback paramCallback, Object paramObject1, Object paramObject2)
  {
    return paramKeyEvent.dispatch(paramCallback, (KeyEvent.DispatcherState)paramObject1, paramObject2);
  }
  
  @Deprecated
  public static Object getKeyDispatcherState(View paramView)
  {
    return paramView.getKeyDispatcherState();
  }
  
  public static boolean hasModifiers(KeyEvent paramKeyEvent, int paramInt)
  {
    return a.a(paramKeyEvent.getMetaState(), paramInt);
  }
  
  public static boolean hasNoModifiers(KeyEvent paramKeyEvent)
  {
    return a.b(paramKeyEvent.getMetaState());
  }
  
  public static boolean isCtrlPressed(KeyEvent paramKeyEvent)
  {
    return a.a(paramKeyEvent);
  }
  
  @Deprecated
  public static boolean isTracking(KeyEvent paramKeyEvent)
  {
    return paramKeyEvent.isTracking();
  }
  
  public static boolean metaStateHasModifiers(int paramInt1, int paramInt2)
  {
    return a.a(paramInt1, paramInt2);
  }
  
  public static boolean metaStateHasNoModifiers(int paramInt)
  {
    return a.b(paramInt);
  }
  
  public static int normalizeMetaState(int paramInt)
  {
    return a.a(paramInt);
  }
  
  @Deprecated
  public static void startTracking(KeyEvent paramKeyEvent)
  {
    paramKeyEvent.startTracking();
  }
  
  static class a
    implements KeyEventCompat.c
  {
    private static int a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5)
    {
      int j = 1;
      int i;
      if ((paramInt2 & paramInt3) != 0)
      {
        i = 1;
        paramInt4 |= paramInt5;
        if ((paramInt2 & paramInt4) == 0) {
          break label51;
        }
        paramInt2 = j;
      }
      for (;;)
      {
        if (i != 0)
        {
          if (paramInt2 != 0)
          {
            throw new IllegalArgumentException("bad arguments");
            i = 0;
            break;
            label51:
            paramInt2 = 0;
            continue;
          }
          paramInt4 = paramInt1 & (paramInt4 ^ 0xFFFFFFFF);
        }
      }
      do
      {
        return paramInt4;
        paramInt4 = paramInt1;
      } while (paramInt2 == 0);
      return paramInt1 & (paramInt3 ^ 0xFFFFFFFF);
    }
    
    public int a(int paramInt)
    {
      if ((paramInt & 0xC0) != 0) {
        paramInt |= 0x1;
      }
      for (;;)
      {
        int i = paramInt;
        if ((paramInt & 0x30) != 0) {
          i = paramInt | 0x2;
        }
        return i & 0xF7;
      }
    }
    
    public boolean a(int paramInt1, int paramInt2)
    {
      return a(a(a(paramInt1) & 0xF7, paramInt2, 1, 64, 128), paramInt2, 2, 16, 32) == paramInt2;
    }
    
    public boolean a(KeyEvent paramKeyEvent)
    {
      return false;
    }
    
    public boolean b(int paramInt)
    {
      return (a(paramInt) & 0xF7) == 0;
    }
  }
  
  static final class b
    extends KeyEventCompat.a
  {
    public final int a(int paramInt)
    {
      return KeyEvent.normalizeMetaState(paramInt);
    }
    
    public final boolean a(int paramInt1, int paramInt2)
    {
      return KeyEvent.metaStateHasModifiers(paramInt1, paramInt2);
    }
    
    public final boolean a(KeyEvent paramKeyEvent)
    {
      return paramKeyEvent.isCtrlPressed();
    }
    
    public final boolean b(int paramInt)
    {
      return KeyEvent.metaStateHasNoModifiers(paramInt);
    }
  }
  
  static abstract interface c
  {
    public abstract int a(int paramInt);
    
    public abstract boolean a(int paramInt1, int paramInt2);
    
    public abstract boolean a(KeyEvent paramKeyEvent);
    
    public abstract boolean b(int paramInt);
  }
}


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