-
public final class ViewExtensionKt
-
-
Field Summary
Fields Modifier and Type Field Description private static LonglastClickTime
-
Method Summary
Modifier and Type Method Description LonggetLastClickTime()voidsetLastClickTime(Long lastClickTime)final static Viewheight(View $self, Integer height)设置View的高度 final static ViewlimitHeight(View $self, Integer h, Integer min, Integer max)设置View高度,限制在min和max范围之内 final static Viewwidth(View $self, Integer width)设置View的宽度 final static ViewlimitWidth(View $self, Integer w, Integer min, Integer max)设置View宽度,限制在min和max范围之内 final static ViewwidthAndHeight(View $self, Integer width, Integer height)设置View的宽度和高度 final static Viewmargin(View $self, Integer leftMargin, Integer topMargin, Integer rightMargin, Integer bottomMargin)设置View的margin final static UnittoggleVisibility(View $self)切换View的可见性 final static BooleanisGone(View $self)可见性相关 final static BooleanisVisible(View $self)final static BooleanisInvisible(View $self)final static Unitgone(View $self)final static Unitinvisible(View $self)final static Unitvisible(View $self)final static Unitdisable(View $self)final static Unitenable(View $self)final static UnitvisibleOrGone(View $self, Boolean boolean)设置界面隐藏显示 final static UnitvisibleOrInvisible(View $self, Boolean boolean)final static UnitinvisibleOrGone(View $self, Boolean boolean)final static Viewview(Context $self, Integer layoutId, ViewGroup root, Boolean attachRoot)通过布局文件获取View实例 final static Viewview(LayoutInflater $self, Integer layoutId, ViewGroup root, Boolean attachRoot)返回布局文件获取到的View实例 final static <T extends View> UnitsingleClick(T $self, Long time, Function1<T, Unit> block)final static <T extends View> UnitsingleClick(T $self, View.OnClickListener onClickListener, Long time)-
-
Method Detail
-
getLastClickTime
Long getLastClickTime()
-
setLastClickTime
void setLastClickTime(Long lastClickTime)
-
limitHeight
final static View limitHeight(View $self, Integer h, Integer min, Integer max)
设置View高度,限制在min和max范围之内
- Parameters:
min- 最小高度max- 最大高度
-
limitWidth
final static View limitWidth(View $self, Integer w, Integer min, Integer max)
设置View宽度,限制在min和max范围之内
- Parameters:
min- 最小宽度max- 最大宽度
-
widthAndHeight
final static View widthAndHeight(View $self, Integer width, Integer height)
设置View的宽度和高度
- Parameters:
width- 要设置的宽度height- 要设置的高度
-
margin
final static View margin(View $self, Integer leftMargin, Integer topMargin, Integer rightMargin, Integer bottomMargin)
设置View的margin
- Parameters:
leftMargin- 默认保留原来的topMargin- 默认是保留原来的rightMargin- 默认是保留原来的bottomMargin- 默认是保留原来的
-
toggleVisibility
final static Unit toggleVisibility(View $self)
切换View的可见性
-
isInvisible
final static Boolean isInvisible(View $self)
-
visibleOrGone
final static Unit visibleOrGone(View $self, Boolean boolean)
设置界面隐藏显示
- Parameters:
boolean- true时显示控件,false时隐藏控件
-
visibleOrInvisible
final static Unit visibleOrInvisible(View $self, Boolean boolean)
- Parameters:
boolean- true时显示控件,false时隐藏控件
-
invisibleOrGone
final static Unit invisibleOrGone(View $self, Boolean boolean)
- Parameters:
boolean- 隐藏控件
-
view
final static View view(Context $self, Integer layoutId, ViewGroup root, Boolean attachRoot)
通过布局文件获取View实例
-
view
final static View view(LayoutInflater $self, Integer layoutId, ViewGroup root, Boolean attachRoot)
返回布局文件获取到的View实例
-
singleClick
final static <T extends View> Unit singleClick(T $self, Long time, Function1<T, Unit> block)
-
singleClick
final static <T extends View> Unit singleClick(T $self, View.OnClickListener onClickListener, Long time)
-
-
-
-