From: dxy <1731678236@qq.com> Date: Fri, 29 Mar 2024 08:22:16 +0000 (+0800) Subject: 合并代码冲突 X-Git-Tag: release_V1.2.70_20241020_135402~1241^2~22 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=1879cf02b120f0254fbd5a06f12a3a9619611d98;p=mirrors%2FFD230.git 合并代码冲突 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h index 91d856c74..afeb6d973 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayList/AlipayListView.h @@ -18,6 +18,8 @@ #include "components/icon_adapter.h" #include "AlipayPresenter.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "AlipayListAdapter.h" #include "AlipayListItem.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h index b38739a42..c000bc17c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h @@ -19,6 +19,8 @@ #include "components/icon_adapter.h" #include "AlipayPresenter.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "AlipayTransListAdapter.h" #include "AlipayTransListItem.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistModel.h b/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistModel.h index 216ec34bd..435c1910e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistModel.h @@ -18,6 +18,8 @@ #include "bundle_info.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "ohos_types.h" #define APP_MAX_NUM 50 diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp index f282011c4..5cfa7ec02 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp @@ -15,6 +15,8 @@ #include "UiConfig.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "ApplistModel.h" #include "ApplistPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h b/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h index f7c45b95e..fc7bce0ad 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/callerlog/include/CallerLogModel.h @@ -11,6 +11,8 @@ #include "string" #include "PhoneService.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "message.h" #include "msg_center.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp index 209404c63..fafb264c4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "classicbluetooth/include/ClassicBlueToothPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/compass/include/CompassPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/compass/include/CompassPresenter.h index e742c53b6..121b77ae0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/compass/include/CompassPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/compass/include/CompassPresenter.h @@ -13,6 +13,8 @@ #include "ohos_types.h" #include "UiConfig.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "CompassView.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/compass/include/MainCompassPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/compass/include/MainCompassPresenter.h index b3597629b..f2a93867e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/compass/include/MainCompassPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/compass/include/MainCompassPresenter.h @@ -12,6 +12,8 @@ #include "ohos_types.h" #include "UiConfig.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "CompassView.h" #include "CompassPresenter.h" #include "CompassModel.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdatePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdatePresenter.cpp index 674eaee73..152b4471b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdatePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/dialupdate/src/DialUpdatePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "DialViewGroup.h" #include "dialupdate/include/DialUpdatePresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp b/code/sdk/application/wearable/fd230app/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp index 72ea7cf17..e7b06f48d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneView.h b/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneView.h index 6340d3ca0..af94c3cce 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/findphone/include/FindPhoneView.h @@ -5,6 +5,7 @@ #include "View.h" #include "components/ui_view_group.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "components/ui_image_animator.h" #include "components/ui_label_button_ext.h" #include "components/ui_image_view.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhonePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhonePresenter.cpp index 7818faa35..50aeb34f3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhonePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhonePresenter.cpp @@ -6,6 +6,8 @@ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/findphone/src/FindPhonePresenter.cpp */ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "findphone/include/FindPhonePresenter.h" #include "common/key_code.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp b/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp index 124c7b50b..63b086b22 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/key/src/KeyInputListener.cpp @@ -8,6 +8,8 @@ #include "KeyInputListener.h" #include "common/key_code.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "View.h" #include "MainViewSample.h" #include "wearable_log.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp b/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp index 8f9132781..86570cf6c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp @@ -51,8 +51,8 @@ namespace OHOS {"uz", "O‘zbek", "乌兹别克语"}, {"az", "Azərbaycan dili", "阿塞拜疆语"}}; - static const char *en = "user/res/language_config/font/en.lang"; - static const char *zh_CN = "user/res/language_config/font/zh.lang"; + static const char *en = "user/res/font/en.lang"; + static const char *zh_CN = "user/res/font/zh.lang"; static const uint8_t langcount = 2; const char *resFiles[langcount] = {zh_CN, en}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt new file mode 100644 index 000000000..6afdb601f --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_en.txt @@ -0,0 +1,176 @@ +STR_EXERCISE_GENERAL,Exercise general +STR_EXERCISE_FREETRAINING,Free training +STR_EXERCISE_RESISTANCETRAINING,Resistance training +STR_EXERCISE_SPINBIKE,Spin bike +STR_EXERCISE_TREADMILL,Treadmill +STR_EXERCISE_STROLLMACHINE,Stroll machine +STR_EXERCISE_HIIT,High intense interval training +STR_EXERCISE_CROSSFIT,Crossfit +STR_EXERCISE_GROUPCALISTHENICS,Group calisthenics +STR_EXERCISE_YOGA,Yoga +STR_EXERCISE_YOGACAT,Yoga cat +STR_EXERCISE_YOGACOW,Yoga cow +STR_EXERCISE_YOGACOBRA,Yoga cobra +STR_EXERCISE_YOGAHERO1,Yoga hero1 +STR_EXERCISE_YOGAHERO2,Yoga hero2 +STR_EXERCISE_YOGAHERO3,Yoga hero3 +STR_EXERCISE_YOGAROLLING,Yoga rolling +STR_EXERCISE_OUTDOORWALKING,Outdoor walking +STR_EXERCISE_OUTDOORRUNNING,Outdoor running +STR_EXERCISE_INDOORWALKING,Indoor walking +STR_EXERCISE_INDOORRUNNING,Indoor running +STR_EXERCISE_OUTDOORBIKING,Outdoor biking +STR_EXERCISE_JUMPINGROPE,Jumping rope +STR_EXERCISE_PILATES,Pilates +STR_EXERCISE_CROSS_FIT,Cross fit +STR_EXERCISE_FUNCTIONALTRAINING,Functional training +STR_EXERCISE_PHYSICALTRAINING,Physical Training +STR_EXERCISE_TAEKWONDO,Taekwondo +STR_EXERCISE_BOXING,Boxing +STR_EXERCISE_KICKBOXING,Kickboxing +STR_EXERCISE_KARATE,Karate +STR_EXERCISE_FENCING,Fencing +STR_EXERCISE_CORETRAINING,Core training +STR_EXERCISE_BODYCOMBAT,Body Combat +STR_EXERCISE_KENDO,Kendo +STR_EXERCISE_HORIZONTALBAR,Horizontal bar +STR_EXERCISE_PARALLELBARS,Parallel bars +STR_EXERCISE_CROSSFIT,Circuit training +STR_EXERCISE_AEROBICS,Aerobics +STR_EXERCISE_CALISTHENICE,Calisthenice +STR_EXERCISE_P90X,P90X +STR_EXERCISE_KETTLEBELLTRAINING,Kettlebell Training +STR_EXERCISE_MIXEDMARTIALARTS,Mixed martial arts +STR_EXERCISE_STAIRCLIMBINGMACHINE,Stair climbing machine +STR_EXERCISE_WEIGHTLIFTING,Weightlifting +STR_EXERCISE_BARRE,Barre +STR_EXERCISE_HANDCYCLING,Hand cycling +STR_EXERCISE_TRACKFIELD,Track field +STR_EXERCISE_WRESTLING,Wrestling +STR_EXERCISE_MINDBODY,Mind body +STR_EXERCISE_FLEXIBILITY,Flexibility +STR_EXERCISE_MIXEDCARDIO,Mixed cardio +STR_EXERCISE_TRADITIONALSTRENGTHTRAINING,Traditional strength training +STR_EXERCISE_CROSSTRAINING,Cross training +STR_EXERCISE_GYMNASTICS,Gymnastics +STR_EXERCISE_STEPTRAINING,Step training +STR_EXERCISE_ELLIPTICALTRAINER,Elliptical trainer +STR_EXERCISE_ROWINGMACHINE,Rowing machine +STR_DANCING_GENERAL,Dancing general +STR_DANCING_BELLY,Belly dance +STR_DANCING_JAZZ,Jazz dance +STR_DANCING_LATIN,Latin dance +STR_DANCING_BALLET,Ballet dance +STR_DANCING_STREET,Street dance +STR_DANCING_PUBLICSQUARE,Public square dancing +STR_DANCING_ZUMBA,Zumba +STR_DANCING_SOCIALDANCE,Social dance +STR_DANCING_TAPDANCE,Tap dance +STR_RECREATIONAL_SPORTS,Recreational Sports +STR_RECREATIONAL_SKATING,Roller Skating +STR_RECREATIONAL_MARTIALARTS,Martial arts +STR_RECREATIONAL_TAICHI,Tai Chi +STR_RECREATIONAL_HULAHOOP,Hula hoop +STR_RECREATIONAL_DISCSPORT,Disc sport +STR_RECREATIONAL_DARTS,Darts +STR_RECREATIONAL_ARCHERY,Archery +STR_RECREATIONAL_HORSERIDING,Horse riding +STR_RECREATIONAL_BATTLEGAME,Battle game +STR_RECREATIONAL_KITE,Fly a kite +STR_RECREATIONAL_TUGOFWAR,Tug of war +STR_RECREATIONAL_SWING,Swing +STR_RECREATIONAL_STAIRCLIMBING,Stair climbing +STR_RECREATIONAL_OBSTACLERACE,Obstacle race +STR_RECREATIONAL_FISHING,Fishing +STR_RECREATIONAL_HUNTING,Hunting +STR_RECREATIONAL_SCOOTERRIDING,Scooter Riding +STR_RECREATIONAL_PARAGLIDING,Paragliding +STR_RECREATIONAL_TEAMSPORTS,Team sports +STR_RECREATIONAL_FINESSGAMING,Finess gaming +STR_RECREATIONAL_HIKING,Hiking +STR_RECREATIONAL_EQUESTRIANSPORTS,Equestrian sports +STR_RECREATIONAL_PLAY,Play +STR_BALL_GAMES,Ball games +STR_BALL_BADMINTON,Badminton +STR_BALL_TABLETENNIS,Table tennis +STR_BALL_TENNIS,Tennis +STR_BALL_BILLIARDS,Billiards +STR_BALL_BOWLING,Bowling +STR_BALL_VOLLEYBALL,Volleyball +STR_BALL_SHUTTLECOCK,Shuttlecock +STR_BALL_HANDBALL,Handball +STR_BALL_BASEBALL,Baseball +STR_BALL_SOFTBALL,Softball +STR_BALL_CRICKET,Cricket +STR_BALL_FOOTBALL,Football +STR_BALL_BEACHSOCCER,Beach soccer +STR_BALL_BEACHVOLLEYBALL,Beach volleyball +STR_BALL_CROQUET,Croquet +STR_BALL_HOCKEY,Hockey +STR_BALL_SQUASH,Squash +STR_BALL_SEPAKTAKRAW,Sepak takraw +STR_BALL_DODGEBALL,Dodge ball +STR_BALL_BASKETBALL,Basketball +STR_BALL_SOCCER,Soccer +STR_BALL_GOLF,Golf +STR_BALL_POLO,Polo +STR_BALL_RACQUETBALL,Racquetball +STR_BALL_RUGBY,Rugby +STR_BALL_GATEBALL,Gateball +STR_BALL_PICKLEBALL,Pickleball +STR_BALL_LACROSSE,Lacrosse +STR_WATER_ACTIVITIES,Water activities +STR_WATER_SAILING,Sailing +STR_WATER_SURFING,Surfing +STR_WATER_WHITEWATERRAFTING,Whitewater rafting +STR_WATER_CANOEING,Canoeing +STR_WATER_KAYAKING,Kayaking +STR_WATER_ROWING,Rowing +STR_WATER_MOTORBOAT,Motorboat +STR_WATER_SUP,SUP +STR_WATER_SCUBADIVING,Scuba diving +STR_WATER_DIVING,Diving +STR_WATER_KITESURFING,Kitesurfing +STR_WATER_WAKEBOARDING,Wakeboarding +STR_WATER_POLO,Water Polo +STR_WATER_WINDSURFING,Windsurfing +STR_WATER_DRIFTING,Drifting +STR_WATER_FITNESS,Water fitness +STR_WATER_SPORTS,Water sports +STR_WATER_OUTDOORSWIM,Outdoor swim +STR_WATER_INDOORSWIM,Indoor swim +STR_WATER_SWIMFREESTYLE,Swim freestyle +STR_WATER_SWIMBREASTSTROKE,Swim +STR_WATER_SWIMBACKSTROKE,Swim +STR_WATER_SWIMBUTTERFLY,Swim +STR_ICE_SPORTS,Ice sports +STR_ICE_SKATING,Skating +STR_ICE_HOCKEY,Hockey +STR_ICE_CURLING,Curling +STR_ICE_SNOWMOBILING,Snow mobiling +STR_ICE_SLED,Sled +STR_ICE_BIATHLON,Biathlon +STR_ICE_CROSSCOUNTRYSKING,Crosscountry sking +STR_ICE_SKIING,Skiing +STR_ICE_SNOWBOARDING,Snowboarding +STR_ICE_SNOWSHOEING,Snowshoeing +STR_ICE_SNOWSPORTS,Snow sport +STR_EXTREME_SPORTS,Extreme sports +STR_EXTREME_SKATEBOARDING,Skateboarding +STR_EXTREME_ROCKCLIMBING,Rock climbing +STR_EXTREME_BUNGEEJUMPING,Bungee Jumping +STR_EXTREME_PARKOUR,Parkour +STR_EXTREME_BMX,Bike motocross +STR_EXTREME_ORIENTEERING,Orienteering +STR_EXTREME_PARACHUTE,Parachute +STR_EXTREME_RACING,Racing +STR_EXTREME_TRIATHLONS,Triathlons +STR_OTHER_ELEVATOR,Elevator +STR_OTHER_ESCALATOR,Escalator +STR_OTHER_GARDENING,Gardening +STR_OTHER_HORSEWORK,House Work +STR_OTHER_INVEHICLE,In Vehicle +STR_OTHER_MEDITATION,Meditation +STR_OTHER_STILL,Still +STR_OTHER_TILTING,Tilting +STR_OTHER_WHEELCHAIR,Wheelchair diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt new file mode 100644 index 000000000..d8e542222 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/input_list_zh.txt @@ -0,0 +1,176 @@ +STR_EXERCISE_GENERAL,一般锻炼 +STR_EXERCISE_FREETRAINING,自由训练 +STR_EXERCISE_RESISTANCETRAINING,肌力训练 +STR_EXERCISE_SPINBIKE,飞轮车/室内健身车 +STR_EXERCISE_TREADMILL,踏步机 +STR_EXERCISE_STROLLMACHINE,漫步机 +STR_EXERCISE_HIIT,HIIT/高强度间歇训练 +STR_EXERCISE_CROSSFIT,健身 +STR_EXERCISE_GROUPCALISTHENICS,团体操 +STR_EXERCISE_YOGA,瑜珈 +STR_EXERCISE_YOGACAT,瑜珈猫式 +STR_EXERCISE_YOGACOW,瑜珈牛式 +STR_EXERCISE_YOGACOBRA,瑜珈眼镜蛇式 +STR_EXERCISE_YOGAHERO1,瑜珈英雄式1 +STR_EXERCISE_YOGAHERO2,瑜珈英雄式2 +STR_EXERCISE_YOGAHERO3,瑜珈英雄式3 +STR_EXERCISE_YOGAROLLING,瑜珈滚轮 +STR_EXERCISE_OUTDOORWALKING,室外走路 +STR_EXERCISE_OUTDOORRUNNING,室外跑步 +STR_EXERCISE_INDOORWALKING,室内走路 +STR_EXERCISE_INDOORRUNNING,室内跑步 +STR_EXERCISE_OUTDOORBIKING,室外骑行 +STR_EXERCISE_JUMPINGROPE,跳绳 +STR_EXERCISE_PILATES,皮拉提斯 +STR_EXERCISE_CROSS_FIT,混合健身 +STR_EXERCISE_FUNCTIONALTRAINING,功能性训练 +STR_EXERCISE_PHYSICALTRAINING,体能训练 +STR_EXERCISE_TAEKWONDO,跆拳道/踢拳 +STR_EXERCISE_BOXING,拳击 +STR_EXERCISE_KICKBOXING,自由搏击 +STR_EXERCISE_KARATE,空手道 +STR_EXERCISE_FENCING,击剑 +STR_EXERCISE_CORETRAINING,核心训练 +STR_EXERCISE_BODYCOMBAT,拳击有氧 +STR_EXERCISE_KENDO,剑道 +STR_EXERCISE_HORIZONTALBAR,单杠 +STR_EXERCISE_PARALLELBARS,双杠 +STR_EXERCISE_CROSSFIT,循环训练 +STR_EXERCISE_AEROBICS,有氧运动 +STR_EXERCISE_CALISTHENICE,健美操 +STR_EXERCISE_P90X,P90X +STR_EXERCISE_KETTLEBELLTRAINING,壶铃训练 +STR_EXERCISE_MIXEDMARTIALARTS,综合格斗 +STR_EXERCISE_STAIRCLIMBINGMACHINE,爬楼梯机 +STR_EXERCISE_WEIGHTLIFTING,举重 +STR_EXERCISE_BARRE,Barre +STR_EXERCISE_HANDCYCLING,手轮 +STR_EXERCISE_TRACKFIELD,田径 +STR_EXERCISE_WRESTLING,角力 +STR_EXERCISE_MINDBODY,身心运动 +STR_EXERCISE_FLEXIBILITY,柔软操 +STR_EXERCISE_MIXEDCARDIO,混和有氧 +STR_EXERCISE_TRADITIONALSTRENGTHTRAINING,传统肌力训练 +STR_EXERCISE_CROSSTRAINING,交叉训练 +STR_EXERCISE_GYMNASTICS,体操 +STR_EXERCISE_STEPTRAINING,阶梯训练 +STR_EXERCISE_ELLIPTICALTRAINER,椭圆机 +STR_EXERCISE_ROWINGMACHINE,划船机 +STR_DANCING_GENERAL,一般舞蹈 +STR_DANCING_BELLY,肚皮舞 +STR_DANCING_JAZZ,爵士舞 +STR_DANCING_LATIN,拉丁舞 +STR_DANCING_BALLET,芭蕾 +STR_DANCING_STREET,街舞 +STR_DANCING_PUBLICSQUARE,广场舞 +STR_DANCING_ZUMBA,尊巴 +STR_DANCING_SOCIALDANCE,社交舞 +STR_DANCING_TAPDANCE,踢踏舞 +STR_RECREATIONAL_SPORTS,一般休闲运动 +STR_RECREATIONAL_SKATING,滑轮溜冰 +STR_RECREATIONAL_MARTIALARTS,武术 +STR_RECREATIONAL_TAICHI,太极拳 +STR_RECREATIONAL_HULAHOOP,呼拉圈 +STR_RECREATIONAL_DISCSPORT,飞盘 +STR_RECREATIONAL_DARTS,飞镖 +STR_RECREATIONAL_ARCHERY,射箭 +STR_RECREATIONAL_HORSERIDING,骑马 +STR_RECREATIONAL_BATTLEGAME,对战游戏 +STR_RECREATIONAL_KITE,放风筝 +STR_RECREATIONAL_TUGOFWAR,拔河 +STR_RECREATIONAL_SWING,鞦韆 +STR_RECREATIONAL_STAIRCLIMBING,爬楼梯 +STR_RECREATIONAL_OBSTACLERACE,障碍赛 +STR_RECREATIONAL_FISHING,钓鱼 +STR_RECREATIONAL_HUNTING,打猎 +STR_RECREATIONAL_SCOOTERRIDING,滑板车 +STR_RECREATIONAL_PARAGLIDING,滑翔伞 +STR_RECREATIONAL_TEAMSPORTS,团队竞技 +STR_RECREATIONAL_FINESSGAMING,健身电玩 +STR_RECREATIONAL_HIKING,健行 +STR_RECREATIONAL_EQUESTRIANSPORTS,马术运动 +STR_RECREATIONAL_PLAY,玩乐 +STR_BALL_GAMES,一般球类运动 +STR_BALL_BADMINTON,羽毛球 +STR_BALL_TABLETENNIS,乒乓球 +STR_BALL_TENNIS,网球 +STR_BALL_BILLIARDS,撞球 +STR_BALL_BOWLING,保龄球 +STR_BALL_VOLLEYBALL,排球 +STR_BALL_SHUTTLECOCK,毽子球 +STR_BALL_HANDBALL,手球 +STR_BALL_BASEBALL,棒球 +STR_BALL_SOFTBALL,垒球 +STR_BALL_CRICKET,板球 +STR_BALL_FOOTBALL,美式橄榄球 +STR_BALL_BEACHSOCCER,沙滩足球 +STR_BALL_BEACHVOLLEYBALL,沙滩排球 +STR_BALL_CROQUET,槌球 +STR_BALL_HOCKEY,曲棍球 +STR_BALL_SQUASH,英式壁球 +STR_BALL_SEPAKTAKRAW,藤球 +STR_BALL_DODGEBALL,躲避球 +STR_BALL_BASKETBALL,篮球 +STR_BALL_SOCCER,足球 +STR_BALL_GOLF,高尔夫球 +STR_BALL_POLO,马球 +STR_BALL_RACQUETBALL,美式壁球 +STR_BALL_RUGBY,英式橄榄球 +STR_BALL_GATEBALL,门球 +STR_BALL_PICKLEBALL,匹克球 +STR_BALL_LACROSSE,袋棍球 +STR_WATER_ACTIVITIES,一般水上活动 +STR_WATER_SAILING,帆船 +STR_WATER_SURFING,冲浪 +STR_WATER_WHITEWATERRAFTING,泛舟 +STR_WATER_CANOEING,划龙舟 +STR_WATER_KAYAKING,轻艇 +STR_WATER_ROWING,赛艇 +STR_WATER_MOTORBOAT,水上摩托车 +STR_WATER_SUP,立桨冲浪 +STR_WATER_SCUBADIVING,潜水 +STR_WATER_DIVING,跳水 +STR_WATER_KITESURFING,滑翔伞冲浪 +STR_WATER_WAKEBOARDING,冲浪滑水 +STR_WATER_POLO,水球 +STR_WATER_WINDSURFING,风帆冲浪 +STR_WATER_DRIFTING,漂流活动 +STR_WATER_FITNESS,水中健身 +STR_WATER_SPORTS,水上运动 +STR_WATER_OUTDOORSWIM,户外游泳 +STR_WATER_INDOORSWIM,室内游泳 +STR_WATER_SWIMFREESTYLE,游泳_自由式 +STR_WATER_SWIMBREASTSTROKE,游泳_蛙式 +STR_WATER_SWIMBACKSTROKE,游泳_仰式 +STR_WATER_SWIMBUTTERFLY,游泳_蝶式 +STR_ICE_SPORTS,一般冰上运动 +STR_ICE_SKATING,溜冰 +STR_ICE_HOCKEY,冰球 +STR_ICE_CURLING,冰石壶/冰壶 +STR_ICE_SNOWMOBILING,雪上摩托车 +STR_ICE_SLED,雪橇 +STR_ICE_BIATHLON,冬季两项 +STR_ICE_CROSSCOUNTRYSKING,越野滑雪 +STR_ICE_SKIING,滑雪 +STR_ICE_SNOWBOARDING,单板滑雪/滑雪板 +STR_ICE_SNOWSHOEING,雪鞋健行 +STR_ICE_SNOWSPORTS,雪地运动 +STR_EXTREME_SPORTS,一般极限运动 +STR_EXTREME_SKATEBOARDING,滑板 +STR_EXTREME_ROCKCLIMBING,攀岩 +STR_EXTREME_BUNGEEJUMPING,高空弹跳/蹦极活动 +STR_EXTREME_PARKOUR,跑酷 +STR_EXTREME_BMX,BMX +STR_EXTREME_ORIENTEERING,定向越野 +STR_EXTREME_PARACHUTE,跳伞 +STR_EXTREME_RACING,赛车 +STR_EXTREME_TRIATHLONS,铁人三项运动 +STR_OTHER_ELEVATOR,乘电梯 +STR_OTHER_ESCALATOR,乘手扶梯 +STR_OTHER_GARDENING,做园艺 +STR_OTHER_HORSEWORK,做家务 +STR_OTHER_INVEHICLE,在车里 +STR_OTHER_MEDITATION,冥想 +STR_OTHER_STILL,静止 +STR_OTHER_TILTING,倾斜 +STR_OTHER_WHEELCHAIR,坐轮椅移动 \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml new file mode 100644 index 000000000..a59185b7c --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_en.xml @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml new file mode 100644 index 000000000..7bb73555b --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/language_zh.xml @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/languagetool.py b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/languagetool.py new file mode 100644 index 000000000..288bcd2b5 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/languagetool.py @@ -0,0 +1,40 @@ + +import xml.dom.minidom + +# 从外部文件读取列表数据 +def read_list_from_file(file_path): + with open(file_path, "r", encoding="utf-8") as f: + lines = f.readlines() + input_list = [line.strip().split(",") for line in lines] + return input_list + +# 生成 XML 文件 +def generate_xml_from_list(input_list, output_file, lang): + dom = xml.dom.minidom.getDOMImplementation().createDocument(None, "language", None) + root = dom.documentElement + root.setAttribute("id", "language") + root.setAttribute("direct", "ltr") + root.setAttribute("languageinfo", lang) + + for item in input_list: + key = item[0] + value = item[1] + + lanstr_element = dom.createElement("lanstr") + lanstr_element.setAttribute("id", key) + lanstr_element.setAttribute("value", value) + root.appendChild(lanstr_element) + + with open(output_file, "w", encoding="utf-8") as f: + f.write(root.toprettyxml()) + + +# 从外部文件读取不同语言的列表数据 +input_list_en = read_list_from_file("./input_list_en.txt") +input_list_zh = read_list_from_file("./input_list_zh.txt") + +# 生成不同语言的 XML 文件 +generate_xml_from_list(input_list_en, "./language_en.xml", "en") +generate_xml_from_list(input_list_zh, "./language_zh.xml", "zh") + +print("XML文件生成完成。") diff --git "a/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/\345\244\232\345\233\275\350\257\255\350\250\200\345\267\245\345\205\267\350\204\232\346\234\254.md" "b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/\345\244\232\345\233\275\350\257\255\350\250\200\345\267\245\345\205\267\350\204\232\346\234\254.md" new file mode 100644 index 000000000..47d5384b8 --- /dev/null +++ "b/code/sdk/application/wearable/fd230app/nativeui/language/Language_xml/\345\244\232\345\233\275\350\257\255\350\250\200\345\267\245\345\205\267\350\204\232\346\234\254.md" @@ -0,0 +1,65 @@ +## 多国语言工具脚本使用方法 + +### 1.下载打包工具 + +\tools\string_packer 属于DebugKit里面的tool + +同时新建文件夹font + +### 2.下载脚本文件 + +将**【Language_xml】**下载到打包工具里面 + +【Language_xml】文件夹包含: + +```c + languagetool.py: 生成xml脚本 + + language_zh.xml: 中文xml(使用脚本可生成) + + language_eh.xml: 英语xml(使用脚本可生成) + + input_list_zh.txt: 中文语言列表 + 里面可以直接输入键和建值:比如:STR_ICE_SPORTS,冰上运动 + input_list_en.txt: 英语语言列表 (同上) +``` + +### 3.使用方法 + +在\tools\string_packer\Language_xml目录下使用cmd: + +输入以下指令将脚本增加权限: + +``` + icacls languagetool.py /grant Everyone:F +``` + +使用指令运行脚本: + +``` + python languagetool.py +``` + +文件夹里面生成两个xml文件。 + +在**DebugKit**里面 + +选择“system”->"string packer" + +```c +python file: /tools/string_packer/language_trans.py + +File path: /tools/string_packer/Language_xml + +Output Path: /tools/string_packer/font +``` + +点击Execute生成:生成的font文件夹里面的内容**需要同步到代码以及res资源库** + +代码路径:application/wearable/fd230app/nativeui/language/font + +res路径: \FD230\code\sdk\build\config\target_config\brandy\mk_fs_image\fd230\fs\user\res\font + + + +【完成多国语言文件配置】 \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang new file mode 100644 index 000000000..eb687d040 Binary files /dev/null and b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang differ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h new file mode 100644 index 000000000..d0c2d220b --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/font/ui_resource_string.h @@ -0,0 +1,197 @@ +/* +* Copyright (c) xxxxxxxx Technologies Co., Ltd. 2021-2021. All rights reserved. +* Description: language +* Author: Graphic develop team +* Create: 2021-07-06 +*/ + +#ifndef UI_RESOURCE_STRING_H +#define UI_RESOURCE_STRING_H +#include +namespace OHOS { +enum UIResourceTextId : uint16_t { + STR_EXERCISE_GENERAL = 0, + STR_EXERCISE_FREETRAINING = 1, + STR_EXERCISE_RESISTANCETRAINING = 2, + STR_EXERCISE_SPINBIKE = 3, + STR_EXERCISE_TREADMILL = 4, + STR_EXERCISE_STROLLMACHINE = 5, + STR_EXERCISE_HIIT = 6, + STR_EXERCISE_CROSSFIT = 7, + STR_EXERCISE_GROUPCALISTHENICS = 8, + STR_EXERCISE_YOGA = 9, + STR_EXERCISE_YOGACAT = 10, + STR_EXERCISE_YOGACOW = 11, + STR_EXERCISE_YOGACOBRA = 12, + STR_EXERCISE_YOGAHERO1 = 13, + STR_EXERCISE_YOGAHERO2 = 14, + STR_EXERCISE_YOGAHERO3 = 15, + STR_EXERCISE_YOGAROLLING = 16, + STR_EXERCISE_OUTDOORWALKING = 17, + STR_EXERCISE_OUTDOORRUNNING = 18, + STR_EXERCISE_INDOORWALKING = 19, + STR_EXERCISE_INDOORRUNNING = 20, + STR_EXERCISE_OUTDOORBIKING = 21, + STR_EXERCISE_JUMPINGROPE = 22, + STR_EXERCISE_PILATES = 23, + STR_EXERCISE_CROSS_FIT = 24, + STR_EXERCISE_FUNCTIONALTRAINING = 25, + STR_EXERCISE_PHYSICALTRAINING = 26, + STR_EXERCISE_TAEKWONDO = 27, + STR_EXERCISE_BOXING = 28, + STR_EXERCISE_KICKBOXING = 29, + STR_EXERCISE_KARATE = 30, + STR_EXERCISE_FENCING = 31, + STR_EXERCISE_CORETRAINING = 32, + STR_EXERCISE_BODYCOMBAT = 33, + STR_EXERCISE_KENDO = 34, + STR_EXERCISE_HORIZONTALBAR = 35, + STR_EXERCISE_PARALLELBARS = 36, + STR_EXERCISE_AEROBICS = 37, + STR_EXERCISE_CALISTHENICE = 38, + STR_EXERCISE_P90X = 39, + STR_EXERCISE_KETTLEBELLTRAINING = 40, + STR_EXERCISE_MIXEDMARTIALARTS = 41, + STR_EXERCISE_STAIRCLIMBINGMACHINE = 42, + STR_EXERCISE_WEIGHTLIFTING = 43, + STR_EXERCISE_BARRE = 44, + STR_EXERCISE_HANDCYCLING = 45, + STR_EXERCISE_TRACKFIELD = 46, + STR_EXERCISE_WRESTLING = 47, + STR_EXERCISE_MINDBODY = 48, + STR_EXERCISE_FLEXIBILITY = 49, + STR_EXERCISE_MIXEDCARDIO = 50, + STR_EXERCISE_TRADITIONALSTRENGTHTRAINING = 51, + STR_EXERCISE_CROSSTRAINING = 52, + STR_EXERCISE_GYMNASTICS = 53, + STR_EXERCISE_STEPTRAINING = 54, + STR_EXERCISE_ELLIPTICALTRAINER = 55, + STR_EXERCISE_ROWINGMACHINE = 56, + STR_DANCING_GENERAL = 57, + STR_DANCING_BELLY = 58, + STR_DANCING_JAZZ = 59, + STR_DANCING_LATIN = 60, + STR_DANCING_BALLET = 61, + STR_DANCING_STREET = 62, + STR_DANCING_PUBLICSQUARE = 63, + STR_DANCING_ZUMBA = 64, + STR_DANCING_SOCIALDANCE = 65, + STR_DANCING_TAPDANCE = 66, + STR_RECREATIONAL_SPORTS = 67, + STR_RECREATIONAL_SKATING = 68, + STR_RECREATIONAL_MARTIALARTS = 69, + STR_RECREATIONAL_TAICHI = 70, + STR_RECREATIONAL_HULAHOOP = 71, + STR_RECREATIONAL_DISCSPORT = 72, + STR_RECREATIONAL_DARTS = 73, + STR_RECREATIONAL_ARCHERY = 74, + STR_RECREATIONAL_HORSERIDING = 75, + STR_RECREATIONAL_BATTLEGAME = 76, + STR_RECREATIONAL_KITE = 77, + STR_RECREATIONAL_TUGOFWAR = 78, + STR_RECREATIONAL_SWING = 79, + STR_RECREATIONAL_STAIRCLIMBING = 80, + STR_RECREATIONAL_OBSTACLERACE = 81, + STR_RECREATIONAL_FISHING = 82, + STR_RECREATIONAL_HUNTING = 83, + STR_RECREATIONAL_SCOOTERRIDING = 84, + STR_RECREATIONAL_PARAGLIDING = 85, + STR_RECREATIONAL_TEAMSPORTS = 86, + STR_RECREATIONAL_FINESSGAMING = 87, + STR_RECREATIONAL_HIKING = 88, + STR_RECREATIONAL_EQUESTRIANSPORTS = 89, + STR_RECREATIONAL_PLAY = 90, + STR_BALL_GAMES = 91, + STR_BALL_BADMINTON = 92, + STR_BALL_TABLETENNIS = 93, + STR_BALL_TENNIS = 94, + STR_BALL_BILLIARDS = 95, + STR_BALL_BOWLING = 96, + STR_BALL_VOLLEYBALL = 97, + STR_BALL_SHUTTLECOCK = 98, + STR_BALL_HANDBALL = 99, + STR_BALL_BASEBALL = 100, + STR_BALL_SOFTBALL = 101, + STR_BALL_CRICKET = 102, + STR_BALL_FOOTBALL = 103, + STR_BALL_BEACHSOCCER = 104, + STR_BALL_BEACHVOLLEYBALL = 105, + STR_BALL_CROQUET = 106, + STR_BALL_HOCKEY = 107, + STR_BALL_SQUASH = 108, + STR_BALL_SEPAKTAKRAW = 109, + STR_BALL_DODGEBALL = 110, + STR_BALL_BASKETBALL = 111, + STR_BALL_SOCCER = 112, + STR_BALL_GOLF = 113, + STR_BALL_POLO = 114, + STR_BALL_RACQUETBALL = 115, + STR_BALL_RUGBY = 116, + STR_BALL_GATEBALL = 117, + STR_BALL_PICKLEBALL = 118, + STR_BALL_LACROSSE = 119, + STR_WATER_ACTIVITIES = 120, + STR_WATER_SAILING = 121, + STR_WATER_SURFING = 122, + STR_WATER_WHITEWATERRAFTING = 123, + STR_WATER_CANOEING = 124, + STR_WATER_KAYAKING = 125, + STR_WATER_ROWING = 126, + STR_WATER_MOTORBOAT = 127, + STR_WATER_SUP = 128, + STR_WATER_SCUBADIVING = 129, + STR_WATER_DIVING = 130, + STR_WATER_KITESURFING = 131, + STR_WATER_WAKEBOARDING = 132, + STR_WATER_POLO = 133, + STR_WATER_WINDSURFING = 134, + STR_WATER_DRIFTING = 135, + STR_WATER_FITNESS = 136, + STR_WATER_SPORTS = 137, + STR_WATER_OUTDOORSWIM = 138, + STR_WATER_INDOORSWIM = 139, + STR_WATER_SWIMFREESTYLE = 140, + STR_WATER_SWIMBREASTSTROKE = 141, + STR_WATER_SWIMBACKSTROKE = 142, + STR_WATER_SWIMBUTTERFLY = 143, + STR_ICE_SPORTS = 144, + STR_ICE_SKATING = 145, + STR_ICE_HOCKEY = 146, + STR_ICE_CURLING = 147, + STR_ICE_SNOWMOBILING = 148, + STR_ICE_SLED = 149, + STR_ICE_BIATHLON = 150, + STR_ICE_CROSSCOUNTRYSKING = 151, + STR_ICE_SKIING = 152, + STR_ICE_SNOWBOARDING = 153, + STR_ICE_SNOWSHOEING = 154, + STR_ICE_SNOWSPORTS = 155, + STR_EXTREME_SPORTS = 156, + STR_EXTREME_SKATEBOARDING = 157, + STR_EXTREME_ROCKCLIMBING = 158, + STR_EXTREME_BUNGEEJUMPING = 159, + STR_EXTREME_PARKOUR = 160, + STR_EXTREME_BMX = 161, + STR_EXTREME_ORIENTEERING = 162, + STR_EXTREME_PARACHUTE = 163, + STR_EXTREME_RACING = 164, + STR_EXTREME_TRIATHLONS = 165, + STR_OTHER_ELEVATOR = 166, + STR_OTHER_ESCALATOR = 167, + STR_OTHER_GARDENING = 168, + STR_OTHER_HORSEWORK = 169, + STR_OTHER_INVEHICLE = 170, + STR_OTHER_MEDITATION = 171, + STR_OTHER_STILL = 172, + STR_OTHER_TILTING = 173, + STR_OTHER_WHEELCHAIR = 174, + STR_MAX_ID = 175, +}; // UIResourceTextId + +enum FontLanguageId : uint8_t { + LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, + LANGUAGE_ID_MAX +}; // UITextLanguageTextId +} +#endif /* UI_RESOURCE_STRING_H */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang new file mode 100644 index 000000000..a9aa37ad9 Binary files /dev/null and b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang differ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/config.json b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/config.json deleted file mode 100644 index 005a9cbc0..000000000 --- a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "languages": { - "zh": { - "path": "user/res/language_config/font/zh.lang" - }, - "en": { - "path": "user/res/language_config/font/en.lang" - } - }, - "languages_satuas": 0 -} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/en.lang deleted file mode 100644 index a58e4c0b5..000000000 Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/en.lang and /dev/null differ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/ui_resource_string.h deleted file mode 100644 index 309da6b0f..000000000 --- a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/ui_resource_string.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -* Copyright (c) xxxxxxxx Technologies Co., Ltd. 2021-2021. All rights reserved. -* Description: language -* Author: Graphic develop team -* Create: 2021-07-06 -*/ - -#ifndef UI_RESOURCE_STRING_H -#define UI_RESOURCE_STRING_H -#include -namespace OHOS { -enum UIResourceTextId : uint16_t { - STR_IMAGE = 0, - STR_PROGRESSBAR = 1, - STR_SLIDEUNLOCK = 2, - STR_LISTBOX = 3, - STR_BUTTON = 4, - STR_SCROLLVIEW = 5, - STR_SCROLLGRID = 6, - STR_CLOCK = 7, - STR_DISTURBANCE = 8, - STR_BRIGHT = 9, - STR_PHONE = 10, - STR_LANGAGE = 11, - STR_ALARM = 12, - STR_SYSTEM = 13, - STR_SPO2 = 14, - STR_COMPASS = 15, - STR_INDOORWALK = 16, - STR_WEATHER = 17, - STR_SYSTEMSETTING = 18, - STR_MAX_ID = 19, -}; // UIResourceTextId - -enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, - LANGUAGE_ID_EN, - LANGUAGE_ID_MAX -}; // UITextLanguageTextId -} -#endif /* UI_RESOURCE_STRING_H */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/zh.lang b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/zh.lang deleted file mode 100644 index de8ffb0fa..000000000 Binary files a/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/zh.lang and /dev/null differ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/language_en.xml b/code/sdk/application/wearable/fd230app/nativeui/language/language_en.xml deleted file mode 100644 index 7d4baae84..000000000 --- a/code/sdk/application/wearable/fd230app/nativeui/language/language_en.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/language_zh.xml b/code/sdk/application/wearable/fd230app/nativeui/language/language_zh.xml deleted file mode 100644 index 14e03d60f..000000000 --- a/code/sdk/application/wearable/fd230app/nativeui/language/language_zh.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageModel.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageModel.h index 67fa5473b..e2fb6d4ea 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageModel.h @@ -13,6 +13,8 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "MessagePresenter.h" #include "message/include/MessageAdapter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp index 96367990d..8ba26d142 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "message/include/MessagePresenter.h" #include "message/include/MessageAdapter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistModel.cpp index 000fd86e3..23d4f3c44 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistModel.cpp @@ -9,6 +9,8 @@ #include "VocassistView.h" #include "VocassistModel.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_service.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistPresenter.cpp index 71f87d970..a394a59d1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistPresenter.cpp @@ -5,6 +5,8 @@ * Create: 2022-01-18 */ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "VocassistPresenter.h" #include "PlayersModel.h" #include "ui_service.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistView.cpp b/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistView.cpp index 8c58506ed..1780bd66f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/offlinevoice/src/VocassistView.cpp @@ -8,6 +8,8 @@ #include #include "cmsis_os.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "PlayersModel.h" #include "CallerLogModel.h" #include "VocassistModel.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp index 0987a0b0d..62a93c51c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "string" #include "phone/include/PhoneCallPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallingPresenter.cpp index d5d1d01ab..95a17c77a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallingPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "phone/include/PhoneCallingPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallupPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallupPresenter.cpp index afff599d1..300d68352 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallupPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallupPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "phone/include/PhoneCallupPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirPresenter.cpp index d67d46502..bf2466d1b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneDirPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "phone/include/PhoneDirPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhonePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhonePresenter.cpp index 67b84321e..4252bce7b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhonePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhonePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "phone/include/PhonePresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneRingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneRingPresenter.cpp index 0eac68070..38fdf2d7b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneRingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneRingPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "phone/include/PhoneRingPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp index 533e48dd6..35594208d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordDeleteView.h b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordDeleteView.h index 048776003..92fc21842 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordDeleteView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordDeleteView.h @@ -8,6 +8,7 @@ #include "components/ui_image_view.h" #include "components/ui_button.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingPlayerView.h b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingPlayerView.h index e9d0b7819..9a05c2d66 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingPlayerView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/record/include/RecordingPlayerView.h @@ -9,6 +9,7 @@ #include "components/ui_circle_progress.h" #include "components/ui_checkbox.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "components/ui_button.h" #define APP_RES_PATH "/user/res" namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp index 6c7c1dad3..f85bd5561 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp index 208c5830b..3be61c176 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "rotate/include/RotatePresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatPresenter.cpp index 794e9e1da..8732423af 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveBatPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "saveele/include/SaveBatPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveElePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveElePresenter.cpp index da6f4d97e..bf9e632f0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveElePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/saveele/src/SaveElePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "saveele/include/SaveElePresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/screennotify/src/ui_screennotify.cpp b/code/sdk/application/wearable/fd230app/nativeui/screennotify/src/ui_screennotify.cpp index 1a98c4c2e..117e72dfb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/screennotify/src/ui_screennotify.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/screennotify/src/ui_screennotify.cpp @@ -9,6 +9,8 @@ #include "power_display_service.h" #include "NativeAbility.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "MainViewSample.h" #include "ui_screennotify.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionPresenter.cpp index 744b85ac3..fc8d59c6d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingAttentionPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "secondaryfunction/include/FastTrainingAttentionPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingPresenter.cpp index a1a0d8f64..aa1e2e67e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/FastTrainingPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/SecondaryFunctionPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/SecondaryFunctionPresenter.cpp index 1f104dd13..febc7af98 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/SecondaryFunctionPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/secondaryfunction/src/SecondaryFunctionPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "secondaryfunction/include/SecondaryFunctionPresenter.h" #include "secondaryfunction/include/SecondaryFunctionModel.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingModel.h b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingModel.h index fc1649b88..385566ad2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingModel.h @@ -11,6 +11,8 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "SettingItem.h" #include "SettingPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumePresenter.cpp index 067f39a68..69e7f0fa2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/CallVolumePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/MediaVolumePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/MediaVolumePresenter.cpp index f76bb1726..84bde0789 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/MediaVolumePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/MediaVolumePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp index f50de29c3..9ff5d096a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SoundAndVibrationPresenter.cpp @@ -7,6 +7,8 @@ */ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumePresenter.cpp index 719e50383..151f9725e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/soundandvibration/src/SystemVolumePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemLanguageView.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemLanguageView.h index a84c792f1..9c3f07c08 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemLanguageView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemLanguageView.h @@ -8,6 +8,7 @@ #include "components/ui_radio_button.h" #include "components/ui_image_view.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { class SystemLanguageView diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemLanguageView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemLanguageView.cpp index 6bf24f867..08452c61e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemLanguageView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemLanguageView.cpp @@ -138,8 +138,8 @@ namespace OHOS return nullptr; } Title->SetPosition(203, 52, 200, 35); - Title->SetTextId(11); - //Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + Title->SetTextId(0); + // Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); scrollView->Add(Title); /* ------------------------------- Background ------------------------------- */ ImageConfig imageconfig = { @@ -210,7 +210,7 @@ namespace OHOS return nullptr; } SetRadioButtonSelectStatus(*SimplifiedChineseRadioButton, true); - UICheckBox::OnChangeListener *SimplifiedChineseRadioButtonChange = static_cast(new RadiobuttonOnChangeListener(SimplifiedChineseRadioButton,Title)); + UICheckBox::OnChangeListener *SimplifiedChineseRadioButtonChange = static_cast(new RadiobuttonOnChangeListener(SimplifiedChineseRadioButton, Title)); SimplifiedChineseRadioButton->SetOnChangeListener(SimplifiedChineseRadioButtonChange); scrollView->Add(SimplifiedChineseRadioButton); /* --------------------------- EnglishRadioButton --------------------------- */ @@ -223,7 +223,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemLanguageView::EnglishRadioButton new fail!"); return nullptr; } - UICheckBox::OnChangeListener *EnglishRadioButtonChange = static_cast(new RadiobuttonOnChangeListener(EnglishRadioButton,Title)); + UICheckBox::OnChangeListener *EnglishRadioButtonChange = static_cast(new RadiobuttonOnChangeListener(EnglishRadioButton, Title)); EnglishRadioButton->SetOnChangeListener(EnglishRadioButtonChange); scrollView->Add(EnglishRadioButton); initViewStatus = true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp index b5b41514c..f3c48e3ad 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" @@ -10,7 +12,7 @@ #include "common/key_code.h" #include "custom_utils.h" #include "language/LanguageInit.h" - +#include "language/font/ui_resource_string.h" namespace OHOS { @@ -197,8 +199,8 @@ namespace OHOS bool RadiobuttonOnChangeListener::OnChange(UICheckBox::UICheckBoxState state) { language *g_planguage; - // static const char *en = "user/res/language_config/font/en.lang"; - // static const char *zh_CN = "user/res/language_config/font/zh.lang"; + // static const char *en = "user/res/font/en.lang"; + // static const char *zh_CN = "user/res/font/zh.lang"; switch (state) { case UICheckBox::SELECTED: @@ -212,7 +214,7 @@ namespace OHOS // 英语文本 g_planguage->ChangeLanguage(LanguageId::EN); } - m_label->SetTextId(11); + m_label->SetTextId(0); // 强制刷新 m_label->ForceResetText(); RootView::GetInstance()->Invalidate(); diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h index 0e1084299..1e80cc1ab 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingModel.h @@ -22,6 +22,7 @@ #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlPresenter.cpp index 12df75ea6..67b9a1ed8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlView.cpp index 9dfa98990..5578eadcb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingControlView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingControlView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp index ed60bdda2..9e73e69b6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp index 01cb5fdcf..53f79031a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingDataView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailPresenter.cpp index 051c42c3b..20f24f097 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailPresenter.cpp @@ -1,6 +1,8 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailView.cpp index 4932ae601..5470ca092 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDetailView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingDetailView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp index 8d5d8c199..983459fbc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp index b4366e081..f83b6f913 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingEnddataView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2Presenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2Presenter.cpp index ae8c85959..d924430ce 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2Presenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2Presenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp index 47283cb64..3332c876f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingEndnote2View.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnotePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnotePresenter.cpp index 80c7f151d..e7e8448e3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnotePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnotePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp index bcd8051fb..b6c99eac5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingEndnoteView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicPresenter.cpp index 487a9ffe0..65dd18790 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp index e93705bcc..f20944733 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingMusicView.h" #include #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp index 3399980e4..bfcf6bf37 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp index 96988b85e..9ba235bb5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingNomalView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp index 6e9eea6f0..472b82c66 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingPresenter.cpp @@ -1,6 +1,8 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliPresenter.cpp index 1d41ef508..b1731eac3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp index 31e05e9f7..06141f6fc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingSetCaluliView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistPresenter.cpp index 0fb5cf850..02e391a3c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp index 68e4a58c8..bcbaf84d3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingSetDistView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp index 79af641af..dde17f27e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptPresenter.cpp index 5841d3d58..20d097633 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp index 850f0903e..1c6408ff1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingSetSeptView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimePresenter.cpp index 124473c74..36f58efe9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp index 83a734391..f2d761b53 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingSetTimeView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp index 0ab028207..1203ece44 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingSetView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongPresenter.cpp index 10310c69d..288e0d889 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp index 5f16244b0..e810e2351 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingStrongView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinPresenter.cpp index e351587e9..c71226bd7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp index 81105ecb2..bbd9a44da 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp @@ -2,6 +2,8 @@ #include "traing/include/TraingWinView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSPresenter.cpp index 0c381c4a5..62c4b8573 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSView.cpp index 275003476..1c0712e69 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSView.cpp @@ -2,6 +2,8 @@ #include "traing/training_GPS/include/TraingGPSView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackPresenter.cpp index 7d2451626..2517296cd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackView.cpp index 0d6b591ab..9ba146b35 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSbackView.cpp @@ -2,6 +2,8 @@ #include "traing/training_GPS/include/TraingGPSbackView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackPresenter.cpp index 0bb60ac5a..876edf700 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackPresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackView.cpp index 0cc434ae7..e6bd415eb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlackView.cpp @@ -2,6 +2,8 @@ #include "traing/training_GPS/include/TraingGPSlackView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostPresenter.cpp index eb6101ad8..0b0a5d05a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostView.cpp index cf1e9dd9d..b7c24621c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSlostView.cpp @@ -2,6 +2,8 @@ #include "traing/training_GPS/include/TraingGPSlostView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnotePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnotePresenter.cpp index d04cba8a2..84430540f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnotePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnotePresenter.cpp @@ -1,5 +1,7 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp index b1cb0a3bd..bc53b07ff 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSnoteView.cpp @@ -2,6 +2,8 @@ #include "traing/training_GPS/include/TraingGPSnoteView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetPresenter.cpp index 17bc6aa2d..28285664f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetView.cpp index 0db56d57d..cb8fbe8e7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_GPS/src/TraingGPSsetView.cpp @@ -2,6 +2,8 @@ #include "traing/training_GPS/include/TraingGPSsetView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp index ae59a77a5..3279404d6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardPresenter.cpp @@ -1,6 +1,8 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp index e318451ef..f4425a77e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/TraingCardView.cpp @@ -1,6 +1,8 @@ #include "traing/training_card/include/TraingCardView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardPresenter.cpp index e1f8a3570..b9c7d60fc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardPresenter.cpp @@ -11,7 +11,11 @@ #include "traing/training_card/include/Training_CardView.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "wearable_log.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp index a0c29297e..4856389c1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_card/src/Training_CardView.cpp @@ -2,6 +2,8 @@ #include "traing/training_card/include/Training_CardView.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceAdapter.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceAdapter.h index 379ee505c..c6fd188e4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceAdapter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceAdapter.h @@ -1,4 +1,4 @@ -/*** +/*** * @Author: Caisking 3449750381@qq.com * @Date: 2024-03-27 11:09:52 * @LastEditors: Caisking 3449750381@qq.com @@ -16,7 +16,9 @@ #include "components/ui_label.h" #include "components/ui_checkbox.h" #include "AppViewIDs.h" - +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" // 列表的适配器 namespace OHOS { @@ -24,7 +26,7 @@ namespace OHOS typedef struct { AppViewId id; - const char *label; // 标签 + UIResourceTextId labelid; // 标签 } TraingDanceItem; class TraingDanceAdapter : public AbstractAdapter diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceItemView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceItemView.h index a3609957e..2fd719472 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceItemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceItemView.h @@ -1,4 +1,19 @@ - +/*** + * @Author: Caisking 3449750381@qq.com + * @Date: 2024-03-27 15:24:12 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-03-28 16:46:53 + * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceItemView.h + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +/*** + * @Author: Caisking 3449750381@qq.com + * @Date: 2024-03-27 15:24:12 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-03-28 16:42:47 + * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceItemView.h + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ #ifndef TraingDance_ITEM_VIEW_H #define TraingDance_ITEM_VIEW_H @@ -10,6 +25,10 @@ #include "traing/training_list_dance/include/TraingDanceAdapter.h" #include "components/ui_label_button.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "ohos_types.h" namespace OHOS @@ -26,9 +45,9 @@ namespace OHOS private: TraingDanceItemView(const TraingDanceItemView &); UIImageView sbackground; // 背景 - UIImageView sicon; // 箭头 - UILabel sLabel; // 标签 - TraingDanceItem sItemInfo = {VIEW_INVALID, nullptr}; + UIImageView sicon; // 箭头 + UILabelExt sLabel; // 标签 + TraingDanceItem sItemInfo = {VIEW_INVALID, STR_DANCING_GENERAL}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceModel.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceModel.h index bbb7296a6..5cae108d7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceModel.h @@ -13,6 +13,10 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "TraingDancePresenter.h" #include "traing/training_list_dance/include/TraingDanceAdapter.h" @@ -34,7 +38,7 @@ namespace OHOS TraingDanceModel &operator=(const TraingDanceModel &); virtual ~TraingDanceModel(); static const uint16_t TraingDanceListMaxNum = 10; - TraingDanceItem TraingDances[TraingDanceListMaxNum] = {VIEW_INVALID, nullptr}; + TraingDanceItem TraingDances[TraingDanceListMaxNum] = {VIEW_INVALID, STR_DANCING_GENERAL}; // std::map TraingDanceIdToViewId; bool btConnectStatus{false}; }; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceView.h index be6094c01..484b4e3dd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/include/TraingDanceView.h @@ -11,6 +11,7 @@ #include "traing/training_list_dance/include/TraingDanceModel.h" #include "components/ui_label_button_ext.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceItemView.cpp index 27095a06c..4b907bd49 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceItemView.cpp @@ -2,6 +2,8 @@ #include "traing/training_list_dance/include/TraingDanceItemView.h" #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" namespace OHOS { @@ -30,7 +32,7 @@ namespace OHOS void TraingDanceItemView::SetItemInfo(const TraingDanceItem itemInfo) { sItemInfo = itemInfo; - sLabel.SetText(itemInfo.label); + sLabel.SetTextId(itemInfo.labelid); } /// @brief 设置每一个itemview上的组件 diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceModel.cpp index 02867ae52..6e4535d15 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceModel.cpp @@ -17,9 +17,13 @@ #include "traing/training_list_dance/include/TraingDanceModel.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { @@ -33,20 +37,20 @@ namespace OHOS return instance; } - static char *text[] = {"一般舞蹈", "肚皮舞", "爵士舞", "拉丁舞", "芭蕾", "街舞", "广场舞", "尊巴", "社交舞", "踢踏舞"}; + // static char *text[] = {"一般舞蹈", "肚皮舞", "爵士舞", "拉丁舞", "芭蕾", "街舞", "广场舞", "尊巴", "社交舞", "踢踏舞"}; void TraingDanceModel::InitTraingDanceListItem() { - TraingDances[0] = {VIEW_TRAININGNOMAL, "一般舞蹈"}; - TraingDances[1] = {VIEW_TRAININGNOMAL, "肚皮舞"}; - TraingDances[2] = {VIEW_TRAININGNOMAL, "爵士舞"}; - TraingDances[3] = {VIEW_TRAININGNOMAL, "拉丁舞"}; - TraingDances[4] = {VIEW_TRAININGNOMAL, "芭蕾"}; - TraingDances[5] = {VIEW_TRAININGNOMAL, "街舞"}; - TraingDances[6] = {VIEW_TRAININGNOMAL, "广场舞"}; - TraingDances[7] = {VIEW_TRAININGNOMAL, "尊巴"}; - TraingDances[8] = {VIEW_TRAININGNOMAL, "社交舞"}; - TraingDances[9] = {VIEW_TRAININGNOMAL, "踢踏舞"}; + TraingDances[0] = {VIEW_TRAININGNOMAL, STR_DANCING_GENERAL}; + TraingDances[1] = {VIEW_TRAININGNOMAL, STR_DANCING_BELLY}; + TraingDances[2] = {VIEW_TRAININGNOMAL, STR_DANCING_JAZZ}; + TraingDances[3] = {VIEW_TRAININGNOMAL, STR_DANCING_LATIN}; + TraingDances[4] = {VIEW_TRAININGNOMAL, STR_DANCING_BALLET}; + TraingDances[5] = {VIEW_TRAININGNOMAL, STR_DANCING_STREET}; + TraingDances[6] = {VIEW_TRAININGNOMAL, STR_DANCING_PUBLICSQUARE}; + TraingDances[7] = {VIEW_TRAININGNOMAL, STR_DANCING_ZUMBA}; + TraingDances[8] = {VIEW_TRAININGNOMAL, STR_DANCING_SOCIALDANCE}; + TraingDances[9] = {VIEW_TRAININGNOMAL, STR_DANCING_TAPDANCE}; } const TraingDanceItem *TraingDanceModel::GetTraingDancelistItems() const diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp index fe9cd72c0..deda1774d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDancePresenter.cpp @@ -16,6 +16,8 @@ */ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp index ec71410cc..d0db319fc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_dance/src/TraingDanceView.cpp @@ -3,6 +3,8 @@ #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "wearable_log.h" @@ -79,8 +81,8 @@ namespace OHOS TraingDanceList->SetMaxScrollDistance(MAX_SCR_DIS); // 增加表冠控制 - TraingDanceList->SetRotateFactor(2); - TraingDanceList->RequestFocus(); + scrollView->SetRotateFactor(2); + scrollView->RequestFocus(); } UIList *TraingDanceView::GetList() { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/include/TraingFitnessView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/include/TraingFitnessView.h index 557378db5..3c54bdaef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/include/TraingFitnessView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_fitness/include/TraingFitnessView.h @@ -11,6 +11,7 @@ #include "traing/training_list_fitness/include/TraingFitnessModel.h" #include "components/ui_label_button_ext.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceAdapter.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceAdapter.h index ac714dc3c..50e83636d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceAdapter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceAdapter.h @@ -1,8 +1,8 @@ -/*** +/*** * @Author: Caisking 3449750381@qq.com * @Date: 2024-03-27 11:09:52 * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-03-27 15:25:46 + * @LastEditTime: 2024-03-28 19:54:05 * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceAdapter.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -16,6 +16,8 @@ #include "components/ui_label.h" #include "components/ui_checkbox.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" // 列表的适配器 namespace OHOS @@ -24,7 +26,7 @@ namespace OHOS typedef struct { AppViewId id; - const char *label; // 标签 + UIResourceTextId labelid; // 标签 } TraingIceItem; class TraingIceAdapter : public AbstractAdapter diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceItemView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceItemView.h index 62eccfd98..aa1cbe6d8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceItemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceItemView.h @@ -10,6 +10,8 @@ #include "traing/training_list_ice/include/TraingIceAdapter.h" #include "components/ui_label_button.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "ohos_types.h" namespace OHOS @@ -27,8 +29,8 @@ namespace OHOS TraingIceItemView(const TraingIceItemView &); UIImageView sbackground; // 背景 UIImageView sicon; // 箭头 - UILabel sLabel; // 标签 - TraingIceItem sItemInfo = {VIEW_INVALID, nullptr}; + UILabelExt sLabel; // 标签 + TraingIceItem sItemInfo = {VIEW_INVALID, STR_ICE_SPORTS}; }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceModel.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceModel.h index 1988a7bad..fef4cf721 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceModel.h @@ -5,6 +5,10 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "TraingIcePresenter.h" #include "traing/training_list_ice/include/TraingIceAdapter.h" @@ -26,7 +30,7 @@ namespace OHOS TraingIceModel &operator=(const TraingIceModel &); virtual ~TraingIceModel(); static const uint16_t TraingIceListMaxNum = 12; - TraingIceItem TraingIces[TraingIceListMaxNum] = {VIEW_INVALID, nullptr}; + TraingIceItem TraingIces[TraingIceListMaxNum] = {VIEW_INVALID, STR_ICE_SPORTS}; // std::map TraingIceIdToViewId; bool btConnectStatus{false}; }; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceView.h index c23d7e342..f768e7a5c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/include/TraingIceView.h @@ -11,6 +11,7 @@ #include "traing/training_list_ice/include/TraingIceModel.h" #include "components/ui_label_button_ext.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceItemView.cpp index 779f5d59e..d159a9474 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceItemView.cpp @@ -2,6 +2,8 @@ #include "traing/training_list_ice/include/TraingIceItemView.h" #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" namespace OHOS { @@ -30,7 +32,7 @@ namespace OHOS void TraingIceItemView::SetItemInfo(const TraingIceItem itemInfo) { sItemInfo = itemInfo; - sLabel.SetText(itemInfo.label); + sLabel.SetTextId(itemInfo.labelid); } /// @brief 设置每一个itemview上的组件 diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceModel.cpp index 12fcd06f5..726ad8660 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceModel.cpp @@ -9,9 +9,13 @@ #include "traing/training_list_ice/include/TraingIceModel.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include "language/font/ui_resource_string.h" namespace OHOS { @@ -29,21 +33,20 @@ namespace OHOS void TraingIceModel::InitTraingIceListItem() { - TraingIces[0] = {VIEW_TRAININGNOMAL, "一般冰上运动"}; - TraingIces[1] = {VIEW_TRAININGNOMAL, "溜冰"}; - TraingIces[2] = {VIEW_TRAININGNOMAL, "冰球"}; - TraingIces[3] = {VIEW_TRAININGNOMAL, "冰石壶/冰壶"}; - TraingIces[4] = {VIEW_TRAININGNOMAL, "雪上摩托车"}; - TraingIces[5] = {VIEW_TRAININGNOMAL, "雪橇"}; - TraingIces[6] = {VIEW_TRAININGNOMAL, "冬季两项"}; - TraingIces[7] = {VIEW_TRAININGNOMAL, "越野滑雪"}; - TraingIces[8] = {VIEW_TRAININGNOMAL, "滑雪"}; - TraingIces[9] = {VIEW_TRAININGNOMAL, "单板滑雪/滑雪板"}; - TraingIces[10] = {VIEW_TRAININGNOMAL, "雪鞋健行"}; - TraingIces[11] = {VIEW_TRAININGNOMAL, "雪地运动"}; + TraingIces[0] = {VIEW_TRAININGNOMAL, STR_ICE_SPORTS}; + TraingIces[1] = {VIEW_TRAININGNOMAL, STR_ICE_SKATING}; + TraingIces[2] = {VIEW_TRAININGNOMAL, STR_ICE_HOCKEY}; + TraingIces[3] = {VIEW_TRAININGNOMAL, STR_ICE_CURLING}; + TraingIces[4] = {VIEW_TRAININGNOMAL, STR_ICE_SNOWMOBILING}; + TraingIces[5] = {VIEW_TRAININGNOMAL, STR_ICE_SLED}; + TraingIces[6] = {VIEW_TRAININGNOMAL, STR_ICE_BIATHLON}; + TraingIces[7] = {VIEW_TRAININGNOMAL, STR_ICE_CROSSCOUNTRYSKING}; + TraingIces[8] = {VIEW_TRAININGNOMAL, STR_ICE_SKIING}; + TraingIces[9] = {VIEW_TRAININGNOMAL, STR_ICE_SNOWBOARDING}; + TraingIces[10] = {VIEW_TRAININGNOMAL, STR_ICE_SNOWSHOEING}; + TraingIces[11] = {VIEW_TRAININGNOMAL, STR_ICE_SNOW_SPORTS}; } - const TraingIceItem *TraingIceModel::GetTraingIcelistItems() const { return TraingIces; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp index 4f902f7fa..ebe797c06 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIcePresenter.cpp @@ -16,6 +16,8 @@ */ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp index 2201ad008..f6f446414 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp @@ -1,8 +1,18 @@ +/*** + * @Author: Caisking 3449750381@qq.com + * @Date: 2024-03-26 09:46:17 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-03-28 19:59:38 + * @FilePath: /sdk/application/wearable/fd230app/nativeui/traing/training_list_ice/src/TraingIceView.cpp + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ #include "traing/training_list_ice/include/TraingIceView.h" #include "traing/training_list_ice/include/TraingIcePresenter.h" #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "wearable_log.h" @@ -79,8 +89,8 @@ namespace OHOS TraingIceList->SetMaxScrollDistance(MAX_SCR_DIS); // 增加表冠控制 - TraingIceList->SetRotateFactor(2); - TraingIceList->RequestFocus(); + scrollView->SetRotateFactor(2); + scrollView->RequestFocus(); } UIList *TraingIceView::GetList() { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitAdapter.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitAdapter.h index 2e84993a1..369720570 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitAdapter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitAdapter.h @@ -16,6 +16,8 @@ #include "components/ui_label.h" #include "components/ui_checkbox.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" // 列表的适配器 namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitItemView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitItemView.h index 729b58f73..f8e683249 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitItemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitItemView.h @@ -17,6 +17,8 @@ #include "traing/training_list_limit/include/TraingLimitAdapter.h" #include "components/ui_label_button.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "ohos_types.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitModel.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitModel.h index cb8433a3c..31e63b229 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitModel.h @@ -5,6 +5,10 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "TraingLimitPresenter.h" #include "traing/training_list_limit/include/TraingLimitAdapter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitView.h index 3fcc7fb45..19597cfab 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/include/TraingLimitView.h @@ -19,6 +19,7 @@ #include "traing/training_list_limit/include/TraingLimitModel.h" #include "components/ui_label_button_ext.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitItemView.cpp index d584b2234..ab62dd3e7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitItemView.cpp @@ -2,6 +2,8 @@ #include "traing/training_list_limit/include/TraingLimitItemView.h" #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitModel.cpp index 48a67e507..3a3f29b73 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitModel.cpp @@ -9,9 +9,13 @@ #include "traing/training_list_limit/include/TraingLimitModel.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitPresenter.cpp index 11593e4ad..04e338ffe 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitPresenter.cpp @@ -16,6 +16,8 @@ */ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp index 18d6a84de..234cf21d3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_limit/src/TraingLimitView.cpp @@ -3,6 +3,8 @@ #include "traing/include/TraingModel.h" #include "traing/Training_UiConfig.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "wearable_log.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp index 021f61b0b..fc22065bd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMorePresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreView.cpp index 7bc5b8b20..f06465c5c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/training_list_more/src/TraingMoreView.cpp @@ -4,6 +4,8 @@ #include "traing/Training_UiConfig.h" #include "common/image_cache_manager.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp index 13a18d0b5..22a0c8b9d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traingrecord/src/TraingRecordPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/uisample/include/UISampleModel.h b/code/sdk/application/wearable/fd230app/nativeui/uisample/include/UISampleModel.h index 4a37a0661..556d8fced 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uisample/include/UISampleModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/uisample/include/UISampleModel.h @@ -11,6 +11,8 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "UiConfig.h" #include "UISamplePresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherReportView.h b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherReportView.h index bf8272bfe..07ef3b5f3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherReportView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/include/WeatherReportView.h @@ -7,6 +7,7 @@ #include "components/ui_view_group.h" #include "components/ui_scroll_view.h" #include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "components/ui_image_animator.h" #include "config/include/ConfigModel.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherPresenter.cpp index 723519533..cddd76bfd 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/FutureWeatherPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "weather/include/FutureWeatherPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorPresenter.cpp index 6fffd0098..4169b7be7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "weather/include/GetWeatherDataErrorPresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp index 39553f891..43bf11f93 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/MainWeatherPresenter.cpp @@ -1,4 +1,6 @@ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" +#include"language/font/ui_resource_string.h" #include "NativeAbility.h" #include "weather/include/MainWeatherPresenter.h" #include "common/key_code.h" diff --git a/code/sdk/application/wearable/nativeabilityfwk/include/ChangeSliceListener.h b/code/sdk/application/wearable/nativeabilityfwk/include/ChangeSliceListener.h index fed36e44f..35b6b85b3 100755 --- a/code/sdk/application/wearable/nativeabilityfwk/include/ChangeSliceListener.h +++ b/code/sdk/application/wearable/nativeabilityfwk/include/ChangeSliceListener.h @@ -18,6 +18,7 @@ #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "components/ui_view.h" #include "NativeAbility.h" diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h index cbf615969..c34e4a907 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h @@ -17,6 +17,7 @@ #ifndef NATIVE_LAUNCHER_H #define NATIVE_LAUNCHER_H #include "AppViewIDs.h" +#include "components/ui_label_ext.h" namespace OHOS { class NativeLauncher { diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp index f180f6eed..3e79969e1 100644 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/slices/main/MainView.cpp @@ -15,6 +15,7 @@ #include "MainView.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "wearable_log.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h index 91d856c74..1f7958c48 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayList/AlipayListView.h @@ -18,6 +18,7 @@ #include "components/icon_adapter.h" #include "AlipayPresenter.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "UiConfig.h" #include "AlipayListAdapter.h" #include "AlipayListItem.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h index b38739a42..61f50ca9c 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/alipay/include/AlipayTrans/AlipayTransListView.h @@ -19,6 +19,7 @@ #include "components/icon_adapter.h" #include "AlipayPresenter.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "UiConfig.h" #include "AlipayTransListAdapter.h" #include "AlipayTransListItem.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h index 57db8ce4e..c0a5d913d 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistModel.h @@ -10,6 +10,7 @@ #include "bundle_info.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "ohos_types.h" #define APP_MAX_NUM 50 diff --git a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h index ad21adb9a..9786748f0 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/callerlog/include/CallerLogModel.h @@ -11,6 +11,7 @@ #include "string" #include "PhoneService.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "message.h" #include "msg_center.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassPresenter.h index 68d6877d8..aa93af255 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/CompassPresenter.h @@ -13,6 +13,7 @@ #include "ohos_types.h" #include "UiConfig.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "CompassView.h" namespace OHOS { diff --git a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h index 0fc70617c..00c389a9f 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/compass/include/MainCompassPresenter.h @@ -12,6 +12,7 @@ #include "ohos_types.h" #include "UiConfig.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "CompassView.h" #include "CompassPresenter.h" #include "CompassModel.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp index 310fcf3a2..d70e6337e 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/key/src/KeyInputListener.cpp @@ -8,6 +8,7 @@ #include "KeyInputListener.h" #include "common/key_code.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "View.h" #include "MainViewSample.h" #include "wearable_log.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp index 000fd86e3..c4c704a72 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistModel.cpp @@ -9,6 +9,7 @@ #include "VocassistView.h" #include "VocassistModel.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "NativeAbility.h" #include "graphic_service.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp index 98b97129d..a158f95e9 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistPresenter.cpp @@ -5,6 +5,7 @@ * Create: 2022-01-18 */ #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "VocassistPresenter.h" #include "PlayersModel.h" #include "ui_service.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp index f67c649ba..ff56910d9 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/offlinevoice/src/VocassistView.cpp @@ -8,6 +8,7 @@ #include #include "cmsis_os.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "PlayersModel.h" #include "CallerLogModel.h" #include "VocassistModel.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp b/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp index da2ae2a46..07627da97 100644 --- a/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/screennotify/src/ui_screennotify.cpp @@ -9,6 +9,7 @@ #include "power_display_service.h" #include "NativeAbility.h" #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "MainViewSample.h" #include "ui_screennotify.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h index d26280bec..be1e4d5a3 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/settings/include/SettingModel.h @@ -11,6 +11,7 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "UiConfig.h" #include "SettingItem.h" #include "SettingPresenter.h" diff --git a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h index 4a37a0661..0570ca0e1 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h +++ b/code/sdk/application/wearable/nativeapp/nativeui/uisample/include/UISampleModel.h @@ -11,6 +11,7 @@ #include #include #include "AppViewIDs.h" +#include "components/ui_label_ext.h" #include "UiConfig.h" #include "UISamplePresenter.h" diff --git a/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h b/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h index 71694573e..82d0a9fc8 100755 --- a/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h +++ b/code/sdk/application/wearable/service/broadcast/include/broadcast_feature.h @@ -48,6 +48,7 @@ typedef enum { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION TOPIC_EVENT_CHARGE_PLUG, TOPIC_EVENT_CHARGE_UNPLUG, + TOPIC_EVENT_LOWPOWER_ALARM, #endif #ifdef SUPPORT_SPO2_NOTIFICATION TOPIC_EVENT_SPO2_UPDATE, diff --git a/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c b/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c index e309f7aee..474ffdc6e 100755 --- a/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c +++ b/code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c @@ -44,6 +44,7 @@ static const TopicToCore topicToCoreArray[] = { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION {TOPIC_EVENT_CHARGE_PLUG, A_CORE_MASK, 1}, {TOPIC_EVENT_CHARGE_UNPLUG, A_CORE_MASK, 1}, + {TOPIC_EVENT_LOWPOWER_ALARM, A_CORE_MASK, 1}, #endif #ifdef SUPPORT_DEVICE_PAIRING_NOTIFICATION {TOPIC_EVENT_DEVICE_BIND,A_CORE_MASK, 1}, diff --git a/code/sdk/application/wearable/service/factorytest_service/CMakeLists.txt b/code/sdk/application/wearable/service/factorytest_service/CMakeLists.txt index 29a329d06..9fa68b6f3 100644 --- a/code/sdk/application/wearable/service/factorytest_service/CMakeLists.txt +++ b/code/sdk/application/wearable/service/factorytest_service/CMakeLists.txt @@ -9,6 +9,7 @@ set(PRIVATE_HEADER ) set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/factorytestService.c + ${CMAKE_CURRENT_SOURCE_DIR}/factorytest_protocol.c ) set(COMPONENT_PUBLIC_CCFLAGS diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytestService.c b/code/sdk/application/wearable/service/factorytest_service/factorytestService.c index 3ff3c3d12..e54ec84d0 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytestService.c +++ b/code/sdk/application/wearable/service/factorytest_service/factorytestService.c @@ -43,26 +43,6 @@ uint32_t factory_ate_write_handl = 0; uint32_t g_factory_ota_report_hdl = 0; uint32_t factory_ota_write_handl = 0; -uint16_t modbus_crc16(uint8_t *data, uint16_t length) { - uint8_t crc_hi = 0xFF; - uint8_t crc_lo = 0xFF; - int i; - - while (length--) { - crc_hi ^= *data++; - for (i = 0; i < 8; i++) { - if (crc_hi & 0x80) { - crc_hi = (crc_hi << 1) ^ 0x8005; - } else { - crc_hi <<= 1; - } - } - } - - return (crc_hi << 8) | crc_lo; -} - - /* 创建服务 */ static void ble_factorytest_add_service(void) { @@ -230,14 +210,14 @@ void ble_factory_server_init(void) ble_factorytest_add_service(); } +extern void factorytest_protocol_decode(uint8_t *buf, uint16_t event_size); //协议接收client下发的数据接口 void factory_recv_cmd_data(uint8_t *buf, uint16_t event_size,uint16_t handle) { - printf("factory_recv_cmd_data len %d , handle 0x%X\r\n",event_size,handle); + if(buf != NULL) + printf("factory_recv_cmd_data len %d , handle 0x%X ,*buf 0x%02X\r\n",event_size,handle,*buf); /****此处为接收指令,处理后反馈结果的参考**/ - uint8_t buff[128]={0}; - sprintf((char*)buff,"%X",event_size); - ble_factorytest_server_send_input_report((uint8_t*)buff,strlen((char*)buff)); + factorytest_protocol_decode(buf,event_size); /*****参考结束****/ } diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytestService.h b/code/sdk/application/wearable/service/factorytest_service/factorytestService.h index 388b5abc8..c88dccd99 100644 --- a/code/sdk/application/wearable/service/factorytest_service/factorytestService.h +++ b/code/sdk/application/wearable/service/factorytest_service/factorytestService.h @@ -34,74 +34,6 @@ extern "C" { /* write */ #define BLE_UUID_ATE_TX 0x1004 -// 主模式ID 公共接口 0x01 -#define BLE_TEST_CMD_MODE_COMMON 0x01 -// 主模式ID 生产软件 0x02 -#define BLE_TEST_CMD_MODE_SOFT_TEST 0x02 -// 主模式ID 硬测接口 0x03 -#define BLE_TEST_CMD_MODE_HW_TEST 0x03 -// 主模式ID 串口接口 0x04 -#define BLE_TEST_CMD_MODE_SERIAL_PORT 0x04 - - -// 协议定义: -// 发送:协议头(0xFD) + 长度(2bytes) +模块ID(1bytes)+子模块ID(1bytes)+测试项ID(1bytes)+可变字节+CRC(2bytes) -// 接收:协议头(0xFD) + 长度(2bytes) +模块ID(1bytes)+子模块ID(1bytes)+测试项ID(1bytes)+执行状态(1bytes)+可变字节+CRC(2bytes) -// 备注: -// 1、状态返回00表示成功,01表示开始执行,其他表示各种错误。 -// 2、命令响应超时为:3秒,超时重发2次。 -// 3、大端模式。 -// 4、长耗时命令,先确认收到,执行完再返回结果。 -#define BLE_TEST_PROTOCOL_HEADER 0xFD - - -//公共模式 子模式ID 模式切换 -#define BLE_TEST_CMD_COMMON_SUB_MODE_SWITCH_MODE 0x01 -//公共模式 子模式ID 系统版本 -#define BLE_TEST_CMD_COMMON_SUB_MODE_SYSTEM_VERSION 0x02 -//公共模式 子模式ID 开关机 -#define BLE_TEST_CMD_COMMON_SUB_MODE_POWER_ON_OFF_DEVICE 0x03 -//公共模式 子模式ID 功耗 -#define BLE_TEST_CMD_COMMON_SUB_MODE_POWERCONSUMPTION 0x04 -//公共模式 子模式ID OTA -#define BLE_TEST_CMD_COMMON_SUB_MODE_OTA 0x05 - -//软件测试 子模式ID 蓝牙 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_BLE 0x01 -//软件测试 子模式ID 马达 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_VIBRATOR 0x02 -//软件测试 子模式ID 按键 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY 0x03 -//软件测试 子模式ID RTC -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_RTC 0x04 -//软件测试 子模式ID 温度 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TEMPERATURE 0x05 - -//软件测试 子模式ID 老化测试 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_AGING_TEST 0x06 - -//软件测试 子模式ID 定制测试 读写SN等 读CHIPID -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CUSTOM_CMD 0x07 - -//软件测试 子模式ID 屏幕 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_LCD 0x11 -//软件测试 子模式ID TP -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TP 0x12 -//软件测试 子模式ID ACC -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ACC 0x13 -//软件测试 子模式ID 心率 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS 0x14 -//软件测试 子模式ID 地磁 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_COMPASS 0x16 -//软件测试 子模式ID 电源管理 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_PM 0x17 -//软件测试 子模式ID 扩展FLASH -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_EXTFLASH 0x18 -//软件测试 子模式ID 扩展RAM -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_EXTRAM 0x19 -//软件测试 子模式ID CAT1 -#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1 0x1A - /** * @if Eng diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c new file mode 100644 index 000000000..d6b2e0de7 --- /dev/null +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.c @@ -0,0 +1,188 @@ +/* + * Copyright (c) @CompanyNameMagicTag 2022. All rights reserved. + * Description: BT HID Service Server Module. + */ +#include "factorytest_protocol.h" +#include "factorytestService.h" +#include "wearable_log.h" +#include "custom_utils.h" + +#pragma pack(1) +typedef struct factorytest_cmd_header_t +{ + uint8_t header; + uint16_t len; + uint8_t mode; + uint8_t submod; + uint8_t testitem; +}factorytest_cmd_header_t; +#pragma pack() + +static int CRC16_XMODEM(uint8_t *bytes,uint16_t length) { + int crc = 0x0000; // initial value + int polynomial = 0x1021; + for (int index = 0; index < length; index++) { + uint8_t b = bytes[index]; + for (int i = 0; i < 8; i++) { + uint8_t bit = ((b >> (7 - i) & 1) == 1); + uint8_t c15 = ((crc >> 15 & 1) == 1); + crc <<= 1; + if (c15 ^ bit) crc ^= polynomial; + } + } + crc &= 0xffff; + return crc; +} +errcode_t factorytest_protocol_replymsg(uint8_t mode, uint8_t submode,uint8_t testitem, + uint8_t *input_data,uint16_t input_len) +{ + + uint8_t * replybuf=NULL; + errcode_t ret; + uint16_t total_len = input_len +1+2+1+1+1+2;//头+长度+mode+submod+testitem+crc + replybuf = malloc(total_len); + printf("input_len 0x%02X, total_len 0x%02X\n",input_len,total_len); + if(replybuf == NULL) + { + printf("malloc buf failed!\r\n"); + return ERRCODE_MALLOC; + } + factorytest_cmd_header_t pcmdheader ={0}; + pcmdheader.header = BLE_TEST_PROTOCOL_HEADER; + pcmdheader.len = total_len - 2 -1 - 2; //去掉头,长度,crc + pcmdheader.mode = mode; + pcmdheader.submod = submode; + pcmdheader.testitem = testitem; + replybuf[0] = pcmdheader.header; + replybuf[1] = ((uint8_t*)&pcmdheader.len)[1]; + replybuf[2] = ((uint8_t*)&pcmdheader.len)[0]; + replybuf[3] = pcmdheader.mode; + replybuf[4] = pcmdheader.submod; + replybuf[5] = pcmdheader.testitem; + if (input_len>0) + memcpy_s(replybuf+1+2+1+1+1/*header+len+mode+submod+testitem*/,input_len,input_data,input_len); + //计算除了crc外的所有数据 + uint16_t crc16 = CRC16_XMODEM(replybuf,total_len - 2); + + replybuf[total_len-1] = ((uint8_t *) &crc16 )[0]; + replybuf[total_len-2] = ((uint8_t *) &crc16 )[1]; + for ( int i = 0; i=(1+2+1+1+1+2/*header+len+mod+submod+item+crc*/)) + { + factorytest_cmd_header_t header ={0}; + header.header = buf[0]; + ((uint8_t *)&header.len)[1] = buf[1]; + ((uint8_t *)&header.len)[0] = buf[2]; + header.mode = buf[3]; + header.submod = buf[4]; + header.testitem = buf[5]; + printf("header 0x%02X vs 0x%02X\n",header.header, buf[0]); + if (header.header == BLE_TEST_PROTOCOL_HEADER ) + { + //消息长度大于event_size证明解析错误. + printf("(header->len 0x%04X\n",header.len); + if ((header.len + 1+2+2) > event_size) + { + printf("Error 数据长度大于eventsize\r\n"); + return ERRCODE_FAIL; + } + uint16_t crc16 = CRC16_XMODEM(buf,header.len+1+2); + uint16_t crc16_2 = 0; + ((uint8_t *)&crc16_2)[1] = buf[event_size-2]; + ((uint8_t *)&crc16_2)[0] = buf[event_size-1]; + + printf("crc16 0x%04X vs 0x%04X\n",crc16,crc16_2); + + if( crc16 == crc16_2) //校验通过,开始正式解析 + { + printf("mode %d\n",header.mode); + switch(header.mode) + { + // 主模式ID 公共接口 0x01 + case BLE_TEST_CMD_MODE_COMMON: + factorytest_protocol_common_decode(header.submod,header.testitem, + buf+1+2+1+1+1, + header.len); + break; + + // 主模式ID 生产软件 0x02 + case BLE_TEST_CMD_MODE_SOFT_TEST: + break; + + // 主模式ID 硬测接口 0x03 + case BLE_TEST_CMD_MODE_HW_TEST: + break; + + // 主模式ID 串口接口 0x04 + case BLE_TEST_CMD_MODE_SERIAL_PORT: + break; + } + + } + + }else{ + printf("crc error!\r\n"); + return ERRCODE_FAIL; + } + + }else{ + printf("error format!\r\n"); + return ERRCODE_FAIL; + } + return ERRCODE_SUCC; +} + + +errcode_t factorytest_ota_recv(const uint8_t *data, uint8_t len) +{ + + return ERRCODE_SUCC; +} + +errcode_t factorytest_ota_report(uint8_t mode, uint8_t submode,uint8_t testitem, + uint8_t *input_data,uint16_t input_len) +{ + + return ERRCODE_SUCC; +} + diff --git a/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h new file mode 100644 index 000000000..5d9c098e6 --- /dev/null +++ b/code/sdk/application/wearable/service/factorytest_service/factorytest_protocol.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) @CompanyNameMagicTag 2022. All rights reserved. + * Description: BT HID Service Server module. + */ + +/** + * @defgroup bluetooth_bts_hid_server HID SERVER API + * @ingroup bluetooth + * @{ + */ +#ifndef BLE_FACTORY_TEST_PROTOCOL_H +#define BLE_FACTORY_TEST_PROTOCOL_H + +#include "errcode.h" + +#ifdef __cplusplus +extern "C" { +#endif +// ATE工厂模式服务UUID: 00002760-08c2-11e1-9073-0e8afefd1000 +// OTA RX characteristic UUID: 00002760-08c2-11e1-9073-0e8afefd1001 +// OTA TX characteristic UUID: 00002760-08c2-11e1-9073-0e8afefd1002 +// ATE RX characteristic UUID: 00002760-08c2-11e1-9073-0e8afefd1003 +// ATE TX characteristic UUID: 00002760-08c2-11e1-9073-0e8afefd1004 + +// 主模式ID 公共接口 0x01 +#define BLE_TEST_CMD_MODE_COMMON 0x01 +// 主模式ID 生产软件 0x02 +#define BLE_TEST_CMD_MODE_SOFT_TEST 0x02 +// 主模式ID 硬测接口 0x03 +#define BLE_TEST_CMD_MODE_HW_TEST 0x03 +// 主模式ID 串口接口 0x04 +#define BLE_TEST_CMD_MODE_SERIAL_PORT 0x04 + + +// 协议定义: +// CRC 计算的所有数据的校驗值 +// 长度是从模块ID开始到CRC结束的长度 +// 发送:协议头(0xFD) + 长度(2bytes) +模块ID(1bytes)+子模块ID(1bytes)+测试项ID(1bytes)+可变字节+CRC(2bytes) +// 接收:协议头(0xFD) + 长度(2bytes) +模块ID(1bytes)+子模块ID(1bytes)+测试项ID(1bytes)+执行状态(1bytes)+可变字节+CRC(2bytes) +// 备注: +// 1、状态返回00表示成功,01表示开始执行,其他表示各种错误。 +// 2、命令响应超时为:3秒,超时重发2次。 +// 3、大端模式。 +// 4、长耗时命令,先确认收到,执行完再返回结果。 +#define BLE_TEST_PROTOCOL_HEADER 0xFD + + +//公共模式 子模式ID 模式切换 +#define BLE_TEST_CMD_COMMON_SUB_MODE_SWITCH_MODE 0x01 +//公共模式 子模式ID 系统版本 +#define BLE_TEST_CMD_COMMON_SUB_MODE_SYSTEM_VERSION 0x02 +//公共模式 子模式ID 开关机 +#define BLE_TEST_CMD_COMMON_SUB_MODE_POWER_ON_OFF_DEVICE 0x03 +//公共模式 子模式ID 功耗 +#define BLE_TEST_CMD_COMMON_SUB_MODE_POWERCONSUMPTION 0x04 +//公共模式 子模式ID OTA +#define BLE_TEST_CMD_COMMON_SUB_MODE_OTA 0x05 + +//软件测试 子模式ID 蓝牙 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_BLE 0x01 +//软件测试 子模式ID 马达 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_VIBRATOR 0x02 +//软件测试 子模式ID 按键 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_KEY 0x03 +//软件测试 子模式ID RTC +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_RTC 0x04 +//软件测试 子模式ID 温度 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TEMPERATURE 0x05 + +//软件测试 子模式ID 老化测试 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_AGING_TEST 0x06 + +//软件测试 子模式ID 定制测试 读写SN等 读CHIPID +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CUSTOM_CMD 0x07 + +//软件测试 子模式ID 屏幕 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_LCD 0x11 +//软件测试 子模式ID TP +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_TP 0x12 +//软件测试 子模式ID ACC +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_ACC 0x13 +//软件测试 子模式ID 心率 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_HRS 0x14 +//软件测试 子模式ID 地磁 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_COMPASS 0x16 +//软件测试 子模式ID 电源管理 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_PM 0x17 +//软件测试 子模式ID 扩展FLASH +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_EXTFLASH 0x18 +//软件测试 子模式ID 扩展RAM +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_EXTRAM 0x19 +//软件测试 子模式ID CAT1 +#define BLE_TEST_CMD_SOFT_TEST_SUB_MODE_CAT1 0x1A +/** + * + * encode cmd msg string and send to ble + * input: mod,submod,data,len + * output: output_data + * return:0 success other failed + * 请注意:output内存是函数内部创建,用后需要执行 factorytest_cmd_msg_free . +*/ +errcode_t factorytest_protocol_replymsg(uint8_t mode, uint8_t submode,uint8_t testitem, + uint8_t *input_data,uint16_t input_len); +/*** + * decode protocol data +*/ +errcode_t factorytest_protocol_decode(uint8_t *buf, uint16_t event_size); + +errcode_t factorytest_ota_recv(const uint8_t *data, uint8_t len); +errcode_t factorytest_ota_report(uint8_t mode, uint8_t submode,uint8_t testitem, + uint8_t *input_data,uint16_t input_len); + +/** + * @} + */ +#ifdef __cplusplus +} +#endif + + +#endif//BLE_FACTORY_TEST_PROTOCOL_H diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 5682646ad..e81516821 100755 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -53,6 +53,7 @@ const PriorityMapper g_pri_mapper[] = { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION {TOPIC_EVENT_CHARGE_PLUG, PRIORITY_TWO}, {TOPIC_EVENT_CHARGE_UNPLUG, PRIORITY_TWO}, + {TOPIC_EVENT_LOWPOWER_ALARM,PRIORITY_TWO}, #endif {TOPIC_EVENT_HFP_INCOMMING, PRIORITY_ONE}, {TOPIC_EVENT_HFP_FINISHED, PRIORITY_ONE}, @@ -60,6 +61,7 @@ const PriorityMapper g_pri_mapper[] = { {TOPIC_EVENT_HFP_WATCH_ACTIVE, PRIORITY_ONE}, {TOPIC_EVENT_HFP_WATCH_TO_PHONE, PRIORITY_ONE}, {TOPIC_EVENT_HFP_PHONE_TO_WATCH, PRIORITY_ONE}, + #ifdef SUPPORT_CAT1_MODEM {TOPIC_EVENT_CAT1_INCOMMING, PRIORITY_ONE}, {TOPIC_EVENT_CAT1_CALLCONNTED, PRIORITY_ONE}, @@ -118,6 +120,7 @@ void MsgCenterSubscribe() #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_PLUG); MsgCenterSubscribeTopic(TOPIC_EVENT_CHARGE_UNPLUG); + MsgCenterSubscribeTopic(TOPIC_EVENT_LOWPOWER_ALARM); #endif #ifdef SUPPORT_SPO2_NOTIFICATION_TEST MsgCenterSubscribeTopic(TOPIC_EVENT_SPO2_UPDATE); @@ -244,6 +247,23 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req) t->ChangeViewcolor(false); } } + +void MsgCenterNotifyLowPowerAlarmProc(const Topic topic, Request* req) +{ + unused(req); + unused(topic); + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: LowPower Alarm !"); + //TODO: 亮屏弹窗倒计时5秒关机(不需要取消,强制关机) + // DialModelCharge::GetInstance()->UpdateChargeStuaut(0); + // SaveEleModel::GetInstance()->SetChargeStuaut(0); + + // testCHANINGView *t=testCHANINGView::GetInstance(); + // if(t!=NULL) + // { + // t->ChangeViewcolor(false); + // } +} + #endif void MsgCenterNotifyNextDayProc(const Topic topic, Request* req) { @@ -699,6 +719,7 @@ static msg_center_notify_table_t g_msg_center_notify_table[] = { #ifdef SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION {TOPIC_EVENT_CHARGE_PLUG, MsgCenterNotifyChargePlugProc}, {TOPIC_EVENT_CHARGE_UNPLUG, MsgCenterNotifyChargeUnPlugProc}, + {TOPIC_EVENT_LOWPOWER_ALARM, MsgCenterNotifyLowPowerAlarmProc}, #endif #ifdef SUPPORT_SPO2_NOTIFICATION_TEST {TOPIC_EVENT_SPO2_UPDATE, MsgCenterNotifySPO2hProc}, diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang new file mode 100644 index 000000000..eb687d040 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h new file mode 100644 index 000000000..d0c2d220b --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h @@ -0,0 +1,197 @@ +/* +* Copyright (c) xxxxxxxx Technologies Co., Ltd. 2021-2021. All rights reserved. +* Description: language +* Author: Graphic develop team +* Create: 2021-07-06 +*/ + +#ifndef UI_RESOURCE_STRING_H +#define UI_RESOURCE_STRING_H +#include +namespace OHOS { +enum UIResourceTextId : uint16_t { + STR_EXERCISE_GENERAL = 0, + STR_EXERCISE_FREETRAINING = 1, + STR_EXERCISE_RESISTANCETRAINING = 2, + STR_EXERCISE_SPINBIKE = 3, + STR_EXERCISE_TREADMILL = 4, + STR_EXERCISE_STROLLMACHINE = 5, + STR_EXERCISE_HIIT = 6, + STR_EXERCISE_CROSSFIT = 7, + STR_EXERCISE_GROUPCALISTHENICS = 8, + STR_EXERCISE_YOGA = 9, + STR_EXERCISE_YOGACAT = 10, + STR_EXERCISE_YOGACOW = 11, + STR_EXERCISE_YOGACOBRA = 12, + STR_EXERCISE_YOGAHERO1 = 13, + STR_EXERCISE_YOGAHERO2 = 14, + STR_EXERCISE_YOGAHERO3 = 15, + STR_EXERCISE_YOGAROLLING = 16, + STR_EXERCISE_OUTDOORWALKING = 17, + STR_EXERCISE_OUTDOORRUNNING = 18, + STR_EXERCISE_INDOORWALKING = 19, + STR_EXERCISE_INDOORRUNNING = 20, + STR_EXERCISE_OUTDOORBIKING = 21, + STR_EXERCISE_JUMPINGROPE = 22, + STR_EXERCISE_PILATES = 23, + STR_EXERCISE_CROSS_FIT = 24, + STR_EXERCISE_FUNCTIONALTRAINING = 25, + STR_EXERCISE_PHYSICALTRAINING = 26, + STR_EXERCISE_TAEKWONDO = 27, + STR_EXERCISE_BOXING = 28, + STR_EXERCISE_KICKBOXING = 29, + STR_EXERCISE_KARATE = 30, + STR_EXERCISE_FENCING = 31, + STR_EXERCISE_CORETRAINING = 32, + STR_EXERCISE_BODYCOMBAT = 33, + STR_EXERCISE_KENDO = 34, + STR_EXERCISE_HORIZONTALBAR = 35, + STR_EXERCISE_PARALLELBARS = 36, + STR_EXERCISE_AEROBICS = 37, + STR_EXERCISE_CALISTHENICE = 38, + STR_EXERCISE_P90X = 39, + STR_EXERCISE_KETTLEBELLTRAINING = 40, + STR_EXERCISE_MIXEDMARTIALARTS = 41, + STR_EXERCISE_STAIRCLIMBINGMACHINE = 42, + STR_EXERCISE_WEIGHTLIFTING = 43, + STR_EXERCISE_BARRE = 44, + STR_EXERCISE_HANDCYCLING = 45, + STR_EXERCISE_TRACKFIELD = 46, + STR_EXERCISE_WRESTLING = 47, + STR_EXERCISE_MINDBODY = 48, + STR_EXERCISE_FLEXIBILITY = 49, + STR_EXERCISE_MIXEDCARDIO = 50, + STR_EXERCISE_TRADITIONALSTRENGTHTRAINING = 51, + STR_EXERCISE_CROSSTRAINING = 52, + STR_EXERCISE_GYMNASTICS = 53, + STR_EXERCISE_STEPTRAINING = 54, + STR_EXERCISE_ELLIPTICALTRAINER = 55, + STR_EXERCISE_ROWINGMACHINE = 56, + STR_DANCING_GENERAL = 57, + STR_DANCING_BELLY = 58, + STR_DANCING_JAZZ = 59, + STR_DANCING_LATIN = 60, + STR_DANCING_BALLET = 61, + STR_DANCING_STREET = 62, + STR_DANCING_PUBLICSQUARE = 63, + STR_DANCING_ZUMBA = 64, + STR_DANCING_SOCIALDANCE = 65, + STR_DANCING_TAPDANCE = 66, + STR_RECREATIONAL_SPORTS = 67, + STR_RECREATIONAL_SKATING = 68, + STR_RECREATIONAL_MARTIALARTS = 69, + STR_RECREATIONAL_TAICHI = 70, + STR_RECREATIONAL_HULAHOOP = 71, + STR_RECREATIONAL_DISCSPORT = 72, + STR_RECREATIONAL_DARTS = 73, + STR_RECREATIONAL_ARCHERY = 74, + STR_RECREATIONAL_HORSERIDING = 75, + STR_RECREATIONAL_BATTLEGAME = 76, + STR_RECREATIONAL_KITE = 77, + STR_RECREATIONAL_TUGOFWAR = 78, + STR_RECREATIONAL_SWING = 79, + STR_RECREATIONAL_STAIRCLIMBING = 80, + STR_RECREATIONAL_OBSTACLERACE = 81, + STR_RECREATIONAL_FISHING = 82, + STR_RECREATIONAL_HUNTING = 83, + STR_RECREATIONAL_SCOOTERRIDING = 84, + STR_RECREATIONAL_PARAGLIDING = 85, + STR_RECREATIONAL_TEAMSPORTS = 86, + STR_RECREATIONAL_FINESSGAMING = 87, + STR_RECREATIONAL_HIKING = 88, + STR_RECREATIONAL_EQUESTRIANSPORTS = 89, + STR_RECREATIONAL_PLAY = 90, + STR_BALL_GAMES = 91, + STR_BALL_BADMINTON = 92, + STR_BALL_TABLETENNIS = 93, + STR_BALL_TENNIS = 94, + STR_BALL_BILLIARDS = 95, + STR_BALL_BOWLING = 96, + STR_BALL_VOLLEYBALL = 97, + STR_BALL_SHUTTLECOCK = 98, + STR_BALL_HANDBALL = 99, + STR_BALL_BASEBALL = 100, + STR_BALL_SOFTBALL = 101, + STR_BALL_CRICKET = 102, + STR_BALL_FOOTBALL = 103, + STR_BALL_BEACHSOCCER = 104, + STR_BALL_BEACHVOLLEYBALL = 105, + STR_BALL_CROQUET = 106, + STR_BALL_HOCKEY = 107, + STR_BALL_SQUASH = 108, + STR_BALL_SEPAKTAKRAW = 109, + STR_BALL_DODGEBALL = 110, + STR_BALL_BASKETBALL = 111, + STR_BALL_SOCCER = 112, + STR_BALL_GOLF = 113, + STR_BALL_POLO = 114, + STR_BALL_RACQUETBALL = 115, + STR_BALL_RUGBY = 116, + STR_BALL_GATEBALL = 117, + STR_BALL_PICKLEBALL = 118, + STR_BALL_LACROSSE = 119, + STR_WATER_ACTIVITIES = 120, + STR_WATER_SAILING = 121, + STR_WATER_SURFING = 122, + STR_WATER_WHITEWATERRAFTING = 123, + STR_WATER_CANOEING = 124, + STR_WATER_KAYAKING = 125, + STR_WATER_ROWING = 126, + STR_WATER_MOTORBOAT = 127, + STR_WATER_SUP = 128, + STR_WATER_SCUBADIVING = 129, + STR_WATER_DIVING = 130, + STR_WATER_KITESURFING = 131, + STR_WATER_WAKEBOARDING = 132, + STR_WATER_POLO = 133, + STR_WATER_WINDSURFING = 134, + STR_WATER_DRIFTING = 135, + STR_WATER_FITNESS = 136, + STR_WATER_SPORTS = 137, + STR_WATER_OUTDOORSWIM = 138, + STR_WATER_INDOORSWIM = 139, + STR_WATER_SWIMFREESTYLE = 140, + STR_WATER_SWIMBREASTSTROKE = 141, + STR_WATER_SWIMBACKSTROKE = 142, + STR_WATER_SWIMBUTTERFLY = 143, + STR_ICE_SPORTS = 144, + STR_ICE_SKATING = 145, + STR_ICE_HOCKEY = 146, + STR_ICE_CURLING = 147, + STR_ICE_SNOWMOBILING = 148, + STR_ICE_SLED = 149, + STR_ICE_BIATHLON = 150, + STR_ICE_CROSSCOUNTRYSKING = 151, + STR_ICE_SKIING = 152, + STR_ICE_SNOWBOARDING = 153, + STR_ICE_SNOWSHOEING = 154, + STR_ICE_SNOWSPORTS = 155, + STR_EXTREME_SPORTS = 156, + STR_EXTREME_SKATEBOARDING = 157, + STR_EXTREME_ROCKCLIMBING = 158, + STR_EXTREME_BUNGEEJUMPING = 159, + STR_EXTREME_PARKOUR = 160, + STR_EXTREME_BMX = 161, + STR_EXTREME_ORIENTEERING = 162, + STR_EXTREME_PARACHUTE = 163, + STR_EXTREME_RACING = 164, + STR_EXTREME_TRIATHLONS = 165, + STR_OTHER_ELEVATOR = 166, + STR_OTHER_ESCALATOR = 167, + STR_OTHER_GARDENING = 168, + STR_OTHER_HORSEWORK = 169, + STR_OTHER_INVEHICLE = 170, + STR_OTHER_MEDITATION = 171, + STR_OTHER_STILL = 172, + STR_OTHER_TILTING = 173, + STR_OTHER_WHEELCHAIR = 174, + STR_MAX_ID = 175, +}; // UIResourceTextId + +enum FontLanguageId : uint8_t { + LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, + LANGUAGE_ID_MAX +}; // UITextLanguageTextId +} +#endif /* UI_RESOURCE_STRING_H */ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang new file mode 100644 index 000000000..a9aa37ad9 Binary files /dev/null and b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/config.json b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/config.json deleted file mode 100644 index 005a9cbc0..000000000 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "languages": { - "zh": { - "path": "user/res/language_config/font/zh.lang" - }, - "en": { - "path": "user/res/language_config/font/en.lang" - } - }, - "languages_satuas": 0 -} \ No newline at end of file diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/en.lang deleted file mode 100644 index a58e4c0b5..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/en.lang and /dev/null differ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/ui_resource_string.h b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/ui_resource_string.h deleted file mode 100644 index 309da6b0f..000000000 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/ui_resource_string.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -* Copyright (c) xxxxxxxx Technologies Co., Ltd. 2021-2021. All rights reserved. -* Description: language -* Author: Graphic develop team -* Create: 2021-07-06 -*/ - -#ifndef UI_RESOURCE_STRING_H -#define UI_RESOURCE_STRING_H -#include -namespace OHOS { -enum UIResourceTextId : uint16_t { - STR_IMAGE = 0, - STR_PROGRESSBAR = 1, - STR_SLIDEUNLOCK = 2, - STR_LISTBOX = 3, - STR_BUTTON = 4, - STR_SCROLLVIEW = 5, - STR_SCROLLGRID = 6, - STR_CLOCK = 7, - STR_DISTURBANCE = 8, - STR_BRIGHT = 9, - STR_PHONE = 10, - STR_LANGAGE = 11, - STR_ALARM = 12, - STR_SYSTEM = 13, - STR_SPO2 = 14, - STR_COMPASS = 15, - STR_INDOORWALK = 16, - STR_WEATHER = 17, - STR_SYSTEMSETTING = 18, - STR_MAX_ID = 19, -}; // UIResourceTextId - -enum FontLanguageId : uint8_t { - LANGUAGE_ID_ZH, - LANGUAGE_ID_EN, - LANGUAGE_ID_MAX -}; // UITextLanguageTextId -} -#endif /* UI_RESOURCE_STRING_H */ diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/zh.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/zh.lang deleted file mode 100644 index de8ffb0fa..000000000 Binary files a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/zh.lang and /dev/null differ diff --git a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h index c62c3cdc1..4b63a572a 100644 --- a/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h +++ b/code/sdk/drivers/peripheral/cywee/Inc/cywee_hal.h @@ -429,6 +429,8 @@ typedef struct extern void get_gsonsen_xyz(gsenson_t *t); +extern void gsensor_get_n_data(uint8_t cnt); + #pragma pack() @@ -450,6 +452,8 @@ extern void get_gsonsen_xyz(gsenson_t *t); int cywee_main_dml(void); void cywee_int_handler(void); + + #ifdef __cplusplus #if __cplusplus } diff --git a/code/sdk/drivers/peripheral/cywee/src/main_dml.c b/code/sdk/drivers/peripheral/cywee/src/main_dml.c index 017442ccb..d3b01a5ea 100644 --- a/code/sdk/drivers/peripheral/cywee/src/main_dml.c +++ b/code/sdk/drivers/peripheral/cywee/src/main_dml.c @@ -19,13 +19,15 @@ int16_t gsensor_z[24] = {0}; #define GSENSON_MSG_COUNT 16 osal_mutex mutex_gsenson_queue; +osal_mutex mutex_gsensor_queue_ext; static unsigned long gsenson_queue; + void uapi_GSENSON_create_queue(void) { - if (osal_msg_queue_create("battery_queue", GSENSON_MSG_COUNT, &gsenson_queue, - 0, sizeof(gsenson_t)) != ERRCODE_SUCC) { - //PRINT("[battery][service] app create mail fail\n"); + if ( (osal_msg_queue_create("gsensor_queue", GSENSON_MSG_COUNT, &gsenson_queue,0, sizeof(gsenson_t)) )!= ERRCODE_SUCC) + { + CWM_OS_dbgPrintf("gsensor_queue create fail\r\n"); } osal_mutex_init(&mutex_gsenson_queue); @@ -33,74 +35,83 @@ void uapi_GSENSON_create_queue(void) static gsenson_t gxyz_t; static uint8_t gsenson_falg=0; + +static uint16 num_falg=0; +static gsenson_t gxyz_t_queue[16]={0}; +static int16 left_falg=0; +static int16 right_falg=-1; + + void get_gsonsen_xyz(gsenson_t *t) { - if(osal_mutex_trylock(&mutex_gsenson_queue)==0) + if(osal_mutex_trylock(&mutex_gsenson_queue)==0) + { + CWM_OS_dbgPrintf("get_gsonsen_xyz_fail\n"); + return; + } + t->x = gxyz_t_queue[left_falg].x; + t->y = gxyz_t_queue[left_falg].y; + t->z = gxyz_t_queue[left_falg].z; + osal_mutex_unlock(&mutex_gsenson_queue); +} + +void gsensor_get_n_data(uint8_t cnt) +{ + for(int i=0;ix=gxyz_t.x; - t->y=gxyz_t.y; - t->z=gxyz_t.z; - CWM_OS_dbgPrintf("get_gsonsen_%d,%d,%d\n",t->x, t->y,t->z); - osal_mutex_unlock(&mutex_gsenson_queue); -} +} +//static int flag=32; void CWM_AP_SensorListen(pSensorEVT_t sensorEVT) { switch (sensorEVT->sensorType) { case IDX_ACCEL: - #if 1 - // CWM_OS_dbgPrintf("acc: x=%.3f, y=%.3f, z=%.3f\n", - // sensorEVT->fData[0], - // sensorEVT->fData[1], - // sensorEVT->fData[2] - // ); - if(osal_msg_queue_is_full(gsenson_queue)) - { - - gsenson_t t; - int ret=osal_msg_queue_read_copy(gsenson_queue, &t, sizeof(gsenson_t),OSAL_MSGQ_NO_WAIT); - if(osal_mutex_trylock(&mutex_gsenson_queue)==0) - { - CWM_OS_dbgPrintf("get_gsonsen_xxxxxxxx_fail\n"); - break; - } - gxyz_t.x=t.x; - gxyz_t.y=t.y; - gxyz_t.z=t.z; - osal_mutex_unlock(&mutex_gsenson_queue); - - if(ret!=0) - { - CWM_OS_dbgPrintf("osal_msg_queue_read_copyz_fail\n"); - } - t.x=sensorEVT->fData[0]*1024; - t.y=sensorEVT->fData[1]*1024; - t.z=sensorEVT->fData[2]*1024; - ret=osal_msg_queue_write_copy(gsenson_queue, &t, sizeof(gsenson_t),OSAL_MSGQ_NO_WAIT); - if(ret!=0) - { - CWM_OS_dbgPrintf("osal_msg_queue_write_copy_fail\n"); - } - - - } - else - { - gsenson_t t; - t.x=sensorEVT->fData[0]; - t.y=sensorEVT->fData[1]; - t.z=sensorEVT->fData[2]; - int ret= osal_msg_queue_write_copy(gsenson_queue, &t, sizeof(gsenson_t),OSAL_MSGQ_NO_WAIT); - if(ret!=0) - { - CWM_OS_dbgPrintf("osal_msg_queue_write_copy_fail\n"); - } - - } - + #if 1 + if(osal_mutex_trylock(&mutex_gsenson_queue)==0) + { + CWM_OS_dbgPrintf("get_gsonsen_xxxxxxxx_fail\n"); + break; + } + if(num_falg==16) + { + left_falg++; + right_falg++; + right_falg=right_falg%16; + left_falg=left_falg%16; + gxyz_t_queue[right_falg].x= sensorEVT->fData[0]; + gxyz_t_queue[right_falg].y= sensorEVT->fData[1]; + gxyz_t_queue[right_falg].z= sensorEVT->fData[2]; + + } + else + { + //left_falg++; + right_falg++; + right_falg=right_falg%16; + //left_falg=left_falg%16; + num_falg++; + gxyz_t_queue[right_falg].x= sensorEVT->fData[0]; + gxyz_t_queue[right_falg].y= sensorEVT->fData[1]; + gxyz_t_queue[right_falg].z= sensorEVT->fData[2]; + CWM_OS_dbgPrintf("write: x=%d, y=%d, z=%d\n", gxyz_t_queue[right_falg].x ,gxyz_t_queue[right_falg].y ,gxyz_t_queue[right_falg].z); + + } + osal_mutex_unlock(&mutex_gsenson_queue); #endif break; @@ -338,6 +349,7 @@ int cywee_main_dml(void) { CWM_SettingControl(SCL_CHIP_VENDOR_CONFIG, &scl); //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__); + uapi_GSENSON_create_queue(); CWM_LibPostInit(CWM_AP_SensorListen); //CWM_OS_dbgPrintf("[DBG] %s %d\n", __func__,__LINE__); diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 357eca4b5..f1c3f8dd8 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -619,7 +619,7 @@ errcode_t init_btaddr_btname(void) { //默认是:WatchSoar printf("是默认值,修改名称\n"); - sprintf_s((char*)(name),sizeof(name),"WatchSoar_%02X%02X",bd_addr[1],bd_addr[0]); + sprintf_s((char*)(name),sizeof(name),"WatchSoar%02X%02X",bd_addr[1],bd_addr[0]); printf("uapi_set_nv_btname %s , namelen %d\n",name,namelen); ret = uapi_set_nv_btname(name,strlen((char*)name)); if (ret != ERRCODE_SUCC) {