Class SmartUtil
-
- All Implemented Interfaces:
public class SmartUtilSmartUtil Created by scwang on 2018/3/5.
-
-
Field Summary
Fields Modifier and Type Field Description public static intINTERPOLATOR_VISCOUS_FLUIDpublic static intINTERPOLATOR_DECELERATE
-
Constructor Summary
Constructors Constructor Description SmartUtil(int type)
-
Method Summary
Modifier and Type Method Description static intmeasureViewHeight(View view)static voidscrollListBy(AbsListView listView, int y)static booleanisScrollableView(View view)static booleanisContentView(View view)static voidfling(View scrollableView, int velocity)static booleancanRefresh(View targetView, PointF touch)判断内容是否可以刷新 static booleancanLoadMore(View targetView, PointF touch, boolean contentFull)判断内容视图是否可以加载更多 static booleanisTransformedTouchPointInView(View group, View child, float x, float y, PointF outLocalPoint)static intdp2px(float dpValue)根据手机的分辨率从 dp 的单位 转成为 px(像素) static floatpx2dp(int pxValue)根据手机的分辨率从 px(像素) 的单位 转成为 dp floatgetInterpolation(float input)-
-
Method Detail
-
measureViewHeight
static int measureViewHeight(View view)
-
scrollListBy
static void scrollListBy(AbsListView listView, int y)
-
isScrollableView
static boolean isScrollableView(View view)
-
isContentView
static boolean isContentView(View view)
-
fling
static void fling(View scrollableView, int velocity)
-
canRefresh
static boolean canRefresh(View targetView, PointF touch)
判断内容是否可以刷新
- Parameters:
targetView- 内容视图touch- 按压事件位置- Returns:
是否可以刷新
-
canLoadMore
static boolean canLoadMore(View targetView, PointF touch, boolean contentFull)
判断内容视图是否可以加载更多
- Parameters:
targetView- 内容视图touch- 按压事件位置contentFull- 内容是否填满页面 (未填满时,会通过canScrollUp自动判断)- Returns:
是否可以刷新
-
isTransformedTouchPointInView
static boolean isTransformedTouchPointInView(View group, View child, float x, float y, PointF outLocalPoint)
-
dp2px
static int dp2px(float dpValue)
根据手机的分辨率从 dp 的单位 转成为 px(像素)
- Parameters:
dpValue- 虚拟像素- Returns:
像素
-
px2dp
static float px2dp(int pxValue)
根据手机的分辨率从 px(像素) 的单位 转成为 dp
- Parameters:
pxValue- 像素- Returns:
虚拟像素
-
getInterpolation
float getInterpolation(float input)
-
-
-
-