The Widget Implementation
Wednesday, February 26, 2014
The Widget Implementation
There are several methods to start actually employing some sort of widget. That
segment outlines a single solution: having a package category (specifically
LinearLayout
) along with inflating the particular articles of your respective widget layout in to the
package.
The particular Constructor
Being operational on the inside of layout XML, you should apply some sort of constructor
which normally takes a couple of guidelines:The Widget Implementation
1. A new
Framework
thing, generally representing the particular
Activity
that is certainly inflating
the widget
3. An
AttributeSet
, representing the particular bunch involving qualities contained in
the particular take into account the particular layout staying inflated which referrals the widget
With this constructor, immediately after chaining on your superclass, you can apply some fundamental
setting of your respective widget. Remember, though, that you will be not really in
place to be able to configure the particular widgets that define the combination widget – you
need to hold out until finally The Widget Implementation
onFinishInflate()
which causes the area accomplish something along with these.
The one thing you certainly need to do from the constructor, though, is usually make use of which
AttributeSet
to get the values involving what ever qualities you described in your
attrs. xml
file. One example is, this can be a constructor for
Meter
:
The Widget Implementation
The Widget Implementation
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment