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) = 4
digit (digital, the first of several)
to take a given number of the first of severaldigit (12345, 2) = 4
Note: 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 between
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 <y 1:? 0
isnull (x) // x == null 1:? 0 // if the expression contains a null variable, usually used to bind variables determine whether the found data
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 of the functions can also support astrin
,isnull
can determine whether the string variable is emptyifelse
can 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, right
coordinate point horizontal alignmentalignV = top, center, bottom
vertical alignment coordinate points the way- Note The properties of Image, Text, Time are also applicable