ViewUtils

object ViewUtils

Properties

Link copied to clipboard

Get the indices(IntRange) of the views in the view group. For for-each.

Link copied to clipboard

Check the view group is empty.

Link copied to clipboard

Check the view group is not empty.

Functions

Link copied to clipboard
fun ViewGroup.findAllViewsByCondition(condition: (view: View) -> Boolean): List<View>

For-each the view group and find the views by condition.

Link copied to clipboard
fun ViewGroup.findViewByCondition(condition: (view: View) -> Boolean): View?

For-each the view group and find the view by condition.

Link copied to clipboard
fun <T : View> ViewGroup.findViewByConditionAs(condition: (view: View) -> Boolean): T?

For-each the view group and find the view by condition, and cast to the T type.

Link copied to clipboard

Find view by id name

Link copied to clipboard
inline fun ViewGroup.forEach(action: (view: View) -> Unit)

For-each for ViewGroup

Link copied to clipboard
inline fun ViewGroup.forEachIndexed(action: (index: Int, view: View) -> Unit)

For-each with index for ViewGroup

Link copied to clipboard
fun getIdByName(name: String, type: String = "id", ctx: Context = EzXHelper.appContext): Int

Get the id by name