ConfigurationHelper.java 2.62 KB
package android.support.v4.content.res;

import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build.VERSION;
import android.support.annotation.NonNull;
import android.util.DisplayMetrics;
import cy;

public final class ConfigurationHelper
{
  private static final a a = new b();
  
  static
  {
    int i = Build.VERSION.SDK_INT;
    if (i >= 17)
    {
      a = new d();
      return;
    }
    if (i >= 13)
    {
      a = new c();
      return;
    }
  }
  
  public static int getDensityDpi(@NonNull Resources paramResources)
  {
    return a.d(paramResources);
  }
  
  public static int getScreenHeightDp(@NonNull Resources paramResources)
  {
    return a.a(paramResources);
  }
  
  public static int getScreenWidthDp(@NonNull Resources paramResources)
  {
    return a.b(paramResources);
  }
  
  public static int getSmallestScreenWidthDp(@NonNull Resources paramResources)
  {
    return a.c(paramResources);
  }
  
  static abstract interface a
  {
    public abstract int a(@NonNull Resources paramResources);
    
    public abstract int b(@NonNull Resources paramResources);
    
    public abstract int c(@NonNull Resources paramResources);
    
    public abstract int d(@NonNull Resources paramResources);
  }
  
  static class b
    implements ConfigurationHelper.a
  {
    public int a(@NonNull Resources paramResources)
    {
      return cy.a(paramResources);
    }
    
    public int b(@NonNull Resources paramResources)
    {
      return cy.b(paramResources);
    }
    
    public int c(@NonNull Resources paramResources)
    {
      return Math.min(cy.b(paramResources), cy.a(paramResources));
    }
    
    public int d(@NonNull Resources paramResources)
    {
      return paramResources.getDisplayMetrics().densityDpi;
    }
  }
  
  static class c
    extends ConfigurationHelper.b
  {
    public final int a(@NonNull Resources paramResources)
    {
      return paramResources.getConfiguration().screenHeightDp;
    }
    
    public final int b(@NonNull Resources paramResources)
    {
      return paramResources.getConfiguration().screenWidthDp;
    }
    
    public final int c(@NonNull Resources paramResources)
    {
      return paramResources.getConfiguration().smallestScreenWidthDp;
    }
  }
  
  static final class d
    extends ConfigurationHelper.c
  {
    public final int d(@NonNull Resources paramResources)
    {
      return paramResources.getConfiguration().densityDpi;
    }
  }
}


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