MarginLayoutParamsCompat.java 4.95 KB
package android.support.v4.view;

import android.os.Build.VERSION;
import android.view.ViewGroup.MarginLayoutParams;

public final class MarginLayoutParamsCompat
{
  static final a a = new b();
  
  static
  {
    if (Build.VERSION.SDK_INT >= 17)
    {
      a = new c();
      return;
    }
  }
  
  public static int getLayoutDirection(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
  {
    int j = a.d(paramMarginLayoutParams);
    int i = j;
    if (j != 0)
    {
      i = j;
      if (j != 1) {
        i = 0;
      }
    }
    return i;
  }
  
  public static int getMarginEnd(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
  {
    return a.b(paramMarginLayoutParams);
  }
  
  public static int getMarginStart(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
  {
    return a.a(paramMarginLayoutParams);
  }
  
  public static boolean isMarginRelative(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
  {
    return a.c(paramMarginLayoutParams);
  }
  
  public static void resolveLayoutDirection(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
  {
    a.d(paramMarginLayoutParams, paramInt);
  }
  
  public static void setLayoutDirection(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
  {
    a.c(paramMarginLayoutParams, paramInt);
  }
  
  public static void setMarginEnd(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
  {
    a.b(paramMarginLayoutParams, paramInt);
  }
  
  public static void setMarginStart(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
  {
    a.a(paramMarginLayoutParams, paramInt);
  }
  
  static abstract interface a
  {
    public abstract int a(ViewGroup.MarginLayoutParams paramMarginLayoutParams);
    
    public abstract void a(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt);
    
    public abstract int b(ViewGroup.MarginLayoutParams paramMarginLayoutParams);
    
    public abstract void b(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt);
    
    public abstract void c(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt);
    
    public abstract boolean c(ViewGroup.MarginLayoutParams paramMarginLayoutParams);
    
    public abstract int d(ViewGroup.MarginLayoutParams paramMarginLayoutParams);
    
    public abstract void d(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt);
  }
  
  static final class b
    implements MarginLayoutParamsCompat.a
  {
    public final int a(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return paramMarginLayoutParams.leftMargin;
    }
    
    public final void a(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
    {
      paramMarginLayoutParams.leftMargin = paramInt;
    }
    
    public final int b(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return paramMarginLayoutParams.rightMargin;
    }
    
    public final void b(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
    {
      paramMarginLayoutParams.rightMargin = paramInt;
    }
    
    public final void c(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt) {}
    
    public final boolean c(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return false;
    }
    
    public final int d(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return 0;
    }
    
    public final void d(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt) {}
  }
  
  static final class c
    implements MarginLayoutParamsCompat.a
  {
    public final int a(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return paramMarginLayoutParams.getMarginStart();
    }
    
    public final void a(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
    {
      paramMarginLayoutParams.setMarginStart(paramInt);
    }
    
    public final int b(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return paramMarginLayoutParams.getMarginEnd();
    }
    
    public final void b(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
    {
      paramMarginLayoutParams.setMarginEnd(paramInt);
    }
    
    public final void c(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
    {
      paramMarginLayoutParams.setLayoutDirection(paramInt);
    }
    
    public final boolean c(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return paramMarginLayoutParams.isMarginRelative();
    }
    
    public final int d(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
    {
      return paramMarginLayoutParams.getLayoutDirection();
    }
    
    public final void d(ViewGroup.MarginLayoutParams paramMarginLayoutParams, int paramInt)
    {
      paramMarginLayoutParams.resolveLayoutDirection(paramInt);
    }
  }
}


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