public final class FoxBaseScreenUtils
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
getAppScreenHeight()
Return the application's height of screen, in pixel.
|
static int |
getAppScreenWidth()
Return the application's width of screen, in pixel.
|
static float |
getScreenDensity()
Return the density of screen.
|
static int |
getScreenDensityDpi()
Return the screen density expressed as dots-per-inch.
|
static int |
getScreenHeight()
Return the height of screen, in pixel.
|
static int |
getScreenRotation(android.app.Activity activity)
Return the rotation of screen.
|
static int |
getScreenWidth()
Return the width of screen, in pixel.
|
static int |
getSleepDuration()
Return the duration of sleep.
|
static boolean |
isFullScreen(android.app.Activity activity)
Return whether screen is full.
|
static boolean |
isLandscape()
Return whether screen is landscape.
|
static boolean |
isPortrait()
Return whether screen is portrait.
|
static boolean |
isScreenLock()
Return whether screen is locked.
|
static android.graphics.Bitmap |
screenShot(android.app.Activity activity)
Return the bitmap of screen.
|
static android.graphics.Bitmap |
screenShot(android.app.Activity activity,
boolean isDeleteStatusBar)
Return the bitmap of screen.
|
static void |
setFullScreen(android.app.Activity activity)
Set full screen.
|
static void |
setLandscape(android.app.Activity activity)
Set the screen to landscape.
|
static void |
setNonFullScreen(android.app.Activity activity)
Set non full screen.
|
static void |
setPortrait(android.app.Activity activity)
Set the screen to portrait.
|
static void |
setSleepDuration(int duration)
Set the duration of sleep.
|
static void |
toggleFullScreen(android.app.Activity activity)
Toggle full screen.
|
public static int getScreenWidth()
public static int getScreenHeight()
public static int getAppScreenWidth()
public static int getAppScreenHeight()
public static float getScreenDensity()
public static int getScreenDensityDpi()
public static void setFullScreen(android.app.Activity activity)
activity - The activity.public static void setNonFullScreen(android.app.Activity activity)
activity - The activity.public static void toggleFullScreen(android.app.Activity activity)
activity - The activity.public static boolean isFullScreen(android.app.Activity activity)
activity - The activity.true: yesfalse: nopublic static void setLandscape(android.app.Activity activity)
activity - The activity.public static void setPortrait(android.app.Activity activity)
activity - The activity.public static boolean isLandscape()
true: yesfalse: nopublic static boolean isPortrait()
true: yesfalse: nopublic static int getScreenRotation(android.app.Activity activity)
activity - The activity.public static android.graphics.Bitmap screenShot(android.app.Activity activity)
activity - The activity.public static android.graphics.Bitmap screenShot(android.app.Activity activity,
boolean isDeleteStatusBar)
activity - The activity.isDeleteStatusBar - True to delete status bar, false otherwise.public static boolean isScreenLock()
true: yesfalse: nopublic static void setSleepDuration(int duration)
Must hold <uses-permission android:name="android.permission.WRITE_SETTINGS" />
duration - The duration.public static int getSleepDuration()