${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
${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
VIEW_DIAL, // 切换表盘
VIEW_MESSAGE, // 信息通知
VIEW_BLOODO, // 血氧监测
+ VIEW_ROTATE, // 模拟表冠
/* -------------------------------------------------------------------------- */
VIEW_MAIN_TEMP, // 体温界面(暂时不用)
VIEW_OFFLINEVOICE, // 语音助手界面(暂时不用)
-/***
- * @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
/* -------------------------------------------------------------------------- */
void InitDisplayBrightnessSlice(void);
/* --------------------------------测试界面------------------------------------ */
-
+ void InitRotateSlice(void);
void InitBloodSlice(void);
void InitMainAlipaySlice(void);
/* -------------------------------------------------------------------------- */
#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"
{VIEW_FAST_TRAINING_ATTENTION, &NativeLauncher::InitFastTrainingAttentionSlice},
{VIEW_MESSAGE, &NativeLauncher::InitMessageSlice},
+ {VIEW_ROTATE, &NativeLauncher::InitRotateSlice},
#ifdef SUPPORT_ALIPAY_SEC
{VIEW_MAIN_ALIPAY, &NativeLauncher::InitMainAlipaySlice},
#endif
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适配初始化
NativeAbility::GetInstance().AddSliceProxy(VIEW_UISAMPLE, uisampleView);
}
-
void NativeLauncher::InitWeatherSlice(void) // 天气
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "NativeLauncher::InitWeatherSlice");
NativeAbility::GetInstance().AddSliceProxy(VIEW_DISPLAY_BRIGHTNESS, uidisplaybrightnessView);
}
-
void NativeLauncher::InitSecondaryFunction(void) // 辅助功能
{
SliceProxy *secondaryfunction = new AbilitySliceProxy<SecondaryFunctionView, SecondaryFunctionPresenter>;
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);
+ }
}
-/***
- * @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
{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
-/*** \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
-/***
- * @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.
- */
-/***
- * @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.
- */
-/***\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
-/***
- * @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.
- */
-/***
- * @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.
- */
-/***
- * @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.
- */
+
-/***
- * @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.
- */
+
-/***
- * @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
--- /dev/null
+#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
+ }
+}
--- /dev/null
+#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
+++ /dev/null
-/***
- * @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.
- */
+++ /dev/null
-/***
- * @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.
- */
--- /dev/null
+{
+ "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
-/***
- * @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
-/***
- * @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
-/***
- * @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");
-/***
- * @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"
-/***
- * @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>
-/***
- * @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
-/***
- * @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
-/***
- * @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
-/***
- * @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
-/***
- * @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
-/***
- * @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"
-/***
- * @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"
-/***
- * @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
-/***
- * @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"
-/***
- * @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"
-/***
- * @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"
--- /dev/null
+/***
+ * @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
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
--- /dev/null
+/*
+ * 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;
+ }
+}
-/*** \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
#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
{\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
}\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
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
-/***
- * @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
-/***
- * @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");
-/***
- * @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");
const char* resFiles[] = {BIN_LANG_ZH, BIN_LANG_EN};
FontGlobalManager::GetInstance()->RegisterLanguageInfo(resFiles, (sizeof(resFiles) / sizeof(char*)), 1);
-
// 初始化所有预加载slice
InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化
InitAllNativeSlices();
-/***
- * @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
-/***
- * @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.
-/***
- * @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
-/***
- * @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
-/***
- * @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>
'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',
--- /dev/null
+{
+ "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