public class BasicUiUtils
extends java.lang.Object
构造器和说明 |
---|
BasicUiUtils() |
限定符和类型 | 方法和说明 |
---|---|
static void |
collapseViews(android.view.View v)
Collapse a view which has already expanded
|
static int |
dip2px(android.content.Context context,
float dpValue)
Converte dp to pixels
|
static float |
dp2px(android.content.Context context,
float dpValue)
Converte dp to pixels
|
static void |
expandViews(android.view.View v)
Expand a view which has already collapsed
|
static void |
hiddenKeyboard(android.content.Context context,
android.app.Activity activity)
Hide soft keyboard method.
|
static void |
hiddenKeyBoardByClick(android.content.Context context,
android.app.Activity activity,
android.view.MotionEvent motionEvent)
Hide soft keyboard by click。
|
static void |
lockScreenOrientation(android.app.Activity activity)
Lock the screen orientation as the current state
|
static void |
popAlertDialog(android.content.Context context,
int title,
java.lang.String message)
Pop a simple alertdialog which only shows title,message and "OK" button
|
static void |
popAlertDialog(android.content.Context context,
java.lang.String title,
java.lang.String message)
Pop a simple alertdialog which only shows title,message and "OK" button
|
static int |
px2dip(android.content.Context context,
float pxValue)
Converting pixels to dp
|
static void |
setActivityFullScreen(android.app.Activity activity,
boolean isFullScreen)
Set the activity to be full screen
|
static void |
setActivityPortraitOrientation(android.app.Activity activity,
boolean isPortrait)
Set activity to be portrait
|
static void |
unlockScreenOrientation(android.app.Activity activity)
Unlock the screen orientation
|
public static void hiddenKeyboard(android.content.Context context, android.app.Activity activity)
context
- activity
- public static void hiddenKeyBoardByClick(android.content.Context context, android.app.Activity activity, android.view.MotionEvent motionEvent)
context
- activity
- motionEvent
- Judge by motion eventpublic static int dip2px(android.content.Context context, float dpValue)
context
- dpValue
- public static int px2dip(android.content.Context context, float pxValue)
context
- pxValue
- public static float dp2px(android.content.Context context, float dpValue)
context
- dpValue
- public static void expandViews(android.view.View v)
v
- public static void collapseViews(android.view.View v)
v
- public static void popAlertDialog(android.content.Context context, java.lang.String title, java.lang.String message)
context
- title
- message
- public static void popAlertDialog(android.content.Context context, int title, java.lang.String message)
context
- title
- message
- public static void setActivityFullScreen(android.app.Activity activity, boolean isFullScreen)
activity
- isFullScreen
- public static void setActivityPortraitOrientation(android.app.Activity activity, boolean isPortrait)
activity
- isPortrait
- public static void lockScreenOrientation(android.app.Activity activity)
activity
- public static void unlockScreenOrientation(android.app.Activity activity)
activity
-