MobileData_toggleButton = nullptr;
}
- // delete NextImage;
- // NextImage = nullptr;
+ if (note != nullptr)
+ {
+ delete note;
+ note = nullptr;
+ }
delete NetworkAndCallScrollView[NETWORKANDCALLVIEW];
NetworkAndCallScrollView[NETWORKANDCALLVIEW] = nullptr;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::NetworkAndCallScrollView[NETWORKANDCALLVIEW] new fail!");
return;
}
- NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+ NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight()-30);
NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetOnDragListener(presenter_);
NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetReboundSize(35);
- NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetHorizontalScrollState(false);
+ NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetScrollBlankSize(30);
+ // NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetHorizontalScrollState(false);
NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetTouchable(true);
NetworkAndCallScrollView[NETWORKANDCALLVIEW]->SetDraggable(true);
/* ---------------------------------- Title --------------------------------- */
NetworkAndCallLabel[i]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
}
/* -------------------------------------------------------------------------- */
+#if defined(SUPPORT_CHINA_MOBILE_DMP)
+ if (VoLTE_toggleButton == nullptr)
+ {
+ VoLTE_toggleButton = new UIToggleButton();
+ if (VoLTE_toggleButton == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::VoLTE_toggleButton is nullptr!");
+ return;
+ }
+ }
+ VoLTE_toggleButton->SetPosition(298, 145, 100, 50);
+ VoLTE_toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+ VoLTE_toggleButton->SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE);
+ VoLTE_toggleButton->SetOnClickListener(presenter_);
+#endif
+ /* --------------------------------- 移动数据开关 --------------------------------- */
if (MobileData_toggleButton == nullptr)
{
MobileData_toggleButton = new UIToggleButton();
return;
}
}
- MobileData_toggleButton->SetPosition(298, 145, 100, 50);
+ if (VoLTE_toggleButton != nullptr)
+ {
+ MobileData_toggleButton->SetPosition(298, VoLTE_toggleButton->GetY() + 120, 100, 50);
+ }
+ else
+ {
+ MobileData_toggleButton->SetPosition(298, 145, 100, 50);
+ }
MobileData_toggleButton->SetState(uapi_cat1_get_power_stat());
MobileData_toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
MobileData_toggleButton->SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE);
MobileData_toggleButton->SetOnClickListener(presenter_);
-/* -------------------------------------------------------------------------- */
-#if defined(SUPPORT_CHINA_MOBILE_DMP)
- if (VoLTE_toggleButton == nullptr)
+ /* -------------------------------------------------------------------------- */
+ if (note == nullptr)
{
- VoLTE_toggleButton = new UIToggleButton();
- if (VoLTE_toggleButton == nullptr)
+ note = new UILabelExt(); // Create a new UILabel for each iteration
+ if (note == nullptr)
{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::VoLTE_toggleButton is nullptr!");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "note is nullptr!");
return;
}
}
- VoLTE_toggleButton->SetPosition(298, 265, 100, 50);
- VoLTE_toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
- VoLTE_toggleButton->SetState(MobileData_toggleButton->GetState() == true && ConfigModel::GetInstance()->GetVoLTE_Call());
- VoLTE_toggleButton->SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE);
- VoLTE_toggleButton->SetOnClickListener(presenter_);
-#endif
- /* -------------------------------------------------------------------------- */
- // NextImage = new UIImageView();
- // if (NextImage == nullptr)
- // {
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "LanguageSwitchView::NextImage is nullptr!");
- // return;
- // }
- // NextImage->SetPosition(369, 397);
- // NextImage->SetSrc(PNG_SETTING_NEXT_IMAGE);
+ if (VoLTE_toggleButton != nullptr)
+ {
+ note->SetPosition(63, NetworkAndCallImage[1]->GetY() + NetworkAndCallImage[1]->GetHeight() + 20, 340, 80);
+ }
+ else
+ {
+ note->SetPosition(63, NetworkAndCallImage[0]->GetY() + NetworkAndCallImage[0]->GetHeight() + 20, 340, 80);
+ }
+ note->SetStyle(STYLE_TEXT_FONT, 26);
+ note->SetStyle(STYLE_LINE_HEIGHT, 40);
+ note->SetText("注:启用4G,可能会加速消耗电量");
+ note->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff));
+ note->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+ note->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_CENTER);
+ note->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
}
}
NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(NetworkAndCallLabel[i]);
}
#if defined(SUPPORT_CHINA_MOBILE_DMP)
+ if (MobileData_toggleButton != nullptr)
+ {
+ VoLTE_toggleButton->SetState(MobileData_toggleButton->GetState() == true && ConfigModel::GetInstance()->GetVoLTE_Call());
+ }
NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(VoLTE_toggleButton);
#endif
NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(MobileData_toggleButton);
- // NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(NextImage);
+ NetworkAndCallScrollView[NETWORKANDCALLVIEW]->Add(note);
RootView::GetInstance()->Add(NetworkAndCallScrollView[NETWORKANDCALLVIEW]);
Draw();
}