From aa778f923d74095fce354564bf221c186ff3d211 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Wed, 24 Apr 2024 01:37:25 +0000 Subject: [PATCH] Merge #71 into xts_origin from refs/changes/71/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/71/head: (9 commits squashed) - 增加震动提醒功能 - Merge branch 'xts_origin' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into xts_origin - 1.设置中增加网络与通话Slice,显示方式Slice去除快速访问Slice 2.修改多国语言适配设置界面 3.增加网络与通话界面图片 - Merge branch 'xts_origin' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into xts_origin - VoLTE,移动数据按钮增加点击监听 - 添加移动数据选项页面 - Merge branch 'xts_origin' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into xts_origin - 增加运动识别Slice - 修改设置视图以适配多国语言 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/71 --- .../wearable/fd230app/CMakeLists.txt | 9 + .../nativelauncher/include/AppViewIDs.h | 4 +- .../nativelauncher/include/NativeLauncher.h | 2 + .../nativelauncher/include/UiConfig.h | 6 +- .../nativelauncher/src/NativeLauncher.cpp | 52 ++- .../language/Language_xml/input_list_en.txt | 42 +-- .../language/Language_xml/input_list_zh.txt | 40 +-- .../language/Language_xml/language_en.xml | 40 +-- .../language/Language_xml/language_zh.xml | 40 +-- .../fd230app/nativeui/language/font/en.lang | Bin 5510 -> 4492 bytes .../fd230app/nativeui/language/font/ja.lang | Bin 6324 -> 6164 bytes .../language/font/ui_resource_string.h | 80 ++--- .../fd230app/nativeui/language/font/zh.lang | Bin 4907 -> 4138 bytes .../include/MotionRecognitionPresenter.h | 41 +++ .../include/MotionRecognitionView.h | 44 +++ .../src/MotionRecognitionPresenter.cpp | 115 +++++++ .../src/MotionRecognitionView.cpp | 171 ++++++++++ .../include/MobileDataOptionsView.h | 39 +++ .../include/NetworkAndCallPresenter.h | 42 +++ .../include/NetworkAndCallView.h | 69 ++++ .../src/MobileDataOptionsView.cpp | 169 ++++++++++ .../src/NetworkAndCallPresenter.cpp | 141 ++++++++ .../networkandcall/src/NetworkAndCallView.cpp | 303 ++++++++++++++++++ .../nativeui/settings/include/SettingItem.h | 5 +- .../settings/include/SettingItemView.h | 4 +- .../nativeui/settings/include/SettingModel.h | 4 +- .../nativeui/settings/src/SettingItemView.cpp | 13 +- .../nativeui/settings/src/SettingModel.cpp | 26 +- .../fd230/fs/user/res/font/en.lang | Bin 5510 -> 4492 bytes .../fd230/fs/user/res/font/ja.lang | Bin 6324 -> 6164 bytes .../fs/user/res/font/ui_resource_string.h | 80 ++--- .../fd230/fs/user/res/font/zh.lang | Bin 4907 -> 4138 bytes .../res/settings/SETTINGS_DISPLAY_MODE.bin | Bin 0 -> 2840 bytes .../settings/SETTINGS_MOTION_RECOGNITION.bin | Bin 0 -> 2840 bytes .../res/settings/SETTINGS_NETWORKANDCALL.bin | Bin 0 -> 2840 bytes .../res/settings/SETTINGS_QUICK_ACCESS.bin | Bin 2840 -> 0 bytes 36 files changed, 1294 insertions(+), 287 deletions(-) create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionPresenter.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp create mode 100644 code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp create mode 100644 code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/MobileDataOptionsView.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallPresenter.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallView.h create mode 100644 code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/MobileDataOptionsView.cpp create mode 100644 code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp create mode 100644 code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallView.cpp create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_DISPLAY_MODE.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_MOTION_RECOGNITION.bin create mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_NETWORKANDCALL.bin delete mode 100644 code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_QUICK_ACCESS.bin diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index 499db9233..362be0696 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -317,6 +317,15 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/flashlight/src/FlashlightView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/flashlight/src/FlashlightModel.cpp + #网络与通话 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/networkandcall/src/NetworkAndCallView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/networkandcall/src/MobileDataOptionsView.cpp + + #运动识别 + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/motionrecognition/src/MotionRecognitionView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/language/LanguageInit.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/config/src/ConfigModel.cpp diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h index c40e47e27..4aae8b9e8 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h @@ -58,6 +58,8 @@ typedef enum : uint16_t VIEW_DNOTDISTURB, // 勿扰模式 VIEW_FLASHLIGHT, // 手电筒 VIEW_BRIGHTNESSLEVEL, // 亮度调节 + VIEW_NETWORKANDCALL, // 网络与通话 + VIEW_MOTION_RECOGNITION, // 运动识别 /* ----------------------------------- 录音 ----------------------------------- */ VIEW_RECORD, /* ---------------------------------- 界面 ---------------------------------- */ @@ -104,7 +106,7 @@ typedef enum : uint16_t #ifdef SUPPORT_ALIPAY_SEC VIEW_MAIN_ALIPAY, #endif - VIEW_SET_DESKTOP, + VIEW_SET_DESKTOP,//显示方式 VIEW_SET_CARD, VIEW_ADD_CARD, VIEW_SET_DIAL, diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h index 3ec99394b..8af622f47 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h @@ -54,6 +54,8 @@ namespace OHOS void InitDnotDisturbSlice(void); void InitFlashlightSlice(void); void InitBrightnessLevelSlice(void); + void InitNetworkAndCallSlice(void); + void InitMotionRecognitionSlice(void); /* --------------------------------界面------------------------------------ */ void InitRotateSlice(void); void InitBloodSlice(void); diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h index 3de41cc9f..34b83510f 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/UiConfig.h @@ -241,7 +241,7 @@ namespace OHOS static constexpr const char *PNG_A019_095_IMAGE_PATH = APP_RES_PATH "/BLUETOOTH_IMAGE_16.bin"; static constexpr const char *PNG_BLUETOOTHEAR = APP_RES_PATH "/BLUETOOTHEAR.bin"; /* --------------------------------- AppList -------------------------------- */ - static constexpr const char *PNG_APPLIST_THEME_IMAGE = APP_LIST_PATH "/theme.bin"; // 主题样式 + static constexpr const char *PNG_APPLIST_THEME_IMAGE = APP_LIST_PATH "/theme.bin"; // 显示方式 static constexpr const char *PNG_APPLIST_CARDSET_IMAGE = APP_LIST_PATH "/cardsetting.bin"; // 卡片管理 static constexpr const char *PNG_APPLIST_CHANGEDIAL_IMAGE = APP_LIST_PATH "/changedial.bin"; // 切换表盘 static constexpr const char *PNG_APPLIST_ALARM_IMAGE = APP_LIST_PATH "/alarm.bin"; // 闹钟 @@ -287,9 +287,11 @@ namespace OHOS static constexpr const char *PNG_WALK_STEPS_IMAGE = APP_RES_PATH "/STEPS_IMAGE.bin"; /* ----------------------------------- 设置 ----------------------------------- */ static constexpr const char *PNG_SETTINGS_DISPLAY_BRIGHTNESS = APP_RES_PATH "/settings/SETTINGS_DISPLAY_BRIGHTNESS.bin"; // 显示与亮度 + static constexpr const char *PNG_SETTINGS_NETWORKANDCALL = APP_RES_PATH "/settings/SETTINGS_NETWORKANDCALL.bin"; // 通话与网络 static constexpr const char *PNG_SETTINGS_BLUETOOTH = APP_RES_PATH "/settings/SETTINGS_BLUETOOTH.bin"; // 蓝牙 static constexpr const char *PNG_SETTINGS_SOUND_VIBRATION = APP_RES_PATH "/settings/SETTINGS_SOUND_VIBRATION.bin"; // 声音与震动 - static constexpr const char *PNG_SETTINGS_SECONDARY_FUNCTION = APP_RES_PATH "/settings/SETTINGS_QUICK_ACCESS.bin"; // 辅助功能 + static constexpr const char *PNG_SETTINGS_DISPLAY_MODE = APP_RES_PATH "/settings/SETTINGS_DISPLAY_MODE.bin"; // 显示方式 + static constexpr const char *PNG_SETTINGS_MOTION_RECOGNITION = APP_RES_PATH "/settings/SETTINGS_MOTION_RECOGNITION.bin"; // 运动识别 static constexpr const char *PNG_SETTINGS_SYSTEM = APP_RES_PATH "/settings/SETTINGS_SYSTEM.bin"; // 系统 static constexpr const char *PNG_SETTINGS_SETTINGS_POWER_CONTROL = APP_RES_PATH "/settings/SETTINGS_POWER_CONTROL.bin"; // 关机和重启 /* ---------------------------------- 消息中心 ---------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 8446d4325..38660a6ce 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -158,6 +158,12 @@ #include "brightnesslevel/include/BrightnessLevelPresenter.h" #include "brightnesslevel/include/BrightnessLevelView.h" + +#include "networkandcall/include/NetworkAndCallPresenter.h" +#include "networkandcall/include/NetworkAndCallView.h" + +#include "motionrecognition/include/MotionRecognitionPresenter.h" +#include "motionrecognition/include/MotionRecognitionView.h" /* -------------------------------------------------------------------------- */ #include "traing/include/TraingView.h" #include "traing/include/TraingPresenter.h" @@ -236,16 +242,19 @@ namespace OHOS {VIEW_CONNECT_PHONE, &NativeLauncher::InitConnectPhoneSlice}, {VIEW_INDOORWALK, &NativeLauncher::InitIndoorWalkSlice}, {VIEW_SHUTDOWN_OR_REBOOT, &NativeLauncher::InitRebootSlice}, - {VIEW_WEATHER, &NativeLauncher::InitWeatherSlice}, // 天气 - {VIEW_SYSTEM, &NativeLauncher::InitSystemSlice}, // 系统实例化地址 - {VIEW_SOUND_VIBRATION, &NativeLauncher::InitSoundAndVibrationSlice}, // 声音与震动实例化地址 - {VIEW_SYSTEM_VOLUME, &NativeLauncher::InitSystemVolumeSlice}, // 系统音量 - {VIEW_CALL_VOLUME, &NativeLauncher::InitCallVolumeSlice}, // 系统音量 - {VIEW_CLASSIC_BLUETOOTH, &NativeLauncher::InitClassicBluetoothSlice}, // 经典蓝牙slice - {VIEW_DISPLAY_BRIGHTNESS, &NativeLauncher::InitDisplayBrightnessSlice}, // 显示与亮度的实例化地址 - {VIEW_SECONDARY_FUNCTION, &NativeLauncher::InitSecondaryFunction}, - {VIEW_FAST_TRAINING, &NativeLauncher::InitFastTrainingSlice}, - {VIEW_FAST_TRAINING_ATTENTION, &NativeLauncher::InitFastTrainingAttentionSlice}, + {VIEW_WEATHER, &NativeLauncher::InitWeatherSlice}, // 天气 + {VIEW_SYSTEM, &NativeLauncher::InitSystemSlice}, // 系统实例化地址 + {VIEW_SOUND_VIBRATION, &NativeLauncher::InitSoundAndVibrationSlice}, // 声音与震动实例化地址 + {VIEW_SYSTEM_VOLUME, &NativeLauncher::InitSystemVolumeSlice}, // 系统音量 + {VIEW_CALL_VOLUME, &NativeLauncher::InitCallVolumeSlice}, // 系统音量 + {VIEW_CLASSIC_BLUETOOTH, &NativeLauncher::InitClassicBluetoothSlice}, // 经典蓝牙slice + {VIEW_DISPLAY_BRIGHTNESS, &NativeLauncher::InitDisplayBrightnessSlice}, // 显示与亮度的实例化地址 + {VIEW_NETWORKANDCALL, &NativeLauncher::InitNetworkAndCallSlice}, // 网络与通话 + {VIEW_MOTION_RECOGNITION, &NativeLauncher::InitMotionRecognitionSlice}, // 网络与通话 + + // {VIEW_SECONDARY_FUNCTION, &NativeLauncher::InitSecondaryFunction}, + // {VIEW_FAST_TRAINING, &NativeLauncher::InitFastTrainingSlice}, + // {VIEW_FAST_TRAINING_ATTENTION, &NativeLauncher::InitFastTrainingAttentionSlice}, {VIEW_RECORD, &NativeLauncher::InitRecordingSlice}, // 录音实例化地址 {VIEW_FIND_PHONE, &NativeLauncher::InitFindPhoneSlice}, @@ -1044,6 +1053,29 @@ namespace OHOS NativeAbility::GetInstance().AddSliceProxy(VIEW_BRIGHTNESSLEVEL, brightnesslevel); } + /*网络与通话*/ + void NativeLauncher::InitNetworkAndCallSlice(void) + { + SliceProxy *networkandcall = new AbilitySliceProxy; + if (networkandcall == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "networkandcall"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_NETWORKANDCALL, networkandcall); + } + + /*网络与通话*/ + void NativeLauncher::InitMotionRecognitionSlice(void) + { + SliceProxy *motionrecognition = new AbilitySliceProxy; + if (motionrecognition == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "motionrecognition"); + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_MOTION_RECOGNITION, motionrecognition); + } /* -------------------------------------------------------------------------- */ void NativeLauncher::InitSetDesktopSlice(void) { 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 index fe332eb13..7e54217b0 100644 --- 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 @@ -238,43 +238,11 @@ STR_OFF$Off STR_MORE$More STR_SETTING$Setting STR_SCREEN_AND_BRIGHTNESS$Screen and Brightness -STR_BRIGHTNESS_ADJUSTMENT$Brightness Adjustment -STR_SCREEN_ON_DURATION$Screen On Duration -STR_5_SECONDS$5 Seconds -STR_10_SECONDS$10 Seconds -STR_15_SECONDS$15 Seconds -STR_30_SECONDS$30 Seconds -STR_60_SECONDS$60 Seconds -STR_300_SECONDS$300 Seconds -STR_RAISE_TO_WAKE$Raise to Wake +STR_NETWORKANDCALL$NetworkAndCall STR_BLUETOOTH$Bluetooth -STR_BLUETOOTH_HEADPHONES$Bluetooth Headphones -STR_TRADITIONAL_BLUETOOTH$Traditional Bluetooth -STR_AUTO_OFF_BLUETOOTH_NOTE$Note: It will be automatically turned off if the connection is not successful for 10 minutes after opening, because the traditional Bluetooth will increase the power consumption for a long time, it is recommended to use when necessary \n\n(this function is mainly used for phone calls/notifications, music control/transmission, etc.) STR_SOUND_AND_VIBRATION$Sound and Vibration -STR_SYSTEM_VOLUME$System Volume -STR_ALARM_REMINDERS_FIND_WATCH$Alarms, Reminders, Find Watch -STR_CALL_VOLUME$Call Volume -STR_WATCH_CALLS$Watch Calls -STR_MEDIA_VOLUME$Media Volume -STR_MUSIC_RECORDINGS_WORKOUTS$Music, Recordings, Workouts -STR_VIBRATION_REMINDER$Vibration Reminder -STR_SILENT_MODE$Silent Mode -STR_SYSTEM_VOLUME_UNAFFECTED$System Volume Unaffected -STR_QUICK_ACCESS$Quick Access -STR_ACCESSIBILITY$Accessibility -STR_ACCESSIBILITY_BUTTON$Accessibility Button -STR_QUICK_ACCESS_APP$This function can be set with the lower right button Quick access to the APP -STR_HEART_RATE_MONITORING$Heart Rate Monitoring -STR_BLOOD_OXYGEN_MONITORING$Blood Oxygen Monitoring -STR_SYSTEM$System -STR_ABOUT_WATCH$About Watch -STR_REGULATORY_MODE$Regulatory Mode -STR_SWITCH_LANGUAGE$Switch Language -STR_LANGUAGE$Language -STR_FACTORY_RESET$Factory Reset -STR_SYSTEM_UPDATE$System Update +STR_DISPLAY_MODE$Display Mode +STR_MOTION_RECOGNITION$Motion Recognition +STR_SYSTEM$System STR_SHUTDOWN_AND_RESTART$Shutdown and Restart -STR_RESTART$Restart -STR_SHUTDOWN$Shutdown -STR_4G_CAPABILITY$4G capability +STR_LANGUAGE$Language \ No newline at end of file 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 index b1dbddb5c..fa04d2891 100644 --- 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 @@ -238,43 +238,11 @@ STR_OFF$关闭 STR_MORE$更多 STR_SETTING$设置 STR_SCREEN_AND_BRIGHTNESS$屏幕与亮度 -STR_BRIGHTNESS_ADJUSTMENT$亮度调节 -STR_SCREEN_ON_DURATION$亮屏时长 -STR_5_SECONDS$5秒 -STR_10_SECONDS$10秒 -STR_15_SECONDS$15秒 -STR_30_SECONDS$30秒 -STR_60_SECONDS$60秒 -STR_300_SECONDS$300秒 -STR_RAISE_TO_WAKE$抬腕亮屏 +STR_NETWORKANDCALL$网络与通话 STR_BLUETOOTH$蓝牙 -STR_BLUETOOTH_HEADPHONES$蓝牙耳机 -STR_TRADITIONAL_BLUETOOTH$传统蓝牙 -STR_AUTO_OFF_BLUETOOTH_NOTE$注:开启后10分钟没连接成功会自动关闭,因为传统蓝牙长时间打开会增加电耗,建议在有需要的时候使用\n\n(该功能主要用于电话拨打/通知、音乐控制/传输等) STR_SOUND_AND_VIBRATION$声音与震动 -STR_SYSTEM_VOLUME$系统音量 -STR_ALARM_REMINDERS_FIND_WATCH$闹钟、提醒、查找手表 -STR_CALL_VOLUME$通话音量 -STR_WATCH_CALLS$手表通话 -STR_MEDIA_VOLUME$媒体音量 -STR_MUSIC_RECORDINGS_WORKOUTS$音乐、录音、训练 -STR_VIBRATION_REMINDER$震动提醒 -STR_SILENT_MODE$静音模式 -STR_SYSTEM_VOLUME_UNAFFECTED$系统音量不受影响 -STR_QUICK_ACCESS$快速访问 -STR_ACCESSIBILITY$辅助功能 -STR_ACCESSIBILITY_BUTTON$辅助按钮 -STR_QUICK_ACCESS_APP$此功能可设置右下方按钮\n快速访问的APP -STR_HEART_RATE_MONITORING$心率监测 -STR_BLOOD_OXYGEN_MONITORING$血氧监测 +STR_DISPLAY_MODE$显示方式 +STR_MOTION_RECOGNITION$运动识别 STR_SYSTEM$系统 -STR_ABOUT_WATCH$关于手表 -STR_REGULATORY_MODE$监管模式 -STR_SWITCH_LANGUAGE$切换语言 -STR_LANGUAGE$语言 -STR_FACTORY_RESET$恢复出厂 -STR_SYSTEM_UPDATE$系统升级 STR_SHUTDOWN_AND_RESTART$关机和重启 -STR_RESTART$重启 -STR_SHUTDOWN$关机 -STR_4G_CAPABILITY$4G能力 \ No newline at end of file +STR_LANGUAGE$语言 \ 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 index c88f33d17..e8e06175e 100644 --- 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 @@ -239,44 +239,12 @@ - - - - - - - - - + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - + 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 index 2b507348f..b9ec11c70 100644 --- 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 @@ -239,44 +239,12 @@ - - - - - - - - - + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - + diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/en.lang index 263ee97cd0dd3a299c256b2ecc66c54af4a5705e..a97bfae195b9d388b14706873c4956d0cdaeeff6 100644 GIT binary patch delta 161 zcmZqE?ok%|_VgTEY90d$_|33U>;kitIxho*ArQL)aS#xv0&xxyH}Y<7V3Fbt_Dd}( z&o9b$%u8`j%*kPJ$|+4P$Ow9!UJ^S*&g&$MfT~qb1$GkZI?Bbd4$Il(G5l4PY$KId$ zdZNCxAVeG71G_*14Tj(;cnMyEci=NPeM*RBum-ll0nlIsUV%5@BlrTofuGrVB{VAy+V=Z~Wg6`LTsnPWEe(9q53 zWKho+((`lZPzUb>v`c8_J0Zi*B>b2c?A^ zvF&88Qf8@X?3-L4*udB6PN1REntDt!23tX4Cbb?>h|X|MwkSvy6iOyYHk_q6q&yiL z$j2;0xkc1e*xC`wsg#LP<%7 z9r?f&?OGix7HutEgBVN!ks@T){)kcW2n8D<(*{^U8S*wv}tn|N5s&Mkwt-daxNZ4l^s&M8KxLNR8MIYMo0hAdJF*z zynUpRnKWsAYR_qxuzG38x*1;cMNqGKi^f@GlO>HQxwW^p1UA(L>d3&5X;iQdbzzgO z&FSHjQ6Gc+=X_j*X!lU^q;VbYM=d>G98C&^jI5;l()6S3vzQqhGHbj#46)OG>y|5*r2AZG|17)#i%iWUrlCyZbJ2gvd{NcOx zojA;sKeL|3vlc=@;{t;#Y&dY?!N&~&LPUs>;Eog-ay;-vff6sgQQ?Cc4O%T`X(=5Y H!v35cWN{8j 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 index 70d61000e..73166d395 100644 --- 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 @@ -1,15 +1,15 @@ -/* -* 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 { +/* +* 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, @@ -253,53 +253,21 @@ enum UIResourceTextId : uint16_t { STR_INSUFFICIENT_EXERCISE_AMOUNT = 240, STR_SETTING = 241, STR_SCREEN_AND_BRIGHTNESS = 242, - STR_BRIGHTNESS_ADJUSTMENT = 243, - STR_SCREEN_ON_DURATION = 244, - STR_5_SECONDS = 245, - STR_10_SECONDS = 246, - STR_15_SECONDS = 247, - STR_30_SECONDS = 248, - STR_60_SECONDS = 249, - STR_300_SECONDS = 250, - STR_RAISE_TO_WAKE = 251, - STR_BLUETOOTH = 252, - STR_BLUETOOTH_HEADPHONES = 253, - STR_TRADITIONAL_BLUETOOTH = 254, - STR_AUTO_OFF_BLUETOOTH_NOTE = 255, - STR_SOUND_AND_VIBRATION = 256, - STR_SYSTEM_VOLUME = 257, - STR_ALARM_REMINDERS_FIND_WATCH = 258, - STR_CALL_VOLUME = 259, - STR_WATCH_CALLS = 260, - STR_MEDIA_VOLUME = 261, - STR_MUSIC_RECORDINGS_WORKOUTS = 262, - STR_VIBRATION_REMINDER = 263, - STR_SILENT_MODE = 264, - STR_SYSTEM_VOLUME_UNAFFECTED = 265, - STR_QUICK_ACCESS = 266, - STR_ACCESSIBILITY = 267, - STR_ACCESSIBILITY_BUTTON = 268, - STR_QUICK_ACCESS_APP = 269, - STR_HEART_RATE_MONITORING = 270, - STR_BLOOD_OXYGEN_MONITORING = 271, - STR_SYSTEM = 272, - STR_ABOUT_WATCH = 273, - STR_REGULATORY_MODE = 274, - STR_SWITCH_LANGUAGE = 275, - STR_LANGUAGE = 276, - STR_FACTORY_RESET = 277, - STR_SYSTEM_UPDATE = 278, - STR_SHUTDOWN_AND_RESTART = 279, - STR_RESTART = 280, - STR_SHUTDOWN = 281, - STR_4G_CAPABILITY = 282, - STR_MAX_ID = 283, + STR_NETWORKANDCALL = 243, + STR_BLUETOOTH = 244, + STR_SOUND_AND_VIBRATION = 245, + STR_DISPLAY_MODE = 246, + STR_MOTION_RECOGNITION = 247, + STR_SYSTEM = 248, + STR_SHUTDOWN_AND_RESTART = 249, + STR_LANGUAGE = 250, + STR_MAX_ID = 251, }; // UIResourceTextId - -enum FontLanguageId : uint8_t { + +enum FontLanguageId : uint8_t { LANGUAGE_ID_JA, - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang b/code/sdk/application/wearable/fd230app/nativeui/language/font/zh.lang index b8c4591b2047ff1fd40938f9b092aace60f9167e..2624d3afaf4767f63d1c8eedac9691ed3ef9b71d 100644 GIT binary patch delta 159 zcmZ3jwn{;)n|%>ORR#kJ_|33U>;kjYO>PE;2SEG*i2njH7Y_r2AP_6^Y;IsV%^m-I z@5JZ3=RDcb_p)Kui}iCEUQC|*ymKbQ)5RNJ&fg3Yp40xcYX!rz8T+0u+4XGN&Zm3& z8D8w402F(%zU^tpYKG^VcR$}fpW$ii=4W$uJ)P9^vc31|g!K$B)~|iBqJaSbgf>f> delta 933 zcmY+C&rcIU6vv;@!~?>~kPu?@M2r_8hzD<;h&K<$6BlDlI1w*iymX<$c3b+x7TB~D z+5)93*ey^YWxH+9#)~KZ0rt(#UhKt_C%@ZWjcoGSdGp@9@4PoNhYyY>M)&XUjeS_4 zYv1^dlhGeHBbP%&S3rWF;1~D}=nm0sa2Je&hhP>A4-?%3kHB;A3cLaDfCe_f9N z=+UfO%hL4J;6Jcu2KJM|e`abhi1-(|vJs?_%x$|`J{+Xd6h(_1yX>}0VMH{IzFlBj z;Y@=wsp%<>MOM9RNt{+>Z%3r6B9`HJ$*~JkJ>;=G?m0w>9FuV?WqR zc|{e4liO^gZMZx&O`d*%CXp}F8E-Y~8>OnyxbaH=X z2D>AhI~#DpkY?R&M=97d5GQXtkDxFrY^Sf4;k1&R*12=Sxg>G#$Wuzv>_t4?B-vfz z_~+mh!iiYZysSy0z8|M2?Uwf5Nt`7} zRupku3n#(35H1#n?6>+B{Uhd@m9S)vsUo>68+B, + public UIView::OnClickListener, + public RootView::OnKeyActListener, + public UIView::OnDragListener + { + public: + MotionRecognitionPresenter(); + virtual ~MotionRecognitionPresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static MotionRecognitionPresenter *GetInstance(); + + private: + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + bool OnDragEnd(UIView &view, const DragEvent &event) override; + bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件 + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h new file mode 100644 index 000000000..28e9bf1ad --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h @@ -0,0 +1,44 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 17:29:18 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 18:03:26 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/include/MotionRecognitionView.h + */ +#ifndef MOTION_RECOGNITION_VIEW_H +#define MOTION_RECOGNITION_VIEW_H + +#include "BaseView.h" +#include "View.h" + +#include "components/ui_scroll_view.h" +#include "components/ui_label_ext.h" +#include "components/ui_image_view.h" +#include "components/ui_toggle_button.h" +namespace OHOS +{ + class MotionRecognitionPresenter; + class MotionRecognitionView : public View + { + + public: + MotionRecognitionView(); + virtual ~MotionRecognitionView(); + static MotionRecognitionView *GetInstance(void); + UIToggleButton *GetMotionRecognitionToggleButton(void); + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + void MotionRecognitionViewInit(void); + void ClearAll(void); + UIScrollView *scrollView = nullptr; + UILabel *Title = nullptr; + UIImageView *MotionRecognitionImage = nullptr; + UILabel *MotionRecognitionLabel = nullptr; + UIToggleButton *MotionRecognitionToggleButton = nullptr; + }; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp new file mode 100644 index 000000000..a322c4a45 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionPresenter.cpp @@ -0,0 +1,115 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-03-28 14:17:43 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 18:12:26 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/language/src/MotionRecognitionPresenter.cpp + */ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "motionrecognition/include/MotionRecognitionPresenter.h" +#include "motionrecognition/include/MotionRecognitionView.h" +#include "common/key_code.h" +#include + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static MotionRecognitionPresenter *g_pMotionRecognitionPresenter = nullptr; + + MotionRecognitionPresenter::MotionRecognitionPresenter() + { + g_pMotionRecognitionPresenter = this; + } + + MotionRecognitionPresenter::~MotionRecognitionPresenter() + { + g_pMotionRecognitionPresenter = nullptr; + } + + MotionRecognitionPresenter *MotionRecognitionPresenter::GetInstance() + { + return g_pMotionRecognitionPresenter; + } + + void MotionRecognitionPresenter::OnStart() + { + Presenter::OnStart(); + } + + void MotionRecognitionPresenter::OnPause(void) + { + Presenter::OnPause(); + } + + void MotionRecognitionPresenter::OnResume(void) + { + Presenter::OnResume(); + } + + void MotionRecognitionPresenter::OnStop(void) + { + Presenter::OnStop(); + } + + bool MotionRecognitionPresenter::OnClick(UIView &view, const ClickEvent &event) + { + UNUSED(event); + MotionRecognitionView *p_MotionRecognitionView = MotionRecognitionView::GetInstance(); + if (p_MotionRecognitionView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " MotionRecognitionView::GetInstance() fail!"); + return false; + } + + UIToggleButton *toggleButton = dynamic_cast(&view); + if (p_MotionRecognitionView->GetMotionRecognitionToggleButton() == toggleButton) + { + if (toggleButton != nullptr) + { + if (toggleButton->GetState() == true) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognition is enable!"); + } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognition is disable!"); + } + } + } + + return true; + } + + bool MotionRecognitionPresenter::OnDrag(UIView &view, const DragEvent &event) + { + UNUSED(view); + UNUSED(event); + return true; + } + + bool MotionRecognitionPresenter::OnDragEnd(UIView &view, const DragEvent &event) + { + UNUSED(view); + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) + { + NativeAbility::GetInstance().Back(); + } + return true; + } + + bool MotionRecognitionPresenter::OnKeyAct(UIView &view, const KeyEvent &event) // 增加按键事件 + { + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MotionRecognitionPresenter::OnKeyAct"); + unsigned short keyID = event.GetKeyId(); + unsigned short keyState = event.GetState(); + // 如果是power键,且是亮屏状态,按键释放就返回上一级 + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) + { + NativeAbility::GetInstance().Back(); + } + return true; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp new file mode 100644 index 000000000..3547c014b --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp @@ -0,0 +1,171 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 17:28:52 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 19:09:24 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp + */ +#include "motionrecognition/include/MotionRecognitionPresenter.h" +#include "motionrecognition/include/MotionRecognitionView.h" +#include "wearable_log.h" +namespace OHOS +{ + + static MotionRecognitionView *g_pMotionRecognitionView{nullptr}; + + MotionRecognitionView::MotionRecognitionView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognitionView::MotionRecognitionView"); + g_pMotionRecognitionView = this; + } + + MotionRecognitionView::~MotionRecognitionView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MotionRecognitionView::~MotionRecognitionView"); + ClearAll(); + g_pMotionRecognitionView = nullptr; + } + + MotionRecognitionView *MotionRecognitionView::GetInstance() + { + return g_pMotionRecognitionView; + } + + void MotionRecognitionView::ClearAll(void) + { + if (scrollView != nullptr) + { + scrollView->RemoveAll(); + + if (Title != nullptr) + { + delete Title; + Title = nullptr; + } + + if (MotionRecognitionImage != nullptr) + { + delete MotionRecognitionImage; + MotionRecognitionImage = nullptr; + } + if (MotionRecognitionLabel != nullptr) + { + delete MotionRecognitionLabel; + MotionRecognitionLabel = nullptr; + } + + if (MotionRecognitionToggleButton != nullptr) + { + delete MotionRecognitionToggleButton; + MotionRecognitionToggleButton = nullptr; + } + + delete scrollView; + scrollView = nullptr; + } + } + + void MotionRecognitionView::MotionRecognitionViewInit(void) + { + + if (scrollView == nullptr) + { + scrollView = new UIScrollView(); + scrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + scrollView->SetScrollBlankSize(50); + scrollView->SetReboundSize(35); + /* -------------------------------------------------------------------------- */ + if (Title == nullptr) + { + Title = new UILabel(); + } + Title->SetPosition(83, 50, 300, 40); + Title->SetStyle(STYLE_TEXT_FONT, 30); + Title->SetStyle(STYLE_LINE_HEIGHT, 35); + Title->SetText("运动识别"); + Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(40); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + Title->SetVisible(true); + /* -------------------------------------------------------------------------- */ + if (MotionRecognitionImage == nullptr) + { + MotionRecognitionImage = new UIImageView(); + } + MotionRecognitionImage->SetPosition(43, 120, 380, 100); + MotionRecognitionImage->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + MotionRecognitionImage->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + MotionRecognitionImage->SetStyle(STYLE_BORDER_RADIUS, 100); + /* -------------------------------------------------------------------------- */ + if (MotionRecognitionLabel == nullptr) + { + MotionRecognitionLabel = new UILabel(); + } + MotionRecognitionLabel->SetPosition(90, 153, 180, 40); + MotionRecognitionLabel->SetStyle(STYLE_TEXT_FONT, 30); + MotionRecognitionLabel->SetStyle(STYLE_LINE_HEIGHT, 35); + MotionRecognitionLabel->SetText("自动识别"); + MotionRecognitionLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + MotionRecognitionLabel->SetRollSpeed(40); + MotionRecognitionLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* -------------------------------------------------------------------------- */ + MotionRecognitionToggleButton = new UIToggleButton(); + if (MotionRecognitionToggleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::MotionRecognitionToggleButton is nullptr!"); + return; + } + MotionRecognitionToggleButton->SetPosition(298, 145, 100, 50); + MotionRecognitionToggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + const char *selectedImg = "/user/res/TOGGLEBUTTON_ON.bin"; + const char *unSelectedImg = "/user/res/TOGGLEBUTTON_OFF.bin"; + MotionRecognitionToggleButton->SetImages(selectedImg, unSelectedImg); + /* ----------------------------- onclickListener ---------------------------- */ + UIView::OnClickListener *toggleButtonClick = static_cast(MotionRecognitionPresenter::GetInstance()); + MotionRecognitionToggleButton->SetOnClickListener(toggleButtonClick); + } + } + + void MotionRecognitionView::OnStart() + { + View::OnStart(); + MotionRecognitionViewInit(); + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::MotionRecognitionPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); + } + + void MotionRecognitionView::OnSetUpView() + { + View::OnSetUpView(); + scrollView->Add(Title); + scrollView->Add(MotionRecognitionImage); + scrollView->Add(MotionRecognitionLabel); + scrollView->Add(MotionRecognitionToggleButton); + RootView::GetInstance()->Add(scrollView); + Draw(); + } + + void MotionRecognitionView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void MotionRecognitionView::OnStop() + { + + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + RootView::GetInstance()->ClearOnKeyActListener(); + return; + } + + UIToggleButton *MotionRecognitionView::GetMotionRecognitionToggleButton(void) + { + return MotionRecognitionToggleButton; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/MobileDataOptionsView.h b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/MobileDataOptionsView.h new file mode 100644 index 000000000..691af5a83 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/MobileDataOptionsView.h @@ -0,0 +1,39 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 15:29:51 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 16:25:18 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/MobileDataOptionsView.h + */ + +#ifndef MOBILE_DATA_OPTIONS_VIEW_H +#define MOBILE_DATA_OPTIONS_VIEW_H + +#include "components/ui_toggle_button.h" +#include "components/ui_scroll_view.h" +#include "components/ui_label_ext.h" + +namespace OHOS +{ + static constexpr const char *MOBILEDATAOPTIONSVIEWID = "mobiledataoptionsview"; + class MobileDataOptionsView + { + public: + MobileDataOptionsView(); + virtual ~MobileDataOptionsView(); + static MobileDataOptionsView *GetInstance(void); + UIScrollView *MobileDataOptionsViewInit(void); + UIToggleButton *GetSystemUpdateToggleButton(void); + UIToggleButton *GetOnlineMusicToggleButton(void); + + private: + void ClearAll(void); + UIScrollView *scrollView{nullptr}; + UILabelExt *Title{nullptr}; + UIImageView *MobileDataOptionsImage[2]{nullptr}; + UILabelExt *MobileDataOptionsImageLabel[2]{nullptr}; + UIToggleButton *SystemUpdateToggleButton{nullptr}; // 系统更新开关:开启系统更新时闲时将安装包下载到本地并添加小红点提示 + UIToggleButton *OnlineMusicToggleButton{nullptr}; // 在线音乐开关 + }; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallPresenter.h new file mode 100644 index 000000000..2524b1eef --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallPresenter.h @@ -0,0 +1,42 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 09:59:18 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 14:44:56 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallPresenter.h + */ + +#ifndef NETWORK_AND_CALL_PRESENTER_H +#define NETWORK_AND_CALL_PRESENTER_H + +#include "Presenter.h" +#include "View.h" + +namespace OHOS +{ + class NetworkAndCallView; + class NetworkAndCallPresenter : public Presenter, + public UIView::OnClickListener, + public RootView::OnKeyActListener, + public UIView::OnDragListener + { + public: + NetworkAndCallPresenter(); + virtual ~NetworkAndCallPresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static NetworkAndCallPresenter *GetInstance(); + + private: + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + bool OnDragEnd(UIView &view, const DragEvent &event) override; + bool OnKeyAct(UIView &view, const KeyEvent &event) override; // 增加按键事件 + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallView.h b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallView.h new file mode 100644 index 000000000..9b3e1bcd8 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallView.h @@ -0,0 +1,69 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 09:57:53 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 16:24:32 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/networkandcall/include/NetworkAndCallView.h + */ + +#ifndef NETWORK_AND_CALL_VIEW_H +#define NETWORK_AND_CALL_VIEW_H + +#include "BaseView.h" +#include "View.h" +#include "components/ui_label_ext.h" +#include "components/ui_image_view.h" +#include "components/ui_toggle_button.h" +#include "components/ui_scroll_view.h" +#include "networkandcall/include/MobileDataOptionsView.h" + +namespace OHOS +{ + typedef enum + { + NETWORKANDCALLVIEW = 0, + MOBILEDATAOPTIONSVIEW, + MAX_NETWORKANDCALLVIEWID, + } NETWORKANDCALLVIEWID; + + static constexpr const uint8_t ITEM_NUM = 3; + + class NetworkAndCallPresenter; + class NetworkAndCallView : public View + { + + public: + NetworkAndCallView(); + virtual ~NetworkAndCallView(); + static NetworkAndCallView *GetInstance(void); + UIToggleButton *GetVoLTEToggleButton(void); + UIToggleButton *GetMobileDataToggleButton(void); + UIImageView *GetNetworkAndCallImage(int index); + MobileDataOptionsView *GetMobileDataOptionsView(void); + bool ChangeNetworkAndCallView(int16_t thisView); + bool ChangeMobileDataOptionsView(int16_t thisView); + bool ClickFunc(int16_t interface); + void ChangeView(int16_t hideView, int16_t showView); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + private: + MobileDataOptionsView *mobileDataOptionsView{nullptr}; + + private: + void NetworkAndCallViewInit(void); + void ClearAll(void); + + UIScrollView *NetworkAndCallScrollView[MAX_NETWORKANDCALLVIEWID]{nullptr}; + UILabelExt *Title{nullptr}; + UIImageView *NetworkAndCallImage[ITEM_NUM]{nullptr}; + UILabelExt *NetworkAndCallLabel[ITEM_NUM]{nullptr}; + UIToggleButton *VoLTE_toggleButton{nullptr}; // VoLTE通话开关 + UIToggleButton *MobileData_toggleButton{nullptr}; // 移动数据开关 + UIImageView *NextImage{nullptr}; + }; +} +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/MobileDataOptionsView.cpp b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/MobileDataOptionsView.cpp new file mode 100644 index 000000000..60c80bed6 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/MobileDataOptionsView.cpp @@ -0,0 +1,169 @@ +#include "networkandcall/include/MobileDataOptionsView.h" +#include "networkandcall/include/NetworkAndCallPresenter.h" +#include "wearable_log.h" + +namespace OHOS +{ + static MobileDataOptionsView *g_pMobileDataOptionsView{nullptr}; + MobileDataOptionsView::MobileDataOptionsView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MobileDataOptionsView::MobileDataOptionsView"); + g_pMobileDataOptionsView = this; + } + + MobileDataOptionsView::~MobileDataOptionsView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MobileDataOptionsView::~MobileDataOptionsView"); + ClearAll(); + g_pMobileDataOptionsView = nullptr; + } + + MobileDataOptionsView *MobileDataOptionsView::GetInstance(void) + { + return g_pMobileDataOptionsView; + } + + UIScrollView *MobileDataOptionsView::MobileDataOptionsViewInit(void) + { + if (scrollView == nullptr) + { + scrollView = new UIScrollView(); + if (scrollView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::scrollView new fail!"); + return nullptr; + } + scrollView->SetPosition(0, 0, 466, 466); + scrollView->SetViewId(MOBILEDATAOPTIONSVIEWID); + UIView::OnDragListener *draglistener = static_cast(NetworkAndCallPresenter::GetInstance()); + if (draglistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::draglistener can not be nullptr!"); + return nullptr; + } + scrollView->SetOnDragListener(draglistener); + scrollView->SetScrollBlankSize(50); + scrollView->SetReboundSize(35); + scrollView->SetHorizontalScrollState(false); + scrollView->SetTouchable(true); + scrollView->SetDraggable(true); + /* ---------------------------------- Title --------------------------------- */ + Title = new UILabelExt(); + if (Title == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::Title is nullptr!"); + return nullptr; + } + Title->SetPosition(83, 50, 300, 40); + Title->SetStyle(STYLE_TEXT_FONT, 30); + Title->SetStyle(STYLE_LINE_HEIGHT, 35); + Title->SetText("移动数据选项"); + Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(40); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + scrollView->Add(Title); + /* -------------------------------------------------------------------------- */ + int positionY_Img = 120; + const char *text[] = {"系统更新", "在线音乐"}; + for (int i = 0; i < 2; i++) + { + MobileDataOptionsImage[i] = new UIImageView(); // Create a new UIImageView for each iteration + if (MobileDataOptionsImage[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::MobileDataOptionsImage[%d] is nullptr!", i); + return nullptr; + } + MobileDataOptionsImage[i]->SetPosition(43, positionY_Img + (i * 120), 380, 100); // Adjust Y position based on iteration + MobileDataOptionsImage[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + MobileDataOptionsImage[i]->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + MobileDataOptionsImage[i]->SetStyle(STYLE_BORDER_RADIUS, 100); + scrollView->Add(MobileDataOptionsImage[i]); + /* -------------------------------------------------------------------------- */ + MobileDataOptionsImageLabel[i] = new UILabelExt(); // Create a new UILabel for each iteration + if (MobileDataOptionsImageLabel[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::MobileDataOptionsImageLabel[%d] is nullptr!", i); + return nullptr; + } + MobileDataOptionsImageLabel[i]->SetPosition(90, 153 + (i * 120), 180, 40); // Adjust Y position based on iteration + MobileDataOptionsImageLabel[i]->SetStyle(STYLE_TEXT_FONT, 30); + MobileDataOptionsImageLabel[i]->SetStyle(STYLE_LINE_HEIGHT, 35); + MobileDataOptionsImageLabel[i]->SetText(text[i]); + MobileDataOptionsImageLabel[i]->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + MobileDataOptionsImageLabel[i]->SetRollSpeed(40); + MobileDataOptionsImageLabel[i]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + scrollView->Add(MobileDataOptionsImageLabel[i]); + } + /* -------------------------------------------------------------------------- */ + SystemUpdateToggleButton = new UIToggleButton(); + if (SystemUpdateToggleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::SystemUpdateToggleButton is nullptr!"); + return nullptr; + } + SystemUpdateToggleButton->SetPosition(298, 145, 100, 50); + SystemUpdateToggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + const char *selectedImg = "/user/res/TOGGLEBUTTON_ON.bin"; + const char *unSelectedImg = "/user/res/TOGGLEBUTTON_OFF.bin"; + SystemUpdateToggleButton->SetImages(selectedImg, unSelectedImg); + scrollView->Add(SystemUpdateToggleButton); + /* -------------------------------------------------------------------------- */ + OnlineMusicToggleButton = new UIToggleButton(); + if (OnlineMusicToggleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::OnlineMusicToggleButton is nullptr!"); + return nullptr; + } + OnlineMusicToggleButton->SetPosition(298, 265, 100, 50); + OnlineMusicToggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + OnlineMusicToggleButton->SetImages(selectedImg, unSelectedImg); + scrollView->Add(OnlineMusicToggleButton); + /* ----------------------------- onclickListener ---------------------------- */ + UIView::OnClickListener *toggleButtonClick = static_cast(NetworkAndCallPresenter::GetInstance()); + SystemUpdateToggleButton->SetOnClickListener(toggleButtonClick); + OnlineMusicToggleButton->SetOnClickListener(toggleButtonClick); + } + return scrollView; + } + + void MobileDataOptionsView::ClearAll(void) + { + if (scrollView != nullptr) + { + scrollView->RemoveAll(); + + delete Title; + Title = nullptr; + + for (int i = 0; i < 2; i++) + { + delete MobileDataOptionsImage[i]; + MobileDataOptionsImage[i] = nullptr; + + delete MobileDataOptionsImageLabel[i]; + MobileDataOptionsImageLabel[i] = nullptr; + } + + delete SystemUpdateToggleButton; + SystemUpdateToggleButton = nullptr; + + delete OnlineMusicToggleButton; + OnlineMusicToggleButton = nullptr; + + delete scrollView; + scrollView = nullptr; + } + } + + UIToggleButton *MobileDataOptionsView::GetSystemUpdateToggleButton(void) + { + return SystemUpdateToggleButton; + } + + UIToggleButton *MobileDataOptionsView::GetOnlineMusicToggleButton(void) + { + return OnlineMusicToggleButton; + } + +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp new file mode 100644 index 000000000..c152acb1a --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp @@ -0,0 +1,141 @@ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-04-23 09:59:32 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-04-23 17:00:37 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp + */ +#include "AppViewIDs.h" +#include "NativeAbility.h" +#include "networkandcall/include/NetworkAndCallPresenter.h" +#include "common/key_code.h" +#include +#include "networkandcall/include/NetworkAndCallView.h" +#include "map" +#include "functional" +#include "iostream" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static NetworkAndCallPresenter *g_pNetworkAndCallPresenter = nullptr; + + NetworkAndCallPresenter::NetworkAndCallPresenter() + { + g_pNetworkAndCallPresenter = this; + } + + NetworkAndCallPresenter::~NetworkAndCallPresenter() + { + g_pNetworkAndCallPresenter = nullptr; + } + + NetworkAndCallPresenter *NetworkAndCallPresenter::GetInstance() + { + return g_pNetworkAndCallPresenter; + } + + void NetworkAndCallPresenter::OnStart() + { + Presenter::OnStart(); + } + + void NetworkAndCallPresenter::OnPause(void) + { + Presenter::OnPause(); + } + + void NetworkAndCallPresenter::OnResume(void) + { + Presenter::OnResume(); + } + + void NetworkAndCallPresenter::OnStop(void) + { + Presenter::OnStop(); + } + + bool NetworkAndCallPresenter::OnClick(UIView &view, const ClickEvent &event) + { + UNUSED(event); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NetworkAndCallPresenter::OnClick"); + NetworkAndCallView *p_NetworkAndCallView = NetworkAndCallView::GetInstance(); + if (p_NetworkAndCallView == nullptr) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NetworkAndCallView::GetInstance fail!!"); + return false; + } + + + std::map buttonMap = { + {p_NetworkAndCallView->GetVoLTEToggleButton(), "VoLTE"}, + {p_NetworkAndCallView->GetMobileDataToggleButton(), "MobileData"}, + {p_NetworkAndCallView->GetMobileDataOptionsView()->GetSystemUpdateToggleButton(), "SystemUpdate"}, + {p_NetworkAndCallView->GetMobileDataOptionsView()->GetOnlineMusicToggleButton(), "OnlineMusic"}}; + + auto it = buttonMap.find(&view); + if (it != buttonMap.end()) + { + UIToggleButton *toggleButton = dynamic_cast(&view); + if (toggleButton != nullptr) + { + if (toggleButton->GetState() == true) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s is enable!", it->second.c_str()); + } + else + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s is disable!", it->second.c_str()); + } + } + return true; + } + + if (&view == p_NetworkAndCallView->GetNetworkAndCallImage(2) && p_NetworkAndCallView->GetMobileDataToggleButton()->GetState() == true) + { + p_NetworkAndCallView->ChangeView(NETWORKANDCALLVIEW, MOBILEDATAOPTIONSVIEW); + return true; + } + + return false; + } + + bool NetworkAndCallPresenter::OnDrag(UIView &view, const DragEvent &event) + { + UNUSED(view); + UNUSED(event); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NetworkAndCallPresenter::OnDrag"); + return true; + } + + bool NetworkAndCallPresenter::OnDragEnd(UIView &view, const DragEvent &event) + { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NetworkAndCallPresenter::OnDragEnd"); + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) + { + if (strcmp(view.GetViewId(), MOBILEDATAOPTIONSVIEWID) == 0) + { + NetworkAndCallView::GetInstance()->ChangeView(MOBILEDATAOPTIONSVIEW, NETWORKANDCALLVIEW); + } + else + { + NativeAbility::GetInstance().Back(); + } + } + return true; + } + bool NetworkAndCallPresenter::OnKeyAct(UIView &view, const KeyEvent &event) // 增加按键事件 + { + UNUSED(view); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NetworkAndCallPresenter::OnKeyAct"); + uint16_t keyID = event.GetKeyId(); + uint16_t keyState = event.GetState(); + // 如果是power键,且是亮屏状态,按键释放就返回上一级 + if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 0 && uapi_get_screen_state() == 0) + { + NativeAbility::GetInstance().Back(); + } + return true; + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallView.cpp b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallView.cpp new file mode 100644 index 000000000..a72c484c0 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/networkandcall/src/NetworkAndCallView.cpp @@ -0,0 +1,303 @@ +#include "networkandcall/include/NetworkAndCallPresenter.h" +#include "networkandcall/include/NetworkAndCallView.h" +#include "wearable_log.h" +#include "UiConfig.h" +namespace OHOS +{ + + static NetworkAndCallView *g_pNetworkAndCallView{nullptr}; + + NetworkAndCallView::NetworkAndCallView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NetworkAndCallView::NetworkAndCallView"); + + g_pNetworkAndCallView = this; + } + + NetworkAndCallView::~NetworkAndCallView() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NetworkAndCallView::~NetworkAndCallView"); + ClearAll(); + g_pNetworkAndCallView = nullptr; + } + + NetworkAndCallView *NetworkAndCallView::GetInstance() + { + return g_pNetworkAndCallView; + } + + void NetworkAndCallView::ClearAll(void) + { + if (NetworkAndCallScrollView[NETWORKANDCALLVIEW] != nullptr) + { + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->RemoveAll(); + + delete Title; + Title = nullptr; + + for (int i = 0; i < ITEM_NUM; i++) + { + delete NetworkAndCallImage[i]; + NetworkAndCallImage[i] = nullptr; + + delete NetworkAndCallLabel[i]; + NetworkAndCallLabel[i] = nullptr; + } + + delete VoLTE_toggleButton; + VoLTE_toggleButton = nullptr; + + delete MobileData_toggleButton; + MobileData_toggleButton = nullptr; + + delete NextImage; + NextImage = nullptr; + + delete NetworkAndCallScrollView[NETWORKANDCALLVIEW]; + NetworkAndCallScrollView[NETWORKANDCALLVIEW] = nullptr; + } + } + + void NetworkAndCallView::NetworkAndCallViewInit(void) + { + if (NetworkAndCallScrollView[NETWORKANDCALLVIEW] == nullptr) + { + NetworkAndCallScrollView[NETWORKANDCALLVIEW] = new UIScrollView(); + if (NetworkAndCallScrollView[NETWORKANDCALLVIEW] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::NetworkAndCallScrollView[NETWORKANDCALLVIEW] new fail!"); + return; + } + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()); + UIView::OnDragListener *draglistener = static_cast(NetworkAndCallPresenter::GetInstance()); + if (draglistener == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::draglistener can not be nullptr!"); + return; + } + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetOnDragListener(draglistener); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetScrollBlankSize(50); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetReboundSize(35); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetHorizontalScrollState(false); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetTouchable(true); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetDraggable(true); + /* ---------------------------------- Title --------------------------------- */ + Title = new UILabelExt(); + if (Title == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::Title is nullptr!"); + return; + } + Title->SetPosition(83, 50, 300, 40); + Title->SetStyle(STYLE_TEXT_FONT, 30); + Title->SetStyle(STYLE_LINE_HEIGHT, 35); + Title->SetText("网络与通话"); + Title->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(40); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + /* -------------------------------------------------------------------------- */ + int positionY_Img = 120; + const char *text[] = {"VoLTE 通话", "移动数据", "移动数据选项"}; + for (int i = 0; i < ITEM_NUM; i++) + { + NetworkAndCallImage[i] = new UIImageView(); // Create a new UIImageView for each iteration + if (NetworkAndCallImage[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::NetworkAndCallImage[%d] is nullptr!", i); + return; + } + NetworkAndCallImage[i]->SetPosition(43, positionY_Img + (i * 120), 380, 100); // Adjust Y position based on iteration + NetworkAndCallImage[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); + NetworkAndCallImage[i]->SetStyle(STYLE_BACKGROUND_OPA, 0xff); + NetworkAndCallImage[i]->SetStyle(STYLE_BORDER_RADIUS, 100); + /* -------------------------------------------------------------------------- */ + NetworkAndCallLabel[i] = new UILabelExt(); // Create a new UILabel for each iteration + if (NetworkAndCallLabel[i] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::NetworkAndCallLabel[%d] is nullptr!", i); + return; + } + NetworkAndCallLabel[i]->SetPosition(90, 153 + (i * 120), 180, 40); // Adjust Y position based on iteration + NetworkAndCallLabel[i]->SetStyle(STYLE_TEXT_FONT, 30); + NetworkAndCallLabel[i]->SetStyle(STYLE_LINE_HEIGHT, 35); + NetworkAndCallLabel[i]->SetText(text[i]); + NetworkAndCallLabel[i]->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + // NetworkAndCallLabel[i]->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + NetworkAndCallLabel[i]->SetRollSpeed(40); + NetworkAndCallLabel[i]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + } + /* -------------------------------------------------------------------------- */ + VoLTE_toggleButton = new UIToggleButton(); + if (VoLTE_toggleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::VoLTE_toggleButton is nullptr!"); + return; + } + VoLTE_toggleButton->SetPosition(298, 145, 100, 50); + VoLTE_toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + const char *selectedImg = "/user/res/TOGGLEBUTTON_ON.bin"; + const char *unSelectedImg = "/user/res/TOGGLEBUTTON_OFF.bin"; + VoLTE_toggleButton->SetImages(selectedImg, unSelectedImg); + /* -------------------------------------------------------------------------- */ + MobileData_toggleButton = new UIToggleButton(); + if (MobileData_toggleButton == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::MobileData_toggleButton is nullptr!"); + return; + } + MobileData_toggleButton->SetPosition(298, 265, 100, 50); + MobileData_toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00); + MobileData_toggleButton->SetImages(selectedImg, unSelectedImg); + /* ----------------------------- onclickListener ---------------------------- */ + UIView::OnClickListener *toggleButtonClick = static_cast(NetworkAndCallPresenter::GetInstance()); + VoLTE_toggleButton->SetOnClickListener(toggleButtonClick); + MobileData_toggleButton->SetOnClickListener(toggleButtonClick); + NetworkAndCallImage[2]->SetTouchable(true); + NetworkAndCallImage[2]->SetOnClickListener(toggleButtonClick); + /* -------------------------------------------------------------------------- */ + NextImage = new UIImageView(); + if (NextImage == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::NextImage is nullptr!"); + return; + } + NextImage->SetPosition(369, 397); + NextImage->SetSrc(PNG_SETTING_NEXT_IMAGE); + } + } + + void NetworkAndCallView::OnStart() + { + View::OnStart(); + NetworkAndCallViewInit(); + // 增加按键监听 + RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::NetworkAndCallPresenter::GetInstance(); + RootView::GetInstance()->SetOnKeyActListener(keyactListener); + } + + void NetworkAndCallView::OnSetUpView() + { + View::OnSetUpView(); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(Title); + for (int i = 0; i < ITEM_NUM; i++) + { + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(NetworkAndCallImage[i]); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(NetworkAndCallLabel[i]); + } + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(VoLTE_toggleButton); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(MobileData_toggleButton); + NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(NextImage); + RootView::GetInstance()->Add(NetworkAndCallScrollView[NETWORKANDCALLVIEW]); + Draw(); + } + + void NetworkAndCallView::OnTearDownView() + { + + View::OnTearDownView(); + return; + } + + void NetworkAndCallView::OnStop() + { + + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + RootView::GetInstance()->ClearOnKeyActListener(); + return; + } + + // 获取VOLTE button + UIToggleButton *NetworkAndCallView::GetVoLTEToggleButton(void) + { + return VoLTE_toggleButton; + } + + // 获取移动数据 button + UIToggleButton *NetworkAndCallView::GetMobileDataToggleButton(void) + { + return MobileData_toggleButton; + } + + UIImageView *NetworkAndCallView::GetNetworkAndCallImage(int index) + { + return NetworkAndCallImage[index]; + } + + MobileDataOptionsView *NetworkAndCallView::GetMobileDataOptionsView(void) + { + return mobileDataOptionsView; + } + + // 切换到网络与通话视图 + bool NetworkAndCallView::ChangeNetworkAndCallView(int16_t thisView) + { + if (NetworkAndCallScrollView[thisView] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NetworkAndCallView::ChangeNetworkAndCallView"); + RootView::GetInstance()->Add(NetworkAndCallScrollView[thisView]); + } + return true; + } + + // 切换到数据选项视图 + bool NetworkAndCallView::ChangeMobileDataOptionsView(int16_t thisView) + { + if (NetworkAndCallScrollView[thisView] == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisplayBrightnessView::ChangeScreenDurationView"); + mobileDataOptionsView = new MobileDataOptionsView(); + if (mobileDataOptionsView == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DisplayBrightnessView:: new scrollView[%d] fail", thisView); + return false; + } + NetworkAndCallScrollView[thisView] = mobileDataOptionsView->MobileDataOptionsViewInit(); + RootView::GetInstance()->Add(NetworkAndCallScrollView[thisView]); + } + return true; + } + + struct NetworkAndCallViewMapper + { + const int16_t viewId; + bool (NetworkAndCallView::*func)(int16_t thisView); + }; + + static const NetworkAndCallViewMapper ViewMapper[] = { + {NETWORKANDCALLVIEW, &NetworkAndCallView::ChangeNetworkAndCallView}, + {MOBILEDATAOPTIONSVIEW, &NetworkAndCallView::ChangeMobileDataOptionsView}, + }; + + bool NetworkAndCallView::ClickFunc(int16_t interface) + { + int funcSize = sizeof(ViewMapper) / sizeof(ViewMapper[0]); + for (int i = 0; i < funcSize; i++) + { + if (interface == ViewMapper[i].viewId) + { + bool jug = (this->*(ViewMapper[i].func))(interface); + if (jug == false) + { + return false; + } + return true; + } + } + return false; + } + + void NetworkAndCallView::ChangeView(int16_t hideView, int16_t showView) + { + if (hideView > MAX_NETWORKANDCALLVIEWID) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "NetworkAndCallView::ViewId Overstep ones bounds"); + return; + } + NetworkAndCallScrollView[hideView]->SetVisible(false); + ClickFunc(showView); + NetworkAndCallScrollView[showView]->SetVisible(true); + Draw(); + } +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h index 85d50a176..8c17b999c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-03 09:32:07 + * @LastEditTime: 2024-04-23 18:09:12 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItem.h */ #ifndef SETTING_ITEM_H @@ -24,6 +24,9 @@ namespace OHOS SETTING_ITEM_THREE, SETTING_ITEM_FOUR, SETTING_ITEM_FIVE, + SETTING_ITEM_SIX, + SETTING_ITEM_SEVEN, + SETTING_ITEM_MAX, } SettingIndex; typedef struct diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h index fe4c0a055..27b85ae82 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-30 09:14:38 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-02 20:04:15 + * @LastEditTime: 2024-04-23 19:24:51 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h */ /* @@ -19,6 +19,7 @@ #include "UiConfig.h" #include "SettingModel.h" #include "components/ui_label_button_ext.h" +#include "components/ui_label_ext.h" #include "components/ui_image_view.h" namespace OHOS { @@ -34,6 +35,7 @@ namespace OHOS private: SettingItemView(const SettingItemView &); UIImageView Icon; + UILabelExt settingLabelExt; UILabelButtonExt settingLabelButtonExt; SettingItem sItemInfo = {SETTING_ITEM_ZERO, nullptr, STR_EXERCISE_GENERAL, false}; }; 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 18d64c2a8..89bf96f23 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingModel.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-30 09:14:38 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-03 09:32:37 + * @LastEditTime: 2024-04-23 10:49:06 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingModel.h */ @@ -35,7 +35,7 @@ namespace OHOS SettingModel(const SettingModel &) = delete; SettingModel &operator=(const SettingModel &) = delete; virtual ~SettingModel(); - static const uint16_t SETTING_ITEM_LEN = 6; + static const uint16_t SETTING_ITEM_LEN = SETTING_ITEM_MAX; SettingItem settings[SETTING_ITEM_LEN] = {SETTING_ITEM_ZERO, nullptr, STR_EXERCISE_GENERAL, false}; std::map settingIdToViewId; bool btConnectStatus{false}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp index 4a3b85082..bf2836d41 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-27 19:48:49 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-03 14:11:23 + * @LastEditTime: 2024-04-23 19:26:32 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp */ @@ -32,12 +32,14 @@ namespace OHOS SetTouchable(true); SetUpChild(); Add(&settingLabelButtonExt); + Add(&settingLabelExt); Add(&Icon); } SettingItemView::~SettingItemView() { Remove(&settingLabelButtonExt); + Remove(&settingLabelExt); Remove(&Icon); } @@ -46,7 +48,7 @@ namespace OHOS sItemInfo = itemInfo; Icon.SetSrc(itemInfo.icon); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d", itemInfo.textId); - settingLabelButtonExt.SetTextId(itemInfo.textId); + settingLabelExt.SetTextId(itemInfo.textId); } void SettingItemView::SetUpChild() @@ -54,6 +56,13 @@ namespace OHOS Icon.SetPosition(SETTING_ICON_X, SETTING_SICON_Y); Icon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE); + settingLabelExt.SetPosition(115, 33,180,100); + settingLabelExt.SetStyle(STYLE_TEXT_FONT, 30); + settingLabelExt.SetStyle(STYLE_LINE_HEIGHT, 35); + settingLabelExt.SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + settingLabelExt.SetRollSpeed(40); + settingLabelExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + settingLabelButtonExt.SetPosition(0, 0, 380, 100); settingLabelButtonExt.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919); settingLabelButtonExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp index 6490b1759..79c3862c6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-18 09:09:13 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-04-03 09:38:57 + * @LastEditTime: 2024-04-23 18:09:47 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp */ #include "SettingModel.h" @@ -23,17 +23,21 @@ namespace OHOS void SettingModel::InitSettingItem() { settings[0] = {SETTING_ITEM_ZERO, PNG_SETTINGS_DISPLAY_BRIGHTNESS, STR_SCREEN_AND_BRIGHTNESS, true}; - settings[1] = {SETTING_ITEM_ONE, PNG_SETTINGS_BLUETOOTH, STR_BLUETOOTH, true}; - settings[2] = {SETTING_ITEM_TWO, PNG_SETTINGS_SOUND_VIBRATION, STR_SOUND_AND_VIBRATION, true}; - settings[3] = {SETTING_ITEM_THREE, PNG_SETTINGS_SECONDARY_FUNCTION, STR_QUICK_ACCESS, true}; - settings[4] = {SETTING_ITEM_FOUR, PNG_SETTINGS_SYSTEM, STR_SYSTEM, true}; - settings[5] = {SETTING_ITEM_FIVE, PNG_SETTINGS_SETTINGS_POWER_CONTROL, STR_SHUTDOWN_AND_RESTART, true}; + settings[1] = {SETTING_ITEM_ONE, PNG_SETTINGS_NETWORKANDCALL, STR_NETWORKANDCALL, true}; + settings[2] = {SETTING_ITEM_TWO, PNG_SETTINGS_BLUETOOTH, STR_BLUETOOTH, true}; + settings[3] = {SETTING_ITEM_THREE, PNG_SETTINGS_SOUND_VIBRATION, STR_SOUND_AND_VIBRATION, true}; + settings[4] = {SETTING_ITEM_FOUR, PNG_SETTINGS_DISPLAY_MODE, STR_DISPLAY_MODE, true}; + settings[5] = {SETTING_ITEM_FIVE, PNG_SETTINGS_MOTION_RECOGNITION, STR_MOTION_RECOGNITION, true}; + settings[6] = {SETTING_ITEM_SIX, PNG_SETTINGS_SYSTEM, STR_SYSTEM, true}; + settings[7] = {SETTING_ITEM_SEVEN, PNG_SETTINGS_SETTINGS_POWER_CONTROL, STR_SHUTDOWN_AND_RESTART, true}; settingIdToViewId.insert(std::pair(SETTING_ITEM_ZERO, VIEW_DISPLAY_BRIGHTNESS)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_ONE, VIEW_CLASSIC_BLUETOOTH)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_SOUND_VIBRATION)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_SECONDARY_FUNCTION)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_SYSTEM)); - settingIdToViewId.insert(std::pair(SETTING_ITEM_FIVE, VIEW_SHUTDOWN_OR_REBOOT)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_ONE, VIEW_NETWORKANDCALL)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_TWO, VIEW_CLASSIC_BLUETOOTH)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_THREE, VIEW_SOUND_VIBRATION)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_FOUR, VIEW_SET_DESKTOP)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_FIVE, VIEW_MOTION_RECOGNITION)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_SIX, VIEW_SYSTEM)); + settingIdToViewId.insert(std::pair(SETTING_ITEM_SEVEN, VIEW_SHUTDOWN_OR_REBOOT)); } const SettingItem *SettingModel::GetSettinglistItems() const 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 index 263ee97cd0dd3a299c256b2ecc66c54af4a5705e..a97bfae195b9d388b14706873c4956d0cdaeeff6 100644 GIT binary patch delta 161 zcmZqE?ok%|_VgTEY90d$_|33U>;kitIxho*ArQL)aS#xv0&xxyH}Y<7V3Fbt_Dd}( z&o9b$%u8`j%*kPJ$|+4P$Ow9!UJ^S*&g&$MfT~qb1$GkZI?Bbd4$Il(G5l4PY$KId$ zdZNCxAVeG71G_*14Tj(;cnMyEci=NPeM*RBum-ll0nlIsUV%5@BlrTofuGrVB{VAy+V=Z~Wg6`LTsnPWEe(9q53 zWKho+((`lZPzUb>v`c8_J0Zi*B>b2c?A^ zvF&88Qf8@X?3-L4*udB6PN1REntDt!23tX4Cbb?>h|X|MwkSvy6iOyYHk_q6q&yiL z$j2;0xkc1e*xC`wsg#LP<%7 z9r?f&?OGix7HutEgBVN!ks@T){)kcW2n8D<(*{^U8S*wv}tn|N5s&Mkwt-daxNZ4l^s&M8KxLNR8MIYMo0hAdJF*z zynUpRnKWsAYR_qxuzG38x*1;cMNqGKi^f@GlO>HQxwW^p1UA(L>d3&5X;iQdbzzgO z&FSHjQ6Gc+=X_j*X!lU^q;VbYM=d>G98C&^jI5;l()6S3vzQqhGHbj#46)OG>y|5*r2AZG|17)#i%iWUrlCyZbJ2gvd{NcOx zojA;sKeL|3vlc=@;{t;#Y&dY?!N&~&LPUs>;Eog-ay;-vff6sgQQ?Cc4O%T`X(=5Y H!v35cWN{8j 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 index 70d61000e..73166d395 100644 --- 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 @@ -1,15 +1,15 @@ -/* -* 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 { +/* +* 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, @@ -253,53 +253,21 @@ enum UIResourceTextId : uint16_t { STR_INSUFFICIENT_EXERCISE_AMOUNT = 240, STR_SETTING = 241, STR_SCREEN_AND_BRIGHTNESS = 242, - STR_BRIGHTNESS_ADJUSTMENT = 243, - STR_SCREEN_ON_DURATION = 244, - STR_5_SECONDS = 245, - STR_10_SECONDS = 246, - STR_15_SECONDS = 247, - STR_30_SECONDS = 248, - STR_60_SECONDS = 249, - STR_300_SECONDS = 250, - STR_RAISE_TO_WAKE = 251, - STR_BLUETOOTH = 252, - STR_BLUETOOTH_HEADPHONES = 253, - STR_TRADITIONAL_BLUETOOTH = 254, - STR_AUTO_OFF_BLUETOOTH_NOTE = 255, - STR_SOUND_AND_VIBRATION = 256, - STR_SYSTEM_VOLUME = 257, - STR_ALARM_REMINDERS_FIND_WATCH = 258, - STR_CALL_VOLUME = 259, - STR_WATCH_CALLS = 260, - STR_MEDIA_VOLUME = 261, - STR_MUSIC_RECORDINGS_WORKOUTS = 262, - STR_VIBRATION_REMINDER = 263, - STR_SILENT_MODE = 264, - STR_SYSTEM_VOLUME_UNAFFECTED = 265, - STR_QUICK_ACCESS = 266, - STR_ACCESSIBILITY = 267, - STR_ACCESSIBILITY_BUTTON = 268, - STR_QUICK_ACCESS_APP = 269, - STR_HEART_RATE_MONITORING = 270, - STR_BLOOD_OXYGEN_MONITORING = 271, - STR_SYSTEM = 272, - STR_ABOUT_WATCH = 273, - STR_REGULATORY_MODE = 274, - STR_SWITCH_LANGUAGE = 275, - STR_LANGUAGE = 276, - STR_FACTORY_RESET = 277, - STR_SYSTEM_UPDATE = 278, - STR_SHUTDOWN_AND_RESTART = 279, - STR_RESTART = 280, - STR_SHUTDOWN = 281, - STR_4G_CAPABILITY = 282, - STR_MAX_ID = 283, + STR_NETWORKANDCALL = 243, + STR_BLUETOOTH = 244, + STR_SOUND_AND_VIBRATION = 245, + STR_DISPLAY_MODE = 246, + STR_MOTION_RECOGNITION = 247, + STR_SYSTEM = 248, + STR_SHUTDOWN_AND_RESTART = 249, + STR_LANGUAGE = 250, + STR_MAX_ID = 251, }; // UIResourceTextId - -enum FontLanguageId : uint8_t { + +enum FontLanguageId : uint8_t { LANGUAGE_ID_JA, - LANGUAGE_ID_ZH, LANGUAGE_ID_EN, + LANGUAGE_ID_ZH, LANGUAGE_ID_MAX }; // UITextLanguageTextId } 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 index b8c4591b2047ff1fd40938f9b092aace60f9167e..2624d3afaf4767f63d1c8eedac9691ed3ef9b71d 100644 GIT binary patch delta 159 zcmZ3jwn{;)n|%>ORR#kJ_|33U>;kjYO>PE;2SEG*i2njH7Y_r2AP_6^Y;IsV%^m-I z@5JZ3=RDcb_p)Kui}iCEUQC|*ymKbQ)5RNJ&fg3Yp40xcYX!rz8T+0u+4XGN&Zm3& z8D8w402F(%zU^tpYKG^VcR$}fpW$ii=4W$uJ)P9^vc31|g!K$B)~|iBqJaSbgf>f> delta 933 zcmY+C&rcIU6vv;@!~?>~kPu?@M2r_8hzD<;h&K<$6BlDlI1w*iymX<$c3b+x7TB~D z+5)93*ey^YWxH+9#)~KZ0rt(#UhKt_C%@ZWjcoGSdGp@9@4PoNhYyY>M)&XUjeS_4 zYv1^dlhGeHBbP%&S3rWF;1~D}=nm0sa2Je&hhP>A4-?%3kHB;A3cLaDfCe_f9N z=+UfO%hL4J;6Jcu2KJM|e`abhi1-(|vJs?_%x$|`J{+Xd6h(_1yX>}0VMH{IzFlBj z;Y@=wsp%<>MOM9RNt{+>Z%3r6B9`HJ$*~JkJ>;=G?m0w>9FuV?WqR zc|{e4liO^gZMZx&O`d*%CXp}F8E-Y~8>OnyxbaH=X z2D>AhI~#DpkY?R&M=97d5GQXtkDxFrY^Sf4;k1&R*12=Sxg>G#$Wuzv>_t4?B-vfz z_~+mh!iiYZysSy0z8|M2?Uwf5Nt`7} zRupku3n#(35H1#n?6>+B{Uhd@m9S)vsUo>68+B$!2qGR z+YBvE#|jR%#0=#l!)T)X8fxtAhVq?hM6+lRR0b37woV3fS$mJ~ZF~3QE(=b5@2@B4 zyyraUoaa3k1b|}tAFg3%?0|aB$ug|rz6>2+}d^P=#w6%S!~|957Z<%!_ek*JkO?_ z>m+A++kPVu(C3>h*7&{e%a5u21ji>~zW%0^Qhoc96^GNcc!X@EuKC;<;yr_r{Z(?j=_6y zShH(_XrqBYiqN*Aj3 zTxvH)&5>4VGu68(tYUgX=(>-zp5neHS`Tnwp!MkURgoUC*UrRn6dPi$=$PI#zIHbG zevF72=;ieH_1IHJvbwq1FV=x8;=;&cPv8(y6mJNvLjxGSh91X(BsNFVyb+^72);qd z#=EN^(thvhYmZ|$905rmUytMS&t&t?vyehdbpH}a&63hP>fGzX^Q7TBJ>&fo{YsCf zxM@3}g8g*>ZSAFEP8o1(%?aG-5SxI9W}(F|u;Cr(bq2Z90fsM~p0IyLAPvCM5^nNW z5u4h71v^L0B5klfpB~#-8}p`oL-AexyxU|3v4WVHFXei*{?~WxLYLm($@;F>T6oVh zA~%iL&oH*BsrzGh5Cem?Xr=3+q6}EmP78C+NVdNAoU%+H=v5Xc`-wQ}G5Ks>w8}$P z*H8&Yh!$TJh zm~qe??=R^nt;;l(}N4?pMt#EZu^u(f6H6u&j~ynTxk!){g(l30_y@rHWur%L|s;XXyO} z!g}P4WWN9m@%)W`V&5cwM9LvE`Ti6-cRcc zJvwSlC9x0e#D&ci)A}XE0kj9$tX{<$>p>j6OZA}Lr!Mi6crVNgCw@v{_~EOZ-!0P+oy1__C$>|Jtu$f_t- zfP2vaOy~u~G!Tn`pH|SpsPB*FD)J6t=)wO(;e1bEB&T*u{D0csHEy2?Co>lOelf@S zZq3P&y$9y8C(l({n2;A{;8Itt}*>g#81mNkv*vw z13YesbV+z9p)Ylx;Gn86?fyUIA7-9*&s$Xm@L0{u>i+nSS-1bvp%rR3;ww#yHxZx7 z+T;8i=P*?JJV1h z>ZmhLD8^|rV8RFuTio3KShCGNMKj1+J`|%a+iGTX!+lt+I2g5e_qDzydkLxCZj+|J zo^#Ln-Sc%XV1Od}A#6g?RCz8)EBJtf*KGJ)bGlPord9yx=ZZRp!O2g}aL&B9osf>l zbzs7kYZhH#B1XuIOT#!}dBmJP8+c`Ay_K=ooM@cdX)9i>s~E{&LWP2PZ#ARH0Ep&4 zntYV?&p zK%(ftgeq}nCj(d6h`(s|@Wl49sttdcVZgjxwIR7*(vR#G^Nnac7t?s!{H)6V&v_n| zpJY$cf5?w0gX#VbK?NE%!grcLfIxlJ`r#dlwjGS!aw2%YVYjWgPO>lYeM*b&Ddu!~ z4yK^3L+%NiB$xclF-G2U*D$A`@dKb=m>CYa$a5j2cH}%E=7+s@rK2&!nIIgjMaFef zeB(rQ{j&loLEb6X1MWW3Hsxl}49M-vF*~lM{gkQ|x6>NYZ*?R#^c)VpJU*bB-2cYn zc)7kD;|bHx#slv*7wj)F9vNO87vZOXwQ%*jwo;7)qxZ=TvXg|*L+f#rxrQ?rF`Qi8rS-U{tQgZ`O*9rxdypk#C(eRr}@lx^>ZFZ1az6u zTAZn-^Y?*m!gk)qKCE9$h#g5*7YkAARqjuYOTzqWXf&OzABTL-?7dZ(LoHw_tgyc|m8A<|pFVEMQ%XY`LDdhTc zO!;NF+}!DKaADW$ayix>J3Be)yLZ!&)K!9Xad@yxSuiuQ@w1~tsi_&sH{|+qyeeFu z*eKBZq?}$T{EB+Y4{CpHRw=Up6ucvCVKocePE1|z*OlW!`TqZlBk`slwUrjN)IBEv0{?05E*np3lSgeb9{*=ToB28_C{m z^DkC8?_%4mcfW4A3~FE)CPCUS@s;BWM_LjHRn_ev%W7e>Q&6OgHIse+0O!_)I6EYVuD-w3w(31sXeZFEHP&MrXI3nr)SHAN723>>r9)usiU|Lv~ zE#wX2JnRZJc`eVV(~mTN;Hh?QF}3v2c_P#er_aIs`Z4kS+3qthR~8<=DYq9Z{u_J2 BLeu~N literal 0 HcmV?d00001 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_NETWORKANDCALL.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_NETWORKANDCALL.bin new file mode 100644 index 0000000000000000000000000000000000000000..98c8a3a99a18391bd13bda96d4faf80b846ab019 GIT binary patch literal 2840 zcmcIm4NMbf7=G_Q=nsemQ7RFk77$64w7?XR!5zqkW)KdCaYh9ks6?|=hX$O|Lu9rC zo&3Zh(bg$065W3Fc{@-Uk{F%BZRSR*QDvw_vd-; z{oe2WKA-{O@rOr>_>uHb5Fh6_FFZ5hHj~;nZi_|+KzX`+5<7?VO`x?GTX^0YrUT~6 zs)E|aEKa`laYL5T7?(t=E!|ueA08fhxxVH~6{B1leb1d$o;^D9t}!7>m+{?7f1E~R zFWy1Q76Z)2KbyT5>nk)c`8X$qMM9#oS#OU|u)}elH}Xy|G2YX&r)SqLo}Vl3W&Qmu z*3PbD905k7@jzn!Mg1^@*aNK&)lY!ttUu%7k|_I*K%kDSHFl^U5OdWtSARM@wb5W9 z;PbYk;S)SRb|>Y%sN7*%4lKB_xL#sD{8M=D+|I-HTi70vEh7QwWY>DO@PtihlNQl` zrh2xLW#61kch(;9n#jkHYNwU&c9!@ng+FLQ9c{VX-7f&m-~2P>qo2PWZI6!~ffe?^ zpg2{#$S=g>FFL<`e{Ew6ccKYFMMqSCXrD13YVWZgT^>tahXMlg)2O4T<>+$R>yK`P zRHbOoZz68d{(0o6ywEu2dgDz*PODEg8ryB)^678a1y5ZU~=b&}G{C+@QGIHs2>4n=0 z%FI?@)23oQy*~XU@Wi+mk9glnePM6|97}9Ql0iR@K5>U_$Yz=k!D}hOKRX!j``ap5 z2L>sh6r+dXcs~*0SSp2kgvv5|d}*+Zd*1&sXsE2nPcHROBGepSUoM}>g%Bu!Hqxc{ zL-^fQysWe14C%w2=Q}xqGNpuQ?>6<4LOlVz%_$)}$DT51VDt%be4lm!#(&;53Hk?2 z#Nq|Yj1aP}R>~*EspTGxtYwIKhWq=6ias4(qV_vy{kF@-699MwNd2`);2%}NkP7}l zphwEm$kywcSYYSF1sOz6z7LKDk_DYK9{Zz6;svn2grOcjNSVy%$O4BIbjE4@AdRO> z7U6l)-PJsyuT7aI0AlYOQ}!~|y+WbBIi~e78L+{f>YY`uFwdPiSZ#IHr(9ok zWM__VU4#!#@6C67H27rN`ziYywxluf8?*SnAe(o9z(?5D!}^ECVG)%R>q}Hbv)+%3 zL$#HriT;iQihyQ5O=}kX{h=Kw>_26PbDrLvY_-QSvy@MYX&>!EJD$(YI=dyv#&f|N z2t0`rcl8|!MfGkqvT6P=&m#agvA&Amf?B!Y(?$XJll+ZmYr1&SsTTB=H|-ucbZiTu z@tWM9kyZOH%IiIDA{(85NqMN~i!^!OXHhCplt}sXxIgP${fW<$bbO#}Usd3mlsi$- zg*7Vy&P1Ah7k(n6dh6I$l}7HE^?Ybsky?6cV?S~jN-{H(zu!EyzoJ!1A+eRFqz7(` z>LT{%D8i`1uWD+lX!DhZ^fYF*us&dVB-JOywD~fguRJGz3$f<7r-Py$YZjjECuN)L zHgwYuqX6)3qc@E0uYCow-(NfS%-Y9~i~iz#`@b>MfTDAUzxLluYJen3g~&H4cdFk- zoMHC$!nYBwED9gyGLXG=-U;(xjQ_9n(+yR)o(^b literal 0 HcmV?d00001 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_QUICK_ACCESS.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/settings/SETTINGS_QUICK_ACCESS.bin deleted file mode 100644 index e09c149a2ab27dd8698664788758096c0bd96351..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2840 zcmb_eZA@Eb6h5~XSUWz(mq9lMU11O=3uS01Ceq%5v=~WfyRfUqK!ZQV4>Kw3D-hZ; zbX*!8D>yMxm`3N8{c#58#JINL!bnC4f(bvyn47?Abo2uQ4fVdhZMjXnOH&bVe?2|# zIp=xL`<(Z@KmnBFA0mb2>$UrV`}}{Q;1>y}iVTU^=8u1>Ayq~KC@1c@=|Q#*IuXiV zmcp3nyY-cfbZee?{}-S4&o)xkbJr|=$o9R=xBLM>x<<5jSTC?Q548JQjPeqxcH(I- zeJ=|XkOc{Wz)|u?vr|llF8{)6!7&_5K>%n(<+FOv!;{}agTdH#YMk?LZM}6XCkLUe zVn^5Fqb|!!Rd&{l>ttl9>B98m@GA`-n$40WkzBk;_2b($A`#}dhWXVR47!T2|9|Dj z#gF7q71ZeR-v^L?BJ-R@Xk%2}HdEG=EXLKcL(G%)r;639Cm^>49@A__XEIP`=c69H z|3QR{iwh7f-~Vl=CUaKlK~x8K=-49=tLEZ!_0}}S<9hyKybc!+y%%*{&-8%f)^coFA6F@+wBwt{?idb3^&N2Jj42o6px>eV%|O9mIC4tncFdBLtf6# z@vSd@;~9X=yam07`Eug`!Pz6l-{fNif1Hc3$A>-l(-k4*?D36SUsz7#n>KGaTGg;GXn z?G`g3Jlrd*c`aBXrMj&#qo2t4+&yfXl1J~?eHG3g6+6$G=SSw4qVpzAP_L>g6Cw;J z+mM{kkB>hstQpJrSR--aeC!nRYXzsxrKUIl`|ch4@+!MR`~bwzFn;+|FQX&+sFZaQ zH$vb9Y^a$0lYGI^i@6I)aT4_K<440KRDgdDBK*jW){rgQ`j8$ZMtCKpD2>3$T9Aq* zQW^E|rLcbQv*ev!0R?mXAsG&2HA-Hk2xo%jBUQ(y9!=5mX#@QHX59U^H^!E|K1spM zwB9puYye!oY~+o~HDej@b;7mu@3DUwwhmS`5=&wK8#wJV!$y6KLLk>yb${2ej6M)IJswE5`Z|WUj1i%g8;m70SU_IG~EFmpFH-+mtd9XDwUt1sC z&R!h`7^P}T@O)XKI~Ed?;rZGv@1LJ?j`8Q5v zpFM*`rm1e5{Y9W?9`GB9xF3_l>$&sUE}v-r+AC*Lt_r;|-5`aXbA*6f&++ABib)Ib zKhen4%gttm_#g9bA^QEp#rwDWQ(m#U=`1|Yy6uU`g)f}#zJCf|#{5l|G;m#m_#&Ie ztY1>{vB)E++MFviE(*NKCr!Sh{GXE)>bT<>=I^8J<7@3?7p zk;d;yIgqAAt@3oya}XQDkSzk=SY=m5@P5=I#}CzO-5>T_C!cMYDXUJvvs$45c(a=y HZ>#uk%5{VI -- 2.17.1