Calculator_Button_3

constructor(context: Context)

Simple constructor to use when creating a view from code.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.


constructor(context: Context, attrs: AttributeSet)

Constructor that is called when inflating a view from XML. This is called when a view is being constructed from an XML file, supplying attributes that were specified in the XML file. This version uses a default style of 0, so the only attribute values applied are those in the Context's Theme and the given AttributeSet.

The method onFinishInflate() will be called after all children have been added.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.

attrs

The attributes of the XML tag that is inflating the view.


constructor(context: Context, attrs: AttributeSet, defStyle: Int)

Perform inflation from XML and apply a class-specific base style. This constructor of View allows subclasses to use their own base style when they are inflating. For example, a Button class's constructor would call this version of the super class constructor and supply R.attr.buttonStyle for defStyle; this allows the theme's button style to modify all of the base view attributes (in particular its background) as well as the Button class's attributes.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.

attrs

The attributes of the XML tag that is inflating the view.

defStyle

The default style to apply to this view. If 0, no style will be applied (beyond what is included in the theme). This may either be an attribute resource, whose value will be retrieved from the current theme, or an explicit style resource.