public interface IViewTools
限定符和类型 | 方法和说明 |
---|---|
void |
dismissDialog(android.app.Dialog dialog)
隐藏窗体
|
float |
dp2px(android.content.Context context,
int dimens)
单位转换:dp convert to px
|
int |
getActionBarHeight(android.content.Context context)
获取ActionBar的高度
|
int |
getColorResource(android.content.Context context,
int resId)
获取颜色
|
android.graphics.drawable.Drawable |
getDrawableByResource(android.content.Context context,
int resId) |
int |
getItemHeightofListView(android.widget.ListView listView,
int items)
获取ListView的所有条目的高度
|
int |
getNavigationBarHeight(android.content.Context context)
获取导航栏的高度
|
float |
getScreenDensity(android.app.Activity act)
获取屏幕密度
|
int |
getScreenHeight(android.app.Activity act)
获取屏幕高度
|
int |
getScreenWidth(android.app.Activity act)
获取屏幕长度
|
int |
getStatusBarHeight(android.app.Activity act)
获取状态栏高度
|
int |
getStatusBarHeight(android.content.Context context)
获取状态栏高度
|
java.lang.String |
getStringResource(android.content.Context context,
int resId)
获取字符串资源
|
int |
getViewHeight(android.view.View view)
获取View的高度
|
int |
getViewWidth(android.view.View view)
获取View的宽度
|
void |
globalPageJump(android.content.Context from,
java.lang.Class<?> to)
页面跳转
|
void |
hideKeyboard(android.app.Activity act)
隐藏键盘
|
void |
initStatusbarColor(android.app.Activity act,
int color)
设置状态栏颜色
|
void |
movePointerToEnd(android.widget.EditText et)
将光标移动到末端
|
void |
setActionBarOverflowButtonColor(android.content.Context context,
android.support.v7.widget.Toolbar toolbar,
int color)
设置操作栏 文字颜色
|
void |
setBottomDialogAttribute(android.content.Context context,
android.app.Dialog dialog) |
void |
setCenterDialogAttribute(android.content.Context context,
android.app.Dialog dialog,
float scale) |
void |
setDialogAttribute(android.content.Context context,
android.app.Dialog dialog,
int gravity,
int maxHeight) |
void |
setDialogAttribute(android.content.Context context,
android.app.Dialog dialog,
int gravity,
int maxHeight,
int y) |
void |
setDialogAttribute(android.content.Context context,
android.app.Dialog dialog,
int gravity,
int maxHeight,
int y,
float dim) |
void |
setDrawableBackground(android.content.Context context,
android.view.View view,
int resId) |
void |
setError(android.widget.EditText edit,
java.lang.String str)
设置错误提醒
|
void |
setImageBackground(android.content.Context context,
android.view.View view,
android.graphics.Bitmap bitmap)
设置ImageView的背景
|
void |
setImageDrawable(android.content.Context context,
android.widget.ImageView view,
int resId) |
void |
setImageSrc(android.content.Context context,
android.view.View view,
android.graphics.Bitmap bitmap)
设置ImageView的内容
|
void |
setTopDialogAttribute(android.content.Context context,
android.app.Dialog dialog) |
boolean |
shouldShowDialogInFragment(android.support.v4.app.Fragment fragment,
android.app.Dialog dialog)
是否可以在Fragment中显示窗体
|
void |
showAppDetailSetting(android.content.Context context)
显示应用程序详情页面
|
void |
showLongToastAtCenter(android.content.Context context,
java.lang.String msg)
屏幕当中显示提示,经过Toast.LENGTH_LONG后自动消失
|
void |
showShortToastAtCenter(android.content.Context context,
java.lang.String msg)
屏幕当中显示提示,经过Toast.LENGTH_SHORT后自动消失
|
void |
showWifiSettig(android.content.Context context)
显示系统无线设置页面
|
void |
translateFragment(android.support.v7.app.AppCompatActivity activity,
android.support.v4.app.Fragment fragment,
int containerId,
int inAnimation,
int outAnimation,
boolean animateEnable)
切换fragment
|
void |
translateFragment(android.support.v4.app.FragmentActivity activity,
android.support.v4.app.Fragment fragment,
int containerId,
int inAnimation,
int outAnimation,
boolean animateEnable)
切换fragment
|
java.lang.String |
wholeExceptionInfo(java.lang.Throwable ex)
将异常转换为可读字符串
|
void showLongToastAtCenter(android.content.Context context, java.lang.String msg)
context
- msg
- void showShortToastAtCenter(android.content.Context context, java.lang.String msg)
context
- msg
- float getScreenDensity(android.app.Activity act)
act
- int getScreenWidth(android.app.Activity act)
act
- int getScreenHeight(android.app.Activity act)
act
- int getItemHeightofListView(android.widget.ListView listView, int items)
listView
- items
- float dp2px(android.content.Context context, int dimens)
context
- dimens
- void setActionBarOverflowButtonColor(android.content.Context context, android.support.v7.widget.Toolbar toolbar, int color)
context
- toolbar
- color
- void showWifiSettig(android.content.Context context)
context
- void translateFragment(android.support.v7.app.AppCompatActivity activity, android.support.v4.app.Fragment fragment, int containerId, int inAnimation, int outAnimation, boolean animateEnable)
activity
- fragment
- containerId
- inAnimation
- outAnimation
- animateEnable
- void translateFragment(android.support.v4.app.FragmentActivity activity, android.support.v4.app.Fragment fragment, int containerId, int inAnimation, int outAnimation, boolean animateEnable)
activity
- fragment
- containerId
- inAnimation
- outAnimation
- animateEnable
- java.lang.String getStringResource(android.content.Context context, int resId)
context
- resId
- void setDialogAttribute(android.content.Context context, android.app.Dialog dialog, int gravity, int maxHeight, int y)
void setDialogAttribute(android.content.Context context, android.app.Dialog dialog, int gravity, int maxHeight, int y, float dim)
void setDialogAttribute(android.content.Context context, android.app.Dialog dialog, int gravity, int maxHeight)
void setTopDialogAttribute(android.content.Context context, android.app.Dialog dialog)
void setBottomDialogAttribute(android.content.Context context, android.app.Dialog dialog)
void setCenterDialogAttribute(android.content.Context context, android.app.Dialog dialog, float scale)
int getStatusBarHeight(android.app.Activity act)
act
- int getStatusBarHeight(android.content.Context context)
context
- void hideKeyboard(android.app.Activity act)
act
- int getViewHeight(android.view.View view)
view
- int getViewWidth(android.view.View view)
view
- int getNavigationBarHeight(android.content.Context context)
context
- int getActionBarHeight(android.content.Context context)
context
- void globalPageJump(android.content.Context from, java.lang.Class<?> to)
from
- to
- void setImageBackground(android.content.Context context, android.view.View view, android.graphics.Bitmap bitmap)
context
- view
- bitmap
- void setImageSrc(android.content.Context context, android.view.View view, android.graphics.Bitmap bitmap)
context
- view
- bitmap
- void setError(android.widget.EditText edit, java.lang.String str)
edit
- str
- android.graphics.drawable.Drawable getDrawableByResource(android.content.Context context, int resId)
void setDrawableBackground(android.content.Context context, android.view.View view, int resId)
void setImageDrawable(android.content.Context context, android.widget.ImageView view, int resId)
boolean shouldShowDialogInFragment(android.support.v4.app.Fragment fragment, android.app.Dialog dialog)
fragment
- dialog
- void showAppDetailSetting(android.content.Context context)
context
- void initStatusbarColor(android.app.Activity act, int color)
act
- color
- java.lang.String wholeExceptionInfo(java.lang.Throwable ex)
ex
- int getColorResource(android.content.Context context, int resId)
context
- resId
- void movePointerToEnd(android.widget.EditText et)
et
- void dismissDialog(android.app.Dialog dialog)
dialog
-