1.多国语言目前还有部分功能需要完善;
authorCaisking <3449750381@qq.com>
Tue, 20 Feb 2024 11:53:58 +0000 (19:53 +0800)
committerCaisking <3449750381@qq.com>
Tue, 20 Feb 2024 11:53:58 +0000 (19:53 +0800)
64 files changed:
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h
code/sdk/application/wearable/fd230app/nativelauncher/include/NativeLauncher.h
code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/fd230app/nativeui/applist/include/ApplistView.h
code/sdk/application/wearable/fd230app/nativeui/applist/src/ApplistModel.cpp
code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodCardView.h
code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodNoteView.h
code/sdk/application/wearable/fd230app/nativeui/blood/include/BloodOxygenView.h
code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodCardView.cpp
code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodNoteView.cpp
code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodTestView.cpp
code/sdk/application/wearable/fd230app/nativeui/blood/src/BloodWarnView.cpp
code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodBandoffView.h
code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.cpp [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/language/LanguageInit.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/language/README [moved from code/sdk/application/wearable/fd230app/nativeui/language/config/README with 100% similarity]
code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.cpp [deleted file]
code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.h [deleted file]
code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.cpp [deleted file]
code/sdk/application/wearable/fd230app/nativeui/language/UILabelExt_Init.h [deleted file]
code/sdk/application/wearable/fd230app/nativeui/language/language_config/config.json [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/en.lang [moved from code/sdk/application/wearable/fd230app/nativeui/language/config/font/en.lang with 100% similarity]
code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/ui_resource_string.h [moved from code/sdk/application/wearable/fd230app/nativeui/language/config/font/ui_resource_string.h with 100% similarity]
code/sdk/application/wearable/fd230app/nativeui/language/language_config/font/zh.lang [moved from code/sdk/application/wearable/fd230app/nativeui/language/config/font/zh.lang with 100% similarity]
code/sdk/application/wearable/fd230app/nativeui/language/language_en.xml [moved from code/sdk/application/wearable/fd230app/nativeui/language/config/language_en.xml with 100% similarity]
code/sdk/application/wearable/fd230app/nativeui/language/language_zh.xml [moved from code/sdk/application/wearable/fd230app/nativeui/language/config/language_zh.xml with 100% similarity]
code/sdk/application/wearable/fd230app/nativeui/main/include/MainPresenterSample.h
code/sdk/application/wearable/fd230app/nativeui/main/include/PullUpDownView.h
code/sdk/application/wearable/fd230app/nativeui/main/src/ModelListenerSample.cpp
code/sdk/application/wearable/fd230app/nativeui/main/src/PresenterTask.cpp
code/sdk/application/wearable/fd230app/nativeui/message/include/MessageAdapter.h
code/sdk/application/wearable/fd230app/nativeui/message/include/MessageCardView.h
code/sdk/application/wearable/fd230app/nativeui/message/include/MessageItemView.h
code/sdk/application/wearable/fd230app/nativeui/message/include/MessageModel.h
code/sdk/application/wearable/fd230app/nativeui/message/include/MessagePresenter.h
code/sdk/application/wearable/fd230app/nativeui/message/include/MessageView.h
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageAdapter.cpp
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageCardView.cpp
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageItemView.cpp
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageModel.cpp
code/sdk/application/wearable/fd230app/nativeui/message/src/MessagePresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/message/src/MessageView.cpp
code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotatePresenter.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/rotate/include/RotateView.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotatePresenter.cpp [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/rotate/src/RotateView.cpp [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h
code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/traing/include/TraingView.h
code/sdk/application/wearable/nativeapp/nativelauncher/include/AppViewIDs.h
code/sdk/application/wearable/nativeapp/nativelauncher/include/NativeLauncher.h
code/sdk/application/wearable/nativeapp/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/nativeapp/nativeui/main/src/PullUpDownView.cpp
code/sdk/application/wearable/ohos_deps/wearable_log.h
code/sdk/application/wearable/service/timeservice/include/TimeService.h
code/sdk/application/wearable/service/timeservice/include/TimeServiceImpl.h
code/sdk/application/wearable/service/timeservice/src/TimeServiceImpl.cpp
code/sdk/build/config/target_config/brandy/config.py
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/config.json [new file with mode: 0644]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/en.lang [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/en.lang with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/ui_resource_string.h [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/ui_resource_string.h with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/language_config/font/zh.lang [moved from code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/font/zh.lang with 100% similarity]

index cc7c972..590a29e 100644 (file)
@@ -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
index df179b5..78a0826 100644 (file)
@@ -58,6 +58,7 @@ typedef enum : uint16_t
     VIEW_DIAL,    // 切换表盘
     VIEW_MESSAGE, // 信息通知
     VIEW_BLOODO,  // 血氧监测
+    VIEW_ROTATE,  // 模拟表冠
     /* -------------------------------------------------------------------------- */
     VIEW_MAIN_TEMP,     // 体温界面(暂时不用)
     VIEW_OFFLINEVOICE,  // 语音助手界面(暂时不用)
index 7a699f5..a96e109 100644 (file)
@@ -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);
         /* -------------------------------------------------------------------------- */
index 437c34a..8ee4b66 100644 (file)
@@ -57,7 +57,6 @@
 #include "UISampleView.h"
 #include "UISamplePresenter.h"
 
-
 #include "blood/include/BloodCardView.h"
 
 #include "weather/include/MainWeatherPresenter.h"
 #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<SecondaryFunctionView, SecondaryFunctionPresenter>;
@@ -585,4 +589,13 @@ namespace OHOS
         NativeAbility::GetInstance().AddSliceProxy(VIEW_FAST_TRAINING_ATTENTION, fasttrainingattention);
     }
 
+    void NativeLauncher::InitRotateSlice(void)
+    {
+        SliceProxy *rotate = new AbilitySliceProxy<RotateView, RotatePresenter>;
+        if (rotate == nullptr)
+        {
+            return;
+        }
+        NativeAbility::GetInstance().AddSliceProxy(VIEW_ROTATE, rotate);
+    }
 }
index 71408f2..ef8235e 100644 (file)
@@ -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
index 975907b..3dff741 100644 (file)
@@ -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
index c452bf1..ed0b1a6 100644 (file)
@@ -1,13 +1,3 @@
-/*** \r
- * @Author: Caisking 3449750381@qq.com\r
- * @Date: 2024-01-17 19:32:15\r
- * @LastEditors: Caisking 3449750381@qq.com\r
- * @LastEditTime: 2024-01-26 15:33:26\r
- * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/include/BloodCardView.h\r
- * @Description: \r
- * @\r
- * @Copyright (c) 2024 by Caisking , All Rights Reserved. \r
- */\r
 \r
 #ifndef _Blood_CARD_VIEW_H\r
 #define _Blood_CARD_VIEW_H\r
index c54634d..e69de29 100644 (file)
@@ -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. 
- */
index a8d5095..e69de29 100644 (file)
@@ -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. 
- */
index cb0a6d4..4b79f79 100644 (file)
@@ -1,13 +1,3 @@
-/***\r
- * @Author: Caisking 3449750381@qq.com\r
- * @Date: 2023-12-12 16:55:23\r
- * @LastEditors: Caisking 3449750381@qq.com\r
- * @LastEditTime: 2024-01-15 17:31:26\r
- * @FilePath: /1.FD230/FD230/code/sdk/application/wearable/nativeapp/nativeui/blood/src/BloodCardView.cpp\r
- * @Description:\r
- * @\r
- * @Copyright (c) 2024 by Caisking , All Rights Reserved.\r
- */\r
 \r
 #include "blood/include/BloodCardView.h"\r
 \r
index ecd217a..e69de29 100644 (file)
@@ -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. 
- */
index be39157..e69de29 100644 (file)
@@ -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. 
- */
index 979cf27..8b13789 100644 (file)
@@ -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. 
- */
+
index dace781..8b13789 100644 (file)
@@ -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. 
- */
+
index c9f0b3f..52640bf 100644 (file)
@@ -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 (file)
index 0000000..3d619d8
--- /dev/null
@@ -0,0 +1,96 @@
+#include <fstream>
+#include <string>
+#include <cstdio>
+#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<char>(file)), std::istreambuf_iterator<char>());
+            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 (file)
index 0000000..6551f6e
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef LANGUAGE_INIT_H
+#define LANGUAGE_INIT_H
+
+#include <string>
+
+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/UILabelButtonExt_Init.cpp b/code/sdk/application/wearable/fd230app/nativeui/language/UILabelButtonExt_Init.cpp
deleted file mode 100644 (file)
index e69de29..0000000
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 (file)
index f5e2c74..0000000
+++ /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 (file)
index e69de29..0000000
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 (file)
index b35be81..0000000
+++ /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 (file)
index 0000000..005a9cb
--- /dev/null
@@ -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
index 137c189..8f52af9 100644 (file)
@@ -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
index e0f4a29..72edf78 100644 (file)
@@ -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
index e430954..c5e76b7 100644 (file)
@@ -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");
index b824460..8707b3b 100644 (file)
@@ -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"
index 053d529..39b3c5b 100644 (file)
@@ -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 <list>
index a38f7e2..1472a3b 100644 (file)
@@ -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
 
index eedaa3c..ffb9028 100644 (file)
@@ -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
 
index d4249d8..d0474af 100644 (file)
@@ -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
 
index 533f9b9..7fa48fc 100644 (file)
@@ -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
 
index 229b1a0..39d43d2 100644 (file)
@@ -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
 
index 3e2778e..e36f385 100644 (file)
@@ -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"
index 9b8bf45..e439cb2 100644 (file)
@@ -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"
 
index 60fb8ab..39cb1fe 100644 (file)
@@ -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
index 674b75d..0a23d50 100644 (file)
@@ -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"
 
index 7c92fa0..29c2410 100644 (file)
@@ -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"
index cdc1f6e..0e0c194 100644 (file)
@@ -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 (file)
index 0000000..a7f0342
--- /dev/null
@@ -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<RotateView>,
+                            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 (file)
index 0000000..3f7c061
--- /dev/null
@@ -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<RotatePresenter>, 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 (file)
index 0000000..208c583
--- /dev/null
@@ -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<RotateView>::OnStart();
+    }
+
+    void RotatePresenter::OnPause(void)
+    {
+
+        Presenter<RotateView>::OnPause();
+    }
+
+    void RotatePresenter::OnResume(void)
+    {
+
+        Presenter<RotateView>::OnResume();
+    }
+
+    void RotatePresenter::OnStop(void)
+    {
+
+        Presenter<RotateView>::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 (file)
index 0000000..945617b
--- /dev/null
@@ -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<RotatePresenter>::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<UIView::OnDragListener *>(RotatePresenter::GetInstance());
+        if (draglistener == nullptr)
+        {
+            return;
+        }
+        container_->SetOnDragListener(draglistener);
+        container_->SetTouchable(true);
+        container_->SetDraggable(true);
+        GetTestView();
+        RootView::GetInstance()->Add(container_);
+    }
+    void RotateView::OnSetUpView()
+    {
+        View<RotatePresenter>::OnSetUpView();
+        Draw();
+    }
+    void RotateView::OnTearDownView()
+    {
+        View<RotatePresenter>::OnTearDownView();
+        return;
+    }
+
+    void RotateView::OnStop()
+    {
+        View<RotatePresenter>::OnStop();
+        RootView::GetInstance()->RemoveAll();
+        return;
+    }
+}
index f99d15d..98362a6 100644 (file)
@@ -1,13 +1,4 @@
-/*** \r
- * @Author: Caisking 3449750381@qq.com\r
- * @Date: 2024-01-29 19:58:37\r
- * @LastEditors: Caisking 3449750381@qq.com\r
- * @LastEditTime: 2024-02-01 16:27:58\r
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h\r
- * @Description: \r
- * @\r
- * @Copyright (c) 2024 by Caisking , All Rights Reserved. \r
- */\r
+\r
 #ifndef SYSTEM_PRESENTER_H\r
 #define SYSTEM_PRESENTER_H\r
 \r
index de1c7df..96a14cb 100644 (file)
@@ -5,6 +5,7 @@
 #include "system/include/SystemPresenter.h"\r
 #include "font/font_global_manager.h"\r
 #include "font/ui_font.h"\r
+#include "language/LanguageInit.h"\r
 \r
 namespace OHOS\r
 {\r
@@ -67,7 +68,7 @@ namespace OHOS
         {\r
             for (int i = 1; i < MAX_SYSTEMVIEWID; i++)\r
             {\r
-                if (p_SystemView->GetSystemScrollView(i)!=nullptr && p_SystemView->GetSystemScrollView(i)->IsVisible() == true)\r
+                if (p_SystemView->GetSystemScrollView(i) != nullptr && p_SystemView->GetSystemScrollView(i)->IsVisible() == true)\r
                 {\r
                     p_SystemView->ChangeView(i, SYSTEMVIEW);\r
                     break;\r
@@ -156,10 +157,8 @@ namespace OHOS
     }\r
 \r
     /* -------------------------------------------------------------------------- */\r
-    // 注册中文和英语两种语言包\r
-    static const char *BIN_LANG_EN = RES_PATH "font/en.lang";\r
-    static const char *BIN_LANG_ZH = RES_PATH "font/zh.lang";\r
-    const char *resFiles[] = {BIN_LANG_ZH, BIN_LANG_EN};\r
+    // 获取语言类\r
+    language *g_planguage = new language;\r
     /* -------------------------------------------------------------------------- */\r
     // 用来监听语言切换\r
     bool RadiobuttonOnChangeListener::OnChange(UICheckBox::UICheckBoxState state)\r
@@ -179,16 +178,12 @@ namespace OHOS
             if (isChineseRadioButtonSelected())\r
             {\r
                 // 中文文本\r
-                FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char *)), 0);\r
-                uiFont->SetCurrentLangId(0); // set language\r
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Switched to Chinese language");\r
+                g_planguage->changelanguage(0);\r
             }\r
             else if (isEnglishRadioButtonSelected())\r
             {\r
                 // 英语文本\r
-                FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char *)), 1);\r
-                uiFont->SetCurrentLangId(1); // set language\r
-                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Switched to English language");\r
+                g_planguage->changelanguage(1);\r
             }\r
             m_label->SetTextId(11);\r
             // 强制刷新\r
index bc624e9..de0c21c 100644 (file)
@@ -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
 
index 9ac25f5..79e8581 100755 (executable)
@@ -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");
index 770104c..cbf6159 100755 (executable)
@@ -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");
index c193915..5d42a4f 100755 (executable)
@@ -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();
index a085f3d..8ee6196 100755 (executable)
@@ -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
index 80de22b..bca0132 100755 (executable)
@@ -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.
index 61e46b0..a4dbfda 100644 (file)
@@ -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
 
index da4bbeb..f2fef80 100644 (file)
@@ -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
index 98f55f0..c41e1f9 100644 (file)
@@ -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 <ctime>
index 7e5b01a..6119897 100755 (executable)
@@ -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 (file)
index 0000000..005a9cb
--- /dev/null
@@ -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