* @Author: luozheng 1732036298@qq.com
* @Date: 2024-07-20 11:05:46
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-28 20:21:31
+ * @LastEditTime: 2024-09-29 18:03:03
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/rebootandshutdown/include/ShutDownImageAnimatorView.h
*/
static ShutDownImageAnimatorView *GetInstance();
UIViewGroup *ShutDownAnimatorViewInit(void);
UIImageAnimatorView *GeShutDownImageAnimatorView(void);
- void ShutDownImageAnimator_Start(bool state);
+ void ShutDownImageAnimator_Start(int type);
bool GetShutDownImageAnimatorIsStart(void);
private:
UIImageAnimatorView *shutDownImageAnimatorView{nullptr}; // 关机动画
ImageAnimatorInfo ShutDownImageInfo[SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES]; // 关机图像的信息
const char **ShutDownPathsArray{nullptr}; // 关机图片路径数组
- bool isShutDownOperation;
+ int OperationType;
bool isShutDownImageAnimatorStart{false};
};
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-20 15:11:17
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-19 14:21:00
+ * @LastEditTime: 2024-09-29 18:14:14
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/RebootAndShutdownPresenter.cpp
*/
#include "AppViewIDs.h"
else if (strcmp(view.GetViewId(), FACTORY_RESET_BUTTON_CHECK_ON) == 0) // 恢复出厂设置确认
{
ui_api_vibrate_once_func(); //恢复出厂增加震动
- do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_RESTORE_FACTORY_SETTING, NULL, 0);
+ view_->ChangeView(FACTORYRESET, SHUTDOWNANIMATOR);
+ ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(2);
+ isShutDownImageAnimatorStart = true;
return true;
}
else if (strcmp(view.GetViewId(), FACTORY_RESET_BUTTON_CHECK_OFF) == 0) // 恢复出厂设置取消
start_shutdown_or_reboot();
shutdown_reboot_prejobs();
- ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(true);
+ ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(0);
isShutDownImageAnimatorStart = true;
}
else if (&view == view_->GetButtonCancel()) // 关机取消
{
UNUSED(view);
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "RebootAndShutdownPresenter::OnAnimatorStop");
- if (isShutDownOperation == true)
+ switch (OperationType)
{
+ case 0:
uapi_poweroff_device(); // 关机
- }
- else
- {
+ break;
+ case 1:
uapi_reboot_device(); // 重启
+ break;
+ case 2:
+ do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_RESTORE_FACTORY_SETTING, NULL, 0);
+ break;
+ default:
+ break;
}
}
return shutDownImageAnimatorView;
}
- // true 关机 false 重启
- void ShutDownImageAnimatorView::ShutDownImageAnimator_Start(bool state)
+ // 0 关机 1 重启 2 恢复出厂
+ void ShutDownImageAnimatorView::ShutDownImageAnimator_Start(int type)
{
- isShutDownOperation = state;
+ OperationType = type;
shutDownImageAnimatorView->Start();
isShutDownImageAnimatorStart = true;
- ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);//关机动画已经开始了不能息屏
+ ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON); // 关机动画已经开始了不能息屏
- //关机增加震动
+ // 关机增加震动
ui_api_vibrate_once_func();
}
bool ShutDownImageAnimatorView::ShowUpShutDownAnimatorView()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ShutDownImageAnimatorView::ShowUpShutDownAnimatorView");
- ShutDownPathsArray = CreateImagePathsArray(ShutDownPaths, SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
+ ShutDownPathsArray = CreateImagePathsArray(ShutDownPaths, SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (shutDownImageAnimatorView == nullptr)
{
start_shutdown_or_reboot();\r
shutdown_reboot_prejobs();\r
\r
- ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(false);\r
+ ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(1);\r
isShutDownImageAnimatorStart = true;\r
return true;\r
}\r
start_shutdown_or_reboot();\r
shutdown_reboot_prejobs();\r
\r
- ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(true);\r
+ ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(0);\r
isShutDownImageAnimatorStart = true;\r
return true;\r
}\r
else if (strcmp(view.GetViewId(), FACTORYRESET_CHECKON) == 0) // 恢复出厂设置确认\r
{\r
ui_api_vibrate_once_func(); //恢复出厂增加震动\r
- do_custom_cmd_service_check_msg(CUSTOM_CMD_MSG_TYPE_RESTORE_FACTORY_SETTING, NULL, 0);\r
+ p_SystemView->ChangeView(FACTORYRESETVIEW, SHUTDOWNANIMATIONVIEW);\r
+ ShutDownImageAnimatorView::GetInstance()->ShutDownImageAnimator_Start(2);\r
+ isShutDownImageAnimatorStart = true;\r
return true;\r
}\r
else if (strcmp(view.GetViewId(), FACTORYRESET_CHECKOFF) == 0) // 恢复出厂设置取消\r