From: Caisking <3449750381@qq.com> Date: Tue, 20 Feb 2024 11:53:58 +0000 (+0800) Subject: 1.多国语言目前还有部分功能需要完善; X-Git-Tag: release_V1.2.70_20241020_135402~1298^2~23 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=74b05ce170f32f026ce06873a26516131f6b2e4f;p=mirrors%2FFD230.git 1.多国语言目前还有部分功能需要完善; --- diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index cc7c97296..590a29ed9 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -236,6 +236,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/language/LanguageInit.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/MainWeatherPresenter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/weather/src/MainWeatherView.cpp @@ -301,6 +302,9 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/message/src/MessageView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/message/src/MessageCardView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rotate/src/RotateView.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/rotate/src/RotatePresenter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/src/PhoneService.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/phoneservice/src/PhoneAudio.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/offlinevoice/src/VocassistModel.cpp diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h index df179b59f..78a0826fe 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h @@ -58,6 +58,7 @@ typedef enum : uint16_t VIEW_DIAL, // 切换表盘 VIEW_MESSAGE, // 信息通知 VIEW_BLOODO, // 血氧监测 + VIEW_ROTATE, // 模拟表冠 /* -------------------------------------------------------------------------- */ VIEW_MAIN_TEMP, // 体温界面(暂时不用) VIEW_OFFLINEVOICE, // 语音助手界面(暂时不用) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h index 7a699f59d..a96e10979 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h @@ -1,26 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-02-18 19:33:16 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-19 19:05:43 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2023-12-13 19:33:14 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-22 16:32:42 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h - * @Description: - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ #ifndef NATIVE_LAUNCHER_H #define NATIVE_LAUNCHER_H @@ -68,7 +46,7 @@ namespace OHOS /* -------------------------------------------------------------------------- */ void InitDisplayBrightnessSlice(void); /* --------------------------------测试界面------------------------------------ */ - + void InitRotateSlice(void); void InitBloodSlice(void); void InitMainAlipaySlice(void); /* -------------------------------------------------------------------------- */ diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 437c34acc..8ee4b6646 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -57,7 +57,6 @@ #include "UISampleView.h" #include "UISamplePresenter.h" - #include "blood/include/BloodCardView.h" #include "weather/include/MainWeatherPresenter.h" @@ -101,6 +100,10 @@ #include "common/graphic_startup.h" #include "font/ui_font.h" #include "font/font_global_manager.h" +#include "language/LanguageInit.h" + +#include "rotate/include/RotateView.h" +#include "rotate/include/RotatePresenter.h" #ifdef SUPPORT_ALIPAY_SEC #include "AlipayMainView.h" @@ -149,6 +152,7 @@ namespace OHOS {VIEW_FAST_TRAINING_ATTENTION, &NativeLauncher::InitFastTrainingAttentionSlice}, {VIEW_MESSAGE, &NativeLauncher::InitMessageSlice}, + {VIEW_ROTATE, &NativeLauncher::InitRotateSlice}, #ifdef SUPPORT_ALIPAY_SEC {VIEW_MAIN_ALIPAY, &NativeLauncher::InitMainAlipaySlice}, #endif @@ -191,11 +195,13 @@ namespace OHOS GraphicStartUp::InitFontEngine(MEM_POOL_UI_FONT, MEM_POOL_UI_FONT_SIZE, OHOS::VECTOR_FONT_DIR, DEFAULT_VECTOR_FONT_FILENAME); WEARABLE_LOGI(WEARABLE_LOG_MODULE_LAUNCHER_FWK, "NativeLauncher::InitNativeLauncher"); /* -------------------------------------------------------------------------- */ - // 注册中文和英语两种语言包 - static const char *BIN_LANG_EN = RES_PATH "font/en.lang"; - static const char *BIN_LANG_ZH = RES_PATH "font/zh.lang"; - const char *resFiles[] = {BIN_LANG_ZH, BIN_LANG_EN}; - FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char *)), 1); + // 从语言json配置里面读取语言包 +#if 0 + if (language::GetInstance()->InitLangues()) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLangues"); + } +#endif /* -------------------------------------------------------------------------- */ // 初始化所有预加载slice InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 @@ -443,7 +449,6 @@ namespace OHOS NativeAbility::GetInstance().AddSliceProxy(VIEW_UISAMPLE, uisampleView); } - void NativeLauncher::InitWeatherSlice(void) // 天气 { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitWeatherSlice"); @@ -544,7 +549,6 @@ namespace OHOS NativeAbility::GetInstance().AddSliceProxy(VIEW_DISPLAY_BRIGHTNESS, uidisplaybrightnessView); } - void NativeLauncher::InitSecondaryFunction(void) // 辅助功能 { SliceProxy *secondaryfunction = new AbilitySliceProxy; @@ -585,4 +589,13 @@ namespace OHOS NativeAbility::GetInstance().AddSliceProxy(VIEW_FAST_TRAINING_ATTENTION, fasttrainingattention); } + void NativeLauncher::InitRotateSlice(void) + { + SliceProxy *rotate = new AbilitySliceProxy; + if (rotate == nullptr) + { + return; + } + NativeAbility::GetInstance().AddSliceProxy(VIEW_ROTATE, rotate); + } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistView.h b/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistView.h index 71408f258..ef8235ee8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistView.h @@ -1,19 +1,3 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-20 17:32:42 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 11:02:35 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/applist/include/ApplistView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ -/* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: ApplistView.h - * Author: - * Create: 2021-09-18 - */ #ifndef APPLIST_VIEW_H #define APPLIST_VIEW_H 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 975907bce..3dff74153 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp @@ -26,6 +26,7 @@ namespace OHOS {VIEW_INDOORWALK, PNG_APPLIST_WALK_IMAGE, PNG_APPLIST_WALK_IMAGE, "室内步行", nullptr}, {VIEW_WEATHER, PNG_APPLIST_WEATHER_IMAGE, PNG_APPLIST_WEATHER_IMAGE, "天气", nullptr}, {VIEW_SETTING, PNG_APPLIST_SETTING_IMAGE, PNG_APPLIST_SETTING_IMAGE, "设置", nullptr}, + {VIEW_ROTATE, PNG_APPLIST_UI_SAMPLE_IMAGE, PNG_APPLIST_UI_SAMPLE_IMAGE, "模拟表冠", nullptr}, #ifdef SUPPORT_ALIPAY_SEC {VIEW_MAIN_ALIPAY, PNG_APPLIST_ALIPAY_IMAGE, PNG_APPLIST_ALIPAY_IMAGE, "支付宝", nullptr}, #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodCardView.h b/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodCardView.h index c452bf1e9..ed0b1a6dc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodCardView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodCardView.h @@ -1,13 +1,3 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-17 19:32:15 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 15:33:26 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodCardView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ #ifndef _Blood_CARD_VIEW_H #define _Blood_CARD_VIEW_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodNoteView.h b/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodNoteView.h index c54634d10..e69de29bb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodNoteView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodNoteView.h @@ -1,10 +0,0 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-26 10:36:06 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 10:36:10 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodNoteView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodOxygenView.h b/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodOxygenView.h index a8d5095d0..e69de29bb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodOxygenView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodOxygenView.h @@ -1,10 +0,0 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-26 10:33:51 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 10:33:55 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/include/bloodoxygenView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodCardView.cpp index cb0a6d48f..4b79f79a3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodCardView.cpp @@ -1,13 +1,3 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2023-12-12 16:55:23 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-15 17:31:26 - * @FilePath: /1.FD230/FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodCardView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ #include "blood/include/BloodCardView.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodNoteView.cpp b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodNoteView.cpp index ecd217a2f..e69de29bb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodNoteView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodNoteView.cpp @@ -1,10 +0,0 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-26 10:35:53 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 10:35:57 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodNoteView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodPresenter.cpp index be391576a..e69de29bb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodPresenter.cpp @@ -1,10 +0,0 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-26 10:34:49 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 10:34:52 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodoxygenPresenter.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodTestView.cpp b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodTestView.cpp index 979cf2763..8b1378917 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodTestView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodTestView.cpp @@ -1,10 +1 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-26 11:06:24 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 11:06:27 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodTestView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + diff --git a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodWarnView.cpp b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodWarnView.cpp index dace7812c..8b1378917 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodWarnView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodWarnView.cpp @@ -1,10 +1 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-26 10:37:57 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 10:38:00 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodWarnView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + diff --git a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodBandoffView.h b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodBandoffView.h index c9f0b3f28..52640bf7d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodBandoffView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodBandoffView.h @@ -1,19 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2023-12-13 19:33:14 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-26 18:24:46 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/bloodoxygen/include/BloodBandoffView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ -/* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: bloodBandoff view - * Author: - * Create: 2021-08-01 - */ + #ifndef BLOOD_BANDOFF_VIEW_H #define BLOOD_BANDOFF_VIEW_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp b/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp new file mode 100644 index 000000000..3d619d8ff --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp @@ -0,0 +1,96 @@ +#include +#include +#include +#include "cJSON.h" +#include "font/ui_font.h" +#include "font/font_global_manager.h" +#include "wearable_log.h" +#include "language/LanguageInit.h" + +namespace OHOS +{ + cJSON *cjson_json = NULL; + static language *g_planguage{nullptr}; + + language::language() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "language::language"); + g_planguage = this; + } + + language::~language() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "language::~language"); + g_planguage = nullptr; + } + + language *language::GetInstance() + { + return g_planguage; + } + // 加载json + bool language::loadJsonData(const std::string &filePath) + { + std::ifstream file(filePath); + if (file.is_open()) + { + std::string json_string((std::istreambuf_iterator(file)), std::istreambuf_iterator()); + file.close(); + cjson_json = cJSON_Parse(json_string.c_str()); + return true; + } + else + { + printf("Failed to open JSON file: %s\n", filePath.c_str()); + return false; + } + } + // 初始化语言 + bool language::InitLangues() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLangues"); + // 获取语言包以及语言状态 + if (loadJsonData(JsonFilePath)) + { + cJSON *languages_cjson = cJSON_GetObjectItem(cjson_json, "languages"); + cJSON *zn_cjson = cJSON_GetObjectItem(languages_cjson, "zn"); + cJSON *en_cjson = cJSON_GetObjectItem(languages_cjson, "en"); + const char *BIN_LANG_EN = cJSON_GetObjectItem(en_cjson, "path")->valuestring; + const char *BIN_LANG_ZH = cJSON_GetObjectItem(zn_cjson, "path")->valuestring; + languages_satuas = cJSON_GetObjectItem(cjson_json, "languages_satuas")->valueint; + resFiles[0] = BIN_LANG_ZH; + resFiles[1] = BIN_LANG_EN; + FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char *)), languages_satuas); + return true; + } + return false; + } + // 切换语言 + bool language::changelanguage(int languages_satuas) + { + // 获取语言包以及语言状态 + if (loadJsonData(JsonFilePath)) + { + cJSON *languages_cjson = cJSON_GetObjectItem(cjson_json, "languages"); + cJSON *zn_cjson = cJSON_GetObjectItem(languages_cjson, "zn"); + cJSON *en_cjson = cJSON_GetObjectItem(languages_cjson, "en"); + const char *BIN_LANG_EN = cJSON_GetObjectItem(en_cjson, "path")->valuestring; + const char *BIN_LANG_ZH = cJSON_GetObjectItem(zn_cjson, "path")->valuestring; + resFiles[0] = BIN_LANG_ZH; + resFiles[1] = BIN_LANG_EN; + } + // 这里修改json里面的语言状态 + cJSON *languages_satuas_cjson = cJSON_GetObjectItem(cjson_json, "languages_satuas"); + cJSON_ReplaceItemInObject(cjson_json, "languages_satuas", cJSON_CreateNumber(languages_satuas)); + + // 获取字体单例 + UIFont *uiFont = UIFont::GetInstance(); + if (uiFont == nullptr) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Get UIFont error"); + return false; + } + FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char *)), languages_satuas); + uiFont->SetCurrentLangId(languages_satuas); // set language + } +} diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.h b/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.h new file mode 100644 index 000000000..6551f6ec6 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.h @@ -0,0 +1,25 @@ +#ifndef LANGUAGE_INIT_H +#define LANGUAGE_INIT_H + +#include + +namespace OHOS +{ + class language + { + public: + language(); + ~language(); + static language *GetInstance(); + bool loadJsonData(const std::string &filePath); + bool InitLangues(); + bool changelanguage(int languages_satuas); + + private: + std::string JsonFilePath = "user/res/language_config/config.json"; + int16_t languages_satuas; + const char *resFiles[2]; + }; +} + +#endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/config/README b/code/sdk/application/wearable/fd230app/nativeui/language/README similarity index 100% rename from code/sdk/application/wearable/fd230app/nativeui/language/config/README rename to code/sdk/application/wearable/fd230app/nativeui/language/README diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.cpp b/code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.h b/code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.h deleted file mode 100644 index f5e2c74bb..000000000 --- a/code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.h +++ /dev/null @@ -1,10 +0,0 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-02-01 14:09:40 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-01 14:09:43 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.cpp b/code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.h b/code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.h deleted file mode 100644 index b35be8119..000000000 --- a/code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.h +++ /dev/null @@ -1,10 +0,0 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-02-01 14:09:58 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-01 14:10:01 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ 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 new file mode 100644 index 000000000..005a9cbc0 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/config.json @@ -0,0 +1,11 @@ +{ + "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/config/font/en.lang b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/en.lang similarity index 100% rename from code/sdk/application/wearable/fd230app/nativeui/language/config/font/en.lang rename to code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/en.lang diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/config/font/ui_resource_string.h b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/ui_resource_string.h similarity index 100% rename from code/sdk/application/wearable/fd230app/nativeui/language/config/font/ui_resource_string.h rename to code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/ui_resource_string.h diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/config/font/zh.lang b/code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/zh.lang similarity index 100% rename from code/sdk/application/wearable/fd230app/nativeui/language/config/font/zh.lang rename to code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/zh.lang diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/config/language_en.xml b/code/sdk/application/wearable/fd230app/nativeui/language/language_en.xml similarity index 100% rename from code/sdk/application/wearable/fd230app/nativeui/language/config/language_en.xml rename to code/sdk/application/wearable/fd230app/nativeui/language/language_en.xml diff --git a/code/sdk/application/wearable/fd230app/nativeui/language/config/language_zh.xml b/code/sdk/application/wearable/fd230app/nativeui/language/language_zh.xml similarity index 100% rename from code/sdk/application/wearable/fd230app/nativeui/language/config/language_zh.xml rename to code/sdk/application/wearable/fd230app/nativeui/language/language_zh.xml diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h index 137c1898d..8f52af927 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h @@ -1,19 +1,3 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2023-12-13 19:33:14 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-17 19:53:31 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/main/include/MainPresenterSample.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ -/* - * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. - * Description: MainPresenterSample - * Author: - * Create: - */ #ifndef MAIN_PRESENTER_SAMPLE_H #define MAIN_PRESENTER_SAMPLE_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h b/code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h index e0f4a297d..72edf78a8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-18 11:03:28 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-20 17:53:18 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/main/include/PullUpDownView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + /* * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. * Description: WeekStep diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp index e4309543e..c5e76b7b8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-02-19 17:06:19 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-19 18:59:28 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + /* * Copyright (c) 2020-2021 CompanyNameMagicTag. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp b/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp index b82446044..8707b3b26 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp @@ -1,13 +1,3 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-02-19 17:06:50 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-19 18:59:02 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ #include "ModelListenerSample.h" #include "PresenterTask.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageAdapter.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageAdapter.h index 053d52969..39b3c5b2a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageAdapter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageAdapter.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-22 16:46:45 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 16:33:12 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/include/MessageAdapter.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef Message_ADAPTER_H #define Message_ADAPTER_H #include diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageCardView.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageCardView.h index a38f7e244..1472a3b31 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageCardView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageCardView.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 19:09:37 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 19:13:04 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/include/MessageCardView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef MESSAGE_CARD_VIEW_H #define MESSAGE_CARD_VIEW_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageItemView.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageItemView.h index eedaa3c69..ffb9028ef 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageItemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageItemView.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 16:33:48 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/include/MessageItemView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef Message_ITEM_VIEW_H #define Message_ITEM_VIEW_H 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 d4249d883..d0474af1f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageModel.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-24 14:33:55 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/include/MessageModel.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef Message_MODEL_H #define Message_MODEL_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h index 533f9b912..7fa48fc1f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 16:37:19 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/include/MessagePresenter.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef Message_PRESENTER_H #define Message_PRESENTER_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h index 229b1a0fd..39d43d24b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 17:21:52 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/include/MessageView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef Message_VIEW_H #define Message_VIEW_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageAdapter.cpp index 3e2778e79..e36f385b0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageAdapter.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-24 17:56:27 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/src/MessageAdapter.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #include "message/include/MessageAdapter.h" #include "message/include/MessageItemView.h" #include "wearable_log.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp index 9b8bf45e7..e439cb2ff 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-24 10:38:52 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/src/MessageCardView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #include "message/include/MessageCardView.h" #include "wearable_log.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageItemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageItemView.cpp index 60fb8abc8..39cb1fed4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageItemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageItemView.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 16:39:02 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/src/MessageItemView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #include "message/include/MessageItemView.h" namespace OHOS diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp index 674b75db7..0a23d5094 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-23 16:03:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 17:07:59 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/src/MessageModel.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #include "message/include/MessageModel.h" #include "common/image_cache_manager.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 7c92fa019..29c241070 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-22 16:22:26 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 17:31:05 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/src/MessagePresenter.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #include "AppViewIDs.h" #include "NativeAbility.h" #include "message/include/MessagePresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp index cdc1f6ecd..0e0c194f1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-22 16:20:34 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-23 18:11:40 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/message/src/MessageView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #include "message/include/MessageView.h" #include "message/include/MessagePresenter.h" diff --git a/code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotatePresenter.h b/code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotatePresenter.h new file mode 100644 index 000000000..a7f034259 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotatePresenter.h @@ -0,0 +1,43 @@ +/*** + * @Author: Caisking 3449750381@qq.com + * @Date: 2024-01-17 19:23:30 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-02-20 17:27:36 + * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/dial/include/RotatePresenter.h + * @Description: + * @ + * @Copyright (c) 2024 by Caisking , All Rights Reserved. + */ +#ifndef _ROTATE_PRESENTER_H +#define _ROTATE_PRESENTER_H + +#include "Presenter.h" +#include "rotate/include/RotateView.h" + +namespace OHOS +{ + class RotateView; + + class RotatePresenter : public Presenter, + public UIView::OnClickListener, + public UIView::OnDragListener + { + public: + RotatePresenter(); + virtual ~RotatePresenter(); + + void OnStart() override; + void OnPause() override; + void OnResume() override; + void OnStop() override; + + static RotatePresenter *GetInstance(); + + private: + + bool OnClick(UIView &view, const ClickEvent &event) override; + bool OnDrag(UIView &view, const DragEvent &event) override; + }; +} // namespace OHOS + +#endif // SLEEPDETAIL_PRESENTER_H \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotateView.h b/code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotateView.h new file mode 100644 index 000000000..3f7c0614e --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotateView.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ROTATE_VIEW_H +#define _ROTATE_VIEW_H + +#include "BaseView.h" +#include "View.h" +#include "components/ui_label.h" +#include "components/ui_label_button.h" +#include "components/ui_picker.h" +#include "components/ui_scroll_view.h" +#include "components/ui_swipe_view.h" +#include "core/render_manager.h" +#include "graphic_config.h" +#include "rotate/include/RotatePresenter.h" + +namespace OHOS +{ + class RotatePresenter; + class RotateView : public View, UIView::OnTouchListener, UIView::OnRotateListener + { + public: + RotateView(); + ~RotateView(); + static RotateView *GetInstance(void); + + void OnStart() override; + void OnSetUpView() override; + void OnTearDownView() override; + void OnStop() override; + + void TestPicker(); + void GetTestView(); + bool OnRotateStart(UIView &view, const RotateEvent &event) override; + + private: + UIViewGroup *container_ = nullptr; + UIPicker *uiPicker1_ = nullptr; + }; +} + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp new file mode 100644 index 000000000..208c5830b --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp @@ -0,0 +1,68 @@ +#include "AppViewIDs.h" +#include "NativeAbility.h" + +#include "rotate/include/RotatePresenter.h" + +namespace OHOS +{ + + // 当前Presenter属性实例化的内存指针 + static RotatePresenter *g_pRotatePresenter = nullptr; + + RotatePresenter::RotatePresenter() + { + g_pRotatePresenter = this; + } + + RotatePresenter::~RotatePresenter() + { + + g_pRotatePresenter = nullptr; + } + + RotatePresenter *RotatePresenter::GetInstance() + { + + return g_pRotatePresenter; + } + + void RotatePresenter::OnStart() + { + + Presenter::OnStart(); + } + + void RotatePresenter::OnPause(void) + { + + Presenter::OnPause(); + } + + void RotatePresenter::OnResume(void) + { + + Presenter::OnResume(); + } + + void RotatePresenter::OnStop(void) + { + + Presenter::OnStop(); + } + + bool RotatePresenter::OnDrag(UIView &view, const DragEvent &event) + { + if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_APPLIST); + } + UNUSED(view); + return true; + } + + bool RotatePresenter::OnClick(UIView &view, const ClickEvent &event) + { + return true; + } + +} \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotateView.cpp b/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotateView.cpp new file mode 100644 index 000000000..945617b60 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotateView.cpp @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rotate/include/RotateView.h" +#include "wearable_log.h" + +#include "dfx/rotate_event_injector.h" +#include "dock/focus_manager.h" +namespace OHOS +{ + + static RotateView *g_pRotateView{nullptr}; + RotateView::RotateView() + { + g_pRotateView = this; + } + + RotateView::~RotateView() + { + if (container_ != nullptr) + { + container_->RemoveAll(); + delete container_; + container_ = nullptr; + } + if (uiPicker1_ != nullptr) + { + delete uiPicker1_; + uiPicker1_ = nullptr; + } + g_pRotateView = nullptr; + } + + RotateView *RotateView::GetInstance() + { + return g_pRotateView; + } + + void RotateView::GetTestView() + { + TestPicker(); + } + bool RotateView::OnRotateStart(UIView &view, const RotateEvent &event) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnRotateStart"); + } + void RotateView::TestPicker() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TestPicker"); + if (container_ == nullptr) + { + container_ = new UIViewGroup(); + container_->SetPosition(0, 0, 466, 466); + container_->SetStyle(STYLE_BACKGROUND_OPA, 0); + } + + // Add Picker to App + if (uiPicker1_ == nullptr) + { + uiPicker1_ = new UIPicker(); + } + uiPicker1_->SetPosition(103, 100); // widget's left position and top position + uiPicker1_->Resize(260, 270); // widget's width and height + uiPicker1_->SetViewId("uiPicker1"); // Set style + + // Set additional property + uiPicker1_->SetItemHeight(100); + uiPicker1_->SetTextColor(Color::GetColorFromRGBA(0xbd, 0xd8, 0xda, 0xff), Color::GetColorFromRGBA(0xff, 0x00, 0x00, 0xff)); + const char *uiPicker1Data[] = {"1", "2", "3", "4", "5", "6", "7", "8"}; + uiPicker1_->SetValues(uiPicker1Data, 8); + uiPicker1_->SetBackgroundFont(DEFAULT_VECTOR_FONT_FILENAME, 80); + uiPicker1_->SetHighlightFont(DEFAULT_VECTOR_FONT_FILENAME, 100); + + uiPicker1_->SetOnTouchListener(this); + uiPicker1_->SetOnRotateListener(this); + uiPicker1_->SetRotateFactor(2); + + // Add to rootView + container_->Add(uiPicker1_); + uiPicker1_->SetVisible(true); + } + + void RotateView::OnStart() + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "RotateView"); + View::OnStart(); + BaseView::RootView(Color::Red().full); + + container_ = new UIViewGroup(); + container_->SetPosition(0, 0); + container_->SetWidth(Screen::GetInstance().GetWidth()); + container_->SetHeight(Screen::GetInstance().GetHeight()); + + // 创建 draglistener 实例并设置为拖动监听器 + UIView::OnDragListener *draglistener = static_cast(RotatePresenter::GetInstance()); + if (draglistener == nullptr) + { + return; + } + container_->SetOnDragListener(draglistener); + container_->SetTouchable(true); + container_->SetDraggable(true); + GetTestView(); + RootView::GetInstance()->Add(container_); + } + void RotateView::OnSetUpView() + { + View::OnSetUpView(); + Draw(); + } + void RotateView::OnTearDownView() + { + View::OnTearDownView(); + return; + } + + void RotateView::OnStop() + { + View::OnStop(); + RootView::GetInstance()->RemoveAll(); + return; + } +} diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h index f99d15dea..98362a6ed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-29 19:58:37 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-01 16:27:58 - * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef SYSTEM_PRESENTER_H #define SYSTEM_PRESENTER_H 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 de1c7df9a..96a14cb43 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp @@ -5,6 +5,7 @@ #include "system/include/SystemPresenter.h" #include "font/font_global_manager.h" #include "font/ui_font.h" +#include "language/LanguageInit.h" namespace OHOS { @@ -67,7 +68,7 @@ namespace OHOS { for (int i = 1; i < MAX_SYSTEMVIEWID; i++) { - if (p_SystemView->GetSystemScrollView(i)!=nullptr && p_SystemView->GetSystemScrollView(i)->IsVisible() == true) + if (p_SystemView->GetSystemScrollView(i) != nullptr && p_SystemView->GetSystemScrollView(i)->IsVisible() == true) { p_SystemView->ChangeView(i, SYSTEMVIEW); break; @@ -156,10 +157,8 @@ namespace OHOS } /* -------------------------------------------------------------------------- */ - // 注册中文和英语两种语言包 - static const char *BIN_LANG_EN = RES_PATH "font/en.lang"; - static const char *BIN_LANG_ZH = RES_PATH "font/zh.lang"; - const char *resFiles[] = {BIN_LANG_ZH, BIN_LANG_EN}; + // 获取语言类 + language *g_planguage = new language; /* -------------------------------------------------------------------------- */ // 用来监听语言切换 bool RadiobuttonOnChangeListener::OnChange(UICheckBox::UICheckBoxState state) @@ -179,16 +178,12 @@ namespace OHOS if (isChineseRadioButtonSelected()) { // 中文文本 - FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char *)), 0); - uiFont->SetCurrentLangId(0); // set language - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Switched to Chinese language"); + g_planguage->changelanguage(0); } else if (isEnglishRadioButtonSelected()) { // 英语文本 - FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char *)), 1); - uiFont->SetCurrentLangId(1); // set language - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Switched to English language"); + g_planguage->changelanguage(1); } m_label->SetTextId(11); // 强制刷新 diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingView.h b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingView.h index bc624e90a..de0c21c59 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingView.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2023-12-12 16:55:27 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-16 14:43:12 - * @FilePath: /1.FD230/FD230/code/sdk/application/wearable/nativeapp/nativeui/traing/include/TraingView.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef _Traing_VIEW_H #define _Traing_VIEW_H diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h index 9ac25f5aa..79e8581cf 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-29 19:58:37 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-01 17:13:46 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + /* * Copyright (c) 2020-2021 CompanyNameMagicTag. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h index 770104c1b..cbf615969 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-29 19:58:37 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-01 17:14:12 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + /* * Copyright (c) 2020-2021 CompanyNameMagicTag. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp index c19391553..5d42a4f47 100755 --- a/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp @@ -148,7 +148,6 @@ void NativeLauncher::InitNativeLauncher() { const char* resFiles[] = {BIN_LANG_ZH, BIN_LANG_EN}; FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char*)), 1); - // 初始化所有预加载slice InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 InitAllNativeSlices(); diff --git a/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp index a085f3d22..8ee619682 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-29 19:58:37 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-02-01 14:53:13 - * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + /* * Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved. * Description: WeekStep diff --git a/code/sdk/application/wearable/ohos_deps/wearable_log.h b/code/sdk/application/wearable/ohos_deps/wearable_log.h index 80de22b98..bca0132bf 100755 --- a/code/sdk/application/wearable/ohos_deps/wearable_log.h +++ b/code/sdk/application/wearable/ohos_deps/wearable_log.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2023-12-20 10:32:41 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-24 17:54:52 - * @FilePath: /FD230/code/sdk/application/wearable/ohos_deps/wearable_log.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + /* * Copyright (c) CompanyNameMagicTag 2023-2023. All rights reserved. * Description: Wearable log header file. diff --git a/code/sdk/application/wearable/service/timeservice/include/TimeService.h b/code/sdk/application/wearable/service/timeservice/include/TimeService.h index 61e46b0e4..a4dbfda1b 100644 --- a/code/sdk/application/wearable/service/timeservice/include/TimeService.h +++ b/code/sdk/application/wearable/service/timeservice/include/TimeService.h @@ -1,23 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-17 16:12:26 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-17 16:13:33 - * @FilePath: /FD230/code/sdk/application/wearable/service/timeservice/include/TimeService.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-17 16:12:26 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-17 16:12:28 - * @FilePath: /FD230/code/sdk/application/wearable/service/timeservice/include/TimeService.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + #ifndef TIMESERVICE_H #define TIMESERVICE_H diff --git a/code/sdk/application/wearable/service/timeservice/include/TimeServiceImpl.h b/code/sdk/application/wearable/service/timeservice/include/TimeServiceImpl.h index da4bbeb45..f2fef806f 100644 --- a/code/sdk/application/wearable/service/timeservice/include/TimeServiceImpl.h +++ b/code/sdk/application/wearable/service/timeservice/include/TimeServiceImpl.h @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-17 16:12:44 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-17 16:23:51 - * @FilePath: /FD230/code/sdk/application/wearable/service/timeservice/include/TimeServiceImpl.h - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + // TimeServiceImpl.h #ifndef TIMESERVICEIMPL_H #define TIMESERVICEIMPL_H diff --git a/code/sdk/application/wearable/service/timeservice/src/TimeServiceImpl.cpp b/code/sdk/application/wearable/service/timeservice/src/TimeServiceImpl.cpp index 98f55f07e..c41e1f9b8 100644 --- a/code/sdk/application/wearable/service/timeservice/src/TimeServiceImpl.cpp +++ b/code/sdk/application/wearable/service/timeservice/src/TimeServiceImpl.cpp @@ -1,13 +1,4 @@ -/*** - * @Author: Caisking 3449750381@qq.com - * @Date: 2024-01-17 16:13:11 - * @LastEditors: Caisking 3449750381@qq.com - * @LastEditTime: 2024-01-17 16:13:13 - * @FilePath: /FD230/code/sdk/application/wearable/service/timeservice/src/TimeServiceImpl.cpp - * @Description: - * @ - * @Copyright (c) 2024 by Caisking , All Rights Reserved. - */ + // TimeServiceImpl.cpp #include "TimeServiceImpl.h" #include diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index 7e5b01abb..611989782 100755 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -127,8 +127,8 @@ target = { 'ENABLE_FONT_VECTOR_GLOBAL', 'ENABLE_SHAPING', 'TPTYPE_FT6X46', - 'SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION', - 'SUPPORT_ALIPAY_SEC' + 'SUPPORT_CHARGER_PLUG_DETECTION_NOTIFICATION' + #'SUPPORT_ALIPAY_SEC' ], 'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", 'dfx_nv', "osal", "arch_port", "-:testsuite", "liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation', 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 new file mode 100644 index 000000000..005a9cbc0 --- /dev/null +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/config.json @@ -0,0 +1,11 @@ +{ + "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/font/en.lang b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/en.lang similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/en.lang 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/language_config/font/ui_resource_string.h similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/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/language_config/font/zh.lang similarity index 100% rename from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang rename to code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/zh.lang