public class TuSdkViewHelper
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static class |
TuSdkViewHelper.AlertDelegate
警告信息委托
|
static interface |
TuSdkViewHelper.EditTextAlertDelegate
弹出文本框信息委托
|
static class |
TuSdkViewHelper.OnSafeClickListener
安全点击事件 避免连点
|
限定符和类型 | 字段和说明 |
---|---|
static int |
alertViewIcon
警告视图Icon id
|
构造器和说明 |
---|
TuSdkViewHelper() |
限定符和类型 | 方法和说明 |
---|---|
static void |
alert(android.content.Context context,
java.lang.String title,
java.lang.String msg,
java.lang.String cancelTitle)
弹出警告信息
|
static void |
alert(TuSdkViewHelper.AlertDelegate delegate,
android.content.Context context,
int titleId,
int msgId,
int cancelTitleId,
int confirmTitleId)
警告提示
|
static void |
alert(TuSdkViewHelper.AlertDelegate delegate,
android.content.Context context,
java.lang.String title,
java.lang.String msg,
java.lang.String cancelTitle,
java.lang.String confirmTitle)
警告提示
|
static android.view.WindowManager.LayoutParams |
buildApplicationPanelParams(java.lang.String title)
创建应用窗口视图参数
|
static <T extends android.view.View> |
buildView(android.content.Context context,
int id)
根据layout id 创建视图 创建成功后会执行loadView
|
static <T extends android.view.View> |
buildView(android.content.Context context,
int id,
android.view.ViewGroup root)
根据layout id 创建视图 创建成功后会执行loadView
|
static android.graphics.Rect |
getDisplayFrame(android.app.Activity context)
获取应用程序显示区域
|
static android.view.ViewGroup.MarginLayoutParams |
getMarginLayoutParams(android.view.View view)
获取视图边距参数
|
static java.lang.String |
getTextViewText(android.widget.TextView view)
获取文字视图文字
|
static android.graphics.Rect |
getViewRect(android.view.View view)
获取视图长宽以及位置
|
static boolean |
isFastDoubleClick()
检查是否快速连续点击
|
static boolean |
isFastDoubleClick(long delay)
检查是否快速连续点击
|
static <T extends android.view.View> |
loadView(android.view.View view)
加载视图 执行loadView
|
static android.graphics.Rect |
locationInWindow(android.view.View view)
获取视图在屏幕中的坐标范围
|
static int |
locationInWindowLeft(android.view.View view)
获取视图在窗口左边距离
|
static int |
locationInWindowTop(android.view.View view)
获取视图在窗口顶部距离
|
static void |
removeGlobalLayoutListener(android.view.ViewTreeObserver vto,
android.view.ViewTreeObserver.OnGlobalLayoutListener listener)
删除全局布局监听
|
static void |
setBackground(android.view.View view,
android.graphics.drawable.Drawable drawable)
设置视图背景
|
static void |
setBackgroundCornerRadius(android.view.View view,
int cornerRadius)
设置圆角背景
|
static void |
setBackgroundCornerRadiusDP(android.view.View view,
int cornerRadiusDP)
设置圆角背景
|
static void |
setTextViewText(android.widget.TextView view,
java.lang.String text)
设置文字视图文字
|
static void |
setViewHeight(android.view.View view,
int height)
设置视图显示高度
|
static void |
setViewHeightConfirmWidth(android.view.View view)
根据视图宽度设置高度
|
static void |
setViewMargin(android.view.View view,
int left,
int top,
int right,
int bottom)
设置视图边距
|
static void |
setViewMarginBottom(android.view.View view,
int bottom)
设置视图下边距
|
static void |
setViewMarginLeft(android.view.View view,
int left)
设置视图左边距
|
static void |
setViewMarginRight(android.view.View view,
int right)
设置视图右边距
|
static void |
setViewMarginTop(android.view.View view,
int top)
设置视图上边距
|
static void |
setViewRect(android.view.View view,
android.graphics.Rect rect)
设置视图长宽以及位置
|
static void |
setViewWidth(android.view.View view,
int width)
设置视图显示宽度
|
static void |
showView(android.view.View view,
boolean isShow)
显示或隐藏视图 不占位
|
static void |
showViewIn(android.view.View view,
boolean isShow)
显示或隐藏视图 占位
|
static void |
toast(android.content.Context context,
int resId)
显示提示信息
|
static void |
toast(android.content.Context context,
java.lang.String title)
显示提示信息
|
static void |
viewWillDestory(android.view.View view)
视图即将销毁
|
public static boolean isFastDoubleClick()
public static boolean isFastDoubleClick(long delay)
delay
- public static <T extends android.view.View> T buildView(android.content.Context context, int id)
context
- id
- public static <T extends android.view.View> T buildView(android.content.Context context, int id, android.view.ViewGroup root)
context
- id
- root
- public static <T extends android.view.View> T loadView(android.view.View view)
view
- public static void showView(android.view.View view, boolean isShow)
view
- isShow
- public static void showViewIn(android.view.View view, boolean isShow)
view
- isShow
- public static java.lang.String getTextViewText(android.widget.TextView view)
view
- public static void setTextViewText(android.widget.TextView view, java.lang.String text)
view
- text
- public static android.graphics.Rect getDisplayFrame(android.app.Activity context)
context
- public static void setViewHeightConfirmWidth(android.view.View view)
view
- public static void setViewRect(android.view.View view, android.graphics.Rect rect)
view
- rect
- public static android.graphics.Rect getViewRect(android.view.View view)
view
- public static void setViewHeight(android.view.View view, int height)
height
- public static void setViewWidth(android.view.View view, int width)
width
- public static void setViewMarginLeft(android.view.View view, int left)
view
- left
- public static void setViewMarginTop(android.view.View view, int top)
view
- top
- public static void setViewMarginRight(android.view.View view, int right)
view
- left
- public static void setViewMarginBottom(android.view.View view, int bottom)
view
- left
- public static void setViewMargin(android.view.View view, int left, int top, int right, int bottom)
view
- left
- top
- right
- bottom
- public static android.view.ViewGroup.MarginLayoutParams getMarginLayoutParams(android.view.View view)
view
- public static void toast(android.content.Context context, java.lang.String title)
context
- title
- public static void toast(android.content.Context context, int resId)
context
- resId
- public static void removeGlobalLayoutListener(android.view.ViewTreeObserver vto, android.view.ViewTreeObserver.OnGlobalLayoutListener listener)
vto
- listener
- public static int locationInWindowTop(android.view.View view)
view
- public static int locationInWindowLeft(android.view.View view)
view
- public static android.graphics.Rect locationInWindow(android.view.View view)
view
- public static void viewWillDestory(android.view.View view)
view
- public static void setBackgroundCornerRadiusDP(android.view.View view, int cornerRadiusDP)
view
- 视图cornerRadiusDP
- 圆角(单位DP)public static void setBackgroundCornerRadius(android.view.View view, int cornerRadius)
view
- 视图cornerRadius
- 圆角(单位px)public static void setBackground(android.view.View view, android.graphics.drawable.Drawable drawable)
view
- 视图drawable
- 背景对象public static void alert(TuSdkViewHelper.AlertDelegate delegate, android.content.Context context, int titleId, int msgId, int cancelTitleId, int confirmTitleId)
delegate
- 警告信息委托context
- 上下文容器titleId
- 标题msgId
- 提示信息cancelTitleId
- 取消按钮标题confirmTitleId
- 确认信息标题public static void alert(TuSdkViewHelper.AlertDelegate delegate, android.content.Context context, java.lang.String title, java.lang.String msg, java.lang.String cancelTitle, java.lang.String confirmTitle)
delegate
- 警告信息委托context
- 上下文容器title
- 标题msg
- 提示信息cancelTitle
- 取消按钮标题confirmTitle
- 确认信息标题public static void alert(android.content.Context context, java.lang.String title, java.lang.String msg, java.lang.String cancelTitle)
context
- title
- msg
- cancelTitle
- public static android.view.WindowManager.LayoutParams buildApplicationPanelParams(java.lang.String title)
title
-