static constexpr const char *PNG_SETTINGS_SYSTEM = APP_RES_PATH "/settings/SETTINGS_SYSTEM.bin"; // 系统
static constexpr const char *PNG_SETTINGS_SHUTDOWN_AND_RESTART = APP_RES_PATH "/settings/SETTINGS_SHUTDOWN_AND_RESTART.bin"; // 关机和重启
static constexpr const char *PNG_SETTINGS_SETTTING_SHUTDOWN = APP_RES_PATH "/settings/SETTTING_SHUTDOWN.bin"; // 关机
- static constexpr const char *PNG_SETTINGS_SETTTING_REBOOT = APP_RES_PATH "/settings/SETTTING_REBOOT.bin"; // 重启
+ static constexpr const char *PNG_SETTINGS_SETTTING_REBOOT = APP_RES_PATH "/settings/SETTTING_REBOOT.bin";
+ static constexpr const char *PNG_SETTINGS_SETTTING_SOS = APP_RES_PATH "/settings/SOS.bin"; // 重启
+ static constexpr const char *PNG_SETTINGS_SETTTING_SHUTDOWN_1 = APP_RES_PATH "/settings/shutdown.bin";
/* ---------------------------------- 消息中心 ---------------------------------- */
static constexpr const char *PNG_Message_System = APP_RES_PATH "/message/system-icon.bin"; // 系统消息
static constexpr const char *PNG_Message_Note = APP_RES_PATH "/message/message-icon.bin"; // 短信
STR_HANG_UP_OR_ANSWER = 537,\r
STR_WATCH_CALL = 538,\r
STR_PHONE_CALL = 539,\r
- STR_MAX_ID = 540,\r
+ STR_STEPS_OF_THE_DAY = 540,\r
+ STR_MILEAGE = 541,\r
+ STR_FAT_BURNING_TIME = 542,\r
+ STR_NUMBER_OF_STANDS = 543,\r
+ STR_CONSUME_CALORIES = 544,\r
+ STR_GOAL_HINT = 545,\r
+ STR_MAX_ID = 546,\r
}; // UIResourceTextId\r
enum FontLanguageId : uint8_t {
{VIEW_COMPASS, &NativeLauncher::InitCompassSlice},
{VIEW_CONNECT_PHONE, &NativeLauncher::InitConnectPhoneSlice},
{VIEW_INDOORWALK, &NativeLauncher::InitIndoorWalkSlice},
- // {VIEW_SHUTDOWN_OR_REBOOT, &NativeLauncher::InitRebootSlice},
+ {VIEW_SHUTDOWN_OR_REBOOT, &NativeLauncher::InitRebootSlice},
{VIEW_WEATHER, &NativeLauncher::InitWeatherSlice}, // 天气
{VIEW_GOAL, &NativeLauncher::InitGoalSlice}, // 每日目标
{VIEW_SYSTEM, &NativeLauncher::InitSystemSlice}, // 系统实例化地址
if (currentTimes == nullptr) {
return false;
}
- currentTimes->SetPosition(184, 38,
- 89, 35);
+ currentTimes->SetPosition(133, 38,
+ 200, 35);
currentTimes->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
currentTimes->SetAlign(TEXT_ALIGNMENT_CENTER);
currentTimes->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
static FactoryResetView *GetInstance(void);
UIViewGroup *FactoryResetViewInit(void);
+ UIViewGroup *FactoryResetViewInit(UIView::OnClickListener *FactoryResetButtonCheckOnClick,UIView::OnDragListener *dragListener);
void ClearAll(void);
private:
}
return group;
}
+
+ UIViewGroup *FactoryResetView::FactoryResetViewInit(UIView::OnClickListener *FactoryResetButtonCheckOnClick,UIView::OnDragListener *dragListener)
+ {
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "FactoryResetView::FactoryResetViewInit");
+ if (group == nullptr)
+ {
+ group = new UIViewGroup();
+ if (group == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::new group fail!");
+ return nullptr;
+ }
+ group->SetViewId("FACTORY_RESET_GROUPVIEW");
+ group->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+ group->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ group->SetStyle(STYLE_BORDER_RADIUS, 100);
+ group->SetTouchable(true);
+ group->SetDraggable(true);
+
+ group->SetOnDragListener(dragListener);
+ /* ------------------------------- scrollView ------------------------------- */
+ // scrollView = new UIScrollView();
+ // if (scrollView == nullptr)
+ // {
+ // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::scrollView new fail!");
+ // return nullptr;
+ // }
+ // scrollView->SetPosition(0, 0, 466, 466);
+ // scrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ // scrollView->SetScrollBlankSize(50);
+ // scrollView->SetReboundSize(35);
+ // scrollView->SetMaxScrollDistance(1000);
+ // scrollView->SetThrowDrag(true);
+ // scrollView->RequestFocus();
+ // scrollView->SetRotateFactor(2);
+ /* ---------------------------------- Title --------------------------------- */
+ Title = new UILabelExt();
+ if (Title == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::new Title fail!");
+ return nullptr;
+ }
+ Title->SetPosition(83, 50, 300, 35);
+ Title->SetStyle(STYLE_TEXT_FONT, 30);
+ Title->SetStyle(STYLE_LINE_HEIGHT, 35);
+ Title->SetTextId(STR_FACTORY_RESET); /*恢复出厂*/
+ Title->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
+ Title->SetRollSpeed(70);
+ Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ /* ---------------------------- FactoryResetImage --------------------------- */
+ FactoryResetImage = new UIImageView();
+ if (FactoryResetImage == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::new FactoryResetImage fail!");
+ return nullptr;
+ }
+ FactoryResetImage->SetPosition(193, 120);
+ FactoryResetImage->SetSrc(PNG_ATTENTION_IMAGE);
+ /* ---------------------------- FactoryResetNote ---------------------------- */
+ FactoryResetNote = new UILabelExt();
+ if (FactoryResetNote == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::new FactoryResetNote fail!");
+ return nullptr;
+ }
+ FactoryResetNote->SetPosition(53, 228, 360, 70);
+ FactoryResetNote->SetStyle(STYLE_TEXT_FONT, 30);
+ FactoryResetNote->SetStyle(STYLE_LINE_HEIGHT, 35);
+ FactoryResetNote->SetTextId(STR_RESET_CONFIRM_NOTE); /*该操作会清空并重置手表数据,是否确认继续?*/
+ FactoryResetNote->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+ FactoryResetNote->SetTextColor(Color::GetColorFromRGBA(0xff, 0x8a, 0x36, 0xff));
+ FactoryResetNote->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ FactoryResetNote->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ /* ----------------------- FactoryResetButtonCheckOff ----------------------- */
+ FactoryResetButtonCheckOff = new UIButton();
+ if (FactoryResetButtonCheckOff == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::new FactoryResetButtonCheckOff fail!");
+ return nullptr;
+ }
+ FactoryResetButtonCheckOff->SetPosition(97, FactoryResetNote->GetTextHeight() + FactoryResetNote->GetY() + 30, 130, 130);
+ FactoryResetButtonCheckOff->SetViewId("FACTORY_RESET_BUTTON_CHECK_OFF");
+ FactoryResetButtonCheckOff->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
+ FactoryResetButtonCheckOff->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+ FactoryResetButtonCheckOff->SetImagePosition(15, 15);
+ FactoryResetButtonCheckOff->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED);
+ FactoryResetButtonCheckOff->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);
+ FactoryResetButtonCheckOff->SetImageSrc(PNG_SYSTEM_CHECK_OFF_IMAGE, PNG_SYSTEM_CHECK_OFF_IMAGE);
+
+ FactoryResetButtonCheckOff->SetOnClickListener((UIView::OnClickListener *)FactoryResetButtonCheckOnClick);
+ /* ------------------------ FactoryResetButtonCheckOn ----------------------- */
+ FactoryResetButtonCheckOn = new UIButton();
+ if (FactoryResetButtonCheckOn == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::new FactoryResetButtonCheckOn fail!");
+ return nullptr;
+ }
+ FactoryResetButtonCheckOn->SetPosition(240, FactoryResetButtonCheckOff->GetY(), 130, 130);
+ FactoryResetButtonCheckOn->SetViewId("FACTORY_RESET_BUTTON_CHECK_ON");
+ FactoryResetButtonCheckOn->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
+ FactoryResetButtonCheckOn->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+ FactoryResetButtonCheckOn->SetImagePosition(15, 15);
+ FactoryResetButtonCheckOn->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff191919, UIButton::PRESSED);
+ FactoryResetButtonCheckOn->SetStyleForState(STYLE_BACKGROUND_OPA, 0x00, UIButton::PRESSED);
+ FactoryResetButtonCheckOn->SetImageSrc(PNG_SYSTEM_CHECK_ON_IMAGE, PNG_SYSTEM_CHECK_ON_IMAGE);
+ // UIView::OnClickListener *FactoryResetButtonCheckOnClick = static_cast<UIView::OnClickListener *>(RebootAndShutdownPresenter::GetInstance());
+ // if (FactoryResetButtonCheckOnClick == nullptr)
+ // {
+ // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FactoryResetView::RebootAndShutdownPresenter::GetInstance fail!!");
+ // return nullptr;
+ // }
+ FactoryResetButtonCheckOn->SetOnClickListener((UIView::OnClickListener *)FactoryResetButtonCheckOnClick);
+
+ /* ----------------------------- Add to scroView ---------------------------- */
+ group->Add(Title);
+ group->Add(FactoryResetImage);
+ group->Add(FactoryResetNote);
+ group->Add(FactoryResetButtonCheckOff);
+ group->Add(FactoryResetButtonCheckOn);
+ //group->Add(scrollView);
+ group->SetVisible(false);
+ initViewStatus = true;
+ }
+ return group;
+ }
}
\ No newline at end of file
}
// 切换到关机/重启卡片
- NativeAbility::GetInstance().EnterSlice(VIEW_REBOOTANDSHUTDOWN);
+ NativeAbility::GetInstance().EnterSlice(VIEW_SHUTDOWN_OR_REBOOT);
}
static void HandlePowerKeyLongPress(void)
#include "components/ui_button.h"
#include "components/ui_image_animator.h"
#include "ConfigModel.h"
+#include "rebootandshutdown/include/FactoryResetView.h"
namespace OHOS {
constexpr int16_t NUM_REBOOT_CONTAINER = 4;
void OnStop() override;
UIViewGroup *InitShowUpView(void);
void ChangeView(int16_t hideView, int16_t showView);
+ void FactoryResetGroupVisible(bool data);
private:
bool ChangeRebootView(int16_t hideView, int16_t thisView);
bool CheckViewParam(int16_t hideView, int16_t showView);
bool ShowUpRebootView(void);
bool ShowUpShutdownView(void);
- UILabel *rebootLabel{nullptr};
+ bool factoryResetLabelInit(void);
+ bool factoryResetViewInit(void);
+ UILabelExt *rebootLabel{nullptr};
UIButton *rebootButton{nullptr};
- UILabel *shutdownLabel{nullptr};
+ UILabelExt *shutdownLabel{nullptr};
+ UILabelExt *factoryResetLabel{nullptr};
+
UIButton *shutdownButton{nullptr};
+ FactoryResetView *factoryResetView{nullptr};
UIViewGroup *group{nullptr};
RebootDeviceView *rebootDeviceView{nullptr};
ShutdownDeviceView *shutdownDeviceView{nullptr};
ShutDownAnimatorView*shutDownAnimatorView{nullptr};
UIViewGroup *container[NUM_REBOOT_CONTAINER]{nullptr};
+ UIViewGroup *FactoryResetGroup{nullptr};
typedef bool (RebootView::*PreprosssChangeView)(int16_t hideView, int16_t thisView);
PreprosssChangeView preProcessView[NUM_REBOOT_CONTAINER];
};
private:
bool ShowUpShutdownDeviceView(void);
- UILabel *shutdownDeviceLabel{nullptr}; //关机标签
+ UILabelExt *shutdownDeviceLabel{nullptr}; //关机标签
UIButton *shutdownDeviceButton{nullptr}; //关机按钮
UIViewGroup *group{nullptr};
};
}
}
rebootDeviceLabel->SetPosition(152, 272, 150, 45); // 152:x 272:y 150:width 45:height
- rebootDeviceLabel->SetText("重启");
+ rebootDeviceLabel->SetText("SOS");
rebootDeviceLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35:font data
rebootDeviceLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);
rebootDeviceLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER,
return false;
}
}
- rebootDeviceButton->SetPosition(172, 147, 110, 110); // 172:x 147:y 110:width 110:height
- rebootDeviceButton->SetImageSrc(PNG_SETTINGS_SETTTING_REBOOT, PNG_SETTINGS_SETTTING_REBOOT);
- rebootDeviceButton->SetImagePosition(16, 16);
+ rebootDeviceButton->SetPosition(172, 147, 100, 100); // 172:x 147:y 110:width 110:height
+ rebootDeviceButton->SetImageSrc(PNG_SETTINGS_SETTTING_SOS, PNG_SETTINGS_SETTTING_SOS);
+ rebootDeviceButton->SetImagePosition(0, 0);
rebootDeviceButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c);
rebootDeviceButton->SetViewId(REBOOTDEVICE_BUTTON);
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
}
// 切换到关机/重启卡片
- NativeAbility::GetInstance().EnterSlice(VIEW_REBOOTANDSHUTDOWN);
+ NativeAbility::GetInstance().EnterSlice(VIEW_SHUTDOWN_OR_REBOOT);
}
/*注册电源键的长按事件*/
#include "custom_utils.h"
#include "components/ui_image_animator.h"
#include "common/key_code.h"
+#include "dial_sos_c.h"
+//#include "rebootandshutdown/include/FactoryResetVIew.h"
+
namespace OHOS
{
static RebootPresenter *g_pRebootPresenter = nullptr;
bool RebootPresenter::OnClick(UIView &view, const ClickEvent &event)
{
UNUSED(event);
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "OnClick OnClick");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick OnClick");
if (strcmp(view.GetViewId(), REBOOT_BUTTON) == 0)
{
RebootView::GetInstance()->ChangeView(REBOOTVIEW, REBOOTDEVICEVIEW);
else if (strcmp(view.GetViewId(), REBOOTDEVICE_BUTTON) == 0)
{
// 重启
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "REBOOTDEVICE_BUTTON OnClick");
- RebootView::GetInstance()->ChangeView(REBOOTDEVICEVIEW, SHUTDOWNANIMATORVIEW);
- start_shutdown_or_reboot();
- shutdown_reboot_prejobs();
+ // WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "REBOOTDEVICE_BUTTON OnClick");
+ // RebootView::GetInstance()->ChangeView(REBOOTDEVICEVIEW, SHUTDOWNANIMATORVIEW);
+ // start_shutdown_or_reboot();
+ // shutdown_reboot_prejobs();
- ShutDownAnimatorView::GetInstance()->GeShutDownImageAnimatorView()->Start();
- isShutDownOperation = false;
+ // ShutDownAnimatorView::GetInstance()->GeShutDownImageAnimatorView()->Start();
+ // isShutDownOperation = false;
+ start_SOS_phone_dail();
}
else if (strcmp(view.GetViewId(), SHUTDOWNDEVICE_BUTTON) == 0)
{
ShutDownAnimatorView::GetInstance()->GeShutDownImageAnimatorView()->Start();
isShutDownOperation = true;
}
+ else if (strcmp(view.GetViewId(), "FACTORYRESET_LABEL_VIEWID") == 0) // 进入出厂设置界面
+ {
+ // RebootAndShutdownView::GetInstance()->ChangeView(REBOOTANDSHUTDOWN, FACTORYRESET);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "FACTORYRESET_LABEL_VIEWID");
+ RebootView::GetInstance()-> FactoryResetGroupVisible(true);
+ return true;
+ }
+ else if (strcmp(view.GetViewId(), "FACTORY_RESET_BUTTON_CHECK_ON") == 0) // 恢复出厂设置确认
+ {
+ do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_RESTORE_FACTORY_SETTING, NULL, 0);
+ return true;
+ }
+ else if (strcmp(view.GetViewId(), "FACTORY_RESET_BUTTON_CHECK_OFF") == 0) // 恢复出厂设置取消
+ {
+ // RebootAndShutdownView::GetInstance()->ChangeView(FACTORYRESET, REBOOTANDSHUTDOWN);
+ RebootView::GetInstance()-> FactoryResetGroupVisible(false);
+ }
return true;
}
{
RebootView::GetInstance()->ChangeView(SHUTDOWNDEVICEVIEW, REBOOTVIEW);
}
+ else if (strcmp(view.GetViewId(), "FACTORY_RESET_GROUPVIEW") == 0)
+ RebootView::GetInstance()-> FactoryResetGroupVisible(false);
}
return true;
}
#include "wearable_log.h"
#include "UiConfig.h"
#include "RebootPresenter.h"
+#include "ui_resource_string.h"
+
static constexpr int16_t BOOT_IMAGE_ANIMATOR_VIEW_X = 0;
static constexpr int16_t BOOT_IMAGE_ANIMATOR_VIEW_Y = 0;
shutdownLabel = nullptr;
delete shutdownButton;
shutdownButton = nullptr;
+
+ if(factoryResetView)
+ {
+ delete factoryResetView;
+ factoryResetView = nullptr;
+ }
+
+ if(FactoryResetGroup)
+ {
+ delete FactoryResetGroup;
+ FactoryResetGroup = nullptr;
+ }
+
+ if(factoryResetLabel)
+ {
+ delete factoryResetLabel;
+ factoryResetLabel = nullptr;
+ }
+
delete group;
group = nullptr;
g_pRebootView = nullptr;
RootView::GetInstance()->RemoveAll();
return;
}
-
+ //李代桃僵一手 不改函数名了,变为SOS
bool RebootView::ShowUpRebootView()
{
if (rebootLabel == nullptr)
{
- rebootLabel = new UILabel();
+ rebootLabel = new UILabelExt();
if (rebootLabel == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpRebootView rebootLabel new fail");
return false;
}
}
- rebootLabel->SetPosition(49, 272, 150, 45); // 49:x 272:y 150:width 45:height
- rebootLabel->SetText("重启");
+ rebootLabel->SetPosition(43, 272, 200, 45); // 49:x 272:y 150:width 45:height
+ rebootLabel->SetText("SOS");
+ rebootLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
rebootLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35:font data
rebootLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);
rebootLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER,
return false;
}
}
- rebootButton->SetPosition(69, 147, 110, 110); // 69:x 147:y 110:width 110:height
- rebootButton->SetImageSrc(PNG_SETTINGS_SETTTING_REBOOT, PNG_SETTINGS_SETTTING_REBOOT);
- rebootButton->SetImagePosition(16, 16);
+ rebootButton->SetPosition(93, 160, 100, 100); // 69:x 147:y 110:width 110:height
+ rebootButton->SetImageSrc(PNG_SETTINGS_SETTTING_SOS, PNG_SETTINGS_SETTTING_SOS);
+ rebootButton->SetImagePosition(0, 0);
rebootButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c);
rebootButton->SetViewId(REBOOT_BUTTON);
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
return true;
}
+ bool RebootView::factoryResetLabelInit(void)
+ {
+
+ factoryResetLabel = new UILabelExt();
+ if (factoryResetLabel == nullptr)
+ {
+ return false;
+ }
+ factoryResetLabel->SetPosition(83, 370, 300,70);
+ factoryResetLabel->SetStyle(STYLE_TEXT_FONT, 30);
+ factoryResetLabel->SetStyle(STYLE_LINE_HEIGHT, 35);
+ factoryResetLabel->SetTextId(STR_FACTORY_RESET);
+ factoryResetLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);
+ factoryResetLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ factoryResetLabel->SetRollSpeed(70);
+ factoryResetLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ factoryResetLabel->SetViewId("FACTORYRESET_LABEL_VIEWID");
+ factoryResetLabel->SetTouchable(true);
+ factoryResetLabel->SetTextColor(Color::GetColorFromRGBA(0x35, 0x49, 0xff, 0xff));
+ factoryResetLabel->SetVisible(true);
+ UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
+ if (clickListener == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clickListener GetInstance nullptr");
+ return false;
+ }
+ factoryResetLabel->SetOnClickListener(clickListener);
+ if(factoryResetLabel)
+ return true;
+ else
+ return false;
+ }
+
+ void RebootView::FactoryResetGroupVisible(bool data)
+ {
+
+ FactoryResetGroup->SetVisible(data);
+ RootView::GetInstance()->Invalidate();
+
+
+ }
+
+ bool RebootView::factoryResetViewInit(void)
+ {
+ factoryResetView = new FactoryResetView();
+ if (factoryResetView == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "factoryResetView new fail");
+ return false;
+ }
+ UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
+ if (clickListener == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clickListener GetInstance nullptr");
+ return false;
+ }
+
+ UIView::OnDragListener *rebootDragListener = (UIView::OnDragListener *)OHOS::RebootPresenter::GetInstance();
+ if (clickListener == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clickListener GetInstance nullptr");
+ return false;
+ }
+
+ FactoryResetGroup = factoryResetView->FactoryResetViewInit(clickListener,rebootDragListener);
+ if(FactoryResetGroup)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+
+ }
+
bool RebootView::ShowUpShutdownView()
{
if (shutdownLabel == nullptr)
{
- shutdownLabel = new UILabel();
+ shutdownLabel = new UILabelExt();
if (shutdownLabel == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpShutdownView shutdownLabel new fail");
return false;
}
}
- shutdownLabel->SetPosition(255, 272, 150, 45); // 255:x 272:y 150:width 45:height
+ shutdownLabel->SetPosition(223, 272, 200, 45); // 255:x 272:y 150:width 45:height
shutdownLabel->SetText("关机");
+ shutdownLabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+ shutdownLabel->SetTextId(STR_SHUTDOWN);
shutdownLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35:font data
shutdownLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);
shutdownLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER,
return false;
}
}
- shutdownButton->SetPosition(275, 147, 110, 110); // 275:x 147:y 110:width 110:height
- shutdownButton->SetImageSrc(PNG_SETTINGS_SETTTING_SHUTDOWN, PNG_SETTINGS_SETTTING_SHUTDOWN);
- shutdownButton->SetImagePosition(16, 16);
+ shutdownButton->SetPosition(273, 160, 100, 100); // 275:x 147:y 110:width 110:height
+ shutdownButton->SetImageSrc(PNG_SETTINGS_SETTTING_SHUTDOWN_1, PNG_SETTINGS_SETTTING_SHUTDOWN_1);
+ shutdownButton->SetImagePosition(0, 0);
shutdownButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff5a36);
shutdownButton->SetViewId(SHUTDOWN_BUTTON);
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
}
group->Add(shutdownLabel);
group->Add(shutdownButton);
+
+ ret=factoryResetLabelInit();
+ if(false==ret)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "factoryResetLabelInit fail");
+ return nullptr;
+ }
+ group->Add(factoryResetLabel);
+
+
+ ret=factoryResetViewInit();
+ if(false==ret)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "factoryResetViewInit fail");
+ return nullptr;
+ }
+ group->Add(FactoryResetGroup);
+
+
UIView::OnDragListener *rebootDragListener = (UIView::OnDragListener *)OHOS::RebootPresenter::GetInstance();
if (rebootDragListener == nullptr)
{
#include "wearable_log.h"
#include "UiConfig.h"
#include "rebootdevice/include/RebootPresenter.h"
+#include "ui_resource_string.h"
namespace OHOS {
static ShutdownDeviceView *g_pShutdownDeviceView{nullptr};
bool ShutdownDeviceView::ShowUpShutdownDeviceView()
{
if (shutdownDeviceLabel == nullptr) {
- shutdownDeviceLabel = new UILabel();
+ shutdownDeviceLabel = new UILabelExt();
if (shutdownDeviceLabel == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowUpShutdownDeviceView shutdownDeviceLabel new fail");
return false;
}
shutdownDeviceLabel->SetPosition(152, 272, 150, 45); // 152:x 272:y 150:width 45:height
shutdownDeviceLabel->SetText("关机");
+ shutdownDeviceLabel->SetTextId(STR_SHUTDOWN);
shutdownDeviceLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35); // 35:font data
shutdownDeviceLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);
shutdownDeviceLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER,
return false;
}
}
- shutdownDeviceButton->SetPosition(172, 147, 110, 110); // 172:x 147:y 110:width 110:height
- shutdownDeviceButton->SetImageSrc(PNG_SETTINGS_SETTTING_SHUTDOWN, PNG_SETTINGS_SETTTING_SHUTDOWN);
- shutdownDeviceButton->SetImagePosition(16, 16);
+ shutdownDeviceButton->SetPosition(172, 147, 100, 100); // 172:x 147:y 110:width 110:height
+ shutdownDeviceButton->SetImageSrc(PNG_SETTINGS_SETTTING_SHUTDOWN_1, PNG_SETTINGS_SETTTING_SHUTDOWN_1);
+ shutdownDeviceButton->SetImagePosition(0, 0);
shutdownDeviceButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff5a36);
shutdownDeviceButton->SetViewId(SHUTDOWNDEVICE_BUTTON);
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::RebootPresenter::GetInstance();
if(uapi_cat1_get_power_stat()|| uapi_dev_runtime_get_cat1_simstat())
#endif
{
- calldial_event_sendmsg_toUI(sos_dail_buf[(0)%3]);
+ calldial_event_sendmsg_toUI(sos_dail_buf[0]);
sos_dail_falg=1;
}
#if SOS_HFP_FALG
STR_HANG_UP_OR_ANSWER = 537,\r
STR_WATCH_CALL = 538,\r
STR_PHONE_CALL = 539,\r
- STR_MAX_ID = 540,\r
+ STR_STEPS_OF_THE_DAY = 540,\r
+ STR_MILEAGE = 541,\r
+ STR_FAT_BURNING_TIME = 542,\r
+ STR_NUMBER_OF_STANDS = 543,\r
+ STR_CONSUME_CALORIES = 544,\r
+ STR_GOAL_HINT = 545,\r
+ STR_MAX_ID = 546,\r
}; // UIResourceTextId\r
enum FontLanguageId : uint8_t {
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:06229296e50d6cb99265e64876b67ef136252c41eeb187d34186d121a900dff9
+size 6824
--- /dev/null
+version https://git-lfs.github.com/spec/v1
+oid sha256:8d9472bc6dd86f0fc3b45ec6501e55baf30e76e364df08af06870f34ff1e99cf
+size 6824
STR_HANG_UP_OR_ANSWER = 537,\r
STR_WATCH_CALL = 538,\r
STR_PHONE_CALL = 539,\r
- STR_MAX_ID = 540,\r
+ STR_STEPS_OF_THE_DAY = 540,\r
+ STR_MILEAGE = 541,\r
+ STR_FAT_BURNING_TIME = 542,\r
+ STR_NUMBER_OF_STANDS = 543,\r
+ STR_CONSUME_CALORIES = 544,\r
+ STR_GOAL_HINT = 545,\r
+ STR_MAX_ID = 546,\r
}; // UIResourceTextId\r
enum FontLanguageId : uint8_t {