public class ViewCompat
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
SCROLL_AXIS_HORIZONTAL
Indicates scrolling along the horizontal axis.
|
static int |
SCROLL_AXIS_NONE
Indicates no axis of view scrolling.
|
static int |
SCROLL_AXIS_VERTICAL
Indicates scrolling along the vertical axis.
|
static int |
TYPE_NON_TOUCH
Indicates that the input type for the gesture is caused by something which is not a user
touching a screen.
|
static int |
TYPE_TOUCH
Indicates that the input type for the gesture is from a user touching the screen.
|
| 构造器和说明 |
|---|
ViewCompat() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
canListViewScrollVertical(android.widget.AbsListView listView,
int direction)
Check if the items in the list can be scrolled in a certain direction.
|
static int |
getAbsoluteGravity(int gravity,
int layoutDirection)
Convert script specific gravity to absolute horizontal value.
|
static int |
getLayoutDirection(android.view.View view) |
static void |
offsetLeftAndRight(android.view.View view,
int offset)
Offset this view's horizontal location by the specified amount of pixels.
|
static void |
offsetTopAndBottom(android.view.View view,
int offset)
Offset this view's vertical location by the specified number of pixels.
|
static void |
postInvalidateOnAnimation(android.view.View view)
Cause an invalidate to happen on the next animation time step, typically the
next display frame.
|
public static final int TYPE_TOUCH
public static final int TYPE_NON_TOUCH
public static final int SCROLL_AXIS_NONE
public static final int SCROLL_AXIS_HORIZONTAL
public static final int SCROLL_AXIS_VERTICAL
public static void postInvalidateOnAnimation(android.view.View view)
Cause an invalidate to happen on the next animation time step, typically the next display frame.
This method can be invoked from outside of the UI thread only when this View is attached to a window.
view - View to invalidatepublic static void offsetTopAndBottom(android.view.View view,
int offset)
view - viewoffset - the number of pixels to offset the view bypublic static void offsetLeftAndRight(android.view.View view,
int offset)
view - viewoffset - the number of pixels to offset the view bypublic static int getAbsoluteGravity(int gravity,
int layoutDirection)
Convert script specific gravity to absolute horizontal value.
if horizontal direction is LTR, then START will set LEFT and END will set RIGHT. if horizontal direction is RTL, then START will set RIGHT and END will set LEFT.gravity - The gravity to convert to absolute (horizontal) values.layoutDirection - The layout direction.public static int getLayoutDirection(android.view.View view)
public static boolean canListViewScrollVertical(android.widget.AbsListView listView,
int direction)
listView - listViewdirection - Negative to check scrolling up, positive to check
scrolling down.