UIImageAnimatorView *GetImageAnimator();
private:
- UILabel *label;
+ UILabelExt *label;
UILabelButton *testButton;
UIScrollView *BloodBandoffScrollView;
UIViewGroup *group;
#include "bloodoxygen/include/BloodOxygenPresenter.h"
#include "bloodoxygen/include/BloodBandoffView.h"
#include "components/ui_scroll_view.h"
+#include "components/ui_label_button_ext.h"
namespace OHOS
{
class BloodOxygenPresenter;
static BloodCheckView *GetInstance(void);
UIScrollView *BloodCheckViewInit();
UIImageAnimatorView *GetImageAnimator();
- UILabelButton *CreateAndSetUIButton(const char *title);
+ UILabelButtonExt *CreateAndSetUIButton(const char *title);
void UpShowBloodText();
private:
BloodBandoffView *bloodbandoff{nullptr};
UIImageAnimatorView *imageAnimator;
- UILabel *titleLabel;
- UILabel *Spo2Text;
+ UILabelExt *titleLabel;
+ UILabelExt *Spo2Text;
UIScrollView *BloodCheckScrollView;
- UILabelButton *testButton;
+ UILabelButtonExt *testButton;
};
}
/***
* @Date: 2024-04-15 10:55:58
* @LastEditors: Caisking 3449750381@qq.com
- * @LastEditTime: 2024-04-18 12:11:45
+ * @LastEditTime: 2024-05-07 18:51:13
* @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/bloodoxygen/include/BloodResultView.h
*/
/*
#include "BloodOxygenPresenter.h"
#include "BloodBandoffView.h"
#include "components/ui_scroll_view.h"
+#include "components/ui_label_button_ext.h"
namespace OHOS
{
class BloodOxygenPresenter;
bool InitLabel(void);
BloodResultView *bloodresult{nullptr};
UIImageView *imageerror; // 图片
- UILabel *titlelabel;
- UILabel *label1;
- UILabel *label2;
- UILabel *label3;
+ UILabelExt *titlelabel;
+ UILabelExt *label1;
+ UILabelExt *label2;
+ UILabelExt *label3;
UIScrollView *BloodResultScrollView;
- UILabelButton *ReButton;
- UILabelButton *StButton;
+ UILabelButtonExt *ReButton;
+ UILabelButtonExt *StButton;
};
}
#include "wearable_log.h"
#include "BloodBandoffView.h"
#include "BloodOxygenModel.h"
+#include "language/font/ui_resource_string.h"
namespace OHOS
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodBandoffView::CreateUIViewGroup");
// 佩戴title
- label = new UILabel();
+ label = new UILabelExt();
if (label == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodBandoffView::new Label fail");
// return nullptr;
}
label->SetPosition(LABEL_POSITION_X, LABEL_POSITION_Y, LABEL_POSITION_WIDTH, LABEL_POSITION_HEIGHT);
- label->SetText("偏紧佩戴,保持静止");
+ // label->SetText("偏紧佩戴,保持静止");
+ label->SetTextId(STR_CHECKNOTE);
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
BloodBandoffScrollView->Add(label);
#include "BloodOxygenModel.h"
#include "ui_image_animator.h"
#include "BloodCheckView.h"
+#include "language/font/ui_resource_string.h"
namespace OHOS
{
// 动态刷新设置
BloodCheckScrollView->SetPosition(0, 0);
BloodCheckScrollView->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION);
/* -------------------------------------------------------------------------- */
- titleLabel = new UILabel();
+ titleLabel = new UILabelExt();
if (titleLabel == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodOxygenView::new titleLabel fail");
titleLabel->Resize(200, 90); // widget's width and height
titleLabel->SetViewId("label3"); // Set style
titleLabel->SetStyle(STYLE_TEXT_FONT, 28);
- titleLabel->SetText("正在检测");
+ // titleLabel->SetText("正在检测");
+ titleLabel->SetTextId(STR_CHECKON);
titleLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
titleLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
titleLabel->SetRollSpeed(0);
/* -------------------------------------------------------------------------- */
if (testButton == nullptr)
{
- testButton = new UILabelButton();
+ testButton = new UILabelButtonExt();
}
testButton->SetPosition(118, 336); // widget's left position and top position
testButton->Resize(230, 80); // widget's width and height
testButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
// Set additional property
- testButton->SetText("停止检测");
+ // testButton->SetText("停止检测");
+ testButton->SetTextId(STR_CHECKSTOP);
testButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
testButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
testButton->SetViewId("checkstop");
testButton->SetOnClickListener(clickLeftListener);
BloodCheckScrollView->Add(testButton);
/* -------------------------------------------------------------------------- */
- Spo2Text = new UILabel();
+ Spo2Text = new UILabelExt();
if (Spo2Text == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BloodOxygenView::new Spo2Text fail");
#include "BloodOxygenModel.h"
#include "ui_image_animator.h"
#include "BloodResultView.h"
+#include "common/image_cache_manager.h"
+#include "language/font/ui_resource_string.h"
namespace OHOS
{
// 图片设置
// 初始化标签
bool BloodResultView::InitLabel()
{
- titlelabel = new UILabel();
+ titlelabel = new UILabelExt();
if (titlelabel == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLabel fail");
titlelabel->SetStyle(STYLE_TEXT_FONT, 28);
// Set additional property
- titlelabel->SetText("检测不到结果");
+ // titlelabel->SetText("检测不到结果");
+ titlelabel->SetTextId(STR_CHECKERROR);
titlelabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
titlelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
titlelabel->SetRollSpeed(0);
titlelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);
/* -------------------------------------------------------------------------- */
- label1 = new UILabel();
+ label1 = new UILabelExt();
if (label1 == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLabel fail");
label1->SetViewId("label4"); // Set style
label1->SetStyle(STYLE_TEXT_FONT, 30);
- label1->SetText("请确认已带上手表,并保持");
+ label1->SetText("请确认已带上手表,并保持静止");
label1->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
label1->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
label1->SetRollSpeed(0);
label1->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
/* -------------------------------------------------------------------------- */
- label2 = new UILabel();
+ label2 = new UILabelExt();
if (label2 == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLabel fail");
label2->Resize(200, 60); // widget's width and height
label2->SetViewId("label5"); // Set style
label2->SetStyle(STYLE_TEXT_FONT, 30);
- label2->SetText("静止,准备好后点击下方按钮");
+ label2->SetText("准备好后点击下方按钮");
label2->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
label2->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
label2->SetRollSpeed(0);
label2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
/* -------------------------------------------------------------------------- */
- label3 = new UILabel();
+ label3 = new UILabelExt();
if (label3 == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLabel fail");
return nullptr;
}
/* -------------------------------------------------------------------------- */
- ReButton = new UILabelButton();
+ ReButton = new UILabelButtonExt();
if (ReButton == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UILabelButton fail");
}
ReButton->SetPosition(118, 334);
ReButton->Resize(230, 80);
- ReButton->SetText("重新检测");
+ // ReButton->SetText("重新检测");
+ ReButton->SetTextId(STR_RECHECK);
ReButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffFF8A36);
ReButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
ReButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
}
ReButton->SetOnClickListener(clickLeft1Listener);
/* -------------------------------------------------------------------------- */
- StButton = new UILabelButton();
+ StButton = new UILabelButtonExt();
if (StButton == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "UILabelButton fail");
}
StButton->SetPosition(118, 434); // widget's left position and top position
StButton->Resize(230, 80); // widget's width and height
- StButton->SetText("停止检测");
+ // StButton->SetText("停止检测");
+ StButton->SetTextId(STR_CHECKSTOP);
StButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
StButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
StButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);