public class

OsUtil

extends Object
java.lang.Object
   ↳ com.davidluoye.support.util.OsUtil

Summary

Constants
String SCHEME_ANDROID_RESOURCE
Public Constructors
OsUtil()
Public Methods
static int dp2px(int dp)
static int dp2px(Resources res, int dp)
static Uri fromResourceId(String pkg, int resId)
static Uri fromResourceName(String pkg, String type, String name)
static int getScreenHeigth()
get screen height
static int getScreenHeigth(Resources res)
static int getScreenWidth(Resources res)
static int getScreenWidth()
get screen width
static int getScreenWidth(Activity activity)
get screen width
static boolean mainProcess(Context context, String processName)
check if current process is the main process.
static int px2dp(Resources res, int px)
static int px2dp(int px)
static int px2sp(Resources res, int px)
static int px2sp(int px)
static int sp2px(int sp)
static int sp2px(Resources res, int sp)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String SCHEME_ANDROID_RESOURCE

Constant Value: "android.resource"

Public Constructors

public OsUtil ()

Public Methods

public static int dp2px (int dp)

public static int dp2px (Resources res, int dp)

public static Uri fromResourceId (String pkg, int resId)

public static Uri fromResourceName (String pkg, String type, String name)

public static int getScreenHeigth ()

get screen height

public static int getScreenHeigth (Resources res)

public static int getScreenWidth (Resources res)

public static int getScreenWidth ()

get screen width

public static int getScreenWidth (Activity activity)

get screen width

public static boolean mainProcess (Context context, String processName)

check if current process is the main process.

public static int px2dp (Resources res, int px)

public static int px2dp (int px)

public static int px2sp (Resources res, int px)

public static int px2sp (int px)

public static int sp2px (int sp)

public static int sp2px (Resources res, int sp)