static constexpr const char *TB_LISTEN_IMAGE_94 = APP_RES_PATH"/animated_icon/listen/94.bin";
static constexpr const char *TB_LISTEN_IMAGE_95 = APP_RES_PATH"/animated_icon/listen/95.bin";
+ // Thunderbird animations: net 1..60
+ static constexpr const char *TB_NET_IMAGE_1 = APP_RES_PATH"/animated_icon/net/1.bin";
+ static constexpr const char *TB_NET_IMAGE_2 = APP_RES_PATH"/animated_icon/net/2.bin";
+ static constexpr const char *TB_NET_IMAGE_3 = APP_RES_PATH"/animated_icon/net/3.bin";
+ static constexpr const char *TB_NET_IMAGE_4 = APP_RES_PATH"/animated_icon/net/4.bin";
+ static constexpr const char *TB_NET_IMAGE_5 = APP_RES_PATH"/animated_icon/net/5.bin";
+ static constexpr const char *TB_NET_IMAGE_6 = APP_RES_PATH"/animated_icon/net/6.bin";
+ static constexpr const char *TB_NET_IMAGE_7 = APP_RES_PATH"/animated_icon/net/7.bin";
+ static constexpr const char *TB_NET_IMAGE_8 = APP_RES_PATH"/animated_icon/net/8.bin";
+ static constexpr const char *TB_NET_IMAGE_9 = APP_RES_PATH"/animated_icon/net/9.bin";
+ static constexpr const char *TB_NET_IMAGE_10 = APP_RES_PATH"/animated_icon/net/10.bin";
+ static constexpr const char *TB_NET_IMAGE_11 = APP_RES_PATH"/animated_icon/net/11.bin";
+ static constexpr const char *TB_NET_IMAGE_12 = APP_RES_PATH"/animated_icon/net/12.bin";
+ static constexpr const char *TB_NET_IMAGE_13 = APP_RES_PATH"/animated_icon/net/13.bin";
+ static constexpr const char *TB_NET_IMAGE_14 = APP_RES_PATH"/animated_icon/net/14.bin";
+ static constexpr const char *TB_NET_IMAGE_15 = APP_RES_PATH"/animated_icon/net/15.bin";
+ static constexpr const char *TB_NET_IMAGE_16 = APP_RES_PATH"/animated_icon/net/16.bin";
+ static constexpr const char *TB_NET_IMAGE_17 = APP_RES_PATH"/animated_icon/net/17.bin";
+ static constexpr const char *TB_NET_IMAGE_18 = APP_RES_PATH"/animated_icon/net/18.bin";
+ static constexpr const char *TB_NET_IMAGE_19 = APP_RES_PATH"/animated_icon/net/19.bin";
+ static constexpr const char *TB_NET_IMAGE_20 = APP_RES_PATH"/animated_icon/net/20.bin";
+ static constexpr const char *TB_NET_IMAGE_21 = APP_RES_PATH"/animated_icon/net/21.bin";
+ static constexpr const char *TB_NET_IMAGE_22 = APP_RES_PATH"/animated_icon/net/22.bin";
+ static constexpr const char *TB_NET_IMAGE_23 = APP_RES_PATH"/animated_icon/net/23.bin";
+ static constexpr const char *TB_NET_IMAGE_24 = APP_RES_PATH"/animated_icon/net/24.bin";
+ static constexpr const char *TB_NET_IMAGE_25 = APP_RES_PATH"/animated_icon/net/25.bin";
+ static constexpr const char *TB_NET_IMAGE_26 = APP_RES_PATH"/animated_icon/net/26.bin";
+ static constexpr const char *TB_NET_IMAGE_27 = APP_RES_PATH"/animated_icon/net/27.bin";
+ static constexpr const char *TB_NET_IMAGE_28 = APP_RES_PATH"/animated_icon/net/28.bin";
+ static constexpr const char *TB_NET_IMAGE_29 = APP_RES_PATH"/animated_icon/net/29.bin";
+ static constexpr const char *TB_NET_IMAGE_30 = APP_RES_PATH"/animated_icon/net/30.bin";
+ static constexpr const char *TB_NET_IMAGE_31 = APP_RES_PATH"/animated_icon/net/31.bin";
+ static constexpr const char *TB_NET_IMAGE_32 = APP_RES_PATH"/animated_icon/net/32.bin";
+ static constexpr const char *TB_NET_IMAGE_33 = APP_RES_PATH"/animated_icon/net/33.bin";
+ static constexpr const char *TB_NET_IMAGE_34 = APP_RES_PATH"/animated_icon/net/34.bin";
+ static constexpr const char *TB_NET_IMAGE_35 = APP_RES_PATH"/animated_icon/net/35.bin";
+ static constexpr const char *TB_NET_IMAGE_36 = APP_RES_PATH"/animated_icon/net/36.bin";
+ static constexpr const char *TB_NET_IMAGE_37 = APP_RES_PATH"/animated_icon/net/37.bin";
+ static constexpr const char *TB_NET_IMAGE_38 = APP_RES_PATH"/animated_icon/net/38.bin";
+ static constexpr const char *TB_NET_IMAGE_39 = APP_RES_PATH"/animated_icon/net/39.bin";
+ static constexpr const char *TB_NET_IMAGE_40 = APP_RES_PATH"/animated_icon/net/40.bin";
+ static constexpr const char *TB_NET_IMAGE_41 = APP_RES_PATH"/animated_icon/net/41.bin";
+ static constexpr const char *TB_NET_IMAGE_42 = APP_RES_PATH"/animated_icon/net/42.bin";
+ static constexpr const char *TB_NET_IMAGE_43 = APP_RES_PATH"/animated_icon/net/43.bin";
+ static constexpr const char *TB_NET_IMAGE_44 = APP_RES_PATH"/animated_icon/net/44.bin";
+ static constexpr const char *TB_NET_IMAGE_45 = APP_RES_PATH"/animated_icon/net/45.bin";
+ static constexpr const char *TB_NET_IMAGE_46 = APP_RES_PATH"/animated_icon/net/46.bin";
+ static constexpr const char *TB_NET_IMAGE_47 = APP_RES_PATH"/animated_icon/net/47.bin";
+ static constexpr const char *TB_NET_IMAGE_48 = APP_RES_PATH"/animated_icon/net/48.bin";
+ static constexpr const char *TB_NET_IMAGE_49 = APP_RES_PATH"/animated_icon/net/49.bin";
+ static constexpr const char *TB_NET_IMAGE_50 = APP_RES_PATH"/animated_icon/net/50.bin";
+ static constexpr const char *TB_NET_IMAGE_51 = APP_RES_PATH"/animated_icon/net/51.bin";
+ static constexpr const char *TB_NET_IMAGE_52 = APP_RES_PATH"/animated_icon/net/52.bin";
+ static constexpr const char *TB_NET_IMAGE_53 = APP_RES_PATH"/animated_icon/net/53.bin";
+ static constexpr const char *TB_NET_IMAGE_54 = APP_RES_PATH"/animated_icon/net/54.bin";
+ static constexpr const char *TB_NET_IMAGE_55 = APP_RES_PATH"/animated_icon/net/55.bin";
+ static constexpr const char *TB_NET_IMAGE_56 = APP_RES_PATH"/animated_icon/net/56.bin";
+ static constexpr const char *TB_NET_IMAGE_57 = APP_RES_PATH"/animated_icon/net/57.bin";
+ static constexpr const char *TB_NET_IMAGE_58 = APP_RES_PATH"/animated_icon/net/58.bin";
+ static constexpr const char *TB_NET_IMAGE_59 = APP_RES_PATH"/animated_icon/net/59.bin";
+ static constexpr const char *TB_NET_IMAGE_60 = APP_RES_PATH"/animated_icon/net/60.bin";
+
// Thunderbird shutdown 1..95
static constexpr const char *TB_SHUTDOWN_IMAGE_1 = APP_RES_PATH"/RebootAndShutDown/ShutDown/1.bin";
static constexpr const char *TB_SHUTDOWN_IMAGE_2 = APP_RES_PATH"/RebootAndShutDown/ShutDown/2.bin";
static constexpr const char *TB_SHUTDOWN_IMAGE_94 = APP_RES_PATH"/RebootAndShutDown/ShutDown/94.bin";
static constexpr const char *TB_SHUTDOWN_IMAGE_95 = APP_RES_PATH"/RebootAndShutDown/ShutDown/95.bin";
- // Thunderbird naughty (test) 1..86
- static constexpr const char *TB_NAUGHTY_IMAGE_1 = APP_RES_PATH"/emoticon/naughty/1.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_2 = APP_RES_PATH"/emoticon/naughty/2.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_3 = APP_RES_PATH"/emoticon/naughty/3.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_4 = APP_RES_PATH"/emoticon/naughty/4.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_5 = APP_RES_PATH"/emoticon/naughty/5.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_6 = APP_RES_PATH"/emoticon/naughty/6.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_7 = APP_RES_PATH"/emoticon/naughty/7.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_8 = APP_RES_PATH"/emoticon/naughty/8.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_9 = APP_RES_PATH"/emoticon/naughty/9.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_10 = APP_RES_PATH"/emoticon/naughty/10.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_11 = APP_RES_PATH"/emoticon/naughty/11.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_12 = APP_RES_PATH"/emoticon/naughty/12.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_13 = APP_RES_PATH"/emoticon/naughty/13.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_14 = APP_RES_PATH"/emoticon/naughty/14.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_15 = APP_RES_PATH"/emoticon/naughty/15.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_16 = APP_RES_PATH"/emoticon/naughty/16.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_17 = APP_RES_PATH"/emoticon/naughty/17.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_18 = APP_RES_PATH"/emoticon/naughty/18.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_19 = APP_RES_PATH"/emoticon/naughty/19.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_20 = APP_RES_PATH"/emoticon/naughty/20.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_21 = APP_RES_PATH"/emoticon/naughty/21.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_22 = APP_RES_PATH"/emoticon/naughty/22.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_23 = APP_RES_PATH"/emoticon/naughty/23.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_24 = APP_RES_PATH"/emoticon/naughty/24.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_25 = APP_RES_PATH"/emoticon/naughty/25.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_26 = APP_RES_PATH"/emoticon/naughty/26.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_27 = APP_RES_PATH"/emoticon/naughty/27.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_28 = APP_RES_PATH"/emoticon/naughty/28.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_29 = APP_RES_PATH"/emoticon/naughty/29.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_30 = APP_RES_PATH"/emoticon/naughty/30.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_31 = APP_RES_PATH"/emoticon/naughty/31.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_32 = APP_RES_PATH"/emoticon/naughty/32.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_33 = APP_RES_PATH"/emoticon/naughty/33.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_34 = APP_RES_PATH"/emoticon/naughty/34.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_35 = APP_RES_PATH"/emoticon/naughty/35.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_36 = APP_RES_PATH"/emoticon/naughty/36.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_37 = APP_RES_PATH"/emoticon/naughty/37.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_38 = APP_RES_PATH"/emoticon/naughty/38.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_39 = APP_RES_PATH"/emoticon/naughty/39.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_40 = APP_RES_PATH"/emoticon/naughty/40.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_41 = APP_RES_PATH"/emoticon/naughty/41.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_42 = APP_RES_PATH"/emoticon/naughty/42.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_43 = APP_RES_PATH"/emoticon/naughty/43.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_44 = APP_RES_PATH"/emoticon/naughty/44.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_45 = APP_RES_PATH"/emoticon/naughty/45.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_46 = APP_RES_PATH"/emoticon/naughty/46.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_47 = APP_RES_PATH"/emoticon/naughty/47.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_48 = APP_RES_PATH"/emoticon/naughty/48.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_49 = APP_RES_PATH"/emoticon/naughty/49.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_50 = APP_RES_PATH"/emoticon/naughty/50.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_51 = APP_RES_PATH"/emoticon/naughty/51.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_52 = APP_RES_PATH"/emoticon/naughty/52.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_53 = APP_RES_PATH"/emoticon/naughty/53.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_54 = APP_RES_PATH"/emoticon/naughty/54.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_55 = APP_RES_PATH"/emoticon/naughty/55.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_56 = APP_RES_PATH"/emoticon/naughty/56.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_57 = APP_RES_PATH"/emoticon/naughty/57.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_58 = APP_RES_PATH"/emoticon/naughty/58.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_59 = APP_RES_PATH"/emoticon/naughty/59.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_60 = APP_RES_PATH"/emoticon/naughty/60.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_61 = APP_RES_PATH"/emoticon/naughty/61.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_62 = APP_RES_PATH"/emoticon/naughty/62.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_63 = APP_RES_PATH"/emoticon/naughty/63.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_64 = APP_RES_PATH"/emoticon/naughty/64.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_65 = APP_RES_PATH"/emoticon/naughty/65.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_66 = APP_RES_PATH"/emoticon/naughty/66.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_67 = APP_RES_PATH"/emoticon/naughty/67.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_68 = APP_RES_PATH"/emoticon/naughty/68.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_69 = APP_RES_PATH"/emoticon/naughty/69.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_70 = APP_RES_PATH"/emoticon/naughty/70.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_71 = APP_RES_PATH"/emoticon/naughty/71.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_72 = APP_RES_PATH"/emoticon/naughty/72.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_73 = APP_RES_PATH"/emoticon/naughty/73.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_74 = APP_RES_PATH"/emoticon/naughty/74.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_75 = APP_RES_PATH"/emoticon/naughty/75.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_76 = APP_RES_PATH"/emoticon/naughty/76.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_77 = APP_RES_PATH"/emoticon/naughty/77.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_78 = APP_RES_PATH"/emoticon/naughty/78.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_79 = APP_RES_PATH"/emoticon/naughty/79.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_80 = APP_RES_PATH"/emoticon/naughty/80.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_81 = APP_RES_PATH"/emoticon/naughty/81.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_82 = APP_RES_PATH"/emoticon/naughty/82.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_83 = APP_RES_PATH"/emoticon/naughty/83.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_84 = APP_RES_PATH"/emoticon/naughty/84.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_85 = APP_RES_PATH"/emoticon/naughty/85.bin";
- static constexpr const char *TB_NAUGHTY_IMAGE_86 = APP_RES_PATH"/emoticon/naughty/86.bin";
-
-
+
// AppList
static constexpr const char *FINDPHONE_MAIN_ICON = APP_RES_PATH"/FINDPHONE_LOGO.bin";
static constexpr const char *CAMERA_IMAGE = APP_RES_PATH"/CAMERA.bin";
static constexpr const char *CAMERA_MAIN_ICON = APP_RES_PATH"/CAMERA_ICON.bin";
+
+ // Reboot animation frames 1..57
+ static constexpr const char *TB_REBOOT_IMAGE_1 = APP_RES_PATH"/RebootAndShutDown/ReBoot/1.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_2 = APP_RES_PATH"/RebootAndShutDown/ReBoot/2.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_3 = APP_RES_PATH"/RebootAndShutDown/ReBoot/3.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_4 = APP_RES_PATH"/RebootAndShutDown/ReBoot/4.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_5 = APP_RES_PATH"/RebootAndShutDown/ReBoot/5.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_6 = APP_RES_PATH"/RebootAndShutDown/ReBoot/6.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_7 = APP_RES_PATH"/RebootAndShutDown/ReBoot/7.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_8 = APP_RES_PATH"/RebootAndShutDown/ReBoot/8.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_9 = APP_RES_PATH"/RebootAndShutDown/ReBoot/9.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_10 = APP_RES_PATH"/RebootAndShutDown/ReBoot/10.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_11 = APP_RES_PATH"/RebootAndShutDown/ReBoot/11.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_12 = APP_RES_PATH"/RebootAndShutDown/ReBoot/12.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_13 = APP_RES_PATH"/RebootAndShutDown/ReBoot/13.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_14 = APP_RES_PATH"/RebootAndShutDown/ReBoot/14.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_15 = APP_RES_PATH"/RebootAndShutDown/ReBoot/15.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_16 = APP_RES_PATH"/RebootAndShutDown/ReBoot/16.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_17 = APP_RES_PATH"/RebootAndShutDown/ReBoot/17.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_18 = APP_RES_PATH"/RebootAndShutDown/ReBoot/18.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_19 = APP_RES_PATH"/RebootAndShutDown/ReBoot/19.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_20 = APP_RES_PATH"/RebootAndShutDown/ReBoot/20.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_21 = APP_RES_PATH"/RebootAndShutDown/ReBoot/21.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_22 = APP_RES_PATH"/RebootAndShutDown/ReBoot/22.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_23 = APP_RES_PATH"/RebootAndShutDown/ReBoot/23.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_24 = APP_RES_PATH"/RebootAndShutDown/ReBoot/24.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_25 = APP_RES_PATH"/RebootAndShutDown/ReBoot/25.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_26 = APP_RES_PATH"/RebootAndShutDown/ReBoot/26.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_27 = APP_RES_PATH"/RebootAndShutDown/ReBoot/27.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_28 = APP_RES_PATH"/RebootAndShutDown/ReBoot/28.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_29 = APP_RES_PATH"/RebootAndShutDown/ReBoot/29.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_30 = APP_RES_PATH"/RebootAndShutDown/ReBoot/30.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_31 = APP_RES_PATH"/RebootAndShutDown/ReBoot/31.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_32 = APP_RES_PATH"/RebootAndShutDown/ReBoot/32.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_33 = APP_RES_PATH"/RebootAndShutDown/ReBoot/33.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_34 = APP_RES_PATH"/RebootAndShutDown/ReBoot/34.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_35 = APP_RES_PATH"/RebootAndShutDown/ReBoot/35.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_36 = APP_RES_PATH"/RebootAndShutDown/ReBoot/36.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_37 = APP_RES_PATH"/RebootAndShutDown/ReBoot/37.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_38 = APP_RES_PATH"/RebootAndShutDown/ReBoot/38.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_39 = APP_RES_PATH"/RebootAndShutDown/ReBoot/39.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_40 = APP_RES_PATH"/RebootAndShutDown/ReBoot/40.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_41 = APP_RES_PATH"/RebootAndShutDown/ReBoot/41.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_42 = APP_RES_PATH"/RebootAndShutDown/ReBoot/42.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_43 = APP_RES_PATH"/RebootAndShutDown/ReBoot/43.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_44 = APP_RES_PATH"/RebootAndShutDown/ReBoot/44.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_45 = APP_RES_PATH"/RebootAndShutDown/ReBoot/45.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_46 = APP_RES_PATH"/RebootAndShutDown/ReBoot/46.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_47 = APP_RES_PATH"/RebootAndShutDown/ReBoot/47.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_48 = APP_RES_PATH"/RebootAndShutDown/ReBoot/48.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_49 = APP_RES_PATH"/RebootAndShutDown/ReBoot/49.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_50 = APP_RES_PATH"/RebootAndShutDown/ReBoot/50.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_51 = APP_RES_PATH"/RebootAndShutDown/ReBoot/51.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_52 = APP_RES_PATH"/RebootAndShutDown/ReBoot/52.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_53 = APP_RES_PATH"/RebootAndShutDown/ReBoot/53.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_54 = APP_RES_PATH"/RebootAndShutDown/ReBoot/54.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_55 = APP_RES_PATH"/RebootAndShutDown/ReBoot/55.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_56 = APP_RES_PATH"/RebootAndShutDown/ReBoot/56.bin";
+ static constexpr const char *TB_REBOOT_IMAGE_57 = APP_RES_PATH"/RebootAndShutDown/ReBoot/57.bin";
}
#endif // UI_CONFIG_H
RecentManager::GetInstance()->AddToBlackList(VIEW_MAIN_SAMPLE);
RecentManager::GetInstance()->SetMaxSize(5); // 5: max number of recent apps.
PageTransitionMgr::GetInstance().SetRecentMinPeriod(1000); // 1000: min period
+
+ NativeAbility::GetInstance().SetDefaultSliceId(VIEW_THUNDER_BIRD);
}
}
-/*\r
- * Copyright (c) CompanyNameMagicTag 2022-2022. All rights reserved.\r
- * Description: ShutdownDevice View\r
- * Create: 2022-04-28\r
- */\r
-#ifndef SHUTDOWNDEVICE_VIEW_H\r
-#define SHUTDOWNDEVICE_VIEW_H\r
-\r
-#include "View.h"\r
-#include "components/ui_view_group.h"\r
-#include "components/ui_label.h"\r
-#include "components/ui_button.h"\r
-\r
-namespace OHOS {\r
-class ShutdownDeviceView {\r
-public:\r
- ShutdownDeviceView();\r
- ~ShutdownDeviceView();\r
- static ShutdownDeviceView *GetInstance();\r
- UIViewGroup *InitShowUpView(void);\r
-\r
-private:\r
- bool ShowUpShutdownDeviceView(void);\r
- UILabel *shutdownDeviceLabel{nullptr};\r
- UIButton *shutdownDeviceButton{nullptr};\r
- UIViewGroup *group{nullptr};\r
-};\r
-} // namespace OHOS\r
+/*
+ * Copyright (c) CompanyNameMagicTag 2022-2022. All rights reserved.
+ * Description: ShutdownDevice View
+ * Create: 2022-04-28
+ */
+#ifndef SHUTDOWNDEVICE_VIEW_H
+#define SHUTDOWNDEVICE_VIEW_H
+
+#include "components/ui_view_group.h"
+#include "components/ui_image_animator.h"
+
+namespace OHOS {
+/* 关机动画参数与资源路径常量(使用与 ThunderBird 相同的资源定义) */
+static constexpr int16_t RB_SD_ANIM_X = 0;
+static constexpr int16_t RB_SD_ANIM_Y = 0;
+static constexpr int16_t RB_SD_ANIM_W = 360;
+static constexpr int16_t RB_SD_ANIM_H = 360;
+static constexpr int16_t RB_SD_ANIM_FRAMES = 95;
+static constexpr int16_t RB_SD_ANIM_INTERVAL = 41;
+
+class ShutdownDeviceView : public UIImageAnimatorView::AnimatorStopListener {
+public:
+ ShutdownDeviceView();
+ virtual ~ShutdownDeviceView();
+
+ static ShutdownDeviceView *GetInstance();
+
+ UIViewGroup *InitShowUpView();
+ UIImageAnimatorView *GetAnimator();
+ void StartShutdownAnimation();
+
+private:
+ void OnAnimatorStop(UIView &view) override;
+ void ClearAll();
+ bool EnsureAnimator();
+
+private:
+ UIViewGroup *group{nullptr};
+ UIImageAnimatorView *shutdownAnimator{nullptr};
+ ImageAnimatorInfo shutdownImageInfo[RB_SD_ANIM_FRAMES];
+ const char **shutdownPathsArray{nullptr};
+};
+} // namespace OHOS
#endif // SHUTDOWNDEVICE_VIEW_H
\ No newline at end of file
RebootView::RebootView()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootView::RebootView");
- preProcessView[REBOOTVIEW] = &RebootView::ChangeRebootView;
- preProcessView[REBOOTDEVICEVIEW] = &RebootView::ChangeRebootDeviceView;
+ preProcessView[REBOOTVIEW] = &RebootView::ChangeShutdownDeviceView;
+ preProcessView[REBOOTDEVICEVIEW] = &RebootView::ChangeShutdownDeviceView;
preProcessView[SHUTDOWNDEVICEVIEW] = &RebootView::ChangeShutdownDeviceView;
g_pRebootView = this;
}
void RebootView::OnStart()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootView::~OnStart");
- if (RebootModel::GetInstance()->GetSelectView() == REBOOT) {
- ChangeView(REBOOT_MAX, REBOOTVIEW);
- } else if (RebootModel::GetInstance()->GetSelectView() == REBOOTDEVICE) {
- ChangeView(REBOOT_MAX, REBOOTDEVICEVIEW);
- RebootModel::GetInstance()->SetSelectViewId(REBOOT);
- } else if (RebootModel::GetInstance()->GetSelectView() == SHUTDOWNDEVICE) {
- ChangeView(REBOOT_MAX, SHUTDOWNDEVICEVIEW);
- RebootModel::GetInstance()->SetSelectViewId(REBOOT);
- }
+ ChangeView(REBOOT_MAX, SHUTDOWNDEVICEVIEW);
+ RebootModel::GetInstance()->SetSelectViewId(REBOOT);
return;
}
bool RebootView::ShowUpRebootView()
{
- if (rebootLabel == nullptr) {
- rebootLabel = new UILabel();
- if (rebootLabel == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpRebootView rebootLabel new fail");
- return false;
- }
- }
- rebootLabel->SetPosition(49, 272, 150, 45); // 49:x 272:y 150:width 45:height
- rebootLabel->SetText("重启");
- rebootLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35:font data
- rebootLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);
- rebootLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER,
- UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);
-
- if (rebootButton == nullptr) {
- rebootButton = new UIButton();
- if (rebootButton == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpRebootView rebootButton new fail");
- return false;
- }
- }
- rebootButton->SetPosition(69, 147, 110, 110); // 69:x 147:y 110:width 110:height
- rebootButton->SetImageSrc(PNG_REBOOT_BUTTON_IMAGE, PNG_REBOOT_BUTTON_IMAGE);
- rebootButton->SetViewId(REBOOT_BUTTON);
- UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
- if (clickListener == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clickListener GetInstance nullptr");
- return false;
- }
- rebootButton->SetOnClickListener(clickListener);
return true;
}
bool RebootView::ShowUpShutdownView()
{
- if (shutdownLabel == nullptr) {
- shutdownLabel = new UILabel();
- if (shutdownLabel == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpShutdownView shutdownLabel new fail");
- return false;
- }
- }
- shutdownLabel->SetPosition(255, 272, 150, 45); // 255:x 272:y 150:width 45:height
- shutdownLabel->SetText("关机");
- shutdownLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35:font data
- shutdownLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);
- shutdownLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER,
- UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);
-
- if (shutdownButton == nullptr) {
- shutdownButton = new UIButton();
- if (shutdownButton == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpShutdownView shutdownButton new fail");
- return false;
- }
- }
- shutdownButton->SetPosition(275, 147, 110, 110); // 275:x 147:y 110:width 110:height
- shutdownButton->SetImageSrc(PNG_SHUTDOWN_BUTTON_IMAGE, PNG_SHUTDOWN_BUTTON_IMAGE);
- shutdownButton->SetViewId(SHUTDOWN_BUTTON);
- UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
- if (clickListener == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clickListener GetInstance nullptr");
- return false;
- }
- shutdownButton->SetOnClickListener(clickListener);
return true;
}
UIViewGroup *RebootView::InitShowUpView(void)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootView::InitShowUpView");
- bool ret;
if (group == nullptr) {
group = new UIViewGroup();
if (group == nullptr) {
group->SetWidth(HORIZONTAL_RESOLUTION);
group->SetHeight(VERTICAL_RESOLUTION);
}
- ret = ShowUpRebootView();
- if (!ret) {
- return nullptr;
- }
- group->Add(rebootLabel);
- group->Add(rebootButton);
-
- ret = ShowUpShutdownView();
- if (!ret) {
- return nullptr;
- }
- group->Add(shutdownLabel);
- group->Add(shutdownButton);
+ (void)ShowUpRebootView();
+ (void)ShowUpShutdownView();
UIView::OnDragListener *rebootDragListener = (UIView::OnDragListener *)OHOS::RebootPresenter::GetInstance();
if (rebootDragListener == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "rebootDragListener GetInstance fail");
}
container[thisView] = viewGroup;
AddViewToRootContainer(container[thisView]);
+ // 直接启动关机动画
+ shutdownDeviceView->StartShutdownAnimation();
}
return true;
}
-/*\r
- * Copyright (c) CompanyNameMagicTag 2022-2022. All rights reserved.\r
- * Description: ShutdownDevice View\r
- * Create: 2022-04-28\r
- */\r
-\r
-#include "rebootdevice/ShutdownDeviceView.h"\r
-#include "PageTransitionMgr.h"\r
-#include "wearable_log.h"\r
-#include "UiConfig.h"\r
-#include "rebootdevice/RebootPresenter.h"\r
-\r
-namespace OHOS {\r
-static ShutdownDeviceView *g_pShutdownDeviceView{nullptr};\r
-ShutdownDeviceView::ShutdownDeviceView()\r
-{\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView::ShutdownDeviceView");\r
- g_pShutdownDeviceView = this;\r
-}\r
-\r
-ShutdownDeviceView::~ShutdownDeviceView()\r
-{\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView::~ShutdownDeviceView");\r
- if (group != nullptr) {\r
- group->RemoveAll();\r
- }\r
- delete shutdownDeviceLabel;\r
- shutdownDeviceLabel = nullptr;\r
- delete shutdownDeviceButton;\r
- shutdownDeviceButton = nullptr;\r
- delete group;\r
- group = nullptr;\r
- g_pShutdownDeviceView = nullptr;\r
-}\r
-\r
-ShutdownDeviceView *ShutdownDeviceView::GetInstance()\r
-{\r
- return g_pShutdownDeviceView;\r
-}\r
-\r
-bool ShutdownDeviceView::ShowUpShutdownDeviceView()\r
-{\r
- if (shutdownDeviceLabel == nullptr) {\r
- shutdownDeviceLabel = new UILabel();\r
- if (shutdownDeviceLabel == nullptr) {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpShutdownDeviceView shutdownDeviceLabel new fail");\r
- return false;\r
- }\r
- }\r
- shutdownDeviceLabel->SetPosition(152, 272, 150, 45); // 152:x 272:y 150:width 45:height\r
- shutdownDeviceLabel->SetText("关机");\r
- shutdownDeviceLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35:font data\r
- shutdownDeviceLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);\r
- shutdownDeviceLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER,\r
- UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);\r
-\r
- if (shutdownDeviceButton == nullptr) {\r
- shutdownDeviceButton = new UIButton();\r
- if (shutdownDeviceButton == nullptr) {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpShutdownDeviceView shutdownDeviceButton new fail");\r
- return false;\r
- }\r
- }\r
- shutdownDeviceButton->SetPosition(172, 147, 110, 110); // 172:x 147:y 110:width 110:height\r
- shutdownDeviceButton->SetImageSrc(PNG_SHUTDOWN_BUTTON_IMAGE, PNG_SHUTDOWN_BUTTON_IMAGE);\r
- shutdownDeviceButton->SetViewId(SHUTDOWNDEVICE_BUTTON);\r
- UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();\r
- if (clickListener == nullptr) {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clickListener GetInstance nullptr");\r
- return false;\r
- }\r
- shutdownDeviceButton->SetOnClickListener(clickListener);\r
- return true;\r
-}\r
-\r
-UIViewGroup *ShutdownDeviceView::InitShowUpView(void)\r
-{\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView::InitShowUpView");\r
- bool ret;\r
- if (group == nullptr) {\r
- group = new UIViewGroup();\r
- if (group == nullptr) {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group new fail");\r
- return nullptr;\r
- }\r
- group->SetPosition(0, 0); // 0:x; 0:y\r
- group->SetWidth(HORIZONTAL_RESOLUTION);\r
- group->SetHeight(VERTICAL_RESOLUTION);\r
- }\r
-\r
- ret = ShowUpShutdownDeviceView();\r
- if (!ret) {\r
- return nullptr;\r
- }\r
- group->Add(shutdownDeviceLabel);\r
- group->Add(shutdownDeviceButton);\r
- UIView::OnDragListener *rebootDragListener = (UIView::OnDragListener *)OHOS::RebootPresenter::GetInstance();\r
- if (rebootDragListener == nullptr) {\r
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "rebootDragListener GetInstance fail");\r
- return nullptr;\r
- }\r
- if (!PageTransitionMgr::GetInstance().CanSlideBack()) { // support default slide back firstly\r
- group->SetOnDragListener(rebootDragListener);\r
- }\r
- group->SetViewId(SHUTDOWNDEVICE_VIEW);\r
- group->SetDraggable(true);\r
- group->SetTouchable(true);\r
- return group;\r
-}\r
+/*
+ * Copyright (c) CompanyNameMagicTag 2022-2022. All rights reserved.
+ * Description: ShutdownDevice View
+ * Create: 2022-04-28
+ */
+
+#include "rebootdevice/ShutdownDeviceView.h"
+#include "PageTransitionMgr.h"
+#include "wearable_log.h"
+#include "UiConfig.h"
+#include "rebootdevice/RebootPresenter.h"
+#include "custom_runtime.h"
+#include "custom_utils.h"
+#include "vibrator_service.h"
+
+namespace OHOS {
+static ShutdownDeviceView *g_pShutdownDeviceView{nullptr};
+
+/* 使用与 ThunderBirdShutdownView 相同的资源宏,定义帧路径数组 */
+static const char *RB_SD_PATHS[RB_SD_ANIM_FRAMES] = {
+ TB_SHUTDOWN_IMAGE_1, TB_SHUTDOWN_IMAGE_2, TB_SHUTDOWN_IMAGE_3, TB_SHUTDOWN_IMAGE_4, TB_SHUTDOWN_IMAGE_5,
+ TB_SHUTDOWN_IMAGE_6, TB_SHUTDOWN_IMAGE_7, TB_SHUTDOWN_IMAGE_8, TB_SHUTDOWN_IMAGE_9, TB_SHUTDOWN_IMAGE_10,
+ TB_SHUTDOWN_IMAGE_11, TB_SHUTDOWN_IMAGE_12, TB_SHUTDOWN_IMAGE_13, TB_SHUTDOWN_IMAGE_14, TB_SHUTDOWN_IMAGE_15,
+ TB_SHUTDOWN_IMAGE_16, TB_SHUTDOWN_IMAGE_17, TB_SHUTDOWN_IMAGE_18, TB_SHUTDOWN_IMAGE_19, TB_SHUTDOWN_IMAGE_20,
+ TB_SHUTDOWN_IMAGE_21, TB_SHUTDOWN_IMAGE_22, TB_SHUTDOWN_IMAGE_23, TB_SHUTDOWN_IMAGE_24, TB_SHUTDOWN_IMAGE_25,
+ TB_SHUTDOWN_IMAGE_26, TB_SHUTDOWN_IMAGE_27, TB_SHUTDOWN_IMAGE_28, TB_SHUTDOWN_IMAGE_29, TB_SHUTDOWN_IMAGE_30,
+ TB_SHUTDOWN_IMAGE_31, TB_SHUTDOWN_IMAGE_32, TB_SHUTDOWN_IMAGE_33, TB_SHUTDOWN_IMAGE_34, TB_SHUTDOWN_IMAGE_35,
+ TB_SHUTDOWN_IMAGE_36, TB_SHUTDOWN_IMAGE_37, TB_SHUTDOWN_IMAGE_38, TB_SHUTDOWN_IMAGE_39, TB_SHUTDOWN_IMAGE_40,
+ TB_SHUTDOWN_IMAGE_41, TB_SHUTDOWN_IMAGE_42, TB_SHUTDOWN_IMAGE_43, TB_SHUTDOWN_IMAGE_44, TB_SHUTDOWN_IMAGE_45,
+ TB_SHUTDOWN_IMAGE_46, TB_SHUTDOWN_IMAGE_47, TB_SHUTDOWN_IMAGE_48, TB_SHUTDOWN_IMAGE_49, TB_SHUTDOWN_IMAGE_50,
+ TB_SHUTDOWN_IMAGE_51, TB_SHUTDOWN_IMAGE_52, TB_SHUTDOWN_IMAGE_53, TB_SHUTDOWN_IMAGE_54, TB_SHUTDOWN_IMAGE_55,
+ TB_SHUTDOWN_IMAGE_56, TB_SHUTDOWN_IMAGE_57, TB_SHUTDOWN_IMAGE_58, TB_SHUTDOWN_IMAGE_59, TB_SHUTDOWN_IMAGE_60,
+ TB_SHUTDOWN_IMAGE_61, TB_SHUTDOWN_IMAGE_62, TB_SHUTDOWN_IMAGE_63, TB_SHUTDOWN_IMAGE_64, TB_SHUTDOWN_IMAGE_65,
+ TB_SHUTDOWN_IMAGE_66, TB_SHUTDOWN_IMAGE_67, TB_SHUTDOWN_IMAGE_68, TB_SHUTDOWN_IMAGE_69, TB_SHUTDOWN_IMAGE_70,
+ TB_SHUTDOWN_IMAGE_71, TB_SHUTDOWN_IMAGE_72, TB_SHUTDOWN_IMAGE_73, TB_SHUTDOWN_IMAGE_74, TB_SHUTDOWN_IMAGE_75,
+ TB_SHUTDOWN_IMAGE_76, TB_SHUTDOWN_IMAGE_77, TB_SHUTDOWN_IMAGE_78, TB_SHUTDOWN_IMAGE_79, TB_SHUTDOWN_IMAGE_80,
+ TB_SHUTDOWN_IMAGE_81, TB_SHUTDOWN_IMAGE_82, TB_SHUTDOWN_IMAGE_83, TB_SHUTDOWN_IMAGE_84, TB_SHUTDOWN_IMAGE_85,
+ TB_SHUTDOWN_IMAGE_86, TB_SHUTDOWN_IMAGE_87, TB_SHUTDOWN_IMAGE_88, TB_SHUTDOWN_IMAGE_89, TB_SHUTDOWN_IMAGE_90,
+ TB_SHUTDOWN_IMAGE_91, TB_SHUTDOWN_IMAGE_92, TB_SHUTDOWN_IMAGE_93, TB_SHUTDOWN_IMAGE_94, TB_SHUTDOWN_IMAGE_95,
+};
+
+ShutdownDeviceView::ShutdownDeviceView()
+{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView::ShutdownDeviceView");
+ g_pShutdownDeviceView = this;
+}
+
+ShutdownDeviceView::~ShutdownDeviceView()
+{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView::~ShutdownDeviceView");
+ if (group != nullptr) {
+ group->RemoveAll();
+ }
+ delete shutdownAnimator;
+ shutdownAnimator = nullptr;
+ delete group;
+ group = nullptr;
+ g_pShutdownDeviceView = nullptr;
+}
+
+ShutdownDeviceView *ShutdownDeviceView::GetInstance()
+{
+ return g_pShutdownDeviceView;
+}
+
+void ShutdownDeviceView::ClearAll()
+{
+ if (group != nullptr) {
+ group->RemoveAll();
+ if (shutdownAnimator != nullptr) {
+ delete shutdownAnimator;
+ shutdownAnimator = nullptr;
+ }
+ delete group;
+ group = nullptr;
+ }
+}
+
+bool ShutdownDeviceView::EnsureAnimator()
+{
+ if (shutdownAnimator == nullptr) {
+ shutdownPathsArray = RB_SD_PATHS;
+ shutdownAnimator = new UIImageAnimatorView();
+ if (shutdownAnimator == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView new UIImageAnimatorView fail");
+ return false;
+ }
+ shutdownAnimator->SetAutoEnable(false);
+ for (uint8_t i = 0; i < RB_SD_ANIM_FRAMES; i++) {
+ shutdownImageInfo[i].imagePath = (shutdownPathsArray[i]);
+ shutdownImageInfo[i].imageType = IMG_SRC_FILE_PATH;
+ shutdownImageInfo[i].pos.x = RB_SD_ANIM_X;
+ shutdownImageInfo[i].pos.y = RB_SD_ANIM_Y;
+ shutdownImageInfo[i].width = RB_SD_ANIM_W;
+ shutdownImageInfo[i].height = RB_SD_ANIM_H;
+ }
+ shutdownAnimator->SetPosition(RB_SD_ANIM_X, RB_SD_ANIM_Y, RB_SD_ANIM_W, RB_SD_ANIM_H);
+ shutdownAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
+ shutdownAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ shutdownAnimator->SetImageAnimatorSrc(shutdownImageInfo, RB_SD_ANIM_FRAMES, RB_SD_ANIM_INTERVAL);
+ shutdownAnimator->SetRepeat(false);
+ shutdownAnimator->SetRepeatTimes(1);
+ shutdownAnimator->SetResizeMode(UIImageView::COVER);
+ shutdownAnimator->SetAnimatorStopListener(this);
+ }
+ return true;
+}
+
+UIViewGroup *ShutdownDeviceView::InitShowUpView(void)
+{
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView::InitShowUpView");
+ if (group == nullptr) {
+ group = new UIViewGroup();
+ if (group == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group new fail");
+ return nullptr;
+ }
+ group->SetPosition(0, 0);
+ group->SetWidth(HORIZONTAL_RESOLUTION);
+ group->SetHeight(VERTICAL_RESOLUTION);
+ }
+ if (!EnsureAnimator()) {
+ return nullptr;
+ }
+ group->Add(shutdownAnimator);
+ if (!PageTransitionMgr::GetInstance().CanSlideBack()) {
+ UIView::OnDragListener *dragListener = (UIView::OnDragListener *)OHOS::RebootPresenter::GetInstance();
+ if (dragListener) {
+ group->SetOnDragListener(dragListener);
+ }
+ }
+ group->SetViewId(SHUTDOWNDEVICE_VIEW);
+ group->SetDraggable(true);
+ group->SetTouchable(true);
+ return group;
+}
+
+UIImageAnimatorView *ShutdownDeviceView::GetAnimator()
+{
+ return shutdownAnimator;
+}
+
+void ShutdownDeviceView::StartShutdownAnimation()
+{
+ if (!EnsureAnimator()) {
+ return;
+ }
+ shutdownAnimator->Start();
+ uapi_dev_runtime_set_shutting_down_status(1);
+ uapi_set_screen_on_api();
+ custom_VibratorFunc_int(0);
+}
+
+void ShutdownDeviceView::OnAnimatorStop(UIView &view)
+{
+ UNUSED(view);
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutdownDeviceView::OnAnimatorStop");
+ shutdown_reboot_prejobs(SHUTDOWN_TYPE);
+}
}
\ No newline at end of file
#include "components/ui_label_ext.h"
#include "components/ui_image_view.h"
#include "components/ui_image_animator.h"
+#include "UiConfig.h"
namespace OHOS
{
static constexpr int16_t TB_NET_ANIM_X = 38;
- static constexpr int16_t TB_NET_ANIM_Y = 151;
+ static constexpr int16_t TB_NET_ANIM_Y = 149;
static constexpr int16_t TB_NET_ANIM_W = 36;
static constexpr int16_t TB_NET_ANIM_H = 36;
static constexpr int16_t TB_NET_ANIM_FRAMES = 60;
static constexpr int16_t TB_NET_ANIM_INTERVAL = 41;
static constexpr const char *TB_NET_ANIM_PATH = "/user/res/animated_icon/net/";
+ static const char *TB_NET_PATHS[TB_NET_ANIM_FRAMES] = {
+ TB_NET_IMAGE_1,
+ TB_NET_IMAGE_2,
+ TB_NET_IMAGE_3,
+ TB_NET_IMAGE_4,
+ TB_NET_IMAGE_5,
+ TB_NET_IMAGE_6,
+ TB_NET_IMAGE_7,
+ TB_NET_IMAGE_8,
+ TB_NET_IMAGE_9,
+ TB_NET_IMAGE_10,
+ TB_NET_IMAGE_11,
+ TB_NET_IMAGE_12,
+ TB_NET_IMAGE_13,
+ TB_NET_IMAGE_14,
+ TB_NET_IMAGE_15,
+ TB_NET_IMAGE_16,
+ TB_NET_IMAGE_17,
+ TB_NET_IMAGE_18,
+ TB_NET_IMAGE_19,
+ TB_NET_IMAGE_20,
+ TB_NET_IMAGE_21,
+ TB_NET_IMAGE_22,
+ TB_NET_IMAGE_23,
+ TB_NET_IMAGE_24,
+ TB_NET_IMAGE_25,
+ TB_NET_IMAGE_26,
+ TB_NET_IMAGE_27,
+ TB_NET_IMAGE_28,
+ TB_NET_IMAGE_29,
+ TB_NET_IMAGE_30,
+ TB_NET_IMAGE_31,
+ TB_NET_IMAGE_32,
+ TB_NET_IMAGE_33,
+ TB_NET_IMAGE_34,
+ TB_NET_IMAGE_35,
+ TB_NET_IMAGE_36,
+ TB_NET_IMAGE_37,
+ TB_NET_IMAGE_38,
+ TB_NET_IMAGE_39,
+ TB_NET_IMAGE_40,
+ TB_NET_IMAGE_41,
+ TB_NET_IMAGE_42,
+ TB_NET_IMAGE_43,
+ TB_NET_IMAGE_44,
+ TB_NET_IMAGE_45,
+ TB_NET_IMAGE_46,
+ TB_NET_IMAGE_47,
+ TB_NET_IMAGE_48,
+ TB_NET_IMAGE_49,
+ TB_NET_IMAGE_50,
+ TB_NET_IMAGE_51,
+ TB_NET_IMAGE_52,
+ TB_NET_IMAGE_53,
+ TB_NET_IMAGE_54,
+ TB_NET_IMAGE_55,
+ TB_NET_IMAGE_56,
+ TB_NET_IMAGE_57,
+ TB_NET_IMAGE_58,
+ TB_NET_IMAGE_59,
+ TB_NET_IMAGE_60,
+ };
+
class ThunderBirdAdjustView
{
public:
#include "components/ui_label_ext.h"
#include "components/ui_image_view.h"
#include "components/ui_image_animator.h"
+#include "UiConfig.h"
namespace OHOS
{
static constexpr int16_t TB_SPEAK_ANIM_X = 141;
- static constexpr int16_t TB_SPEAK_ANIM_Y = 114;
+ static constexpr int16_t TB_SPEAK_ANIM_Y = 112;
static constexpr int16_t TB_SPEAK_ANIM_W = 78;
static constexpr int16_t TB_SPEAK_ANIM_H = 24;
static constexpr int16_t TB_SPEAK_ANIM_FRAMES = 25;
static constexpr const char *TB_SPEAK_ANIM_PATH = "/user/res/animated_icon/speak/";
static constexpr int16_t TB_LISTEN_ANIM_X = 69;
- static constexpr int16_t TB_LISTEN_ANIM_Y = 67;
+ static constexpr int16_t TB_LISTEN_ANIM_Y = 65;
static constexpr int16_t TB_LISTEN_ANIM_W = 36;
static constexpr int16_t TB_LISTEN_ANIM_H = 36;
static constexpr int16_t TB_LISTEN_ANIM_FRAMES = 61;
static constexpr int16_t TB_LISTEN_ANIM_INTERVAL = 41;
static constexpr const char *TB_LISTEN_ANIM_PATH = "/user/res/animated_icon/listen/";
+ static const char *TB_SPEAK_PATHS[TB_SPEAK_ANIM_FRAMES] = {
+ TB_SPEAK_IMAGE_1,
+ TB_SPEAK_IMAGE_2,
+ TB_SPEAK_IMAGE_3,
+ TB_SPEAK_IMAGE_4,
+ TB_SPEAK_IMAGE_5,
+ TB_SPEAK_IMAGE_6,
+ TB_SPEAK_IMAGE_7,
+ TB_SPEAK_IMAGE_8,
+ TB_SPEAK_IMAGE_9,
+ TB_SPEAK_IMAGE_10,
+ TB_SPEAK_IMAGE_11,
+ TB_SPEAK_IMAGE_12,
+ TB_SPEAK_IMAGE_13,
+ TB_SPEAK_IMAGE_14,
+ TB_SPEAK_IMAGE_15,
+ TB_SPEAK_IMAGE_16,
+ TB_SPEAK_IMAGE_17,
+ TB_SPEAK_IMAGE_18,
+ TB_SPEAK_IMAGE_19,
+ TB_SPEAK_IMAGE_20,
+ TB_SPEAK_IMAGE_21,
+ TB_SPEAK_IMAGE_22,
+ TB_SPEAK_IMAGE_23,
+ TB_SPEAK_IMAGE_24,
+ TB_SPEAK_IMAGE_25,
+ };
+ static const char *TB_LISTEN_PATHS[TB_LISTEN_ANIM_FRAMES] = {
+ TB_LISTEN_IMAGE_1,
+ TB_LISTEN_IMAGE_2,
+ TB_LISTEN_IMAGE_3,
+ TB_LISTEN_IMAGE_4,
+ TB_LISTEN_IMAGE_5,
+ TB_LISTEN_IMAGE_6,
+ TB_LISTEN_IMAGE_7,
+ TB_LISTEN_IMAGE_8,
+ TB_LISTEN_IMAGE_9,
+ TB_LISTEN_IMAGE_10,
+ TB_LISTEN_IMAGE_11,
+ TB_LISTEN_IMAGE_12,
+ TB_LISTEN_IMAGE_13,
+ TB_LISTEN_IMAGE_14,
+ TB_LISTEN_IMAGE_15,
+ TB_LISTEN_IMAGE_16,
+ TB_LISTEN_IMAGE_17,
+ TB_LISTEN_IMAGE_18,
+ TB_LISTEN_IMAGE_19,
+ TB_LISTEN_IMAGE_20,
+ TB_LISTEN_IMAGE_21,
+ TB_LISTEN_IMAGE_22,
+ TB_LISTEN_IMAGE_23,
+ TB_LISTEN_IMAGE_24,
+ TB_LISTEN_IMAGE_25,
+ TB_LISTEN_IMAGE_26,
+ TB_LISTEN_IMAGE_27,
+ TB_LISTEN_IMAGE_28,
+ TB_LISTEN_IMAGE_29,
+ TB_LISTEN_IMAGE_30,
+ TB_LISTEN_IMAGE_31,
+ TB_LISTEN_IMAGE_32,
+ TB_LISTEN_IMAGE_33,
+ TB_LISTEN_IMAGE_34,
+ TB_LISTEN_IMAGE_35,
+ TB_LISTEN_IMAGE_36,
+ TB_LISTEN_IMAGE_37,
+ TB_LISTEN_IMAGE_38,
+ TB_LISTEN_IMAGE_39,
+ TB_LISTEN_IMAGE_40,
+ TB_LISTEN_IMAGE_41,
+ TB_LISTEN_IMAGE_42,
+ TB_LISTEN_IMAGE_43,
+ TB_LISTEN_IMAGE_44,
+ TB_LISTEN_IMAGE_45,
+ TB_LISTEN_IMAGE_46,
+ TB_LISTEN_IMAGE_47,
+ TB_LISTEN_IMAGE_48,
+ TB_LISTEN_IMAGE_49,
+ TB_LISTEN_IMAGE_50,
+ TB_LISTEN_IMAGE_51,
+ TB_LISTEN_IMAGE_52,
+ TB_LISTEN_IMAGE_53,
+ TB_LISTEN_IMAGE_54,
+ TB_LISTEN_IMAGE_55,
+ TB_LISTEN_IMAGE_56,
+ TB_LISTEN_IMAGE_57,
+ TB_LISTEN_IMAGE_58,
+ TB_LISTEN_IMAGE_59,
+ TB_LISTEN_IMAGE_60,
+ TB_LISTEN_IMAGE_61,
+ };
+
class ThunderBirdDialogueView
{
public:
private:
UIViewGroup *group{nullptr};
UILabelExt *TextLabel{nullptr};
+ UILabelExt *TextLabel_Y{nullptr};
UIImageAnimatorView *speakAnimator{nullptr};
UIImageAnimatorView *listenAnimator{nullptr};
ImageAnimatorInfo speakImageInfo[TB_SPEAK_ANIM_FRAMES];
private:
UIViewGroup *group{nullptr};
UILabelExt *TextLabel{nullptr};
+ UILabelExt *TextLabel_Y{nullptr};
UILabelButton *RemindButton{nullptr};
UILabelExt *RemindLabel{nullptr};
UIImageView *RemindGround{nullptr};
private:
UIViewGroup *group{nullptr};
UILabelExt *TextLabel{nullptr};
+ UILabelExt *TextLabel_Y{nullptr};
UILabelExt *RemindLabel{nullptr};
UIImageView *RemindIcon{nullptr};
UIImageView *RemindIcon2{nullptr};
void InitCommonPageComponents();
void HideCommonPageComponents();
bool SwitchVideo(const char *uri);
+ // 切换头发贴图
+ void SwitchHair(const char *hairPath);
// 关机前关闭视频与相关资源
void CloseVideo();
// 打开遮罩(部分视图需要)
ThunderBirdShutdownView *g_pThunderBirdShutdownView{nullptr};
ThunderBirdShutdownTestView *g_pThunderBirdShutdownTestView{nullptr};
-#define SCREEN_WIDTH (Screen::GetInstance().GetWidth())
-#define SCREEN_HEIGHT (Screen::GetInstance().GetHeight())
+#define SCREEN_WIDTH 360
+#define SCREEN_HEIGHT 360
};
}
void StartTimer(uint32_t interval = 2 * 1000);//2秒
void StartReminderHideTimer(uint32_t intervalMs = 1000);
void StartOtaCountdown(uint32_t startVal);
+ void StopOtaCountdown(void);
void StartCountUpTimer(uint32_t targetSeconds);
void StopCountUpTimer(void);
int GetCountUpValue() const;
{
static constexpr int16_t TB_SHUTDOWN_ANIM_X_TEST = 0;
static constexpr int16_t TB_SHUTDOWN_ANIM_Y_TEST = 0;
- static constexpr int16_t TB_SHUTDOWN_ANIM_W_TEST = 466;
- static constexpr int16_t TB_SHUTDOWN_ANIM_H_TEST = 466;
+ static constexpr int16_t TB_SHUTDOWN_ANIM_W_TEST = 360;
+ static constexpr int16_t TB_SHUTDOWN_ANIM_H_TEST = 360;
static constexpr int16_t TB_SHUTDOWN_ANIM_FRAMES_TEST = 86;
static constexpr int16_t TB_SHUTDOWN_ANIM_INTERVAL_TEST = 41;
static constexpr const char *TB_SHUTDOWN_ANIM_PATH_TEST = "/user/res/emoticon/naughty";
{
static constexpr int16_t TB_SHUTDOWN_ANIM_X = 0;
static constexpr int16_t TB_SHUTDOWN_ANIM_Y = 0;
- static constexpr int16_t TB_SHUTDOWN_ANIM_W = 466;
- static constexpr int16_t TB_SHUTDOWN_ANIM_H = 466;
+ static constexpr int16_t TB_SHUTDOWN_ANIM_W = 360;
+ static constexpr int16_t TB_SHUTDOWN_ANIM_H = 360;
static constexpr int16_t TB_SHUTDOWN_ANIM_FRAMES = 95;
static constexpr int16_t TB_SHUTDOWN_ANIM_INTERVAL = 41;
static constexpr const char *TB_SHUTDOWN_ANIM_PATH = "/user/res/RebootAndShutDown/ShutDown/";
#include "thunderbird/include/ThunderBirdAdjustView.h"
#include "wearable_log.h"
#include "common/image_cache_manager.h"
-#include "UiConfig.h"
namespace OHOS
{
- const char *searchImagePath[TB_NET_ANIM_FRAMES] = {
- PNG_A019_080_IMAGE_PATH,
- PNG_A019_081_IMAGE_PATH,
- PNG_A019_082_IMAGE_PATH,
- PNG_A019_083_IMAGE_PATH,
- PNG_A019_084_IMAGE_PATH,
- PNG_A019_085_IMAGE_PATH,
- PNG_A019_086_IMAGE_PATH,
- PNG_A019_087_IMAGE_PATH,
- };
+
static ThunderBirdAdjustView *g_pThunderBirdAdjustView{nullptr};
ThunderBirdAdjustView::ThunderBirdAdjustView()
{
if (netAnimator == nullptr)
{
- netPathsArray = searchImagePath;
+ netPathsArray = TB_NET_PATHS;
netAnimator = new UIImageAnimatorView();
if (netAnimator == nullptr)
{
}
netAnimator->SetPosition(TB_NET_ANIM_X, TB_NET_ANIM_Y, TB_NET_ANIM_W, TB_NET_ANIM_H);
netAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
- netAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ netAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
netAnimator->SetImageAnimatorSrc(netImageInfo, TB_NET_ANIM_FRAMES, TB_NET_ANIM_INTERVAL);
netAnimator->SetRepeat(true);
+ netAnimator->SetRepeatTimes(1);
netAnimator->SetResizeMode(UIImageView::COVER);
//netAnimator->SetAnimatorStopListener(this);
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdAdjustView::group null!");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
// 公共控件
BackGround = new UIImageView();
{
BackGround->SetAutoEnable(false);
BackGround->SetPosition(0, 0, 360, 360);
- BackGround->SetSrc("/user/res/RebootAndShutDown/ReBoot/4.bin");
+ BackGround->SetSrc("/user/res/yellowbg.bin");
BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
BackGround->SetResizeMode(UIImageView::CONTAIN);
BackGround->SetVisible(true);
{
RemindIcon->SetAutoEnable(false);
RemindIcon->SetVisible(false);
+ RemindIcon->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon);
}
RemindIcon2 = new UIImageView();
{
RemindIcon2->SetAutoEnable(false);
RemindIcon2->SetVisible(false);
+ RemindIcon2->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon2);
}
RemindIcon3 = new UIImageView();
{
RemindIcon3->SetAutoEnable(false);
RemindIcon3->SetVisible(false);
+ RemindIcon3->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon3);
}
RemindLabel = new UILabelExt();
if (RemindLabel)
{
RemindLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT);
- RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindLabel->SetVisible(false);
group->Add(RemindLabel);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(98, 151, 36, 36);
+ RemindIcon->SetPosition(98, 146, 36, 36);
RemindIcon->SetSrc("/user/res/completed.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
RemindIcon2->SetPosition(158, 286, 24, 24);
- RemindIcon2->SetSrc("/user/res/completed.bin");
+ RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
break;
}
if (RemindIcon)
{
- RemindIcon->SetPosition(68, 151, 36, 36);
+ RemindIcon->SetPosition(68, 146, 36, 36);
RemindIcon->SetSrc("/user/res/warning.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(104, 277, 22, 22);
+ RemindIcon2->SetPosition(105, 277, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_down.bin");
RemindIcon2->SetVisible(true);
}
if (RemindIcon3)
{
- RemindIcon3->SetPosition(216, 277, 22, 22);
+ RemindIcon3->SetPosition(211, 276, 22, 22);
RemindIcon3->SetSrc("/user/res/volume_up.bin");
RemindIcon3->SetVisible(true);
}
TextLabel->SetPosition(82, 148, 240, 42);
TextLabel->SetText("正在重新连接网络");
TextLabel->SetVisible(true);
- }
+ }
if (netAnimator) { netAnimator->SetVisible(true); netAnimator->Start(); }
break;
}
#include "thunderbird/include/ThunderBirdDialogueView.h"
#include "wearable_log.h"
-#include "UiConfig.h"
+
namespace OHOS
{
static ThunderBirdDialogueView *g_pThunderBirdDialogueView{nullptr};
- static const char *TB_SPEAK_PATHS[TB_SPEAK_ANIM_FRAMES] = {
- TB_SPEAK_IMAGE_1,
- TB_SPEAK_IMAGE_2,
- TB_SPEAK_IMAGE_3,
- TB_SPEAK_IMAGE_4,
- TB_SPEAK_IMAGE_5,
- TB_SPEAK_IMAGE_6,
- TB_SPEAK_IMAGE_7,
- TB_SPEAK_IMAGE_8,
- TB_SPEAK_IMAGE_9,
- TB_SPEAK_IMAGE_10,
- TB_SPEAK_IMAGE_11,
- TB_SPEAK_IMAGE_12,
- TB_SPEAK_IMAGE_13,
- TB_SPEAK_IMAGE_14,
- TB_SPEAK_IMAGE_15,
- TB_SPEAK_IMAGE_16,
- TB_SPEAK_IMAGE_17,
- TB_SPEAK_IMAGE_18,
- TB_SPEAK_IMAGE_19,
- TB_SPEAK_IMAGE_20,
- TB_SPEAK_IMAGE_21,
- TB_SPEAK_IMAGE_22,
- TB_SPEAK_IMAGE_23,
- TB_SPEAK_IMAGE_24,
- TB_SPEAK_IMAGE_25,
- };
- static const char *TB_LISTEN_PATHS[TB_LISTEN_ANIM_FRAMES] = {
- TB_LISTEN_IMAGE_1,
- TB_LISTEN_IMAGE_2,
- TB_LISTEN_IMAGE_3,
- TB_LISTEN_IMAGE_4,
- TB_LISTEN_IMAGE_5,
- TB_LISTEN_IMAGE_6,
- TB_LISTEN_IMAGE_7,
- TB_LISTEN_IMAGE_8,
- TB_LISTEN_IMAGE_9,
- TB_LISTEN_IMAGE_10,
- TB_LISTEN_IMAGE_11,
- TB_LISTEN_IMAGE_12,
- TB_LISTEN_IMAGE_13,
- TB_LISTEN_IMAGE_14,
- TB_LISTEN_IMAGE_15,
- TB_LISTEN_IMAGE_16,
- TB_LISTEN_IMAGE_17,
- TB_LISTEN_IMAGE_18,
- TB_LISTEN_IMAGE_19,
- TB_LISTEN_IMAGE_20,
- TB_LISTEN_IMAGE_21,
- TB_LISTEN_IMAGE_22,
- TB_LISTEN_IMAGE_23,
- TB_LISTEN_IMAGE_24,
- TB_LISTEN_IMAGE_25,
- TB_LISTEN_IMAGE_26,
- TB_LISTEN_IMAGE_27,
- TB_LISTEN_IMAGE_28,
- TB_LISTEN_IMAGE_29,
- TB_LISTEN_IMAGE_30,
- TB_LISTEN_IMAGE_31,
- TB_LISTEN_IMAGE_32,
- TB_LISTEN_IMAGE_33,
- TB_LISTEN_IMAGE_34,
- TB_LISTEN_IMAGE_35,
- TB_LISTEN_IMAGE_36,
- TB_LISTEN_IMAGE_37,
- TB_LISTEN_IMAGE_38,
- TB_LISTEN_IMAGE_39,
- TB_LISTEN_IMAGE_40,
- TB_LISTEN_IMAGE_41,
- TB_LISTEN_IMAGE_42,
- TB_LISTEN_IMAGE_43,
- TB_LISTEN_IMAGE_44,
- TB_LISTEN_IMAGE_45,
- TB_LISTEN_IMAGE_46,
- TB_LISTEN_IMAGE_47,
- TB_LISTEN_IMAGE_48,
- TB_LISTEN_IMAGE_49,
- TB_LISTEN_IMAGE_50,
- TB_LISTEN_IMAGE_51,
- TB_LISTEN_IMAGE_52,
- TB_LISTEN_IMAGE_53,
- TB_LISTEN_IMAGE_54,
- TB_LISTEN_IMAGE_55,
- TB_LISTEN_IMAGE_56,
- TB_LISTEN_IMAGE_57,
- TB_LISTEN_IMAGE_58,
- TB_LISTEN_IMAGE_59,
- TB_LISTEN_IMAGE_60,
- TB_LISTEN_IMAGE_61,
- };
+
ThunderBirdDialogueView::ThunderBirdDialogueView()
{
group = nullptr;
}
if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; }
+ if (TextLabel_Y != nullptr) { delete TextLabel_Y; TextLabel_Y = nullptr; }
+
if (speakAnimator != nullptr) { delete speakAnimator; speakAnimator = nullptr; }
if (listenAnimator != nullptr) { delete listenAnimator; listenAnimator = nullptr; }
}
}
speakAnimator->SetPosition(TB_SPEAK_ANIM_X, TB_SPEAK_ANIM_Y, TB_SPEAK_ANIM_W, TB_SPEAK_ANIM_H);
speakAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
- speakAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ speakAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
speakAnimator->SetImageAnimatorSrc(speakImageInfo, TB_SPEAK_ANIM_FRAMES, TB_SPEAK_ANIM_INTERVAL);
speakAnimator->SetRepeat(true);
+ speakAnimator->SetRepeatTimes(1);
speakAnimator->SetResizeMode(UIImageView::COVER);
//speakAnimator->SetAnimatorStopListener(this);
}
}
listenAnimator->SetPosition(TB_LISTEN_ANIM_X, TB_LISTEN_ANIM_Y, TB_LISTEN_ANIM_W, TB_LISTEN_ANIM_H);
listenAnimator->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
- listenAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ listenAnimator->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
listenAnimator->SetImageAnimatorSrc(listenImageInfo, TB_LISTEN_ANIM_FRAMES, TB_LISTEN_ANIM_INTERVAL);
listenAnimator->SetRepeat(true);
+ listenAnimator->SetRepeatTimes(1);
listenAnimator->SetResizeMode(UIImageView::COVER);
//listenAnimator->SetAnimatorStopListener(this);
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdDialogueView::group null!");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
// 公共控件
+ TextLabel_Y = new UILabelExt();
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(2, 66, 360, 42);
+ TextLabel_Y->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ TextLabel_Y->SetStyle(STYLE_TEXT_COLOR, 0xff000000);
+ TextLabel_Y->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ TextLabel_Y->SetVisible(false);
+ group->Add(TextLabel_Y);
+ }
TextLabel = new UILabelExt();
if (TextLabel)
{
{
if (group == nullptr) { return; }
if (TextLabel) { TextLabel->SetVisible(false);}
+ if (TextLabel_Y) { TextLabel_Y->SetVisible(false);}
if (speakAnimator) { speakAnimator->SetVisible(false); speakAnimator->Stop(); }
if (listenAnimator) { listenAnimator->SetVisible(false); listenAnimator->Stop(); }
TextLabel->SetText("保镖小姐 , 你来啦");
TextLabel->SetVisible(true);
}
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetText("保镖小姐 , 你来啦");
+ TextLabel_Y->SetVisible(true);
+ }
//动效图标
if (speakAnimator) { speakAnimator->SetVisible(true); speakAnimator->Start(); }
break;
TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT);
TextLabel->SetVisible(true);
}
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(113, 66, 180, 42);
+ TextLabel_Y->SetText("超认真聆听中");
+ TextLabel_Y->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT);
+ TextLabel_Y->SetVisible(true);
+ }
//动效图标
if (listenAnimator) { listenAnimator->SetVisible(true); listenAnimator->Start(); }
break;
{
if (TextLabel)
{
+ TextLabel->SetPosition(111, 64, 180, 42);
TextLabel->SetText("发呆中...");
+ TextLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT);
TextLabel->SetVisible(true);
}
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(113, 66, 180, 42);
+ TextLabel_Y->SetText("发呆中...");
+ TextLabel_Y->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT);
+ TextLabel_Y->SetVisible(true);
+ }
break;
}
default:
}
if (RemindButton != nullptr) { delete RemindButton; RemindButton = nullptr; }
if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; }
+ if (TextLabel_Y != nullptr) { delete TextLabel_Y; TextLabel_Y = nullptr; }
if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; }
+ if (RemindGround != nullptr) { delete RemindGround; RemindGround = nullptr; }
+ if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; }
+ if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; }
}
UIViewGroup *ThunderBirdGuideView::ThunderBirdGuideViewInit(void)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdGuideView::group null!");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
// 公共控件
+ TextLabel_Y = new UILabelExt();
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(0, 106, 360, 48);
+ TextLabel_Y->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ TextLabel_Y->SetStyle(STYLE_TEXT_COLOR, 0xff000000);
+ TextLabel_Y->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ TextLabel_Y->SetStyle(STYLE_LINE_SPACE, 10);
+ TextLabel_Y->SetStyle(STYLE_LETTER_SPACE, 1);
+ TextLabel_Y->SetVisible(false);
+ group->Add(TextLabel_Y);
+ }
TextLabel = new UILabelExt();
if (TextLabel)
{
- TextLabel->SetPosition(0, 104, 466, 48);
+ TextLabel->SetPosition(0, 104, 360, 48);
TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34);
+ TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ TextLabel->SetStyle(STYLE_LINE_SPACE, 10);
+ TextLabel->SetStyle(STYLE_LETTER_SPACE, 1);
+
TextLabel->SetVisible(false);
group->Add(TextLabel);
}
+
RemindButton = new UILabelButton();
if (RemindButton)
{
RemindLabel = new UILabelExt();
if (RemindLabel)
{
- RemindLabel->SetPosition(0, 180, 466, 40);
+ RemindLabel->SetPosition(0, 180, 360, 40);
RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);
+ RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindLabel->SetVisible(false);
group->Add(RemindLabel);
}
RemindIcon = new UIImageView();
if (RemindIcon)
{
+ RemindIcon->SetAutoEnable(false);
RemindIcon->SetPosition(280, 320, 30, 30);
+ RemindIcon->SetResizeMode(UIImageView::CONTAIN);
RemindIcon->SetVisible(false);
group->Add(RemindIcon);
}
+ RemindIcon2 = new UIImageView();
+ if (RemindIcon2)
+ {
+ RemindIcon2->SetAutoEnable(false);
+ RemindIcon2->SetVisible(false);
+ group->Add(RemindIcon2);
+ }
+
return group;
}
void ThunderBirdGuideView::Show(int16_t showView)
{
if (group == nullptr) { return; }
- if (TextLabel) { TextLabel->SetVisible(false);TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);}
+ if (TextLabel) { TextLabel->SetVisible(false);TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);}
+ if (TextLabel_Y) { TextLabel_Y->SetVisible(false); }
if (RemindButton) { RemindButton->SetVisible(false); }
if (RemindLabel) { RemindLabel->SetVisible(false); }
if (RemindIcon) { RemindIcon->SetVisible(false); }
+ if (RemindIcon2) { RemindIcon2->SetVisible(false); }
switch (showView)
{
TextLabel->SetText("Hey, 我是Amby~");
TextLabel->SetVisible(true);
}
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(2, 66, 360, 42);
+ TextLabel_Y->SetText("Hey, 我是Amby~");
+ TextLabel_Y->SetVisible(true);
+ }
if (RemindButton)
{
RemindButton->SetPosition(106, 114, 148, 40);
- RemindButton->SetText("按 下一页");
- RemindButton->SetLabelPosition(16, 6);
+ RemindButton->SetText("按 下一页");
+ RemindButton->SetLabelPosition(2, 0);
RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindButton->SetVisible(true);
}
if(RemindIcon)
{
- RemindIcon->SetPosition(148, 122, 24, 24);
+ RemindIcon->SetPosition(152, 122, 24, 24);
RemindIcon->SetSrc("/user/res/volume_up.bin");
RemindIcon->SetVisible(true);
}
{
if (TextLabel)
{
- TextLabel->SetPosition(0, 64, 466, 42);
+ TextLabel->SetPosition(0, 64, 360, 42);
TextLabel->SetText("我可以和你聊天,哄你睡觉");
+ TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
TextLabel->SetRollSpeed(35);
TextLabel->SetVisible(true);
}
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(2, 66, 360, 42);
+ TextLabel_Y->SetText("我可以和你聊天,哄你睡觉");
+ TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+ TextLabel_Y->SetRollSpeed(35);
+ TextLabel_Y->SetVisible(true);
+ }
if (RemindButton)
{
RemindButton->SetPosition(106, 114, 148, 40);
- RemindButton->SetText("按 下一页");
- RemindButton->SetLabelPosition(16, 6);
+ RemindButton->SetText("按 下一页");
+ RemindButton->SetLabelPosition(2, 0);
RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindButton->SetVisible(true);
}
if(RemindIcon)
{
- RemindIcon->SetPosition(148, 122, 24, 24);
+ RemindIcon->SetPosition(152, 122, 24, 24);
RemindIcon->SetSrc("/user/res/volume_up.bin");
RemindIcon->SetVisible(true);
}
ThunderBirdMainView::GetInstance()->OpenBackGround();
if (TextLabel)
{
- TextLabel->SetPosition(60, 64, 240, 84);
- TextLabel->SetText("换角色、挑声音、哄睡...扫码尽享受");
+ TextLabel->SetPosition(60, 64, 250, 84);
+ TextLabel->SetText("换角色、挑声音、\n哄睡...扫码尽享!");
TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);//自动换行
TextLabel->SetVisible(true);
}
-
- if (RemindLabel)
+ if(RemindIcon2)
{
- RemindLabel->SetText("按 跳过");
- RemindLabel->SetVisible(true);
+ RemindIcon2->SetPosition(133, 169, 104, 104);
+ RemindIcon->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
+ RemindIcon2->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ //RemindIcon->SetSrc("/user/res/volume_up.bin");
+ RemindIcon2->SetVisible(true);
}
if(RemindIcon)
{
- RemindIcon->SetPosition(192, 185, 30, 30);
+ RemindIcon->SetPosition(158, 296, 30, 30);
RemindIcon->SetSrc("/user/res/volumeup.bin");
RemindIcon->SetVisible(true);
+ }
+ if (RemindButton)
+ {
+ RemindButton->SetPosition(116, 288, 148, 40);
+ RemindButton->SetText("按 跳过");
+ RemindButton->SetLabelPosition(2, 0);
+ RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
+ RemindButton->SetVisible(true);
}
+
// 黑色背景与二维码需要补充
break;
}
group = nullptr;
}
if (TextLabel != nullptr) { delete TextLabel; TextLabel = nullptr; }
+ if (TextLabel_Y != nullptr) { delete TextLabel_Y; TextLabel_Y = nullptr; }
if (RemindLabel != nullptr) { delete RemindLabel; RemindLabel = nullptr; }
if (RemindIcon != nullptr) { delete RemindIcon; RemindIcon = nullptr; }
if (RemindIcon2 != nullptr) { delete RemindIcon2; RemindIcon2 = nullptr; }
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdLullabyView::group null!");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
// 公共控件
+ TextLabel_Y = new UILabelExt();
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ TextLabel_Y->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ TextLabel_Y->SetVisible(false);
+ group->Add(TextLabel_Y);
+ }
TextLabel = new UILabelExt();
if (TextLabel)
{
TextLabel->SetVisible(false);
group->Add(TextLabel);
}
+
RemindLabel = new UILabelExt();
if (RemindLabel)
{
{
RemindIcon->SetAutoEnable(false);
RemindIcon->SetVisible(false);
+ RemindIcon->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon);
}
RemindIcon2 = new UIImageView();
{
RemindIcon2->SetAutoEnable(false);
RemindIcon2->SetVisible(false);
+ RemindIcon2->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon2);
}
if(!EnsureListenAnimator())
void ThunderBirdLullabyView::Show(int16_t showView)
{
+ ThunderBirdModel::GetInstance()->StopCountUpTimer();//每次进入哄睡界面都停止定时器
if (group == nullptr) { return; }
- if (TextLabel) { TextLabel->SetVisible(false);
- TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
- TextLabel->SetRollSpeed(35); }
+ if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS); }
+ if (TextLabel_Y) { TextLabel_Y->SetVisible(false); }
if (RemindLabel) { RemindLabel->SetVisible(false);}
if (RemindIcon) { RemindIcon->SetVisible(false); }
if (RemindIcon2) { RemindIcon2->SetVisible(false); }
{
if (TextLabel)
{
- TextLabel->SetPosition(43, 64, 268, 42);
- TextLabel->SetText("按 说「哄我睡觉」");
+ TextLabel->SetPosition(43, 64, 280, 42);
+ TextLabel->SetText("按 说「哄我睡觉」");
TextLabel->SetVisible(true);
}
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(45, 66, 280, 42);
+ TextLabel_Y->SetText("按 说「哄我睡觉」");
+ TextLabel_Y->SetVisible(true);
+ }
if(RemindIcon)
{
- RemindIcon->SetPosition(79, 69, 36, 36);
+ RemindIcon->SetPosition(75, 65, 36, 36);
RemindIcon->SetSrc("/user/res/voice.bin");
RemindIcon->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
{
TextLabel->SetPosition(82, 148, 240, 42);
TextLabel->SetText("告诉我想听的故事");
+ TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+ TextLabel->SetRollSpeed(35);
TextLabel->SetVisible(true);
}
if (listenAnimator) { listenAnimator->SetVisible(true); listenAnimator->Start(); }
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
{
TextLabel->SetPosition(0, 64, 360, 42);
TextLabel->SetText("从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?");
+ TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+ TextLabel->SetRollSpeed(35);
TextLabel->SetVisible(true);
}
+ if (TextLabel_Y)
+ {
+ TextLabel_Y->SetPosition(2, 66, 360, 42);
+ TextLabel_Y->SetText("从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?从前有座山,山里有座庙,庙里有个老和尚,老和尚给小和尚讲故事,讲什么呢?");
+ TextLabel_Y->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+ TextLabel_Y->SetRollSpeed(35);
+ TextLabel_Y->SetVisible(true);
+ }
if(RemindLabel)
{
- RemindLabel->SetPosition(155, 114, 131, 28);
+ RemindLabel->SetPosition(115, 114, 131, 28);
RemindLabel->SetText("04:00/15:00");
RemindLabel->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
#include "battery_service.h"
#include "custom_runtime.h"
#include <service/graphic_service.h>
+//#include "ln/ln_api.h"
namespace OHOS
{
- static constexpr int16_t VIDEO_WIDTH = 466;
- static constexpr int16_t VIDEO_HEIGHT = 466;
+ static constexpr int16_t VIDEO_WIDTH = 360;
+ static constexpr int16_t VIDEO_HEIGHT = 360;
static constexpr int16_t STRIDE_ALIGNMENT_VALUE = 128;
static constexpr int16_t JPEG_WIDTH_BYTE_ALIGNMENT = 128;
static constexpr int16_t JPEG_HEIGHT_BYTE_ALIGNMENT = 16;
ThunderBirdMainView::~ThunderBirdMainView()
{
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::~ThunderBirdMainView");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::~ThunderBirdMainView");
DeInit();
if (ScrollView_ != nullptr)
{
g_lastPlayed = false;
// 注销屏幕状态通知
- //deregisterNotifyScreenStatus(ScreenStatusNotify);
+ deregisterNotifyScreenStatus(ScreenStatusNotify);
if (curFace != nullptr)
{
video_ = nullptr;
videoPlayer_ = nullptr;
}
-
- void ThunderBirdMainView::OnStart()
+ void ThunderBirdMainView::OnStart()//开机操作
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::OnStart");
View<ThunderBirdPresenter>::OnStart();
Initback(); // 最底层
- // ScrollView_->Add(group[THUNDERBIRD_GUIDEVIEW]);
- // //顶部状态栏
- // if (pagesGroup == nullptr)
- // {
- // pagesGroup = new UIViewGroup();
- // if (pagesGroup == nullptr)
- // {
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "pagesGroup new fail");
- // return;
- // }
- // }
- // g_pThunderBirdShutdownTestView = new ThunderBirdShutdownTestView();
- // pagesGroup = g_pThunderBirdShutdownTestView->Init();
- // ScrollView_->Add(pagesGroup);
- // g_pThunderBirdShutdownTestView->StartAnimation();
iconView = new UIImageView(); //(表情图片)需要遮罩时启用,预先增加在对应图层
iconView->SetAutoEnable(false);
- iconView->SetPosition(0, 0, 466, 466);
+ iconView->SetPosition(0, 0, 360, 360);
iconView->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
iconView->SetResizeMode(UIImageView::COVER);
- iconView->SetSrc("/user/res/emoticon/naughty/1.bin");
+ iconView->SetSrc("/user/res/1.bin");
iconView->SetVisible(false);
ScrollView_->Add(iconView);
backGroundView = new UIImageView(); //(黑色遮罩)需要遮罩时启用,预先增加在对应图层
backGroundView->SetAutoEnable(false);
- backGroundView->SetPosition(0, 0, 466, 466);
+ backGroundView->SetPosition(0, 0, 360, 360);
backGroundView->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
backGroundView->SetStyle(STYLE_BACKGROUND_OPA, 0xD0);
backGroundView->SetVisible(false);
// 默认显示主界面
ChangeView(MAXVIEW, THUNDERBIRD_GUIDEVIEW, 0); // 文字显示图层
- // iconLabel = new UILabel();
- // iconLabel->SetPosition(0, 160, 466, 40);
- // iconLabel->SetStyle(STYLE_TEXT_COLOR, 0xffffffff);
- // iconLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- // iconLabel->SetText("你好,我是Amby~");
- // iconLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34);
- // iconLabel->SetVisible(true);
- // ScrollView_->Add(iconLabel);
+ //绑定设备提示 > 配置更新成功>OTA升级>其他(按触发时间先后提示)
+ /*************************用户是否绑定*************************/
+ // ln_http_server_send_task(LN_HTTP_SERVICE_CMD_GET_USER_ID, nullptr, 0);//获取用户是否绑定
+ // if(uapi_ln_get_user_bind_status() == 0)//未绑定
+ // {
+ // ChangeView(MAXVIEW, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_1);
+ // }
+ // if(uapi_ln_get_user_bind_status() == 1)//已绑定
+ // {
+ // ChangeView(MAXVIEW, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_2);
+ // }
+
+ // /*************************更新角色配置*************************/
+ // ln_http_server_send_task(LN_HTTP_SERVICE_CMD_GET_CHARACTER, nullptr, 0);//获取角色配置
+
+
+ // /*************************OTA升级*************************/
+ // ln_http_server_send_task(LN_HTTP_SERVICE_CMD_OTA_GET_TASK, nullptr, 0);//获取是否需要OTA升级
+ // if(uapi_ln_ota_get_update_type() == 1)//强制OTA升级
+ // {
+ // ChangeView(MAXVIEW, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_NOW);
+ // }
+ // if(uapi_ln_ota_get_update_type() == 0)//可选OTA升级
+ // {
+ // ChangeView(MAXVIEW, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL);
+ // }
ScrollView_->Add(InitBaseData()); // 最上面状态栏
- // 增加按键监听
- RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::ThunderBirdPresenter::GetInstance();
- RootView::GetInstance()->SetOnKeyActListener(keyactListener);
+
+
+
+ // // 增加按键监听
+ // RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::ThunderBirdPresenter::GetInstance();
+ // RootView::GetInstance()->SetOnKeyActListener(keyactListener);
}
}
g_videoPlay = nullptr;
g_lastPlayed = false;
// 注销屏幕状态通知
- //deregisterNotifyScreenStatus(ScreenStatusNotify);
+ deregisterNotifyScreenStatus(ScreenStatusNotify);
// 释放表面与背景
if (surfaceView_ != nullptr)
{
{
return;
}
- curFace->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
- curFace->SetSrc("/user/res/hair_sad.bin");
+ curFace->SetAutoEnable(false);
+ curFace->SetPosition(0, 0, 360, 360);
+ curFace->SetResizeMode(UIImageView::COVER);
+ curFace->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+ //curFace->SetStyle(STYLE_BACKGROUND_COLOR, 0xffe0c7c1);
+ curFace->SetSrc("/user/res/501.bin");
surfaceView_ = new UILiteSurfaceView();
if (surfaceView_ == nullptr)
surface->SetSize(bufferSize);
if (videoPlay_ == nullptr)
{
- std::string uri("/user/video/46x46_sad.mp4");
+ std::string uri("/user/video/Expression_0/Angry.mp4");
videoPlay_ = new MediaVideoPlay(surface, nullptr, uri, false);
if (videoPlay_ == nullptr)
{
return;
}
g_videoPlay = videoPlay_;
- //registerNotifyScreenStatus(ScreenStatusNotify);
+ registerNotifyScreenStatus(ScreenStatusNotify);
}
if (videoPlay_->isExited_ || !videoPlay_->isEntered_)
{
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::Initback videoPlay_->StartVideoPlay");
videoPlay_->StartVideoPlay();
}
ScrollView_->Add(surfaceView_);
ScrollView_->Add(curFace);
}
+
+ void ThunderBirdMainView::SwitchHair(const char *hairPath)
+ {
+ if (curFace == nullptr || hairPath == nullptr) {
+ return;
+ }
+ curFace->SetSrc(hairPath);
+ curFace->Invalidate();
+ }
UIViewGroup *ThunderBirdMainView::InitBaseData()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDownView::InitBaseData");
return nullptr;
}
}
- group1->SetPosition(96, 14, 168, 40);
+ group1->SetPosition(90, 14, 175, 40);
group1->SetStyle(STYLE_BACKGROUND_OPA, 0);
timeLabel = new UILabelExt();
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "timeLabel new fail");
return nullptr;
}
- timeLabel->SetPosition(0, 4, 46, 33);
+ timeLabel->SetPosition(0, 4, 60, 33);
timeLabel->SetViewId("timeLabel");
timeLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 24);
timeLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
return nullptr;
}
}
- NoSignal->SetPosition(140, (group1->GetHeight() - 38) / 2, 36, 38);
NoSignal->SetAutoEnable(false);
- NoSignal->SetResizeMode(UIImageView::CENTER);
+ NoSignal->SetPosition(80, (group1->GetHeight() - 25) / 2, 25, 25);
+ NoSignal->SetResizeMode(UIImageView::COVER);
NoSignal->SetSrc(DROPDOWN_NOSIGNAL_IMAGE);
NoSignal->SetVisible(false);
group1->Add(NoSignal);
};
// 待添加的 ImageView 信息列表
std::vector<ImageViewInfo> imageViewList = {
- {65+8, 28, 6, 6},
- {150, 20, 6, 14},
- {160, 12, 6, 22},
- {170, 4, 6, 30},
+ {65, 28, 6, 6},
+ {75, 20, 6, 14},
+ {85, 12, 6, 22},
+ {95, 4, 6, 30},
};
// 循环添加 ImageView 到相应的容器中
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryimage new fail");
return nullptr;
}
- batteryimage->SetPosition(170 + 20, (group1->GetHeight() - 30) / 2, 48, 30);
+ batteryimage->SetAutoEnable(false);
+ batteryimage->SetPosition(95 + 20, (group1->GetHeight() - 20) / 2, 32, 20);
+ batteryimage->SetResizeMode(UIImageView::COVER);
std::string batteryimagesPath = "/user/res/Battery_White.bin";
batteryimage->SetSrc(batteryimagesPath.c_str());
group1->Add(batteryimage);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "progress new fail");
return nullptr;
}
- progress->SetPosition(batteryimage->GetX() + 7, batteryimage->GetY() + 6, 30, 18);
- progress->SetValidWidth(30);
- progress->SetValidHeight(18);
+ progress->SetPosition(batteryimage->GetX() + 5, batteryimage->GetY() + 4, 18, 12);
+ progress->SetValidWidth(18);
+ progress->SetValidHeight(12);
progress->SetRange(100, 0);
progress->SetStyle(STYLE_BORDER_RADIUS, 3);
progress->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 0x00);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryLabel new fail");
return nullptr;
}
- batteryLabel->SetPosition(batteryimage->GetX() + 58, (group1->GetHeight() - 28) / 2, 30, 28);
- batteryLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 25);
+ batteryLabel->SetPosition(batteryimage->GetX() + 38, (group1->GetHeight() - 14) / 2, 30, 30);
+ batteryLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 15);
batteryLabel->SetText("100");
batteryLabel->SetStyle(STYLE_TEXT_COLOR, Color::White().full);
batteryLabel->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_LEFT);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "chargeBatteryicon creation failed");
return nullptr;
}
- chargeBatteryicon->SetPosition(progress->GetX() + 6, batteryimage->GetY() + 2, 17, 26);
- chargeBatteryicon->SetSrc("/user/res/Icon.bin");
chargeBatteryicon->SetAutoEnable(false);
+ chargeBatteryicon->SetPosition(progress->GetX() + 5, batteryimage->GetY() + 3, 9, 13);
+ chargeBatteryicon->SetSrc("/user/res/Icon.bin");
chargeBatteryicon->SetResizeMode(UIImageView::CONTAIN);
chargeBatteryicon->SetVisible(false);
group1->Add(chargeBatteryicon);
g_otaCountdownTimer = nullptr;
}
}
-
+ void ThunderBirdModel::StopOtaCountdown(void)
+ {
+ if (g_otaCountdownTimer != nullptr)
+ {
+ osTimerStop(g_otaCountdownTimer);
+ osTimerDelete(g_otaCountdownTimer);
+ g_otaCountdownTimer = nullptr;
+ }
+ g_otaCountdownValue = 0;
+ }
+
+
// ---------------------- 通用计时加一定时器(0 -> targetSeconds,每步1秒) ----------------------
static osTimerId_t g_countUpTimer = nullptr;
static int g_countUpTargetSeconds = 0;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdOtaView::group null!");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
BackGround = new UIImageView();
if (BackGround)
{
BackGround->SetAutoEnable(false);
- BackGround->SetPosition(0, 0, 466, 466);
- BackGround->SetSrc("/user/res/RebootAndShutDown/ReBoot/4.bin");
+ BackGround->SetPosition(0, 0, 360, 360);
+ BackGround->SetSrc("/user/res/yellowbg.bin");
BackGround->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
BackGround->SetResizeMode(UIImageView::CONTAIN);
BackGround->SetVisible(false);
TextLabel = new UILabelExt();
if (TextLabel)
{
- TextLabel->SetPosition(0, 104, 466, 48);
+ TextLabel->SetPosition(0, 104, 360, 48);
TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34);
+ TextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ TextLabel->SetStyle(STYLE_LINE_SPACE, 10);
+ //TextLabel->SetStyle(STYLE_LETTER_SPACE, 1);
TextLabel->SetVisible(false);
group->Add(TextLabel);
}
LittleTextLabel = new UILabelExt();
if (LittleTextLabel)
{
- LittleTextLabel->SetPosition(0, 180, 466, 40);
+ LittleTextLabel->SetPosition(0, 180, 360, 40);
LittleTextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- LittleTextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 34);
+ LittleTextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
LittleTextLabel->SetVisible(false);
group->Add(LittleTextLabel);
}
RemindLabel = new UILabelExt();
if (RemindLabel)
{
- RemindLabel->SetPosition(0, 180, 466, 40);
+ RemindLabel->SetPosition(0, 180, 360, 40);
RemindLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);
+ RemindLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindLabel->SetVisible(false);
group->Add(RemindLabel);
}
{
RemindIcon->SetAutoEnable(false);
RemindIcon->SetVisible(false);
+ RemindIcon->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon);
}
RemindIcon2 = new UIImageView();
{
RemindIcon2->SetAutoEnable(false);
RemindIcon2->SetVisible(false);
+ RemindIcon2->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon2);
}
RemindIcon3 = new UIImageView();
{
RemindIcon3->SetAutoEnable(false);
RemindIcon3->SetVisible(false);
+ RemindIcon3->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon3);
}
VolumeProgress = new UIBoxProgress();
if (LittleTextLabel)
{
LittleTextLabel->SetVisible(false);
- LittleTextLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+ TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);
LittleTextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
LittleTextLabel->SetRollSpeed(35);
- LittleTextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);
+ LittleTextLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
}
if (LittleTextLabel_2) { LittleTextLabel_2->SetVisible(false);}
if (RemindLabel) { RemindLabel->SetVisible(false);}
if (RemindIcon2) { RemindIcon2->SetVisible(false); }
if (RemindIcon3) { RemindIcon3->SetVisible(false); }
if (VolumeProgress) { VolumeProgress->SetVisible(false); }
+ ThunderBirdModel::GetInstance()->StopOtaCountdown();
switch (showView)
{
case THUNDERBIRD_OTAVIEW_NORMAL:
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
if (TextLabel)
{
TextLabel->SetPosition(90, 102, 180, 84);
- TextLabel->SetText(" 设定成功! 记得充好电哦");
+ TextLabel->SetText("设定成功!\n记得充好电哦");
TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
TextLabel->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(38, 127, 36, 36);
+ RemindIcon2->SetPosition(38, 124, 36, 36);
RemindIcon2->SetSrc("/user/res/warning.bin");
RemindIcon2->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
if (RemindIcon3)
{
- RemindIcon3->SetPosition(68, 127, 36, 36);
+ RemindIcon3->SetPosition(68, 124, 36, 36);
RemindIcon3->SetSrc("/user/res/warning.bin");
RemindIcon3->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
if (RemindIcon3)
{
- RemindIcon3->SetPosition(38, 127, 36, 36);
+ RemindIcon3->SetPosition(38, 124, 36, 36);
RemindIcon3->SetSrc("/user/res/warning.bin");
RemindIcon3->SetVisible(true);
}
{
if (TextLabel)
{
- TextLabel->SetPosition(90, 108, 120, 42);
- TextLabel->SetText("更新中");
+ TextLabel->SetPosition(90, 108, 180, 82);
+ TextLabel->SetText("更新中\n请勿关闭设备");
TextLabel->SetVisible(true);
}
if (VolumeProgress)
}
if (RemindLabel)
{
- RemindLabel->SetPosition(198, 246, 106, 22);
- RemindLabel->SetText("更新预计需要5分钟");
+ RemindLabel->SetPosition(170, 246, 150, 22);
+ RemindLabel->SetText("更新还需5分钟");
RemindLabel->SetVisible(true);
}
break;
{
if (TextLabel)
{
- TextLabel->SetPosition(142, 122, 164, 42);
+ TextLabel->SetPosition(127, 122, 164, 42);
TextLabel->SetText("更新成功");
TextLabel->SetVisible(true);
}
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(98, 125, 36, 36);
+ RemindIcon2->SetPosition(98, 124, 36, 36);
RemindIcon2->SetSrc("/user/res/completed.bin");
RemindIcon2->SetVisible(true);
}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(104, 277, 22, 22);
+ RemindIcon->SetPosition(105, 276, 22, 22);
RemindIcon->SetSrc("/user/res/volume_down.bin");
RemindIcon->SetVisible(true);
}
if (RemindIcon2)
{
- RemindIcon2->SetPosition(216, 277, 22, 22);
+ RemindIcon2->SetPosition(211, 276, 22, 22);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
if (RemindIcon3)
{
- RemindIcon3->SetPosition(83, 125, 36, 36);
+ RemindIcon3->SetPosition(83, 124, 36, 36);
RemindIcon3->SetSrc("/user/res/completed.bin");
RemindIcon3->SetVisible(true);
}
#include "broadcast_service.h"
#include "samgr_lite.h"
#include "service_id_define.h"
+#include "dock/input_device.h"
namespace OHOS
{
+ static int i=0;//版本临时变量
REGIST_SLICE(VIEW_THUNDER_BIRD, ThunderBirdMainView, ThunderBirdPresenter);
ThunderBirdPresenter::ThunderBirdPresenter()
{
+ NativeAbility::GetInstance().SetDefaultSliceId(VIEW_THUNDER_BIRD);
g_pThunderBirdPresenter = this;
}
return g_pThunderBirdPresenter;
}
- void ThunderBirdPresenter::PublishEvent(uint16_t topic, uint8_t *data, uint32_t size)
- {
- int32 ret;
- BroadcastApi *broadcastApi = nullptr;
- IUnknown *api = nullptr;
-
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter::PublishEvent topic=%u!!", topic);
-
- void *publishData = nullptr;
- if (size > 0 && data != nullptr)
- {
- publishData = malloc(size);
- if (publishData == nullptr)
- {
- return;
- }
- ret = memcpy_s(publishData, size, (const void *)data, size);
- if (ret != EOK)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PublishEvent memcpy_s fail! ret = %d", ret);
- free(publishData);
- return;
- }
- }
-
- Request request = {
- .msgId = topic,
- .len = size,
- .msgValue = 0,
- .data = publishData,
- };
-
- /* public request */
- api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME);
- if (api == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetFeatureApi failed");
- free(publishData);
- return;
- }
- ret = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi);
- if (ret != 0 || broadcastApi == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "QueryInterface failed");
- free(publishData);
- return;
- }
- broadcastApi->PublishTopic((IUnknown *)broadcastApi, &request);
- broadcastApi->Release((IUnknown *)broadcastApi);
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PublishEvent end!!");
- }
+
void ThunderBirdPresenter::OnStart()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter::OnKeyAct");
uint16_t keyID = event.GetKeyId();
uint16_t keyState = event.GetState();
- // 如果是power键就返回上一级
- if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0)
+
+ // 长按关机键
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER) &&
+ keyState == InputDevice::STATE_LONG_PRESS)
{
+ NativeAbility::GetInstance().SwitchSlice(VIEW_REBOOT);
+ return true;
+ }
+ /*************************power键*************************/
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0)
+ {
int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView();
int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView();
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "currentView = %d, currentSubView = %d", currentView, currentSubView);
- // 音量界面:电源键 +10
- if (currentView == THUNDERBIRD_DIALOGUEVIEW)
+ i++;
+ if(i == 1)
+ {
+ ThunderBirdMainView::GetInstance()->SwitchHair("/user/res/hair/Classic/blue.bin");
+ }
+ else if(i == 2)
+ {
+ ThunderBirdMainView::GetInstance()->SwitchHair("/user/res/hair/Classic/curly_hair.bin");
+ }
+ else if(i == 3)
+ {
+ ThunderBirdMainView::GetInstance()->SwitchHair("/user/res/hair/SidePartingShort/purple.bin");
+ }
+ else if(i == 4)
+ {
+ ThunderBirdMainView::GetInstance()->SwitchHair("/user/res/hair/Bangs/gold.bin");
+ }
+ else if(i == 5)
+ {
+ ThunderBirdMainView::GetInstance()->SwitchVideo("/user/video/Angry.mp4");
+ }
+ return true;
+
+ }
+ /*************************语音键*************************/
+ if(keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC) && keyState == 1 && uapi_get_screen_state() == 0)
+ {
+ int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView();
+ int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView();
+
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING);
+
+
+ }
+
+ /*************************VENDOR_UP键*************************/
+ if (keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_VENDOR_UP) && uapi_get_screen_state() == 0)
+ {
+ static bool s_vendorUpPressed = false;
+ if (keyState == InputDevice::STATE_PRESS) {
+ if (s_vendorUpPressed) {
+ return true;
+ }
+ s_vendorUpPressed = true;
+ } else if (keyState == InputDevice::STATE_RELEASE) {
+ s_vendorUpPressed = false;
+ return true;
+ } else {
+ return true;
+ }
+ int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView();
+ int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView();
+ // 音量界面:FUNC 键 -10
+ if (currentView == THUNDERBIRD_DIALOGUEVIEW ||
+ (currentView == THUNDERBIRD_LULLABYVIEW &&
+ (currentSubView == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1 ||
+ currentSubView == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_4))) //只有在对话界面还有哄睡界面才触发
{
- ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000);
ThunderBirdMainView::GetInstance()->ChangeThunderBirdReminderView(THUNDERBIRD_REMINDERVIEW);//不走ChangeView
- // if (ThunderBirdReminderView::GetInstance())
- // {
- // ThunderBirdReminderView::GetInstance()->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME);
- // ThunderBirdReminderView::GetInstance()->AdjustRemindProgress(10);
- // ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000);
- // }
if (ThunderBirdReminderView::GetInstance())
{
- ThunderBirdReminderView::GetInstance()->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT);
- }
-
+ ThunderBirdModel::GetInstance()->StartReminderHideTimer(1000);
+ ThunderBirdReminderView::GetInstance()->Show(ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME);
+ ThunderBirdReminderView::GetInstance()->AdjustRemindProgress(10);
+
+ }
return true;
}
- // 引导界面导航
- if(currentView == THUNDERBIRD_GUIDEVIEW)
+ // 引导界面导航
+ else if(currentView == THUNDERBIRD_GUIDEVIEW)
+ {
+ if(currentSubView == ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_1)
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_2);
+ }
+ else if(currentSubView == ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_2)
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL);
+ }
+ // else if(currentSubView == ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3)
+ // {
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL);
+ // }
+ return true;
+ }
+ // 对话界面导航
+ else if(currentView == THUNDERBIRD_DIALOGUEVIEW)
{
- if(currentSubView == ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_1)
+ if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING) // 说话中
{
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_2);
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING);
}
- else if(currentSubView == ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_2)
+ else if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING) // 聆听中
{
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_GUIDEVIEW, ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3);
+
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
}
- else if(currentSubView == ThunderBirdGuideView::THUNDERBIRD_GUIDEVIEW_3)
+ else if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW) // 状态展示
{
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL);
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME);
}
+ return true;
}
-
- // OTA界面导航
- else if(currentView == THUNDERBIRD_OTAVIEW)
- {
- if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL) // 有新功能
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_OBVIOUS);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_OBVIOUS) // 需要立即更新
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_NOW);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_NOW) // 设置夜间更新
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE) // 设置夜间更新成功
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS) // 更新倒计时
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_COUNTDOWN);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_COUNTDOWN) // 电量不足
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_LOW_BATTERY);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_LOW_BATTERY) // 网络异常
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NETWORK_ERROR);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NETWORK_ERROR) // 内存不足
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_MEMORY_ERROR);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_MEMORY_ERROR) // 内存不足
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS) // 更新成功
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED) // 更新失败
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1);
- }
- else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATING) // 更新中
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS);
- }
- }
-
- // 哄睡界面导航
+ // OTA界面导航
+ else if(currentView == THUNDERBIRD_OTAVIEW)
+ {
+ if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL) // 有新功能
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_OBVIOUS);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_OBVIOUS) // 需要立即更新
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_NOW);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_NOW) // 设置夜间更新
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS);
+ }
+
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE) // 设置夜间更新
+ {
+ // if(uapi_get_battery_level() > 50)//获取电量
+ // {
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS);
+ // }
+ // else
+ // {
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_LOW_BATTERY);
+ // }
+ // if(uapi_get_network_state() == 1)//获取网络状态
+ // {
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS);
+ // }
+ // else
+ // {
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NETWORK_ERROR);
+ // }
+ // if(uapi_get_memory_state() == 1)//获取内存状态
+ // {
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS);
+ // }
+ // else
+ // {
+ // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS);
+ // }
+
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS) // 更新倒计时
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_COUNTDOWN);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_COUNTDOWN) // 更新倒计时
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATING);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATING) // 更新中
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS) // 更新成功
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED) // 更新失败
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1);
+ }
+ return true;
+ }
+ // 哄睡界面导航
else if(currentView == THUNDERBIRD_LULLABYVIEW)
{
if(currentSubView == ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1)
// 返回主界面
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING);
}
+ return true;
}
- // 对话界面导航
- else if(currentView == THUNDERBIRD_DIALOGUEVIEW)
- {
- if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING) // 说话中
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING);
- }
- else if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_LISTENING) // 聆听中
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW);
- }
- else if(currentSubView == ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_STATUS_SHOW) // 状态展示
- {
- // 返回主界面
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME);
- }
- }
- // 提醒界面导航
- else if(currentView == THUNDERBIRD_REMINDERVIEW)
- {
- if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME) // 音量调节
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER);
- }
- else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER) // 事项提醒
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT);
- }
- else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT) // 网络断开
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_LOW_BATTERY);
- }
- else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_LOW_BATTERY) // 电量不足
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGING);
- }
- else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGING) // 充电中
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE);
- }
- else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE) // 充电完成
- {
- // 返回主界面
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_BIND_SUCCESS);
- }
- }
- // 调节界面导航
- else if(currentView == THUNDERBIRD_ADJUSTVIEW)
- {
- if(currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_BIND_SUCCESS) // 绑定成功
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING);
- }
- else if(currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING) // 异常警告
- {
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING);
- }
- else if(currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING) // 网络连接中
- {
- // ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_SHUTDOWNVIEW, 0);
- ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_SHUTDOWNTESTVIEW, -1);
- }
- }
+ // 提醒界面导航
+ else if(currentView == THUNDERBIRD_REMINDERVIEW)
+ {
+ if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_VOLUME) // 音量调节
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER);
+ }
+ else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_TASK_REMINDER) // 事项提醒
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT);
+ }
+ else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_NETWORK_DISCONNECT) // 网络断开
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_LOW_BATTERY);
+ }
+ else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_LOW_BATTERY) // 电量不足
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGING);
+ }
+ else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGING) // 充电中
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_REMINDERVIEW, ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE);
+ }
+ else if(currentSubView == ThunderBirdReminderView::THUNDERBIRD_REMINDERVIEW_CHARGE_COMPLETE) // 充电完成
+ {
+ // 返回主界面
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_BIND_SUCCESS);
+ }
+ return true;
+ }
+ // 调节界面导航
+ else if(currentView == THUNDERBIRD_ADJUSTVIEW)
+ {
+ if(currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_BIND_SUCCESS) // 绑定成功
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING);
+ }
+ else if(currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_WARNING) // 异常警告
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_ADJUSTVIEW, ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING);
+ }
+ else if(currentSubView == ThunderBirdAdjustView::THUNDERBIRD_ADJUSTVIEW_NETWORK_CONNECTING) // 网络连接中
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_SHUTDOWNVIEW, 0);
+ //ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_SHUTDOWNTESTVIEW, -1);
+ }
+ return true;
+ }
+ return true;
}
- if(keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC) && keyState == 1 && uapi_get_screen_state() == 0)
+ /*************************VENDOR_DOWN键*************************/
+ if(keyID == static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_VENDOR_DOWN) && keyState == 1 && uapi_get_screen_state() == 0)
{
int16_t currentView = ThunderBirdMainView::GetInstance()->GetCurrentView();
int16_t currentSubView = ThunderBirdMainView::GetInstance()->GetCurrentSubView();
}
return true;
}
- // // 发布OTA升级事件,显示OTA升级弹窗
- // PublishEvent(TOPIC_EVENT_OTA_UPDATE, nullptr, 0);
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdPresenter: Published OTA update event");
-
- // // 原有的视频切换功能
- // ThunderBirdMainView::GetInstance()->SwitchVideo("/user/video/46x46_shocked.mp4");
+ if(currentView == THUNDERBIRD_OTAVIEW)
+ {
+ if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NORMAL || currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_OBVIOUS
+ ) // 可选升级退出进入是否设置夜间更新
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE) // 夜间更新退出返回原任务
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_NOW);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE) // 设置夜间更新成功
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_NIGHT_UPDATE_SUCCESS) // 更新倒计时
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_COUNTDOWN);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_COUNTDOWN) // 电量不足
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_LOW_BATTERY);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS) // 更新成功
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_FAILED) // 更新失败
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_LULLABYVIEW, ThunderBirdLullabyView::THUNDERBIRD_LULLABYVIEW_1);
+ }
+ else if(currentSubView == ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATING) // 更新中
+ {
+ ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_OTAVIEW, ThunderBirdOtaView::THUNDERBIRD_OTAVIEW_UPDATE_SUCCESS);
+ }
+ }
}
+
return true;
}
+}
-}
\ No newline at end of file
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdReminderView::group null!");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
group->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
// 公共控件
if (TextLabel)
{
TextLabel->SetVisible(false);
+ TextLabel->SetStyle(STYLE_LINE_SPACE, 10);
+ TextLabel->SetStyle(STYLE_LETTER_SPACE, 1);
group->Add(TextLabel);
}
if(RemindLabel)
{
RemindIcon->SetAutoEnable(false);
RemindIcon->SetVisible(false);
+ RemindIcon->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon);
}
RemindIcon2 = new UIImageView();
{
RemindIcon2->SetAutoEnable(false);
RemindIcon2->SetVisible(false);
+ RemindIcon2->SetResizeMode(UIImageView::CONTAIN);
group->Add(RemindIcon2);
}
VolumeProgress = new UIBoxProgress();
void ThunderBirdReminderView::Show(int16_t showView)
{
if (group == nullptr) { return; }
- if (TextLabel) { TextLabel->SetVisible(false); }
+ if (TextLabel) { TextLabel->SetVisible(false); TextLabel->SetLineBreakMode(UILabel::LINE_BREAK_ELLIPSIS);}
if (RemindLabel) { RemindLabel->SetVisible(false); }
if (RemindButton) { RemindButton->SetVisible(false); }
if (RemindIcon) { RemindIcon->SetVisible(false); RemindIcon->SetStyle(STYLE_BACKGROUND_OPA, 0x00);}
}
if (RemindIcon)
{
- RemindIcon->SetPosition(57, 67, 36, 36);
+ RemindIcon->SetPosition(57, 64, 36, 36);
RemindIcon->SetSrc("/user/res/notification.bin");
RemindIcon->SetVisible(true);
}
{
RemindButton->SetPosition(102, 114, 168, 40);
RemindButton->SetText("按 关闭通知");
- RemindButton->SetLabelPosition(16, 6);
+ RemindButton->SetLabelPosition(4, 2);
RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindButton->SetVisible(true);
}
{
RemindButton->SetPosition(99, 114, 185, 59);
RemindButton->SetText("网络已断开");
- RemindButton->SetLabelPosition(69, 16);
+ RemindButton->SetLabelPosition(69, 0);
RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindButton->SetVisible(true);
}
{
if (RemindButton)
{
- RemindButton->SetPosition(103, 114, 185, 40);
- RemindButton->SetLabelPosition(46, 6);
+ RemindButton->SetPosition(87, 114, 185, 40);
+ RemindButton->SetText("电量不足20%");
+ RemindButton->SetLabelPosition(40, 0);
RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindButton->SetVisible(true);
}
if (RemindIcon)
{
RemindIcon->SetPosition(103, 122, 23, 23);
- RemindIcon->SetSrc("/user/res/no_network.bin");
+ RemindIcon->SetSrc("/user/res/low_battery.bin");
RemindIcon->SetVisible(true);
}
if(RemindLabel)
{
if (ThunderBirdMainView::GetInstance()->Batteryvalue <= 20 && ThunderBirdMainView::GetInstance()->Batteryvalue > 10)
{
- RemindButton->SetText(" 电量不足20%");
+ RemindButton->SetText("电量不足20%");
}
else if (ThunderBirdMainView::GetInstance()->Batteryvalue <= 10 && ThunderBirdMainView::GetInstance()->Batteryvalue > 5)
{
- RemindButton->SetText(" 电量不足10%");
+ RemindButton->SetText("电量不足10%");
}
else if (ThunderBirdMainView::GetInstance()->Batteryvalue <= 5)
{
- RemindButton->SetText(" 电量不足5%");
+ RemindButton->SetText("电量不足5%");
}
}
{
RemindButton->SetPosition(119, 116, 121, 40);
RemindButton->SetText("充电中");
- RemindButton->SetLabelPosition(46, 6);
+ RemindButton->SetLabelPosition(40, 0);
RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindButton->SetVisible(true);
}
if (RemindIcon)
{
RemindIcon->SetPosition(135, 124, 23, 23);
- RemindIcon->SetSrc("/user/res/no_network.bin");
+ RemindIcon->SetSrc("/user/res/charging.bin");
RemindIcon->SetVisible(true);
}
break;
{
RemindButton->SetPosition(109, 116, 141, 40);
RemindButton->SetText("充电完成");
- RemindButton->SetLabelPosition(46, 6);
+ RemindButton->SetLabelPosition(40, 0);
RemindButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
RemindButton->SetVisible(true);
}
if (RemindIcon)
{
RemindIcon->SetPosition(125, 124, 23, 23);
- RemindIcon->SetSrc("/user/res/no_network.bin");
+ RemindIcon->SetSrc("/user/res/charged.bin");
RemindIcon->SetVisible(true);
}
if(RemindLabel)
{
RemindLabel->SetPosition(132, 296, 96, 28);
- RemindLabel->SetText("按 确认");
+ RemindLabel->SetText("按 确认");
RemindLabel->SetVisible(true);
}
if(RemindIcon2)
{
- RemindIcon2->SetPosition(158, 298, 24, 24);
+ RemindIcon2->SetPosition(156, 294, 24, 24);
RemindIcon2->SetSrc("/user/res/volume_up.bin");
RemindIcon2->SetVisible(true);
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownTestView group new fail");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
if (!EnsureAnimator())
{
return nullptr;
}
group->Add(animator);
iconView = new UIImageView();
- iconView->SetPosition(0, 0, 466, 466);
+ iconView->SetPosition(0, 0, 360, 360);
iconView->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
iconView->SetStyle(STYLE_BACKGROUND_OPA, 0x66);
iconView->SetVisible(false);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdShutdownView group new fail");
return nullptr;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 360, 360);
if (!EnsureAnimator())
{
return nullptr;
ZLITE_KEY_AUDIO = ZLITE_KEY_CAT(FUNCTION, 0x2A),
ZLITE_KEY_HOME = ZLITE_KEY_CAT(FUNCTION, 0x3F),
ZLITE_KEY_FUNC = ZLITE_KEY_CAT(FUNCTION, 0x100),
+#ifdef BOARD_LEINIAO
+ /* leiniao */
+ ZLITE_KEY_VENDOR_UP = ZLITE_KEY_CAT(FUNCTION, 0x110),
+ ZLITE_KEY_VENDOR_DOWN = ZLITE_KEY_CAT(FUNCTION, 0x111),
+#endif
};
}
#endif
\ No newline at end of file
#include "custom_utils.h"
#include "components/ui_image_animator.h"
#include "wearable_log.h"
+#include "UiConfig.h"
#ifdef SUPPORT_CUSTOM_UI_COMPONENT
#include "uicomponents/UIComponents.h"
#endif
#elif defined(BOARD_LEINIAO)
static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; // 开机图片路径
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 57; // 图片帧数
+static const char *TB_REBOOT_PATHS[REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES] = {
+ OHOS::TB_REBOOT_IMAGE_1, OHOS::TB_REBOOT_IMAGE_2, OHOS::TB_REBOOT_IMAGE_3, OHOS::TB_REBOOT_IMAGE_4, OHOS::TB_REBOOT_IMAGE_5,
+ OHOS::TB_REBOOT_IMAGE_6, OHOS::TB_REBOOT_IMAGE_7, OHOS::TB_REBOOT_IMAGE_8, OHOS::TB_REBOOT_IMAGE_9, OHOS::TB_REBOOT_IMAGE_10,
+ OHOS::TB_REBOOT_IMAGE_11, OHOS::TB_REBOOT_IMAGE_12, OHOS::TB_REBOOT_IMAGE_13, OHOS::TB_REBOOT_IMAGE_14, OHOS::TB_REBOOT_IMAGE_15,
+ OHOS::TB_REBOOT_IMAGE_16, OHOS::TB_REBOOT_IMAGE_17, OHOS::TB_REBOOT_IMAGE_18, OHOS::TB_REBOOT_IMAGE_19, OHOS::TB_REBOOT_IMAGE_20,
+ OHOS::TB_REBOOT_IMAGE_21, OHOS::TB_REBOOT_IMAGE_22, OHOS::TB_REBOOT_IMAGE_23, OHOS::TB_REBOOT_IMAGE_24, OHOS::TB_REBOOT_IMAGE_25,
+ OHOS::TB_REBOOT_IMAGE_26, OHOS::TB_REBOOT_IMAGE_27, OHOS::TB_REBOOT_IMAGE_28, OHOS::TB_REBOOT_IMAGE_29, OHOS::TB_REBOOT_IMAGE_30,
+ OHOS::TB_REBOOT_IMAGE_31, OHOS::TB_REBOOT_IMAGE_32, OHOS::TB_REBOOT_IMAGE_33, OHOS::TB_REBOOT_IMAGE_34, OHOS::TB_REBOOT_IMAGE_35,
+ OHOS::TB_REBOOT_IMAGE_36, OHOS::TB_REBOOT_IMAGE_37, OHOS::TB_REBOOT_IMAGE_38, OHOS::TB_REBOOT_IMAGE_39, OHOS::TB_REBOOT_IMAGE_40,
+ OHOS::TB_REBOOT_IMAGE_41, OHOS::TB_REBOOT_IMAGE_42, OHOS::TB_REBOOT_IMAGE_43, OHOS::TB_REBOOT_IMAGE_44, OHOS::TB_REBOOT_IMAGE_45,
+ OHOS::TB_REBOOT_IMAGE_46, OHOS::TB_REBOOT_IMAGE_47, OHOS::TB_REBOOT_IMAGE_48, OHOS::TB_REBOOT_IMAGE_49, OHOS::TB_REBOOT_IMAGE_50,
+ OHOS::TB_REBOOT_IMAGE_51, OHOS::TB_REBOOT_IMAGE_52, OHOS::TB_REBOOT_IMAGE_53, OHOS::TB_REBOOT_IMAGE_54, OHOS::TB_REBOOT_IMAGE_55,
+ OHOS::TB_REBOOT_IMAGE_56, OHOS::TB_REBOOT_IMAGE_57,
+};
+
#else
static constexpr const char *ReBootPaths = "/user/res/RebootAndShutDown/ReBoot/"; // 开机图片路径
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES = 36; // 图片帧数
static OHOS::ImageAnimatorInfo ReBootImageInfo[REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 开机图像的信息
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_X = 0;
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_Y = 0;
+#ifdef BOARD_LEINIAO
+ static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_W = 360;
+ static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_H = 360;
+#else
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_W = 466;
static constexpr int16_t REBOOT_IMAGE_ANIMATOR_VIEW_H = 466;
+#endif
const OHOS::ImageInfo **ReBootPathsArray{nullptr}; // 开机图片路径数组
static OHOS::UIImageAnimatorView::AnimatorStopListener *bootStoplistener{nullptr};
static bool boot_animation_flag = false;
bool ShowReBootAnimatorView()
{
-#ifdef SUPPORT_CUSTOM_UI_COMPONENT
+// 优先使用静态路径表(BOARD_LEINIAO),将路径转换为 ImageInfo;否则回退目录生成
+#if defined(BOARD_LEINIAO)
+ const OHOS::ImageInfo **tmpArray = new const OHOS::ImageInfo *[REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES];
+ if (tmpArray == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowReBootAnimatorView: alloc array failed");
+ return false;
+ }
+ for (int i = 0; i < REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
+ {
+ tmpArray[i] = OHOS::ImageCacheManager::GetInstance().LoadSingleRes(TB_REBOOT_PATHS[i]);
+ if (tmpArray[i] == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowReBootAnimatorView: load frame %d failed", i + 1);
+ }
+ }
+ ReBootPathsArray = tmpArray;
+#elif defined(SUPPORT_CUSTOM_UI_COMPONENT)
ReBootPathsArray = OHOS::CreateImageInfoArray(ReBootPaths, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
#endif
ReBootImageInfo[i].width = REBOOT_IMAGE_ANIMATOR_VIEW_W;
ReBootImageInfo[i].height = REBOOT_IMAGE_ANIMATOR_VIEW_H;
}
-#endif
-#if defined(BOARD_LEINIAO)
- ReBootImageAnimatorView->SetAutoEnable(false);
#endif
ReBootImageAnimatorView->SetPosition(REBOOT_IMAGE_ANIMATOR_VIEW_X, REBOOT_IMAGE_ANIMATOR_VIEW_Y, REBOOT_IMAGE_ANIMATOR_VIEW_W, REBOOT_IMAGE_ANIMATOR_VIEW_H);
ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_COLOR, 0xffffffff);
ReBootImageAnimatorView->SetStyle(OHOS::STYLE_BACKGROUND_OPA, 0xff);
ReBootImageAnimatorView->SetImageAnimatorSrc(ReBootImageInfo, REBOOT_IMAGE_ANIMATOR_VIEW_NUM_FRAMES, 100);
#if defined(BOARD_LEINIAO)
+ ReBootImageAnimatorView->SetAutoEnable(false);
ReBootImageAnimatorView->SetResizeMode(OHOS::UIImageView::COVER);
#endif
ReBootImageAnimatorView->SetRepeat(false);
-/*\r
- * Copyright (c) 2022 CompanyNameMagicTag.\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-#include "hals/lite_input_hal.h"\r
-#include "common/input_device_manager.h"\r
-#include "common/key_code.h"\r
-#include "gfx_utils/graphic_log.h"\r
-#include "hals/lite_input_distributer.h"\r
-#include "dock/lite_key_device.h"\r
-#include "dock/lite_touch_device.h"\r
-#include "dock/lite_encoder_device.h"\r
-#include "dfx/dfx_record.h"\r
-\r
-namespace OHOS {\r
-static bool ConvertKeyId(uint16_t indevKey, uint16_t* key)\r
-{\r
- if (indevKey == INDEV_KEY_POWER) {\r
- *key = static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER);\r
- } else if (indevKey == INDEV_KEY_FUNC) {\r
- *key = static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC);\r
- } else {\r
- GRAPHIC_LOGW("Unsupported KeyId.");\r
- return false;\r
- }\r
- return true;\r
-}\r
-\r
-static void EventCallback(InputDevData* data)\r
-{\r
- if (data == nullptr) {\r
- return;\r
- }\r
- RawEvent event = {0};\r
- if (data->type == INDEV_TYPE_TOUCH) {\r
- if (IsShowTPRaw()) {\r
- GRAPHIC_LOGP("TP s: %u, x: %d, y: %d, t: %u", data->state, data->x, data->y,\r
- data->timestamp);\r
- }\r
- event.x = data->x;\r
- event.y = data->y;\r
- event.state = data->state;\r
- event.timestamp = data->timestamp;\r
- event.type = InputDevType::INDEV_TYPE_TOUCH;\r
- } else if (data->type == INDEV_TYPE_ENCODER) {\r
- if (IsShowTPRaw()) {\r
- GRAPHIC_LOGP("Encoder s: %u, rotate: %d, t: %u", data->state,data->rotate, data->timestamp);\r
- }\r
- event.rotate = data->rotate;\r
- event.state = data->state;\r
- event.timestamp = data->timestamp;\r
- event.type = InputDevType::INDEV_TYPE_ENCODER;\r
- } else if (data->type == INDEV_TYPE_KEY) {\r
- if (!ConvertKeyId(data->keyId, &event.keyId)) {\r
- return;\r
- }\r
- event.state = data->state;\r
- event.timestamp = data->timestamp;\r
- event.type = InputDevType::INDEV_TYPE_KEY;\r
- } else {\r
- return;\r
- }\r
- LiteInputDistributer::GetInstance()->SendRawEvent(event);\r
-}\r
-\r
-void LiteInputHal::AddToIndevManager(uint8_t type)\r
-{\r
- InputDevice* dev = nullptr;\r
- if (type == static_cast<uint8_t>(INDEV_TYPE_ENCODER)) {\r
- dev = new LiteEncoderDevice();\r
- } else if (type == static_cast<uint8_t>(INDEV_TYPE_TOUCH)) {\r
- dev = new LiteTouchDevice();\r
- } else if (type == static_cast<uint8_t>(INDEV_TYPE_KEY)) {\r
- dev = new LiteKeyDevice();\r
- }\r
- InputDeviceManager::GetInstance()->Add(dev);\r
-}\r
-\r
-bool LiteInputHal::SetUp()\r
-{\r
- if (InitInputManager(&inputFuncs_) != INPUT_SUCCESS) {\r
- return false;\r
- }\r
- if ((inputFuncs_->ScanInputDevice == nullptr) || (inputFuncs_->RegisterEventCallback == nullptr) ||\r
- (inputFuncs_->UnregisterReportCallback == nullptr) || (inputFuncs_->OpenInputDevice == nullptr) ||\r
- (inputFuncs_->CloseInputDevice == nullptr)) {\r
- DeinitInputManager(inputFuncs_);\r
- GRAPHIC_LOGE("input funcs is nullptr.");\r
- return false;\r
- }\r
- inputDevs_ = inputFuncs_->ScanInputDevice(&inputDevsNum_);\r
- for (uint8_t i = 0; i < inputDevsNum_; i++) {\r
- if (inputFuncs_->RegisterEventCallback(inputDevs_[i], EventCallback) != INPUT_SUCCESS) {\r
- continue;\r
- }\r
- if (inputFuncs_->OpenInputDevice(inputDevs_[i]) != INPUT_SUCCESS) {\r
- inputFuncs_->UnregisterReportCallback(inputDevs_[i]);\r
- continue;\r
- }\r
- AddToIndevManager(inputDevs_[i]);\r
- }\r
- return true;\r
-}\r
-\r
-void LiteInputHal::TearDown()\r
-{\r
- for (uint8_t i = 0; i < inputDevsNum_; i++) {\r
- inputFuncs_->UnregisterReportCallback(inputDevs_[i]);\r
- inputFuncs_->CloseInputDevice(inputDevs_[i]);\r
- }\r
- if (inputDevs_ != nullptr) {\r
- free(inputDevs_);\r
- inputDevs_ = nullptr;\r
- }\r
- DeinitInputManager(inputFuncs_);\r
- inputDevsNum_ = 0;\r
-}\r
+/*
+ * Copyright (c) 2022 CompanyNameMagicTag.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hals/lite_input_hal.h"
+#include "common/input_device_manager.h"
+#include "common/key_code.h"
+#include "gfx_utils/graphic_log.h"
+#include "hals/lite_input_distributer.h"
+#include "dock/lite_key_device.h"
+#include "dock/lite_touch_device.h"
+#include "dock/lite_encoder_device.h"
+#include "dfx/dfx_record.h"
+
+namespace OHOS {
+static bool ConvertKeyId(uint16_t indevKey, uint16_t* key)
+{
+ if (indevKey == INDEV_KEY_POWER) {
+ *key = static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_POWER);
+ } else if (indevKey == INDEV_KEY_FUNC) {
+ *key = static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_FUNC);
+ }
+ #ifdef BOARD_LEINIAO
+ else if (indevKey == 2u) {
+ *key = static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_VENDOR_UP);
+ } else if (indevKey == 3u) {
+ *key = static_cast<uint16_t>(ZliteKeyCode::ZLITE_KEY_VENDOR_DOWN);
+ }
+ #endif
+ else {
+ GRAPHIC_LOGW("Unsupported KeyId: %u", indevKey);
+ return false;
+ }
+ return true;
+}
+
+static void EventCallback(InputDevData* data)
+{
+ if (data == nullptr) {
+ return;
+ }
+ RawEvent event = {0};
+ if (data->type == INDEV_TYPE_TOUCH) {
+ if (IsShowTPRaw()) {
+ GRAPHIC_LOGP("TP s: %u, x: %d, y: %d, t: %u", data->state, data->x, data->y,
+ data->timestamp);
+ }
+ event.x = data->x;
+ event.y = data->y;
+ event.state = data->state;
+ event.timestamp = data->timestamp;
+ event.type = InputDevType::INDEV_TYPE_TOUCH;
+ } else if (data->type == INDEV_TYPE_ENCODER) {
+ if (IsShowTPRaw()) {
+ GRAPHIC_LOGP("Encoder s: %u, rotate: %d, t: %u", data->state,data->rotate, data->timestamp);
+ }
+ event.rotate = data->rotate;
+ event.state = data->state;
+ event.timestamp = data->timestamp;
+ event.type = InputDevType::INDEV_TYPE_ENCODER;
+ } else if (data->type == INDEV_TYPE_KEY) {
+ if (!ConvertKeyId(data->keyId, &event.keyId)) {
+ return;
+ }
+ event.state = data->state;
+ event.timestamp = data->timestamp;
+ event.type = InputDevType::INDEV_TYPE_KEY;
+ } else {
+ return;
+ }
+ LiteInputDistributer::GetInstance()->SendRawEvent(event);
+}
+
+void LiteInputHal::AddToIndevManager(uint8_t type)
+{
+ InputDevice* dev = nullptr;
+ if (type == static_cast<uint8_t>(INDEV_TYPE_ENCODER)) {
+ dev = new LiteEncoderDevice();
+ } else if (type == static_cast<uint8_t>(INDEV_TYPE_TOUCH)) {
+ dev = new LiteTouchDevice();
+ } else if (type == static_cast<uint8_t>(INDEV_TYPE_KEY)) {
+ dev = new LiteKeyDevice();
+ }
+ InputDeviceManager::GetInstance()->Add(dev);
+}
+
+bool LiteInputHal::SetUp()
+{
+ if (InitInputManager(&inputFuncs_) != INPUT_SUCCESS) {
+ return false;
+ }
+ if ((inputFuncs_->ScanInputDevice == nullptr) || (inputFuncs_->RegisterEventCallback == nullptr) ||
+ (inputFuncs_->UnregisterReportCallback == nullptr) || (inputFuncs_->OpenInputDevice == nullptr) ||
+ (inputFuncs_->CloseInputDevice == nullptr)) {
+ DeinitInputManager(inputFuncs_);
+ GRAPHIC_LOGE("input funcs is nullptr.");
+ return false;
+ }
+ inputDevs_ = inputFuncs_->ScanInputDevice(&inputDevsNum_);
+ for (uint8_t i = 0; i < inputDevsNum_; i++) {
+ if (inputFuncs_->RegisterEventCallback(inputDevs_[i], EventCallback) != INPUT_SUCCESS) {
+ continue;
+ }
+ if (inputFuncs_->OpenInputDevice(inputDevs_[i]) != INPUT_SUCCESS) {
+ inputFuncs_->UnregisterReportCallback(inputDevs_[i]);
+ continue;
+ }
+ AddToIndevManager(inputDevs_[i]);
+ }
+ return true;
+}
+
+void LiteInputHal::TearDown()
+{
+ for (uint8_t i = 0; i < inputDevsNum_; i++) {
+ inputFuncs_->UnregisterReportCallback(inputDevs_[i]);
+ inputFuncs_->CloseInputDevice(inputDevs_[i]);
+ }
+ if (inputDevs_ != nullptr) {
+ free(inputDevs_);
+ inputDevs_ = nullptr;
+ }
+ DeinitInputManager(inputFuncs_);
+ inputDevsNum_ = 0;
+}
}
\ No newline at end of file