MAML Tutorial (MIUI Theme)

March 26, 2018 | Author: RhiskiAprilianto | Category: Button (Computing), User Interface, Control Flow, Variable (Computer Science), Icon (Computing)


Comments



Description

MAML TutorialsFrom MIUI Theme Wiki 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 MORE & MAML Overview MAML engine scripting language MIUI Application Markup Language for MORE (MIUI MORE engine application markup language) MORE rendering engine Markup Oriented Rendering Engine (the rendering engine based markup language) 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. What types of interface development engine applies MORE 1. 2. 3. 4. 5. 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) If specified as 720.launcher. The default is 30. showSysWallpaper: The default is false.xml file is described in the script <Lockscreen frameRate = "" displayDesktop = "" showSysWallpaper = "" screenWidth = "720"> <Image /> <Image /> <Unlocker /> <Unlocker /> <Time /> <DateTime /> .AlarmAlertFullScreen Freedom dynamic desktop widgets com. MAML applications dynamically changeable wallpaper and icons Variety Wallpaper Variety wallpaper in the theme package miwallpaper catalog description file is manifest.home. energy saving.AwesomeGadget Variety wallpaper com. 480p phone will automatically scaled. will be used as a lock screen wallpaper wallpaper. Meego. displayDesktop: The default is false.home. You can achieve the perfect WP7.android. 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.home.impl. screenWidth: set the screen width criteria.PhotoFrame Alarm bells interface com.android..miui.gadget. If you do not specify after opening the lock screen wallpaper <Wallpaper />.AwesomeClock Frame Gadget com..MiWallpaper (based SurfaceView) Dynamic Icon Weather Gadget com.gadget.home.gadget.miui.launcher. whether to display the lock screen wallpaper.AwesomeLockScreen Desktop Clock com.Weather_2x4_custom (v4) MAML Variety lock screen application in Variety lock screen theme lockscreen bag / directory under the advance.miui. if the animation is slow. manifest. <Text /> </ Lockscreen> frameRate: Specifies the frame rate.gadget.launcher. Ali cloud and other unlock interface.home.deskclock. Consistent with the root node represents Variety lock screen: <MiWallpaper frameRate = "1" width = "720" height = "1280" screenWidth = "720"> <Var /> <Image /> .internal.launcher.miui.launcher. the location of all the elements of the lock screen layouts are written by 720p.MIUI theme modules using MORE Variety lock screen com.miui.xml. you can specify the value of smaller. perspective to the desktop features.policy. xml <Icon version = "1" frameRate = "" width = "136" height = "136" screenWidth = "720" useVariableUpdater = "" hideApplicationMessage = ""> <Var /> <Image /> <Text /> <DateTime /> . otherwise a default will be updated every minute. in order to save system resources. and you can specify the update period of time. If a gadget or a dynamic icon display only the date is updated once a day.android. now includes power and time.0) Relationship between the two: #wallpaper_offset_x * screen width = -1 * # wallpaper_offset_pixel_x Slide: In the first screen. For example. # wallpaper_offset_x wallpaper_offset_pixel_x: the number of pixels offset (0 to -1 * screen width) wallpaper_offset_x: Offset percentage (0 to 1. Wallpaper position: x = ". wallpaper_offset_pixel_x = -1 * screen width. </ MiWallpaper> width: width represents amazing wallpaper. height: represents the height Also. Need to follow the sliding element positioning: x = ".. Wallpaper cut dual wide (screen width refers screenWidth) 2. wallpaper_offset_x = 1. wallpaper_offset_pixel_x = 0. need the help of # wallpaper_offset_pixel_x.# wallpaper_offset_x * screen width" 3. you can specify the update cycle for one day. which contains the description file manifest.. each dynamic icon is a folder. you need to specify the update cycle for one second. </ Icon> hideApplicationMessage: default false. slid the last screen. The proposed design approach: 1.0 To adapt to different resolution models. the folder name is the corresponding app package name.. Try to choose a longer update cycle. we recommend using #wallpaper_offset_x.# wallpaper_offset_x * Wide screen wallpaper + relative position" Dynamic Icon Under the theme of dynamic icons pack icons \ fancy_icons \ directory. the icon is a dynamic calendar called "com.<Group /> . . wallpaper_offset_x = 0. shielded notice the top right corner flag. if the time gadgets updated every second. useVariableUpdater: Which system variable specifies the need..calendar" folder. if you want to achieve the effect of finger sliding elements follow. Day. DateTime. DateTime. If the variable value will change during the lock-screen operation. animations. After designated ture. DateTime. can improve efficiency.Currently supported tag: Battery. const set to false Default: false threshold threshold trigger. There /> 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.visibility" value = "true" /> <Command target = "time3_anim. DateTime. can trigger some commands. in addition to other things you Image elements identical. For example: <Var name = "time3" expression = "# minute% 10" threshold = "1"> <Trigger> <Command target = "time3_anim.Second If a gadget does not require electricity or time variable.Hour.Hour" If you need to refresh several times per second.visiblity" value = "true" delay = "400" /> <Command target = "time_3_anim_new. when the change variable value exceeds the set threshold. DateTime.animation" value = "play" delay = "400" /> </ Trigger> </ Var> The code represents the value of # time3 every change of 1. and can be used directly frameRate Wallpaper element Wallpaper wallpaper element reference can not specify the source images and properties can be controlled.visibility" value = "false" /> <Command target = "time_3_anim_new. it will execute all commands <Trigger /> inside persist default false. you need to use useVariableUpdater = "none". .Minute. he would not be recalculated. specifies the time variable and so do the update. variable persistence. If a gadget display system power and change per hour depending on the time display background images: useVariableUpdater = "Battery. if not re given the value of the other variable. Examples: <Wallpaper system settings. Without can be multiple.animation" value = "play" /> <Command target = "time3_anim_new. and other this element does not display wallpaper. then the value would have been saved. . </ Vars> <Items> <Item expression = "ifelse (isnull (date_format).... <Item value <Item value </ Items> </ VarArray> <Text text = "@ = "January" /> = "February" /> = "November" /> = "December" /> month_str" color = "# FFFFFFFF" size = "20" .after re-lock or unlock regardless reapply themes are not restored 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" /> . -> <Var name = "show_date" expression = "ifelse (isnull (#show_date).date_format)" /> <Item value = "EEEE" /> <Item value = "yyyy-year" /> <Item value = "MMMM" /> <Item value = "d day" /> </ Items> </ VarArray> // Display the English Month <VarArray type = "string"> <Vars> <Var name = "month_str" index = "# month" /> </ Vars> <Items> <Item value <Item value . </ Items> </ VarArray> Item array element definition expression elements corresponding expression If the element is a constant value. // Array elements can be used to display different values ​ based on numeric variables string <-! If const is true.. /> Global Variables . 18. # show_date)" type = "number" const = "true" /> <Var name = "text_size_date" expression = "ifelse (isnull (#text_size_date). 1.. # tex t_size_date)" type = "number" const = "true" /> <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'. the variable will only evaluate once at the initial time. the value is specified by a constant value // Define a two-second rotation time date display format DateTime every element. 'MMMMd day EEEE'.date_format)" /> <Item value = "EEEE" /> .. move_dist unlocking member moves from unlocker. and so on) date date day_of_week week (1 for Sunday. 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.state unlocking member state: 0 normal.unlocker: Offset unlocker.move_y unlocking member in the y-direction unlocker. 1 pressed. 1 for February. 2 for Monday. 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 . 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.0 for January.move_x unlocking member in the x-direction Offset unlocker. cosh. 3 half (intermediate) bluetooth_state 0 off. acos.bmp_height music: music_control. 3 intermediate Expression Support brackets and modulo arithmetic functions modulo arithmetic: + . 2 normal wifi_state 0 disabled.music_state 0 1 Play Pause others: sms_unread_count number of unread messages call_missed_count missed phone number next_alarm_time an alarm clock next time intercept_sys_touch whether intercepted after a touch event. to avoid being caught Other View. the first of several) to take the first of several given numbers . tan. 1 charge only. zoom effects.* /% support functions: sin. in a free desktop widget can prevent the desktop to enter the edit mode to scroll and touch operation on the widget frame_rate current screen frame rate volume_type 0 Call Volume 1 System Volume 2 ringtone. 1 on usb_mode 0 disconnected. asin. 2 half data_state 0 off. SMS ringtone music player volume 3 4 5 notification volume alarm volume 6 Bluetooth connection when the call volume 7 in some countries mandatory system volume 8 DTMF 9 TTS Volume Volume Volume 10 FM ring_mode 0 silent. 1 on. cos.actual_h image. sqrt.resolution of the device. 1 vibrate. only to find the specified picture according src. abs. min.bmp_width width of image files (not crop. 1 enabled.actual_w actual width of the picture image. and detects the width of the document) image. not the root of the impact screenWidth) raw_screen_height physical height image: image. for example. max does not explain len (digital) given the number of digits len (1234) = 4 digit (numbers. sinh. 2 storage. 2 problem. atan. Z) rotation angle. center. z) // x> 0 y:? z ifelse (x1. you can directly call the desired output variables such as "time is now 9:00. the old angle can also be used. the string starting position. default false . you need to specify the corresponding variable expression% d in paras where there can be multiple expressions with variables. and from the beginning substr (original string. If the multi-line specifies the display will fold lines.. y. isnull can determine whether the string variable is empty.. @ string2) Element is visible expression of support visibility = "expression" <= 0 invisible> 0 Visible Image. y) // x> = y 1:? 0 gt (x. you need to specify the format. text coordinates textExp: literal expression... Time's property align = left. "" separated align: alignment of the left. y) // x = y 1:? 0 ge (x. else return z + Can concatenate strings. the coordinates attribute support variables color: text color. the string length) substr ('Today is really hot'. String Comparison Functions eqs (@ string1. y) // x> y 1:? 0 le (x. right horizontal alignment of the coordinate points alignV = top. x2. ifelse can select String. some functions can also support string. When the interval after the re-emergence of the text display. z) if x1> 0 return y1. right. y1. 2) = 4 Note: subscript right to left." can be written textExp = "'Now the time is' + # hour12 + 'point'. Y. y2. . else if x2> 0 return y2.." width text width. the default width of four characters rotation (X. If you specify the text scrolling. specify the numeric position with% d paras: If you specify the format. y) // x == y 1:? 0 ! ne (x. center. scrolling in the specified location will display text marqueeSpeed ​ text scrolling speed. 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.digit (12345. bottom vertical alignment coordinate points the way Text Displays the format of the text. center. but the recommended rotation. Text. y) // x <= y 1:? 0 lt (x. 1. when the text exceeds the specified width will be cut off.2) = 'naive' round () rounded to the nearest integer int () rounded down eq (x. . because of relatively high atmospheric internationalization multiLine ture / false whether to support multi-line display. with the width of the use of the above marqueeGap scroll interval. # FFFFFF size: Text Size format: If you need to display a variable number in the text.. # battery_level" /> textExp property supports string expression: * Weather information is displayed if the temperature is empty ... the use of positive images spacing becomes larger. Coordinate property supports variable expression space represents a gap time of the picture. time_1. an additional Lunar: NNNN <DateTime x = "" y = "" color = "" size = "" format = ""> <PositionAnimation /> <DateTime> September: M -> 9 MM -> 09 7 minutes: . time_9. /> # Tt..not empty display values <Text visibility = "# hasweather" x = "(# screen_width / 2) +180" y = "# screen_height-290" w = "360" size = "36" color = "# ffffff" alig Time <Time x = "10" y = "10" src = "time. you can make a projection overlap to save space Date Display format specified date format: Supports standard date format.png.text_width width of a line of text that can be used to typeset <Text name = "tt" . will write negative space..png. /> <Text format = "under an alarm clock: [% s] Battery: [% d %%]" paras = "@ next_alarm_time..png.text_width Examples of usage: Display the next alarm time <Text text = "@ next_alarm_time" . .png" space = ""> </ Time> src time picture of the prefix follows that the use time_0.png. then you can cut small pictures.. For the projection of images. we can use this feature to typeset time images. save memory. time_dot.spacingMult multiple default spacing 1 increase the amount of the default spacing spacingAdd 0 text. png" /> . y coordinates relative to the upper left corner of the screen w. h width and height pivotX.png" 0-255 alpha transparency. a week 360 src Image Name srcid picture sequence suffix number. Examples: <Image x = "0" y = "# screen_height-323" src = "bottom_bg. pivotY center of rotation rotation angle of rotation.png" srcid = "1" will show the last picture "pic_1. but the speed will be slower srcExp picture source expression srcFormat picture source format srcForamtExp picture source format expression srcParas picture source parameters align / alignV alignment. have been introduced earlier. you can specify various attributes <Image x = "" y = "" w = "" h = "" pivotX = "" pivotY = "" rotation = "" src = "" srcid = "" alpha = "" align = "" antiAlias ​ = "" /> x. if src = "pic. usually with variable. you can display different pictures based on variables. if true picture does not have serrated deformation in the rotation.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" -> "4月6日3: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. less than or equal to 0 is not displayed antiAlias ​ true / false anti-aliasing. Otherwise mask remain intact.png .png" align = "absolute" /> </ Image> x. Time similar parts Pictures mask <Image x = "444" y = "# screen_height-92" src = "hs_path_light. y coordinates src mask image..png number_1.> <PositionAnimation> .. </ PositionAnimation> </ Image> // SrcExp: Picture source expression <Image x = "210" y = ". Mask can also be active animation. align coordinates are relative or absolute position of the picture belongs.438" y = "0" time = "2000" /> </ PositionAnimation> <Mask x = "0" y = "# screen_height-92" src = "hs_path_mask_r. if it is relative.26" align = "center" srcExp = "'weather / weather_' + #weather_id +icon_suffix + '. support SourceAnimation If the src = "number.png" number_0.png"> <PositionAnimation> <Position x = "..png'" /> Digital Pictures <ImageNumber number = "" src = ""> numeric expression number is to be displayed src is the file name of the picture source. will be used to draw the digital image files. property supports variable expression <Mask x = "" y = "" src = "" centerX = "" centerY = "" angle = "" align = ""> <SourcesAnimation /> <RotationAnimation /> <PositionAnimation /> </ Mask> Elements of animation .. rotation animation.<Image name = "img" . the other part is transparent. animation and location.. the black part represents an opaque opaque.. Pictures Mobile is moving mask will follow accordingly. keyframes. y optional. size. and then calculate the current linear interpolation property. from the far left to the far right of the transparency of the process of change. each loop.5 seconds to reach the rightmost gradient opaque. the animation consists of several key frames. transparency. Other animation will find two adjacent key frames based on the current time.All elements supports animated movie is divided into: Picture source. represent the relative location of the picture. independent of each animation. the picture outside source animation division. <Image x = "0" y = "# screen_height-177" src = "charging_light. the default time is 0. after 0.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> NOTE: Only image support image source animation image source animation slightly different.0-255 -> <AlphaAnimation> <Alpha a = "" time = "" /> <Alpha a = "" time = "" /> </ AlphaAnimation> Example: Location animated representation of one second from the left to the far right of the screen. stay one second. rotation. position. including property and time frame. transparency of 175 indicates the beginning of the animation. If the first frame of the time does not start from zero.5 seconds and then disappear becomes transparent. the first frame as a picture of the original property. <Image> <PositionAnimation> <Position x = "10" y = "20" time = "100" /> <Position x = "100" y = "200" time = "1000" /> </ PositionAnimation> </ Image> <RotationAnimation> <Rotation angle = "" time = "" /> <Rotation angle = "" time = "" /> </ RotationAnimation> <SizeAnimation> <Size w = "" h = "" time = "" /> <Size w = "" h = "" time = "" /> </ SizeAnimation> <! . Then loop. no interpolation. the time in milliseconds. x. transparency. Position in the animation position coordinates relative to the picture itself. 0. the current picture is found in the first list that is greater than the current time point specified . the time in seconds). support the Trigger Slider starting point: the starting point of the elements contained in drag to move the position will follow the current operation. By adding the group to coordinate and width and height. etc. equivalent controls are a container that can be used to contain live other elements. when a Slider visible.<SourcesAnimation> <Source x = "" y = "" src = "pic1. You can have any number of Slider components. So it is recommended that you pick plus the corresponding frame rate when you add a Group Slider <Slider name = ""> name: the name used for the variable name bounceInitSpeed.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. other Slider disappear. time. . such as pictures. Trigger Slider state switching. all support the expression alwaysShow = "true / false" default is false. you can easily adjust the position and size of a onetime multiple elements.png" time = "100" /> <Source x = "" y = "" src = "pic2. reduce memory and cpu usage each group based on the current frame rate. While Group also add a variety of animation types and Image as comprehensive The new version also adds a frame rate control. bounceAccelation rebound animation initial velocity and acceleration (distance in pixels. you can add framaRate = "0". if a group of elements are static. the system will automatically adjust the refresh rate. display these elements -> <PressedState> <Image /> <Time /> <DateTime /> <Text /> // When switching from other states to PressedState. dragging.After reaching the trigger target.mp3" volume = "1" /> </ Trigger> </ ReachedState> </ StartPoint> Three state can not specify the variables can be used to change the status of the other interface elements to represent the triggering process. you can have more than one trigger purposes.Normal state. then release your finger that can generate a trigger. can contain several elements -> <NormalState> <Image /> <Time /> <DateTime /> <Text /> // When switching from other states to NormalState.visibility" value = "false" /> </ Trigger> </ NormalState> <! . trigger the Trigger <Trigger> <Command target = "test_trigger. reaching the trigger position. you can specify a different intent -> <Intent action = "" type = "" category = "" package = "" class = "" /> <NormalState> </ NormalState> <-! Show the target position if pressed trying to unlock -> <PressedState> <Image /> </ PressedState> <-! Show specified image when reached target. said the start trigger operation. <EndPoint x = "" y = "" w = "" h = "" reachedSound = ""> <! . hide other elements to display these elements -> <ReachedState> <Image /> <Time /> <DateTime /> <Text /> // When switching from other states to ReachedState.Hit area in the press.Slider path <Path x = "" y <Position x <Position x </ Path> </ EndPoint> 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"> . triggered Trigger -> <Trigger> <SoundCommand sound = "reached. if touch up then perform unlock -> <ReachedState> <Image /> </ ReachedState> <.Slider perform actions.visibility" value = "true" /> </ Trigger> </ PressedState> <! . Slider target point: When the starting point x. hiding other state elements. trigger the Trigger <Trigger> <Command target = "test_trigger.<StartPoint x = "" y = "" w = "" h = "" normalSound = "" pressedSound = ""> <! . y point fall EndPoint rectangle target area. see http://www. x.com/thread-290094-1-1.mp3" pressedSound = "sound_normal. double-clicking the event. y.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. the control object button specified by name. <Button name = "" x = "" y = "" w = "" h = "" listener = ""> All elements of the name attribute increases. See Command Trigger and Trigger & Command Unlocker inherit Slider. pressedSound. trigger defines the button action trigger-related operations.miui. w. Button element can also be passed to other elements on the event interface.mp3"> </ Unlocker> Push button Button element can be used to receive clicks. Button can have a number of trigger. a Trigger can have multiple Command. specified in the normal state and press play sound EndPoint: reachedSound. The button's event listener to specify which element to pass.<NormalState> <Image x = "31" y = "# screen_height-117" src = "unlock_button.html Lock screen sounds StartPoint: normalSound.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. unlocking member rebound animation.mp3"> <EndPoint x = "0" y = "640" w = "480" h = "400" reachedSound = "sound_reached. h specifies the button area. to make the other elements in response to user actions on the lock screen interface. such as controlling the properties of an element <Trigger action = "" target = "" property = "" value = "" /> . after reaching the endpoint play sound <Unlocker name = "unlocker"> <StartPoint x = "0" y = "440" w = "480" h = "400" normalSound = "sound_normal. more than just the tag name usage Slider to Unlocker. and according to the definition of trigger to control other elements on the interface. 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. Must contain 4 Button and a Text. </ Normal> <! . </ Pressed> </ Button> Music Player Specify the name. simple demonstration: <Button> <Triggers> <Trigger action = "down / up / double"> <Command target = "test.artist . <Normal> <Image /> <Text /> . respectively. and the name was specified name. play animations. and execute commands.Button normal state. up (lift). using @ music_control. etc. such as Image like. so that the display can be controlled by another button or not.. currently supports: visibility will add other attributes to control later. can contain any interface elements. can not specify Note: Button in Button Image coordinates and their coordinates are independent.You can specify any number of trigger. <Pressed> <Image /> <Text /> . May contain any other interface elements.visibility" value = "true / false"> <Command target = "test. you can not specify -> <Triggers> <Trigger /> <Trigger /> </ Triggers> <! .. can contain any interface elements. etc. such as double-click. toggle Usually target button control has three categories.action: button action: down (pressed). double (double-click) target: the name of the control objectives property: property name.animation" value = "play"> <VariableCommand name = "test1" expression = "0"> </ Trigger> </ Triggers> </ Button> About command <Command /> will be described in detail later in Button xml structure elements: <Button> <! . you can not specify. such as Image Text. if you specify a normal state. value: property value for the boolean currently have: true. visibility control.. false.title and @ music_control. namely... are relative to the parent element of Button.. autoShow true / false if they go into the lock screen when playing music.Button pressed. such as Image Text. png" x = "40" y = "40" /> </ Normal> <Pressed> <Image src = "music_previous_p.On the one button -> <Button name = "music_prev" /> <! .png" x = "186" y = "40" /> </ Normal> <Pressed> <Image src = "music_play_p.Play button -> <Button name = "music_play" /> <! . 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.Pause button -> <Button name = "music_pause" /> </ MusicControl> Example: Double-click Show hidden control music control <Button x = "178" y = "529" w = "126" h = "126"> <Triggers> <Trigger action = "double" target = "music_control" property = "visibility" value = "toggle" /> </ Triggers> </ Button> <MusicControl x = "0" y = "300" name = "music_control" visibility = "false"> <Image name = "music_album_cover" x = "240" y = "40" alpha = "150" align = "center" alignV = "center" /> <! .The next song button -> <Button name = "music_next" /> <! .Song title and artist display text -> <Text name = "music_display" /> <! . if developed width and scroll speed marqueeSpeed.png" x = "332" y = "40" /> </ Normal> <Pressed> <Image src = "music_next_p. and the like in addition to the ordinary Image picture is bound to the album cover.Background -> <Image src = "music_bg.<MusicControl name = "music_control" x = "" y = ""> <! .png" x = "40" y = "0" alpha = "100" /> <-! Text Added automatic scrolling feature.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 = "186" y = "40" /> </ Pressed> </ Button> </ MusicControl> .Album cover. you can specify the size.png" x = "186" y = "40" /> </ Normal> <Pressed> <Image src = "music_pause_p. plus Ma <Image name = "music_album_cover" /> <! .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" /> </ Pressed> </ Button> <Button name = "music_pause" x = "186" y = "40" w = "108" h = "84"> <Normal> <Image src = "music_pause_n. And if the data changes name2 re-query. For example.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. as long as third-party applications to provide the appropriate The content provider. it will content provider provides application information generic query interface that defines a new xml code to query the content provider. to-do. 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. SMS ringtone 3 music player volume 4 alarm volume 5 Notification volume 6 Bluetooth connection when the call volume 7 In some countries. name1 name2 queries can use variables. you can display weather information. etc. 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> . 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. notes. and queries to the binding information to the variables used to display information about third-party applications.. 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. e-mail. 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. location.geniewidget. row: number of rows to variable binding. .weather/weather/current/%d" uriParas = "# time_sys" columns = "iconResId.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. the same SQL args: "where" parameters. order: Sort with SQL countName: The number of queries structure is bound to the variable name Variable: Given a bind variable name: variable name type: content provider data type: string / double / float / int / long column: the name of the variable bound to the column. weather_flurries = 2130837564.google.genie.png" visibility = "# hasweather" x = "240" y = "100" srcid = "# weather_id" align = "center"> <PositionAnimation> <Position x = ". you can use the format.android. ContentProviderBinder: Define a content provider and a source of variable bindings to it uri: content provider uri. weather_clear = 2130837556. temperature. highTemperature.</ VariableBinders> VariableBinders: definition of variables bound to the source. currently only supports content provider. weather_cloudy = 2130837560. description" countName = "hasweather"> <Variable name = "weather_id" type = "int" column = "iconResId" /> <Variable name = "weather_location" type = "string" column = "location" /> <Variable name = "weather_temperature" type = "int" column = "temperature" /> <Variable name = "weather_lowTemperature" type = "int" column = "lowTemperature" /> <Variable name = "weather_highTemperature" type = "int" column = "highTemperature" /> <Variable name = "weather_description" type = "string" column = "description" /> </ ContentProviderBinder> </ VariableBinders> <Nowiki> <-! Display <Text visibility = "# <Text visibility = "# <Text visibility = "# <Text visibility = "# weather information -> hasweather" x = "240" y = "60" w = "360" size = "24" color = "# FFFFFF" alpha = "200" align = "center" format = "% hasweather * not (isnull (#weather_lowTemperature)) * not (isnull (#weather_highTemperature))" x = "240" y = "85" w hasweather * isnull (#weather_lowTemperature) * not (isnull (#weather_highTemperature))" x = "240" y = "85" w = "36 hasweather * not (isnull (#weather_lowTemperature)) * isnull (#weather_highTemperature)" x = "240" y = "85" w = "36 <Image src = "weather. weather_chance_storm = 2130837544. the default is 0. weather_chance_snow = 2130837540.Check the weather information from Google News Weather -> <nowiki> <VariableBinders> <ContentProviderBinder uriFormat = "content: //com. which specifies the content provider selection uriFormat: If uri need to add a variable.apps. lowTemperature. you need to be used with uriParas uriParas: Text element of the same format columns: column names need to check. separated by commas where: query. <! . value which is written true or false. weather_sunny = 2130837612. number" where = "type = 3 AND new = 1". weather_windy = 2130837626. the interface can be controlled through the properties of other elements in the object name and object. Trigger & Command Command Basic commands. Usually controls the visibility (visibility) and animation elements (animation). weather_heavy_rain = 2130837572. columns = "_id. 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 Missed calls query parameters uri = "content: // call_log / calls". weather_unknown = 2130837621.animation" value = "play" condition = "" delay = "" delayCondition = "" /> 1. MIUI notes query content. weather_snow_rain = 2130837606.". condition is conditional. display and modify the contents of the first time notes <VariableBinders> <ContentProviderBinder uri = "content: // notes / note" columns = "modified_date. iamge1 is the name of the object to be controlled ". 2. Control when visibility. weather_mist = 2130837583.weather_fog = 2130837568. When the condition . weather_icy_sleet = 2130837576.visibility" value = "false" condition = "" delay = "" delayCondition = "" /> <Command target = "iamge1. weather_snow = 2130837608. weather_partly_cloudy = 2130837587. followed by the property (currently supports visibility and animation). support for regular expressions. value write-play (currently not supported so that the animation pause) 3. control the animation time. weather_thunderstorm = 2130837617. weather_rain = 2130837600. <Command target = "iamge1. is false.mp3. whether to keep the currently playing sound. 2. 40)" delayCondition = "lt VariableCommand Variables command.mp3" volume = "1" loop = "true" keepCur = "true" /> ExternCommand . Including the name and expression of two special attributes. keepCur: when you play this audio. Note: The sound file size requirements do not exceed 500kB. 40)" delay = "6000" / second <40. 4. when the length is not more than 10 seconds (10 seconds after playback sound does not come out). 3. Examples: // Loop reached. while constantly being played out other sounds <SoundCommand sound = "reached. sound: the sound file name volume: loudness. execute the command. 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. delay is the delay.where the condition is true. default is false. after the delay time and then judge. executed <VariableCommand name = "delayCond1" expression = "# // Second <40. if the second <40. After reading a delay before the command execution 5. true / false. default false. condition. 2000ms delay execution <VariableCommand name = "delayCond0" expression = "# // Delay after 6000ms. executed delayCond2 + 5" condition = "lt (# second. 4. in milliseconds. true / false. at this time if the <VariableCommand name = "delayCond2" expression = "# </ Trigger> </ Triggers> </ Button> delayCond0 + 5" condition = "lt (# second. delay. 40)" delay = "2000" /> delayCond1 + 5" delayCondition = "lt (# second. not executed. Examples: <Button x = "0" y = "0" h = "100" w = "100"> <Triggers> <Trigger action = "down"> // Second <40. used to control variables (Var) value. delayCondition judgment is delayed. a floating-point number between 0 and 1 loop: if looping. the delay 4000ms. png" /> </ Pressed> <Normal> <Image x = "10" y = "10" src = "toggle_btn_normal.png" /> </ Normal> </ Button> .Common commands used to send commands to external programs <ExternCommand command = "command name" numPara = "parameters of a digital expression" strPara = "parameter 2. usually used to receive the opening screen / off-screen commands to execute some commands. 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. desktop plug-in. typical usage: in the lock screen.animation" value = "play" /> </ Trigger> <Trigger action = "pause"> <Command target = "__ root.animation" value = "play" /> </ Trigger> <Trigger action = "pause"> <VariableCommand name = "pause_time" expression = "# time_sys" /> </ Trigger> </ ExternalCommands> Example desktop plug-cut screen use <ExternalCommands> <Trigger action = "resume"> <Command target = "__ root. without the use of <Unlocker /> ExternalCommand And ExternCommand relative. pause indicates that the command is executed when off-screen <ExternalCommands> <Trigger action = "resume"> <Command target = "target.animation" value = "play" /> </ Trigger> </ ExternalCommands> Use the buttons to achieve switch <! . is used to detect the cut screen to perform command resume indicates that the command executed when the opening screen.Each Button can have a number of Command -> <Button x = "10" y = "10" w = "100" h = "100"> <Triggers> <Trigger action = "up"> <Command target = "Wifi" value = "toggle" /> </ Trigger> </ Triggers> <Pressed> <Image x = "10" y = "10" src = "toggle_btn_pressed. string expression" /> At present. is to receive an external command command. you Three states switched <Command target = "RingMode" value = "toggle" /> Below and above the same effect <Command target = "RingMode" value = "normal. vibrate" /> Only normal and mute switch <Command target = "RingMode" value = "normal.Only to switch to open. you can specify only one state. silent" /> Only normal and vibration switch <Command target = "RingMode" value = "normal. with another button to switch to the OFF -> <Command target = "Data" value = "on" /> <Command target = "Data" value = "off" /> Ringtone / mute / shock <-! Value = "normal. silent. silent. vibrate" /> Only switch to mute other button to switch to another state <Command target = "RingMode" value = "silent" /> USB storage toggle / on / off <Command target = "UsbStorage" value = "toggle" /> <Command target = "UsbStorage" value = "on" /> <Command target = "UsbStorage" value = "off" /> Wifi toggle / on / off <Command target = "Wifi" value = "toggle" /> A sliding manner to achieve the switching <Slider name = "switch_usb_mode" bounceInitSpeed ​ = "500" bounceAcceleration = "1500" alwaysShow = "true" visibility = "# usb_mode"> <StartPoint x = "0" y = "0" w = "100" h = "100"> <NormalState> </ NormalState> </ StartPoint> <EndPoint x = "340" y = "0" w = "100" h = "100"> <Command target = "UsbStorage" value = "toggle" /> <Path> <Position x = "0" y = "0" /> <Position x = "340" y = "0" /> </ Path> </ EndPoint> </ Slider> . vibrate" value = "silent" value = "normal" <br> In a comma-separated state key switch.Bluetooth value = "on" value = "off" <Command target = "Bluetooth" value = "toggle" /> Data <Command target = "Data" value = "toggle" /> <! . each with a different multiple button state value value. to show the smooth animation. there is no ordinary state animation frame rate can be set to 0.animation" value = "play" /> </ Trigger> </ Triggers> </ Button> <Var name = "ani_offset_x"> <VariableAnimation> <AniFrame value = "# ani_begin_x" time = "0" /> <AniFrame value = "0" time = "300" /> <AniFrame value = "0" time = "100000000000000" /> </ VariableAnimation> </ Var> Dynamic Frame Rate Simple Usage In addition to the original frame rate frameRate property controls ordinary state.# screenview_w. 1 enabled. 3 intermediate Trigger's Command support variable assignment <VariableCommand name = "test" expression = "# test + 1" /> name: variable name. # ani_begin_x_dec. full frame rate power state to facilitate the control of the frame rate under these conditions. 1 on #usb_mode: 0 disconnected. expression: assignment expression Command Support Trigger animation playback controls <Button x = "0" y = "# screenview_y" w = "# screen_width" h = "# screenview_h"> <Triggers> <Trigger action = "up"> <VariableCommand name = "gesture_valid" expression = "ge (abs (#gesture_offset).State variables. the frame rate can be set to 30. such ordinary state can be very efficient. 1 charge only. For example. 0). # gestu <VariableCommand name = "ani_begin_x" expression = "ifelse (# gesture_valid. ifelse (# gesture_offset. For example: frameRateCharging = "30" frameRateBatteryLow = "20" frameRateBatteryFull = "1" Advanced Usage . 2 storage. # screenview_count-1). 2 half #data_state: 0 off. to achieve energy saving goals. the charged state of animation. # gesture_offset. 1 on. only add the appropriate command after the effective #ring_mode: 0 silent. 2 problem. 1 vibrate. # gesture_offset + # s <VariableCommand name = "ani_begin_x_dec" expression = "ifelse (gt (# current_screen. it also supports were set charging. 2 normal #wifi_state: 0 disabled. 80)" /> <VariableCommand name = "ani_begin_x_add" expression = "ifelse (lt (# current_screen. # ani_beg <VariableCommand name = "touch_x" expression = "# touch_begin_x" /> <Command target = "ani_offset_x. 3 half (intermediate) #bluetooth_state: 0 off. the battery is low. and other interface elements can be added to each container. z-axis to the positive y-axis direction of the steering index = 2: roll angle. 270 = West index = 1: pitch angle. ie. -90 ~ 90. the same elements.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. <FramerateController visibility = "# music_control. 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" . 0 ~ 359. -180 ~ 180. add an element.0 = North. frame rate change elements of the container under all animations are synchronized with this element specified. 90 = East. Sensor calls Added <SensorBinder type = ""> You can bind the sensor data to the variables for gravity sensing. orientation sensor. pressure sensors (altitude) <VariableBinders> // Orientation sensor: type = "orientation" index = 0: azimuth. 180 = South. acceleration sensors.To specify the xml description language different frame rates depending on the time line. called FramerateController. this element contains a frame rate control timeline specified in the certain amount of time to use a certain frame rate. This page has been accessed 51.com/index.xiaomi. can be estimated based on t <SensorBinder type = "pressure"> <Variable name = "" index = "0" /> </ SensorBinder> </ VariableBinders> From " http://wiki. .989 times.dev.25hPa. The average air pressure at sea level is 1013.php?title=MAML Tutorials & oldid = 1936 " This page was last modified in 2014 8 月 18 日 (星期一) 15:29.index = 0: barometric pressure units hPa.
Copyright © 2024 DOKUMEN.SITE Inc.