Expression
- Support brackets and the modulo arithmetic functions
- modulo arithmetic:
+ - * /% - MIUI7 Added support for:
!: logical negation**: and||: or==: equal!=: not equal- Example:
! (# Cur_weather_type-1 == 4 || # cur_weather_type-1 == 5)
- Example:
- More functions :
sin, cos, tan, asin, acos, atan, sinh, cosh, sqrt, abs, min len (digital)given the number of digitslen (1234) = 4digit (digital, the first of several)to take a given number of the first of severaldigit (12345, 2) = 4Note: The subscript right to left, and from the beginningsubstr (the original string, the string starting position, the string length)substr ('Today is really hot', 1,2) = 'naive'round ()rounded to the nearest integerint ()rounded downrand ()random number between takes 0-1- Examples:
int (rand () * a + b) is taken to an integer b to b + a betweeneq (x, y) // x == y 1:? 0! ne (x, y) // x = y 1:? 0ge (x, y) // x> = y 1:? 0gt (x, y) // x> y 1:? 0le (x, y) // x <= y 1:? 0lt (x, y) // x <y 1:? 0isnull (x) // x == null 1:? 0 // if the expression contains a null variable, usually used to bind variables determine whether the found datanot (x) x> 0 0:? 1ifelse (x, y, z) // x> 0 y:? zifelse (x1, y1, x2, y2, ..., z)if x1> 0 return y1; else if x2> 0 return y2; ...; else return z
+Can concatenate strings, some of the functions can also support astrin,isnullcan determine whether the string variable is emptyifelsecan chooseeqs (@ string1, @ string2)a string comparison functionformatDate function ('string', time)MIUI 7 new date format to a string- Example:
<Var name = "time" expression = "formatDate ('2 hours' time was on: H: mm', # time_sys + 2 * 60 * 60 * 1000)" type = "string" /> <Text x = "120" y = "405" textExp = "@ time" size = "45" color = "# 000000" />
- Example:
- Element is visible expression of support visibility =
"expression" <= 0invisible> 0 //visible align = left, center, rightcoordinate point horizontal alignmentalignV = top, center, bottomvertical alignment coordinate points the way- Note The properties of Image, Text, Time are also applicable