适配多国语言每日活动
authorhcj <1224667075@qq.com>
Tue, 27 Aug 2024 10:16:35 +0000 (18:16 +0800)
committerhcj <1224667075@qq.com>
Tue, 27 Aug 2024 10:16:35 +0000 (18:16 +0800)
code/sdk/application/wearable/fd230app/nativeui/goal/src/goalhint.cpp
code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp
code/sdk/application/wearable/fd230app/nativeui/goal/src/goalview.cpp

index f8a4f07..d695a87 100644 (file)
@@ -71,13 +71,14 @@ namespace OHOS
             goalhintlabel = new UILabelExt();
         }
         goalhintlabel->SetPosition(98, 198);         // widget's left position and top position
-        goalhintlabel->Resize(200, 60);          // widget's width and height
+        goalhintlabel->Resize(270, 70);          // widget's width and height
         goalhintlabel->SetViewId("label13");// Set style
         goalhintlabel->SetStyle(STYLE_TEXT_FONT, 30);
 
         // Set additional property
-        goalhintlabel->SetText("目标设置及更多数据\n请前往手机APP查看");
-        goalhintlabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        goalhintlabel->SetText("目标设置及更多数据请前往手机APP查看");
+        goalhintlabel->SetTextId(STR_GOAL_HINT);
+        goalhintlabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
         goalhintlabel->SetTextColor(Color::GetColorFromRGBA(0x66, 0x66, 0x66, 0xff));
         goalhintlabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         goalhintlabel->SetRollSpeed(0);
index 30fcd8d..890f64e 100644 (file)
@@ -221,14 +221,15 @@ namespace OHOS
         if (mileagegoalTitle == nullptr) {
             mileagegoalTitle = new UILabelExt();
         }
-        mileagegoalTitle->SetPosition(168, 49);         // widget's left position and top position
-        mileagegoalTitle->Resize(201, 65);          // widget's width and height
+        mileagegoalTitle->SetPosition(113, 61);         // widget's left position and top position
+        mileagegoalTitle->Resize(240, 35);          // widget's width and height
         mileagegoalTitle->SetViewId("label1");// Set style
         mileagegoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
 
         // Set additional property
         mileagegoalTitle->SetText("里程(KM)");
-        mileagegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        mileagegoalTitle->SetTextId(STR_MILEAGE);
+        mileagegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
         mileagegoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         mileagegoalTitle->SetRollSpeed(0);
         mileagegoalTitle->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
@@ -237,14 +238,15 @@ namespace OHOS
         if (fatburninggoalTitle == nullptr) {
             fatburninggoalTitle = new UILabelExt();
         }
-        fatburninggoalTitle->SetPosition(61, 195);         // widget's left position and top position
-        fatburninggoalTitle->Resize(201, 65);          // widget's width and height
+        fatburninggoalTitle->SetPosition(8, 188);         // widget's left position and top position
+        fatburninggoalTitle->Resize(200, 35);          // widget's width and height
         fatburninggoalTitle->SetViewId("label1");// Set style
         fatburninggoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
 
         // Set additional property
         fatburninggoalTitle->SetText("燃脂时间");
-        fatburninggoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        fatburninggoalTitle->SetTextId(STR_FAT_BURNING_TIME);
+        fatburninggoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
         fatburninggoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         fatburninggoalTitle->SetRollSpeed(0);
         fatburninggoalTitle->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
@@ -253,13 +255,14 @@ namespace OHOS
         if (standgoalTitle == nullptr) {
             standgoalTitle = new UILabelExt();
         }
-        standgoalTitle->SetPosition(279, 196);         // widget's left position and top position
-        standgoalTitle->Resize(201, 65);          // widget's width and height
+        standgoalTitle->SetPosition(257, 188);         // widget's left position and top position
+        standgoalTitle->Resize(200, 35);          // widget's width and height
         standgoalTitle->SetViewId("label1");// Set style
         standgoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
         // Set additional property
         standgoalTitle->SetText("站立次数");
-        standgoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        standgoalTitle->SetTextId(STR_NUMBER_OF_STANDS);
+        standgoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
         standgoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         standgoalTitle->SetRollSpeed(0);
         standgoalTitle->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
@@ -268,13 +271,14 @@ namespace OHOS
         if (caloriegoalTitle == nullptr) {
             caloriegoalTitle = new UILabelExt();
         }
-        caloriegoalTitle->SetPosition(158, 313);         // widget's left position and top position
-        caloriegoalTitle->Resize(201, 65);          // widget's width and height
+        caloriegoalTitle->SetPosition(53, 317);         // widget's left position and top position
+        caloriegoalTitle->Resize(360, 35);          // widget's width and height
         caloriegoalTitle->SetViewId("label1");// Set style
         caloriegoalTitle->SetStyle(STYLE_TEXT_FONT, 30);
         // Set additional property
         caloriegoalTitle->SetText("消耗卡路里");
-        caloriegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        caloriegoalTitle->SetTextId(STR_CONSUME_CALORIES);
+        caloriegoalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
         caloriegoalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         caloriegoalTitle->SetRollSpeed(0);
         caloriegoalTitle->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
@@ -284,7 +288,7 @@ namespace OHOS
         if (mileagenowdataLabel == nullptr) {
             mileagenowdataLabel = new UILabel();
         }
-        mileagenowdataLabel->SetPosition(163-20, 87);         // widget's left position and top position
+        mileagenowdataLabel->SetPosition(163-20+10, 87);         // widget's left position and top position
         mileagenowdataLabel->Resize(75, 60);          // widget's width and height
         mileagenowdataLabel->SetViewId("label2");// Set style
         mileagenowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
@@ -302,7 +306,7 @@ namespace OHOS
         if (mileagegoaldataLabel == nullptr) {
             mileagegoaldataLabel = new UILabel();
         }
-        mileagegoaldataLabel->SetPosition(243-20, 86);         // widget's left position and top position
+        mileagegoaldataLabel->SetPosition(243-20+10, 86);         // widget's left position and top position
         mileagegoaldataLabel->Resize(82, 60);          // widget's width and height
         mileagegoaldataLabel->SetViewId("label2");// Set style
         mileagegoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
@@ -320,7 +324,7 @@ namespace OHOS
         if (fatburningnowdataLabel == nullptr) {
             fatburningnowdataLabel = new UILabel();
         }
-        fatburningnowdataLabel->SetPosition(47-20, 223);         // widget's left position and top position
+        fatburningnowdataLabel->SetPosition(47-20-10, 223);         // widget's left position and top position
         fatburningnowdataLabel->Resize(75, 60);          // widget's width and height
         fatburningnowdataLabel->SetViewId("label2");// Set style
         fatburningnowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
@@ -337,7 +341,7 @@ namespace OHOS
         if (fatburninggoaldataLabel == nullptr) {
             fatburninggoaldataLabel = new UILabel();
         }
-        fatburninggoaldataLabel->SetPosition(128-20, 223);         // widget's left position and top position
+        fatburninggoaldataLabel->SetPosition(128-20-10, 223);         // widget's left position and top position
         fatburninggoaldataLabel->Resize(82, 60);          // widget's width and height
         fatburninggoaldataLabel->SetViewId("label2");// Set style
         fatburninggoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
@@ -354,7 +358,7 @@ namespace OHOS
         if (standnowdataLabel == nullptr) {
             standnowdataLabel = new UILabel();
         }
-        standnowdataLabel->SetPosition(47+200, 223);         // widget's left position and top position
+        standnowdataLabel->SetPosition(47+200+10, 223);         // widget's left position and top position
         standnowdataLabel->Resize(75, 60);          // widget's width and height
         standnowdataLabel->SetViewId("label2");// Set style
         standnowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
@@ -372,7 +376,7 @@ namespace OHOS
         if (standgoaldataLabel == nullptr) {
             standgoaldataLabel = new UILabel();
         }
-        standgoaldataLabel->SetPosition(128+200, 223);         // widget's left position and top position
+        standgoaldataLabel->SetPosition(128+200+10, 223);         // widget's left position and top position
         standgoaldataLabel->Resize(82, 60);          // widget's width and height
         standgoaldataLabel->SetViewId("label2");// Set style
         standgoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
@@ -389,7 +393,7 @@ namespace OHOS
         if (calorienowdataLabel == nullptr) {
             calorienowdataLabel = new UILabel();
         }
-        calorienowdataLabel->SetPosition(163-20, 353);         // widget's left position and top position
+        calorienowdataLabel->SetPosition(163-20-10, 353);         // widget's left position and top position
         calorienowdataLabel->Resize(75, 60);          // widget's width and height
         calorienowdataLabel->SetViewId("label2");// Set style
         calorienowdataLabel->SetStyle(STYLE_TEXT_FONT, 40);
@@ -406,7 +410,7 @@ namespace OHOS
         if (caloriegoaldataLabel == nullptr) {
             caloriegoaldataLabel = new UILabel();
         }
-        caloriegoaldataLabel->SetPosition(243-20, 353);         // widget's left position and top position
+        caloriegoaldataLabel->SetPosition(243-20-10, 353);         // widget's left position and top position
         caloriegoaldataLabel->Resize(82, 60);          // widget's width and height
         caloriegoaldataLabel->SetViewId("label2");// Set style
         caloriegoaldataLabel->SetStyle(STYLE_TEXT_FONT, 40);
index bb8ec16..76e51cf 100644 (file)
@@ -133,14 +133,15 @@ namespace OHOS
          if (goalTitle == nullptr) {
             goalTitle = new UILabelExt();
         }
-        goalTitle->SetPosition(173, 50);         // widget's left position and top position
-        goalTitle->Resize(200, 60);          // widget's width and height
+        goalTitle->SetPosition(83, 50);         // widget's left position and top position
+        goalTitle->Resize(300, 35);          // widget's width and height
         goalTitle->SetViewId("label1");// Set style
         goalTitle->SetStyle(STYLE_TEXT_FONT, 30);
 
         // Set additional property
         goalTitle->SetText("今日步数");
-        goalTitle->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        goalTitle->SetTextId(STR_STEPS_OF_THE_DAY);
+        goalTitle->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
         goalTitle->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         goalTitle->SetRollSpeed(0);
         goalTitle->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);