ViewHolder

inner class ViewHolder

ViewHolder主要提供视图控件的一些常用设置(适用于Dialog,不适用于DialogFragment)

Functions

Link copied to clipboard
open fun addLinks(@IdRes id: Int): TextView
添加链接 addLinks
open fun addLinks(@IdRes id: Int, mask: Int): TextView
open fun addLinks(@IdRes id: Int, @NonNull pattern: Pattern, @Nullable scheme: String): TextView
添加链接 addLinks
Link copied to clipboard
open fun isChecked(@IdRes id: Int): Boolean
是否选中 isChecked
Link copied to clipboard
open fun isEnabled(@IdRes id: Int): Boolean
是否启用 isEnabled
Link copied to clipboard
open fun isSelected(@IdRes id: Int): Boolean
是否选择 isSelected
Link copied to clipboard
open fun setAlpha(@IdRes id: Int, alpha: Float): View
设置视图的透明度 setAlpha
Link copied to clipboard
open fun setBackground(@IdRes id: Int, drawable: Drawable): View
设置视图的背景色 setBackground
Link copied to clipboard
open fun setBackgroundColor(@IdRes id: Int, color: Int): View
设置视图的背景色 setBackgroundColor
Link copied to clipboard
open fun setBackgroundResource(@IdRes id: Int, @DrawableRes resId: Int): View
设置视图的背景色 setBackgroundResource
Link copied to clipboard
open fun setChecked(@IdRes id: Int, isChecked: Boolean): CompoundButton
设置是否选中 setChecked
Link copied to clipboard
设置视图下方的复合绘图 DrawablesetCompoundDrawables
Link copied to clipboard
open fun setCompoundDrawableLeft(@IdRes id: Int, drawable: Drawable): TextView
设置视图左方的复合绘图 DrawablesetCompoundDrawables
Link copied to clipboard
open fun setCompoundDrawablePadding(@IdRes id: Int, padding: Int): TextView
设置视图的可填充内距 setCompoundDrawablePadding
Link copied to clipboard
open fun setCompoundDrawableRight(@IdRes id: Int, drawable: Drawable): TextView
设置视图右方的复合绘图 DrawablesetCompoundDrawables
Link copied to clipboard
open fun setCompoundDrawables(@IdRes id: Int, left: Drawable, top: Drawable, right: Drawable, bottom: Drawable): TextView
设置视图的复合绘图 DrawablesetCompoundDrawables
Link copied to clipboard
open fun setCompoundDrawableTop(@IdRes id: Int, drawable: Drawable): TextView
设置视图上方的复合绘图 DrawablesetCompoundDrawables
Link copied to clipboard
open fun setEnabled(@IdRes id: Int, enabled: Boolean): View
设置是否启用 setEnabled
Link copied to clipboard
open fun setImageBitmap(@IdRes id: Int, bitmap: Bitmap): ImageView
根据位图设置图像 setImageBitmap
Link copied to clipboard
open fun setImageDrawable(@IdRes id: Int, drawable: Drawable): ImageView
根据 Drawable 设置图像 setImageResource
Link copied to clipboard
open fun setImageResource(@IdRes id: Int, @DrawableRes resId: Int): ImageView
根据Drawable资源ID设置图像 setImageResource
Link copied to clipboard
open fun setInVisibility(@IdRes id: Int, isVisible: Boolean): View
设置视图的可见性 setVisibility
Link copied to clipboard
open fun setMax(@IdRes id: Int, max: Int): ProgressBar
设置最大进度值 setMax
Link copied to clipboard
open fun setNumStars(@IdRes id: Int, numStars: Int): RatingBar
设置星星数量 setNumStars
Link copied to clipboard
open fun setOnClickListener(@IdRes id: Int, onClickListener: View.OnClickListener)
设置点击监听事 setOnClickListener
Link copied to clipboard
open fun setOnKeyListener(@IdRes id: Int, onKeyListener: View.OnKeyListener)
设置按键监听 setOnKeyListener
Link copied to clipboard
open fun setOnLongClickListener(@IdRes id: Int, onLongClickListener: View.OnLongClickListener)
设置长按监听 setOnLongClickListener
Link copied to clipboard
open fun setOnTouchListener(@IdRes id: Int, onTouchListener: View.OnTouchListener)
设置触摸监听 setOnTouchListener
Link copied to clipboard
open fun setProgress(@IdRes id: Int, progress: Int): ProgressBar
设置进度值 setProgress
Link copied to clipboard
open fun setRating(@IdRes id: Int, rating: Float): RatingBar
设置评分 setRating
open fun setRating(@IdRes id: Int, rating: Float, max: Int): RatingBar
设置评分和最大评分值 setRating and setMax
Link copied to clipboard
open fun setSelected(@IdRes id: Int, selected: Boolean): View
设置是否选择 setSelected
Link copied to clipboard
open fun setTag(@IdRes id: Int, tag: Any): View
open fun setTag(@IdRes id: Int, key: Int, tag: Any): View
设置视图的标签 setTag
Link copied to clipboard
open fun setText(@IdRes id: Int, @StringRes resId: Int): TextView
open fun setText(@IdRes id: Int, text: CharSequence): TextView
设置文本内容 setText
Link copied to clipboard
open fun setTextColor(@IdRes id: Int, @NonNull colors: ColorStateList): TextView
open fun setTextColor(@IdRes id: Int, color: Int): TextView
设置字体颜色 setTextColor
Link copied to clipboard
open fun setTextSize(@IdRes id: Int, size: Float): TextView
open fun setTextSize(@IdRes id: Int, unit: Int, size: Float): TextView
设置字体大小 setTextSize
Link copied to clipboard
open fun setTypeface(@IdRes id: Int, @Nullable tf: Typeface): TextView
open fun setTypeface(@IdRes id: Int, @Nullable tf: Typeface, style: Int): TextView
设置字体 setTypeface
Link copied to clipboard
open fun setVisibility(@IdRes id: Int, isVisible: Boolean): View
open fun setVisibility(@IdRes id: Int, visibility: Int): View
设置视图的可见性 setVisibility
Link copied to clipboard
open fun toggle(@IdRes id: Int): CompoundButton
切换 toggle