手机锁屏开发-时间

227 阅读1分钟

时间

时间模板1

9d518be63b7306c4da98fced0820486.png

方法一

  • x 值为时间起始坐标+上一个图片的宽度(#times1/2/3/...)+时间数字的间隔;
  • #hour_0.bmp_width = 该名称图片的宽度
<ImageNumber name="hour_0" src="time/time.png" x="0" y="0" number="ifelse(eq(#time_format,0),ifelse(eq(#hour12,0),12,#hour12)/10,#hour24/10)"/>
<ImageNumber name="hour_1" src="time/time.png" x="0+#hour_0.bmp_width" y="0" number="ifelse(eq(#time_format,0),ifelse(eq(#hour12,0),12,#hour12)%10,#hour24%10)"/>
<Image name="img_1" src="time/time_dot.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width" y="0"/>
<ImageNumber name="minute_0" src="time/time.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width+#img_1.bmp_width" y="0" number="(#minute)/10"/>
<ImageNumber name="minute_1" src="time/time.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width+#img_1.bmp_width+#minute_0.bmp_width" y="0" number="(#minute)%10" />
        

方法二

  • <Var name="x_w" expression="#screen_width/2"/>
  • <Var name="y_h" expression="#screen_height/2"/>
  • x 为屏幕横坐标中心位置减去数字图片位置坐标;
  • y 为屏幕纵坐标中心位置减去数字图片位置坐标;
<Image name="hour_0" src="time/time.png" srcid="ifelse(#time_format,#hour24/10,ifelse(eq(#hour12,0),1,#hour12/10))" x="#x_w-0" y="#y_h-0"/>
<Image name="hour_1" src="time/time.png" srcid="ifelse(#time_format,#hour24%10,ifelse(eq(#hour12,0),2,#hour12%10))" x="#x_w-0" y="#y_h-0"/>
<Image name="img_1" src="time/time_dot.png" x="#x_w-0" y="#y_h-0"/>
<Image name="minute_0" src="time/time.png" srcid="#minute/10" x="#x_w-0" y="#y_h-0"/>
<Image name="minute_1" src="time/time.png" srcid="#minute%10" x="#x_w-0" y="#y_h-0"/>
        

时间模板2

时间模板2.png

方法一

  • 同上
        <ImageNumber name="hour_0"  src="time/time.png" x="0" y="0" number="ifelse(eq(#time_format,0),ifelse(eq(#hour12,0),12,#hour12)/10,#hour24/10)"/>
        <ImageNumber name="hour_1"  src="time/time.png" x="0+#hour_0.bmp_width" y="0" number="ifelse(eq(#time_format,0),ifelse(eq(#hour12,0),12,#hour12)%10,#hour24%10)"/>
        <Image name="img_1" src="time/time_dot.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width" y="0"/>
        <ImageNumber name="minute_0"  src="time/time.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width+#img_1.bmp_width" y="0" number="(#minute)/10"/>
        <ImageNumber name="minute_1"  src="time/time.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width+#img_1.bmp_width+#minute_0.bmp_width" y="0" number="(#minute)%10"/>
        <Image name="img_2" src="time/time_dot.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width+#img_1.bmp_width+#minute_0.bmp_width+#minute_1.bmp_width" y="0"/>
        <ImageNumber name="second_0" src="time/time.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width+#img_1.bmp_width+#minute_0.bmp_width+#minute_1.bmp_width+#img_2.bmp_width" y="0" number="(#second)/10"/>
        <ImageNumber name="second_1" src="time/time.png" x="0+#hour_0.bmp_width+#hour_1.bmp_width+#img_1.bmp_width+#minute_0.bmp_width+#minute_1.bmp_width+#img_2.bmp_width+#second_0.bmp_width" y="0" number="(#second)%10"/>
        

方法二

  • 同上
<Image name="hour_0" src="time/time.png" srcid="ifelse(#time_format,#hour24/10,ifelse(eq(#hour12,0),1,#hour12/10))" x="#x_w-0" y="#y_h-0"/>
<Image name="hour_1" src="time/time.png" srcid="ifelse(#time_format,#hour24%10,ifelse(eq(#hour12,0),2,#hour12%10))" x="#x_w-0" y="#y_h-0"/>
<Image name="img_1" src="time/time_dot.png" x="#x_w-0" y="#y_h-0"/>
<Image name="minute_0" src="time/time.png" srcid="#minute/10" x="#x_w-0" y="#y_h-0"/>
<Image name="minute_1" src="time/time.png" srcid="#minute%10" x="#x_w-0" y="#y_h-0"/>
<Image name="img_2" src="time/time_dot.png" x="#x_w-0" y="#y_h-0"/>
<Image name="second_0" src="time/time.png" srcid="(#second)/10" x="#x_w-0" y="#y_h-0"/>
<Image name="second_1" src="time/time.png" srcid="(#second)%10" x="#x_w-0" y="#y_h-0"/>

日期

日期模板1

日期模板1.png

方法一

 <ImageNumber name="month_0"  src="date/date.png" x="0" y="0" number="(#month+1)/10"/>
 <ImageNumber name="month_1"  src="date/date.png" x="0+#month_0.bmp_width" y="0" number="(#month+1)%10"/>
 <Image name="img_y" src="date/date_y.png" x="0+#month_0.bmp_width+#month_1.bmp_width" y="0"/>
 <ImageNumber name="date_0" src="date/date.png" x="0+#month_0.bmp_width+#month_1.bmp_width+#img_y.bmp_width" y="0" number="#date/10"/>
 <ImageNumber name="date_1" src="date/date.png" x="0+#month_0.bmp_width+#month_1.bmp_width+#img_y.bmp_width+#date_0.bmp_width" y="0" number="#date%10"/>
 <Image name="img_r" src="date/date_r.png" x="0+#month_0.bmp_width+#month_1.bmp_width+#img_y.bmp_width+#date_0.bmp_width+#date_1.bmp_width" y="0"/>

方法二

<Image name="month_0" src="date/date.png" srcid="(#month+1)/10" x="#x_w-0" y="#y_h-0"/>
<Image name="month_1" src="date/date.png" srcid="(#month+1)%10" x="#x_w-0" y="#y_h-0"/>
<Image name="img_y" src="date/date_y.png" x="#x_w-0" y="#y_h-0"/>
<Image name="date_0" src="date/date.png" srcid="#date/10" x="#x_w-0" y="#y_h-0"/>
<Image name="date_1" src="date/date.png" srcid="#date%10" x="#x_w-0" y="#y_h-0"/>
<Image name="img_r" src="date/date_r.png" x="#x_w-0" y="#y_h-0"/>
     

日期模板2

日期模板2.png

方法一

<ImageNumber name="year_0" src="date/date.png" x="0" y="0" number="#year/1000"/>
<ImageNumber name="year_1" src="date/date.png" x="0+#year_0.bmp_width" y="0" number="(#year/100)%10"/>
<ImageNumber name="year_2" src="date/date.png" x="0+#year_0.bmp_width+#year_1.bmp_width" y="0" number="(#year/10)%10"/>
<ImageNumber name="year_3" src="date/date.png" x="0+#year_0.bmp_width+#year_1.bmp_width+#year_2.bmp_width" y="0" number="#year%10"/>
<Image name="img_1" src="date/date_dot.png" x="0+#year_0.bmp_width+#year_1.bmp_width+#year_2.bmp_width+#year_3.bmp_width" y="0"/>
<ImageNumber name="month_0" src="date/date.png" number="(#month+1)/10" x="0+#year_0.bmp_width+#year_1.bmp_width+#year_2.bmp_width+#year_3.bmp_width+#img_1.bmp_width" y="0"/>
<ImageNumber name="month_1" src="date/date.png" number="(#month+1)%10" x="0+#year_0.bmp_width+#year_1.bmp_width+#year_2.bmp_width+#year_3.bmp_width+#img_1.bmp_width+#month_0.bmp_width" y="0"/>
<Image name="img_2" src="date/date_dot.png" x="0+#year_0.bmp_width+#year_1.bmp_width+#year_2.bmp_width+#year_3.bmp_width+#img_1.bmp_width+#month_0.bmp_width+#month_1.bmp_width" y="0"/>
<ImageNumber name="date_0" src="date/date.png" number="#date/10" x="0+#year_0.bmp_width+#year_1.bmp_width+#year_2.bmp_width+#year_3.bmp_width+#img_1.bmp_width+#month_0.bmp_width+#month_1.bmp_width+#img_2.bmp_width" y="0"/>
<ImageNumber name="date_1" src="date/date.png" number="#date%10" x="0+#year_0.bmp_width+#year_1.bmp_width+#year_2.bmp_width+#year_3.bmp_width+#img_1.bmp_width+#month_0.bmp_width+#month_1.bmp_width+#img_2.bmp_width+#date_0.bmp_width"  y="0"/>

方法二

<Image name="year_0" src="date/date.png" srcid="int(#year/1000)" x="#x_w-0" y="#y_h-0"/>
<Image name="year_1" src="date/date.png" srcid="int(#year/100)%10" x="#x_w-0" y="#y_h-0"/>
<Image name="year_2" src="date/date.png" srcid="#year/10%10" x="#x_w-0" y="#y_h-0"/>
<Image name="year_3" src="date/date.png" srcid="#year%10" x="#x_w-0" y="#y_h-0"/>
<Image name="img_1" src="date/date_dot.png" x="#x_w-0" y="#y_h-0"/>
<Image name="month_0" src="date/date.png" srcid="(#month+1)/10" x="#x_w-0" y="#y_h-0"/>
<Image name="month_1" src="date/date.png" srcid="(#month+1)%10" x="#x_w-0" y="#y_h-0"/>
<Image name="img_1" src="date/date_dot.png" x="#x_w-0" y="#y_h-0"/>
<Image name="date_0" src="date/date.png" srcid="#date/10" x="#x_w-0" y="#y_h-0"/>
<Image name="date_1" src="date/date.png" srcid="#date%10" x="#x_w-0" y="#y_h-0"/>
            

星期

星期模板

<Image name="week" src="week/s_week.png" srcid="#day_of_week" x="#x_w-160" y="#y_h-655"/>