* @Author: luozheng 1732036298@qq.com
* @Date: 2024-04-23 17:28:52
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-14 16:14:37
+ * @LastEditTime: 2024-10-05 12:41:35
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/motionrecognition/src/MotionRecognitionView.cpp
*/
#include "motionrecognition/include/MotionRecognitionPresenter.h"
note->SetStyle(STYLE_TEXT_FONT, 26);
note->SetStyle(STYLE_LINE_HEIGHT, 40);
note->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff));
- note->SetText("开启后,手表会在检测到你处于运动状态时发出提醒。支持的运动包括:走路、跑步、骑车、划船机、椭圆机。"); /*自动识别*/
+ note->SetTextId(STR_MOTION_RECOGNITION_NOTE);//开启后,手表会在检测到你处于运动状态时发出提醒。支持的运动包括:走路、跑步、骑车、划船机、椭圆机。
note->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
note->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
/* -------------------------------------------------------------------------- */
}
note->SetStyle(STYLE_TEXT_FONT, 26);
note->SetStyle(STYLE_LINE_HEIGHT, 40);
- note->SetText("开启此功能后,手表可以4G SIM卡拨打电话,耗电会增加。");
+ note->SetTextId(STR_4G_NOTE);//开启此功能后,手表可以4G SIM卡拨打电话,耗电会增加。
note->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff));
note->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
note->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER);
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-08 09:36:33
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-04 18:26:41
+ * @LastEditTime: 2024-10-05 12:29:42
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/include/RespiratoryTrainingPresenter.h
*/
static RespiratoryTrainingPresenter *GetInstance();
- std::string GetRespiratoryTrainingSelectTime();
+ int GetRespiratoryTrainingSelectTime();
std::string GetRespiratoryTrainingSelectTime1();
private:
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-09-29 15:57:59
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-04 20:24:42
+ * @LastEditTime: 2024-10-05 12:34:35
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/respiratorytraining/src/RespiratoryTrainingDurationSelectionView.cpp
*/
#include "respiratorytraining/include/RespiratoryTrainingDurationSelectionView.h"
#include "wearable_log.h"
#include "UiConfig.h"
#include "dock/focus_manager.h"
+#include "ui_resource_string.h"
namespace OHOS
{
label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height);
label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize);
label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
- // label->SetTextId(labelconfig.textId);
- label->SetText(labelconfig.text);
+ label->SetTextId(labelconfig.textId);
+ // label->SetText(labelconfig.text);
label->SetLineBreakMode(labelconfig.lineBreakMode);
label->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER);
label->SetRollSpeed(70);
return nullptr;
}
TitleLabel->SetPosition(83, 50, 300, 35);
- TitleLabel->SetText("时长设置"); // 时长设置
+ TitleLabel->SetTextId(STR_DURATION_SETTINGS); // 时长设置
TitleLabel->SetStyle(STYLE_TEXT_FONT, 30);
TitleLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
TitleLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
scrollView->Add(DurationButton[i]);
}
/* -------------------------------------------------------------------------- */
- // int16_t textId[MAX_NUM_TRAINING_DURATION] = {STR_1_MIN, STR_CELLULAR_DISPLAY, STR_5_MIN};
- const char *text[MAX_NUM_TRAINING_DURATION] = {"1分钟", "2分钟", "3分钟", "4分钟", "5分钟"};
+ int16_t textId[MAX_NUM_TRAINING_DURATION] = {STR_1_MIN, STR_2_MIN,STR_3_MIN,STR_4_MIN, STR_5_MIN};
+ // const char *text[MAX_NUM_TRAINING_DURATION] = {"1分钟", "2分钟", "3分钟", "4分钟", "5分钟"};
LabelConfig labelConfig = {
.left = 103,
.top = 153,
for (int16_t i = 0; i < MAX_NUM_TRAINING_DURATION; i++)
{
labelConfig.top = 153 + 120 * i;
- // labelConfig.textId = textId[i];
- labelConfig.text = text[i];
+ labelConfig.textId = textId[i];
+ // labelConfig.text = text[i];
DurationLabel[i] = LabelViewinit(labelConfig);
if (DurationLabel[i] == nullptr)
{
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:26:06
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-04 18:05:11
+ * @LastEditTime: 2024-10-05 12:30:08
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/RespiratoryTraining/src/RespiratoryTrainingPresenter.cpp
*/
#include "respiratorytraining/include/RespiratoryTrainingModel.h"
#include "gfx_utils/mem_check.h"
#include "map"
+#include "ui_resource_string.h"
namespace OHOS
{
return true;
}
- std::string RespiratoryTrainingPresenter::GetRespiratoryTrainingSelectTime()
+ int RespiratoryTrainingPresenter::GetRespiratoryTrainingSelectTime()
{
int time = RespiratoryTrainingModel::GetInstance().GetRespiratoryTrainingSelectTime();
- std::string text;
+ int textId;
switch (time)
{
case 1:
- text = "1分钟 >";
+ textId = STR_ONE_MIN;
break;
case 2:
- text = "2分钟 >";
+ textId = STR_TWO_MIN;
break;
case 3:
- text = "3分钟 >";
+ textId = STR_THREE_MIN;
break;
case 4:
- text = "4分钟 >";
+ textId = STR_FOUR_MIN;
break;
case 5:
- text = "5分钟 >";
+ textId = STR_FIVE_MIN;
break;
default:
- text = "1分钟 >";
+ textId = STR_TWO_MIN;
break;
}
- return text;
+ return textId;
}
std::string RespiratoryTrainingPresenter::GetRespiratoryTrainingSelectTime1()
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-05-07 11:25:58
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-04 18:26:22
+ * @LastEditTime: 2024-10-05 12:37:07
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/RespiratoryTraining/src/RespiratoryTrainingView.cpp
*/
}
if (TrainingDurationSelectiontitlelabel)
{
- TrainingDurationSelectiontitlelabel->SetText(presenter_->GetRespiratoryTrainingSelectTime().c_str());
+ TrainingDurationSelectiontitlelabel->SetTextId(presenter_->GetRespiratoryTrainingSelectTime());
+ TrainingDurationSelectiontitlelabel->ForceResetText();
}
return true;
}
TrainingDurationSelectiontitlelabel->SetPosition(83, 95, 300, 35);
TrainingDurationSelectiontitlelabel->SetStyle(STYLE_TEXT_FONT, 30);
TrainingDurationSelectiontitlelabel->SetStyle(STYLE_LINE_HEIGHT, 35);
- TrainingDurationSelectiontitlelabel->SetText(presenter_->GetRespiratoryTrainingSelectTime().c_str());
+ TrainingDurationSelectiontitlelabel->SetTextId(presenter_->GetRespiratoryTrainingSelectTime());
TrainingDurationSelectiontitlelabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
TrainingDurationSelectiontitlelabel->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff));
TrainingDurationSelectiontitlelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);