? “(View) This class represents the basic building block for user interface components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. — Oficial Android documentation”
view starts it’ s life from a Constructor. And what it gives us, is a great opportunity to prepare it for an initial drawing, make various calculation, set default values or whatever we need.
class SearchView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : RelativeLayout(context, attrs, defStyleAttr) Create a new class extends from a View