Class SmartUtil
-
- All Implemented Interfaces:
public class SmartUtil
SmartUtil Created by scwang on 2018/3/5.
-
-
Field Summary
Fields Modifier and Type Field Description public static int
INTERPOLATOR_VISCOUS_FLUID
public static int
INTERPOLATOR_DECELERATE
-
Constructor Summary
Constructors Constructor Description SmartUtil(int type)
-
Method Summary
Modifier and Type Method Description static int
measureViewHeight(View view)
static void
scrollListBy(AbsListView listView, int y)
static boolean
isScrollableView(View view)
static boolean
isContentView(View view)
static void
fling(View scrollableView, int velocity)
static boolean
canRefresh(View targetView, PointF touch)
判断内容是否可以刷新 static boolean
canLoadMore(View targetView, PointF touch, boolean contentFull)
判断内容视图是否可以加载更多 static boolean
isTransformedTouchPointInView(View group, View child, float x, float y, PointF outLocalPoint)
static int
dp2px(float dpValue)
根据手机的分辨率从 dp 的单位 转成为 px(像素) static float
px2dp(int pxValue)
根据手机的分辨率从 px(像素) 的单位 转成为 dp float
getInterpolation(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)
-
-
-
-