Advertisement
pedroadmn

SensorClock

May 4th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 2.65 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Clock version="1" frameRate="0" type="awesome" useVariableUpdater="DateTime.Minute" resDensity="480" extraResources="sw1440-den640::1.222" extraScaleByDensity="640:1.222">
  3.    
  4.     <VariableBinders>
  5.         <ContentProviderBinder
  6.            uri="content://weather/weather" columns="city_name,temperature,temperature_range,description,weather_type" countName="hasweather">
  7.             <Variable name="weather_id" type="int" column="weather_type"/>
  8.             <Variable name="weather_location" type="string" column="city_name"/>
  9.             <Variable name="weather_temperature" column="temperature" type="string"/>
  10.             <Variable name="weather_description" type="string" column="description"/>
  11.         </ContentProviderBinder>
  12.        
  13.         <SensorBinder type="gravity">
  14.             <Variable name="_gravity_x" index="0" />
  15.             <Variable name="_gravity_y" index="1" />
  16.             <Variable name="_gravity_z" index="2" />
  17.         </SensorBinder>
  18.     </VariableBinders> 
  19.    
  20.     <Var name="is_rain" expression="ge(#weather_id,4)*le(#weather_id,11)" />
  21.     <Var name="is_snow" expression="ge(#weather_id,12)*le(#weather_id,17)" />
  22.     <Var name="is_dust" expression="ge(#weather_id,18)*le(#weather_id,21)+ge(#weather_id,23)*le(#weather_id,24)" />
  23.     <Var name="icon_suffix" expression="ifelse(isnull(#weather_id),1,gt(#weather_id,24),1,#weather_id)" />
  24.     <Var name="icon_index" expression="ifelse(#is_rain,4,#is_snow,12,#is_dust,18,#icon_suffix)" /> 
  25.  
  26.     <Image x="#view_width/2" y="#view_height*0.55" align="center" alignV="center" src="bg.png" ></Image>
  27.         <Group>
  28.         <Time x="#view_width*0.91" y="#view_height*0.73" src="l.png"  alignV="bottom" align="right" space="0" />
  29.         <Text x="#view_width*0.12" y="#view_height*0.72" size="42" color="#ffffff" textExp="@weather_description+'    '+@weather_temperature"  />
  30.     <Text x="#view_width*0.86" y="#view_height*0.72" size="42" color="#ffffff" textExp="@weather_location" align="right" />
  31.    
  32.    
  33.     </Group>
  34.     <Group  >
  35.         <Image src="weather_0_0.png"  scale="0.8"  x="#view_width*0.22*#_gravity_x" y="#view_height*0.5" align="center" alignV="center" visibility="ifelse(isnull(#weather_id),1,0)" />
  36.         <Image src="weather_0.png" scale="0.8" x="#view_width*0.22*#_gravity_x" y="#view_height*0.5" align="center" alignV="center"  srcid="not(ge(#hour24,6)*le(#hour24,17))" visibility="#hasweather*eq(#weather_id,0)" />
  37.         <Image src="weather_1.png"  scale="0.8" x="#view_width*0.22*#_gravity_x" y="#view_height*0.5" align="center" alignV="center" srcid="not(ge(#hour24,6)*le(#hour24,17))" visibility="#hasweather*eq(#weather_id,1)" />           
  38.         <Image x="#view_width*0.22*#_gravity_x" scale="0.8" y="#view_height*0.5" align="center" alignV="center"  srcExp="'weather_'+ #icon_index + '.png'" />
  39.     </Group>
  40. </Clock>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement