Button
<Button name = "" x = "" y = "" w = "" h = "" listener = "">
Button
elements can be used to receive clicks, double-clicking the event, according to the definition of trigger to control other elements on the interface. Button element can pass events to other elements on the interface, to make the other elements in response to user actions on the lock screen interface.- All elements name attribute increases, the control object button to specify by name.
x
,y
,w
,h
specifies the button area.- The button's event listener to specify which element to pass.
- A
Button
can have several trigger, trigger defines a trigger button actions related operations, such as control of an element of property<Trigger action = "" target = "" property = "" value = "" />
action
: button action:down
(pressed),up
(lift),double
(double-click)target
: control target nameproperty
: property name, currently supported: visibility will increase other attributes control later.value
: property value, currently there are for boolean: true, false, toggle- Usually target button control has three categories, namely, visibility control, play animations, and execute commands, simple demonstration:
<Button> <Triggers> <Trigger action = "down / up / double"> <Command target = "test.visibility" value = "true / false"> <Command target = "test.animation" value = "play"> <VariableCommand name = "test1" expression = "0"> </ Trigger> </ Triggers> </ Button>
- About command
<Command />
will be described in detail later Button
xml configuration elements:<Button> <! - You can specify any number of trigger, also can not specify -> <Triggers> <Trigger /> <Trigger /> </ Triggers> <! - Buttons the normal state, can contain any interface elements, such as Image Text, etc., can not specify Note: Button in Button Image coordinates and their coordinates are independent, are relative to the parent element of Button. -> <Normal> <Image /> <Text /> ... </ Normal> <! - Button pressed, can contain any interface elements, such as Image Text, etc., you can not specify, if you specify a normal state, the normal state of the element is displayed. -> <Pressed> <Image /> <Text /> ... </ Pressed> </ Button>