Académique Documents
Professionnel Documents
Culture Documents
Table of Contents
1 MORE & MAML Overview
2 MAML Variety lock screen application in the
3 MAML applications dynamically changeable wallpaper and icons
4 wallpaper element
5 variables
6 variable array
7 global variables
8 expression
9 text
10 hours
11 Date
12 Photos
13 digital pictures
14 picture mask
15 elements in animation
16 Group
17 Slider
18 buttons
19 Music Player
20 volume control
21 Content Provider
22 Trigger & Command
23 Dynamic Frame Rate
24 sensor call
Outline
Initially Variety lock screen for use with a specific syntax description xml lock
screen. Later continuous enhancements, and gradually evolved into a near universal
interface description language and graphics rendering engine, at a certain demand for
developing user interface styles. Can be easily changed by replacing the skin
interface style, animation or interactive mode.
MAML Android interface description language and similar xml. The difference is that
Android is a static interface description, changes to the interface elements depend
java code. MAML describe static interface + dynamic attributes, UI timeline constantly
refreshed by a certain frame rate, UI updated in real time based on the calculation
results show variable expression of element attributes. MAML language and runtime
engines have been independent from the lock screen as MIUI built into a common
framework, in addition to displaying the date and time, but also supports the query
criteria Content Provider to obtain a variety of information such as weather. Display
pictures of various elements such as text, a variety of animations, slide interactive
interface controls such as clicking, suitable for implementing the present information
or simple interaction interface. Such as clocks, weather widget, alarm clock ringing
interface.
Framework supports dynamic frame rate, according to a fixed frame rate does not have
to stop rendering, animation and updated without stopping at the right time rendering,
only this time with minimal resources, for slowly changing animation rendering using a
low frame rate, high dynamic animation begins Immediately after the adjustment to
render high frame rate at full speed. The basic frame rate at full speed in full
screen rendering can reach 60. Rational use can both cool and not much power.
The display of information, such as images, text (not suitable for a large segment of text list information and is not suitable for u
The need to have a wealth of interface animation and interactive animation.
relatively simple interaction, drag, click on (but not limited to drag click through xml code can interact partially similar java pro
The information display mode can not be achieved using standard controls, or interaction can not be achieved, the need for self-contr
Replace the skin need to be flexible style, animation and interactive interface and even some interactive animations are available th
Some simple tools such as application, no input interface hoping to replace the
operating mode (eg incoming calls interface) and desktop gadget can consider using,
also can be used as a framework to achieve a similar animated e-card interface that
supports interactive, As the application of eggs (such as a birthday SMS eggs)
frameRate: Specifies the frame rate, if the animation is slow, you can specify
the value of smaller, energy saving. The default is 30.
displayDesktop: The default is false, perspective to the desktop features, if
there is no lock screen wallpaper or lock screen wallpaper can be removed or
transparent can see the desktop or the application launcher in front of the lock
screen. You can achieve the perfect WP7, Meego, Ali cloud and other unlock
interface.
showSysWallpaper: The default is false, whether to display the lock screen
wallpaper. If you do not specify after opening the lock screen wallpaper
<Wallpaper />, will be used as a lock screen wallpaper wallpaper.
screenWidth: set the screen width criteria. If specified as 720, the location of
all the elements of the lock screen layouts are written by 720p, 480p phone will
automatically scaled.
<Group />
...
</ MiWallpaper>
Dynamic Icon
Under the theme of dynamic icons pack icons \ fancy_icons \ directory, each dynamic
icon is a folder, the folder name is the corresponding app package name. For example,
the icon is a dynamic calendar called "com.android.calendar" folder, which contains
the description file manifest.xml
<Icon version = "1" frameRate = "" width = "136" height = "136" screenWidth = "720" useVariableUpdater = "" hideApplicationMessage = "">
<Var />
<Image />
<Text />
<DateTime />
...
</ Icon>
hideApplicationMessage: default false, shielded notice the top right corner flag.
useVariableUpdater: Which system variable specifies the need, now includes power and
time, and you can specify the update period of time, if the time gadgets updated every
second, you need to specify the update cycle for one second, otherwise a default will
be updated every minute. If a gadget or a dynamic icon display only the date is
updated once a day, you can specify the update cycle for one day. Try to choose a
longer update cycle, in order to save system resources.
Wallpaper element
Wallpaper wallpaper element reference
can not specify the source images and
properties can be controlled. Without
can be multiple. Examples: <Wallpaper
Variable
<Var> variable
<Var name = "" expression = "" type = "" const = "" threshold = "" persist = "" />
name variable name
expression corresponding variable or constant expression Note: If you define a
string constant need more single quotes: expression = "'my string'"
type = number / string variable or a string variable to define default values:
number
const = true variable is calculated only once at initialization time, he would
not be recalculated, can improve efficiency. If the variable value will change
during the lock-screen operation, const set to false Default: false
threshold threshold trigger, when the change variable value exceeds the set
threshold, can trigger some commands. For example:
<Var name = "time3" expression = "# minute% 10" threshold = "1">
<Trigger>
<Command target = "time3_anim.visibility" value = "true" />
<Command target = "time3_anim.animation" value = "play" />
<Command target = "time3_anim_new.visibility" value = "false" />
<Command target = "time_3_anim_new.visiblity" value = "true" delay = "400" />
<Command target = "time_3_anim_new.animation" value = "play" delay = "400" />
</ Trigger>
</ Var>
The code represents the value of # time3 every change of 1, it will execute all
commands <Trigger /> inside
persist default false, variable persistence. After designated ture, if not re
given the value of the other variable, then the value would have been saved,
Variable array
<VarArray> variable array
<VarArray type = "string">
<Vars>
<Var name = "date_format1" index = "# time / 2000% 5" />
<Var name = "date_format2" index = "2" const = "true" />
...
</ Vars>
<Items>
<Item expression = "ifelse (isnull (date_format), 'MMMMd day EEEE',date_format)" />
<Item value = "EEEE" />
...
</ Items>
</ VarArray>
= "January" />
= "February" />
= "November" />
= "December" />
month_str" color = "# FFFFFFFF" size = "20" ... />
Global Variables
unlocker:
Offset unlocker.move_x unlocking member in the x-direction
Offset unlocker.move_y unlocking member in the y-direction
unlocker.move_dist unlocking member moves from
unlocker.state unlocking member state: 0 normal, 1 pressed, 2 reached
touch:
touch_x current x coordinate of the touch point
touch_y
The initial x coordinate of the screen when pressed touch_begin_x
touch_begin_y
touch_begin_time time the screen is pressed
time:
time the current time, long
time_sys system time in milliseconds
year Year
month month (ranging from 0 to 11,0 for January, 1 for February, and so on)
date date
day_of_week week (1 for Sunday, 2 for Monday, and so on)
hour12 current hour (12-hour)
hour24 24 hour clock
minute minute
second second
ampm afternoon 0: am 1: pm
time_format 0: 12h 1: 24h
Lunar calendar
year_lunar Lunar Year
year_lunar1864 used to calculate the attribution
month_lunar lunar month starting from 1 meter
Are Run month_lunar_leap 0/1 months
date_lunar lunar dates starting from 1 meter
battery:
battery_level current amount of power, 1 to 100
Normal charging battery_state 0 1 2 3 low battery is fully charged
screen:
screen_width screen width
screen_height screen height
raw_screen_width physical width (this indicates that the current screen
Expression
Support brackets and modulo arithmetic functions
modulo arithmetic: + - * /%
support functions: sin, cos, tan, asin, acos, atan, sinh, cosh, sqrt, abs, min, max
does not explain
len (digital) given the number of digits len (1234) = 4
digit (numbers, the first of several) to take the first of several given numbers
digit (12345, 2) = 4 Note: subscript right to left, and from the beginning
substr (original string, the string starting position, the string length) substr
('Today is really hot', 1,2) = 'naive'
round () rounded to the nearest integer int () rounded down
eq (x, y) // x == y 1:? 0
! ne (x, y) // x = y 1:? 0
ge (x, y) // x> = y 1:? 0
gt (x, y) // x> y 1:? 0
le (x, y) // x <= y 1:? 0
lt (x, y) // x isnull (x) // x == null 1:? 0 // if the variable contains a null
variable expression often used to determine whether the binding data found
not (x) x> 0 0:? 1
ifelse (x, y, z) // x> 0 y:? z
ifelse (x1, y1, x2, y2, ..., z)
if x1> 0 return y1; else if x2> 0 return y2; ...; else return z
+ Can concatenate strings, some functions can also support string, isnull can
determine whether the string variable is empty, ifelse can select String, String
Comparison Functions eqs (@ string1, @ string2)
Element is visible expression of support visibility = "expression" <= 0 invisible> 0
Visible
Image, Text, Time's property
align = left, center, right horizontal alignment of the coordinate points
alignV = top, center, bottom vertical alignment coordinate points the way
Text
Displays the format of the text, the coordinates attribute support variables
color: text color, # FFFFFF
size: Text Size
format: If you need to display a variable number in the text, you need to specify
the format, specify the numeric position with% d
paras: If you specify the format, you need to specify the corresponding variable
expression% d in paras where there can be multiple expressions with variables, ""
separated
align: alignment of the left, center, right, text coordinates
textExp: literal expression, you can directly call the desired output variables
such as "time is now 9:00," can be written textExp = "'Now the time is' + #
hour12 + 'point'."
width text width, when the text exceeds the specified width will be cut off. If
the multi-line specifies the display will fold lines. If you specify the text
scrolling, scrolling in the specified location will display text
marqueeSpeed
text scrolling speed, with the width of the use of the above
marqueeGap scroll interval. When the interval after the re-emergence of the text
display, the default width of four characters
rotation (X, Y, Z) rotation angle, the old angle can also be used, but the
recommended rotation, because of relatively high atmospheric internationalization
multiLine ture / false whether to support multi-line display, default false
Examples of usage:
Display the next alarm time
<Text text = "@ next_alarm_time" ... />
<Text format = "under an alarm clock: [% s] Battery: [% d %%]" paras = "@ next_alarm_time, # battery_level" />
Time
<Time x = "10" y = "10" src = "time.png" space = "">
</ Time>
src time picture of the prefix follows that the use time_0.png, time_1.png, ...
time_9.png, time_dot.png. Coordinate property supports variable expression
space represents a gap time of the picture, we can use this feature to typeset time
images, the use of positive images spacing becomes larger, then you can cut small
pictures, save memory. For the projection of images, will write negative space, you
can make a projection overlap to save space
Date
Display format specified date
format: Supports standard date format, an additional Lunar: NNNN
<DateTime x = "" y = "" color = "" size = "" format = "">
<PositionAnimation />
<DateTime>
September:
M -> 9
MM -> 09
7 minutes:
m -> 7
mm -> 07
mmm -> 007
mmmm -> 0007
1970 4 6 3:23 am
"Yyyy / MM / dd h: MMAA" -> "1970/04/06 3:23 am"
"M dated May d h: mmaa" -> "463:23 am"
Week
"E" -> "Wednesday"
"EEEE" -> "Wednesday"
"Day: M / d" -> "Day: 4/6"
24 hours: "kk: mm" -> "13:34"
Picture
Pictures component used to display an image on the lock screen, you can specify
various attributes
<Image x = "" y = "" w = "" h = "" pivotX = "" pivotY = "" rotation = "" src = "" srcid = "" alpha = "" align = "" antiAlias
= "" />
Examples:
<Image x = "0" y = "# screen_height-323" src = "bottom_bg.png" />
Digital Pictures
<ImageNumber number = "" src = "">
Pictures mask
<Image x = "444" y = "# screen_height-92" src = "hs_path_light.png">
<PositionAnimation>
<Position x = "- 438" y = "0" time = "2000" />
</ PositionAnimation>
<Mask x = "0" y = "# screen_height-92" src = "hs_path_mask_r.png" align = "absolute" />
</ Image>
x, y coordinates
src mask image, the black part represents an opaque opaque, the other part is
transparent.
align coordinates are relative or absolute position of the picture belongs, if it
is relative, Pictures Mobile is moving mask will follow accordingly. Otherwise
mask remain intact.
Mask can also be active animation, rotation animation, animation and location,
property supports variable expression
<Mask x = "" y = "" src = "" centerX = "" centerY = "" angle = "" align = "">
<SourcesAnimation />
<RotationAnimation />
<PositionAnimation />
</ Mask>
Elements of animation
<RotationAnimation>
<Rotation angle = "" time = "" />
<Rotation angle = "" time = "" />
</ RotationAnimation>
<SizeAnimation>
<Size w = "" h = "" time = "" />
<Size w = "" h = "" time = "" />
</ SizeAnimation>
Example: Location animated representation of one second from the left to the far right
of the screen, stay one second, transparency, transparency of 175 indicates the
beginning of the animation, from the far left to the far right of the transparency of
the process of change, after 0.5 seconds to reach the rightmost gradient opaque, 0.5
seconds and then disappear becomes transparent. Then loop.
<Image x = "0" y = "# screen_height-177" src = "charging_light.png" category = "Charging">
<PositionAnimation>
<Position x = "480" y = "0" time = "1000" />
<Position x = "480" y = "0" time = "2000" />
</ PositionAnimation>
<AlphaAnimation>
<Alpha a = "175" time = "0" />
<Alpha a = "175" time = "1000" />
<Alpha a = "255" time = "1500" />
<Alpha a = "0" time = "2000" />
</ AlphaAnimation>
</ Image>
<SourcesAnimation>
<Source x = "" y = "" src = "pic1.png" time = "100" />
<Source x = "" y = "" src = "pic2.png" time = "1000" />
</ SourcesAnimation>
Group
<Group name = "" x = "" y = "" w = "" h = "" frameRate = "0">
<Image />
<Time />
<DateTime />
<Text />
<PositionAnimation />
<SizeAnimation />
</ Group>
Group is a group of meaning, equivalent controls are a container that can be used to
contain live other elements, such as pictures, time, etc. By adding the group to
coordinate and width and height, you can easily adjust the position and size of a onetime multiple elements. While Group also add a variety of animation types and Image as
comprehensive
The new version also adds a frame rate control, if a group of elements are
static, you can add framaRate = "0", the system will automatically adjust the
refresh rate, reduce memory and cpu usage each group based on the current frame
rate. So it is recommended that you pick plus the corresponding frame rate when
you add a Group
Slider
<Slider name = "">
Three state can not specify the variables can be used to change the status of the
other interface elements to represent the triggering process. Slider target point:
When the starting point x, y point fall EndPoint rectangle target area, reaching the
trigger position, then release your finger that can generate a trigger, you can have
more than one trigger purposes.
of tolerance:! After the start trigger action path when moving the maximum distance exceeds this value will be canceled
= "" tolerance = "">
= "" y = "" />
= "" y = "" />
Examples:
<Slider name = "slider">
<StartPoint x = "31" y = "# screen_height-117" w = "90" h = "90">
<NormalState>
<Image x = "31" y = "# screen_height-117" src = "unlock_button.png">
</ Image>
</ NormalState>
</ StartPoint>
<EndPoint x = "359" y = "# screen_height-117" w = "90" h = "90">
<PressedState>
<Image x = "359" y = "# screen_height-117" src = "unlock_target.png">
</ Image>
</ PressedState>
<Path x = "0" y = "# screen_height-117">
<Position x = "31" y = "0" />
<Position x = "359" y = "0" />
</ Path>
</ EndPoint>
</ Slider>
Slider's intent may be a Trigger and Command, a Trigger can have multiple
Command. See Command Trigger and Trigger & Command
Unlocker inherit Slider, more than just the tag name usage Slider to Unlocker.
unlocking member rebound animation, see http://www.miui.com/thread-290094-1-1.html
Lock screen sounds
StartPoint: normalSound, pressedSound, specified in the normal state and press play
sound
EndPoint: reachedSound, after reaching the endpoint play sound
<Unlocker name = "unlocker">
<StartPoint x = "0" y = "440" w = "480" h = "400" normalSound = "sound_normal.mp3" pressedSound = "sound_normal.mp3">
<EndPoint x = "0" y = "640" w = "480" h = "400" reachedSound = "sound_reached.mp3">
</ Unlocker>
Push button
Button element can be used to receive clicks, double-clicking the event, and according
to the definition of trigger to control other elements on the interface. Button
element can also be passed to other elements on the event interface, to make the other
elements in response to user actions on the lock screen interface.
<Button name = "" x = "" y = "" w = "" h = "" listener = "">
All elements of the name attribute increases, the control object button specified by
name.
x, y, w, h specifies the button area.
The button's event listener to specify which element to pass.
Button can have a number of trigger, trigger defines the button action trigger-related
operations, such as controlling the properties of an element
<Trigger action = "" target = "" property = "" value = "" />
Music Player
Specify the name, so that the display can be controlled by another button or not, such
as double-click. Must contain 4 Button and a Text, and the name was specified name.
May contain any other interface elements, such as Image like.
autoShow true / false if they go into the lock screen when playing music, whether
to automatically display MusicControl
music_state stop a player playing status 0
After updating the music player supports the song and artist name displayed
separately, respectively, using @ music_control.title and @ music_control.artist
<-! Text Added automatic scrolling feature, if developed width and scroll speed marqueeSpeed, will automatically scroll through the tex
<Text name = "music_display" x = "240" y = "10" w = "300" marqueeSpeed
= "30" size = "24" color = "# FFFFFF" alpha = "150" align = "cen
<Button name = "music_prev" x = "40" y = "40" w = "108" h = "84">
<Normal>
<Image src = "music_previous_n.png" x = "40" y = "40" />
</ Normal>
<Pressed>
<Image src = "music_previous_p.png" x = "40" y = "40" />
</ Pressed>
</ Button>
<Button name = "music_next" x = "332" y = "40" w = "108" h = "84">
<Normal>
<Image src = "music_next_n.png" x = "332" y = "40" />
</ Normal>
<Pressed>
<Image src = "music_next_p.png" x = "332" y = "40" />
</ Pressed>
</ Button>
<Button name = "music_play" x = "186" y = "40" w = "108" h = "84">
<Normal>
<Image src = "music_play_n.png" x = "186" y = "40" />
</ Normal>
<Pressed>
<Image src = "music_play_p.png" x = "186" y = "40" />
</ Pressed>
</ Button>
<Button name = "music_pause" x = "186" y = "40" w = "108" h = "84">
<Normal>
<Image src = "music_pause_n.png" x = "186" y = "40" />
</ Normal>
<Pressed>
<Image src = "music_pause_p.png" x = "186" y = "40" />
</ Pressed>
</ Button>
</ MusicControl>
Volume adjustment
volume_level volume now
volume_level_old adjust the volume of the previous value: 1-15 based on
comparison of the two judgments is increasing or decreasing
volume_type
0 call volume
A system volume
2 phone ringtone, SMS ringtone
3 music player volume
4 alarm volume
5 Notification volume
6 Bluetooth connection when the call volume
7 In some countries, mandatory system volume
8 DTMF volume
9 TTS volume
10 FM volume
Under normal lock screen can adjust 3 (volume player volume)
volume_type> = 0 represents the volume is being adjusted, the adjusted value of -1 is
completed according to the show or hide the volume display
Content Provider
content provider support where the format:
where = "" whereFormat = "" whereParas = ""
content Provider support dependencies, ie after the end of a ContentProviderBinder
query to get the variable as a parameter to the next query ContentProviderBinder
<ContentProviderBinder name = "name1" dependency = "name2">
<ContentProviderBinder name = "name2">
triggers name1 name2 inquiry after inquiry ended, name1 name2 queries can use variables. And if the data changes name2 re-query, it will
content provider provides application information generic query interface that defines
a new xml code to query the content provider, and queries to the binding information
to the variables used to display information about third-party applications, as long
as third-party applications to provide the appropriate The content provider. For
example, you can display weather information, e-mail, to-do, notes, etc., you can also
write an application to query any information you want and by content provider to
provide to use the lock screen.
<VariableBinders>
<ContentProviderBinder uri = "content: // sample / test" c uriFormat = "" uriParas = "" columns = "col1, col2" where = "" args = "" ord
<Variable name = "variable_name1" type = "int" column = "col1" row = "0" />
<Variable name = "variable_name2" type = "string" column = "col2" row = "0" />
</ ContentProviderBinder>
</ VariableBinders>
<Image src = "weather.png" visibility = "# hasweather" x = "240" y = "100" srcid = "# weather_id" align = "center">
<PositionAnimation>
<Position x = "- 10" y = "0" time = "1000" />
<Position x = "10" y = "0" time = "3000" />
<Position x = "0" y = "0" time = "4000" />
</ PositionAnimation>
</ Image>
Weather id list:
weather_chance_of_rain = 2130837536;
weather_chance_snow = 2130837540;
weather_chance_storm = 2130837544;
weather_clear = 2130837556;
weather_cloudy = 2130837560;
weather_flurries = 2130837564;
weather_fog = 2130837568;
weather_heavy_rain = 2130837572;
weather_icy_sleet = 2130837576;
weather_mist = 2130837583;
weather_partly_cloudy = 2130837587;
weather_rain = 2130837600;
weather_snow_rain = 2130837606;
weather_snow = 2130837608;
weather_sunny = 2130837612;
weather_thunderstorm = 2130837617;
weather_unknown = 2130837621;
weather_windy = 2130837626;
MIUI notes query content, display and modify the contents of the first time notes
<VariableBinders>
<ContentProviderBinder uri = "content: // notes / note" columns = "modified_date, snippet" order = "modified_date DESC" countName = "no
<Variable name = "note_date1" type = "long" column = "modified_date" row = "0" />
<Variable name = "note_snippet1" type = "string" column = "snippet" row = "0" />
</ ContentProviderBinder>
</ VariableBinders>
<DateTime x = "300" y = "50" color = "# ffffffff" visibility = "# note_count" value = "# note_date1" format = "yyyy-year MMMMdd day hh: m
<Text x = "5" y = "180" w = "450"
color = "# ffffffff" visibility = "# note_count" size = "18" marqueeSpeed
= "60" text = "@ note_snippet
1. iamge1 is the name of the object to be controlled ".", followed by the property
(currently supports visibility and animation).
2. Control when visibility, value which is written true or false, control the
animation time, value write-play (currently not supported so that the animation
pause)
3. condition is conditional, support for regular expressions. When the condition
where the condition is true, execute the command; is false, not executed.
4. delay is the delay, in milliseconds. After reading a delay before the command
execution
5. delayCondition judgment is delayed, after the delay time and then judge.
Examples:
<Button x = "0" y = "0" h = "100" w = "100">
<Triggers>
<Trigger action = "down">
// Second <40, 2000ms delay execution
<VariableCommand name = "delayCond0" expression = "#
// Delay after 6000ms, if the second <40, executed
<VariableCommand name = "delayCond1" expression = "#
// Second <40, the delay 4000ms, at this time if the
<VariableCommand name = "delayCond2" expression = "#
</ Trigger>
</ Triggers>
</ Button>
VariableCommand
Variables command, used to control variables (Var) value. Including the name and
expression of two special attributes, condition, delay, delayCondition usage is
consistent with Command
// The width value assigned to the screen w
<VariableCommand name = "w" expression = "# screen_width" />
SoundCommand
Voice commands can be used to play audio files
<SoundCommand sound = "" volume = "" loop = "" keepCur = "" />
1.
2.
3.
4.
Note: The sound file size requirements do not exceed 500kB, when the length is not
more than 10 seconds (10 seconds after playback sound does not come out).
Examples:
// Loop reached.mp3, while constantly being played out other sounds
<SoundCommand sound = "reached.mp3" volume = "1" loop = "true" keepCur = "true" />
ExternCommand
At present, a command can be used is the unlock command (only valid in the lock
screen)
<ExternCommand command = "unlock" />
Use this command to achieve the unlock operation, without the use of <Unlocker />
ExternalCommand
And ExternCommand relative, is to receive an external command command, typical usage:
in the lock screen, usually used to receive the opening screen / off-screen commands
to execute some commands; desktop plug-in, is used to detect the cut screen to perform
command
resume indicates that the command executed when the opening screen, pause indicates that the command is executed when off-screen
<ExternalCommands>
<Trigger action = "resume">
<Command target = "target.animation" value = "play" />
</ Trigger>
<Trigger action = "pause">
<VariableCommand name = "pause_time" expression = "# time_sys" />
</ Trigger>
</ ExternalCommands>
Data
<Command target = "Data" value = "toggle" />
<! - Only to switch to open, with another button to switch to the OFF ->
<Command target = "Data" value = "on" />
<Command target = "Data" value = "off" />
<-! Value = "normal, silent, vibrate" value = "silent" value = "normal" <br>
In a comma-separated state key switch, you can specify only one state, each with a different multiple button state value value, you
Three states switched
<Command target = "RingMode" value = "toggle" />
Below and above the same effect
<Command target = "RingMode" value = "normal, silent, vibrate" />
Only normal and mute switch
<Command target = "RingMode" value = "normal, silent" />
Only normal and vibration switch
<Command target = "RingMode" value = "normal, vibrate" />
Only switch to mute other button to switch to another state
<Command target = "RingMode" value = "silent" />
State variables, only add the appropriate command after the effective
#ring_mode: 0 silent, 1 vibrate, 2 normal
#wifi_state: 0 disabled, 1 enabled, 2 problem, 3 half (intermediate)
#bluetooth_state: 0 off, 1 on, 2 half
#data_state: 0 off, 1 on
#usb_mode: 0 disconnected, 1 charge only, 2 storage, 3 intermediate
Trigger's Command support variable assignment
<VariableCommand name = "test" expression = "# test + 1" />
name: variable name, expression: assignment expression
Advanced Usage
To specify the xml description language different frame rates depending on the time
line, add an element, called FramerateController, the same elements, and other
interface elements can be added to each container, this element contains a frame rate
control timeline specified in the certain amount of time to use a certain frame rate.
<FramerateController visibility = "# music_control.visibility" loop = "true">
<ControlPoint time = "0" frameRate = "20" />
<ControlPoint time = "1000" frameRate = "0" />
<ControlPoint time = "3000" />
</ FramerateController>
This element will control the frame rate at which it is under the timeline container,
ie, frame rate change elements of the container under all animations are synchronized
with this element specified.
Sensor calls
Added <SensorBinder type = ""> You can bind the sensor data to the variables for
gravity sensing, orientation sensor, acceleration sensors, pressure sensors (altitude)
<VariableBinders>
// Orientation sensor:
type = "orientation"
index = 0: azimuth, 0 ~ 359,0 = North, 90 = East, 180 = South, 270 = West
index = 1: pitch angle, -180 ~ 180, z-axis to the positive y-axis direction of the steering
index = 2: roll angle, -90 ~ 90, x-axis turning positive z-axis direction
<SensorBinder type = "orientation">
<Variable name = "" index = "0" />
<Variable name = "" index = "1" />
<Variable name = "" index = "2" />
</ SensorBinder>
// Linear acceleration
type = "linear_acceleration"
index = 0: x direction of linear acceleration
index = 1: linear acceleration in the y direction
index = 2: z direction of linear acceleration
Linear acceleration is to remove the influence of gravity: gravitational acceleration = linear acceleration +
<SensorBinder type = "linear_acceleration">
<Variable name = "linear_acceleration_x" index = "0" />
<Variable name = "linear_acceleration_y" index = "1" />
<Variable name = "linear_acceleration_z" index = "2" />
</ SensorBinder>
// Acceleration
type = "accelerometer"
index = 0: acceleration in the x direction
index = 1: acceleration in the y direction
index = 2: z direction acceleration
<SensorBinder type = "accelerometer">
<Variable name = "" index = "0" />
<Variable name = "" index = "1" />
<Variable name = "" index = "2" />
</ SensorBinder>
// Gravity sensor
type = "gravity"
index = 0: gravitational acceleration in the x direction
gravitational acceleration in the y direction: index = 1
index = 2: gravitational acceleration in the z direction
<SensorBinder type = "gravity">
<Variable name = "" index = "0" />
<Variable name = "" index = "1" />
<Variable name = "index =" 2 "/>
</ SensorBinder>
// Pressure Sensors
type = "pressure"
index = 0: barometric pressure units hPa. The average air pressure at sea level is 1013.25hPa, can be estimated based on t
<SensorBinder type = "pressure">
<Variable name = "" index = "0" />
</ SensorBinder>
</ VariableBinders>