if (display_api->get_screen_state() != SCREEN_ON)
{
display_api->turn_on_screen();
- }
- display_api->set_screen_set_keepon_timeout(1000*5);
+ }
+ display_api->set_auto_timeout_function(1000*5);
if(*x==3)
{
//倒计时结束后,直接执行关机动画
{
//提醒低电充电
set_lowpower_falg(0);
- // if (NotificationManager::GetInstance()->HasNotifyShowing())
- // NotificationManager::GetInstance()->StopNotify();
- NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
+ NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_TWO);
+
+ if (NotificationManager::GetInstance()->HasNotifyShowing())
+ return;
NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true);
}
else
{
//电量过低,直接提醒关机
+ display_api->set_auto_timeout_function(1000*10);
set_lowpower_falg(1);
- // if (NotificationManager::GetInstance()->HasNotifyShowing())
- // NotificationManager::GetInstance()->StopNotify();
+ if (NotificationManager::GetInstance()->HasNotifyShowing())
+ NotificationManager::GetInstance()->StopNotify();
+
NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
NotificationManager::GetInstance()->ShowNotify(showlowpowerNotify, (uint16_t)topic, true);
// imageCharge->SetVisible(true);
// }
// }
+
+ static void FreeImagePathsArray(const char **imagePaths, const int numImages)
+ {
+ for (int i = 0; i < numImages; i++)
+ {
+ // ImageCacheManager::GetInstance().UnloadSingleRes(imagePaths[i]);
+ delete imagePaths[i];
+ imagePaths[i] = nullptr;
+ }
+ }
+
static const char ** CreateImagePathsArray(const char *basePath, const char *fileExtension, int numImages)
{
const char **imagePaths = new const char *[numImages];
return imagePaths;
}
- UIViewGroup * ShowUpShutDownAnimatorView()
+ void ShowUpShutDownAnimatorView()
{
group = new UIViewGroup();
if (group == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "group new fail");
- return nullptr;
+ return ;
}
- group->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ group->SetPosition(0, 0, 466, 466);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShutDownAnimatorView::ShowUpShutDownAnimatorView");
ShutDownPathsArray = CreateImagePathsArray(ShutDownPaths, "bin", SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
if (ShutDownImageAnimatorView == nullptr)
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BluetoothEarPhoneView new ShutDownImageAnimatorView fail");
- return NULL;
+ return ;
}
for (uint8_t i = 0; i < SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES; i++)
{
ShutDownImageAnimatorView->SetRepeatTimes(1);
}
+ UIImageAnimatorView::AnimatorStopListener *stoplistener = static_cast<UIImageAnimatorView::AnimatorStopListener *>(lowppowrAnimatorStopListener::GetInstance());
+ ShutDownImageAnimatorView->SetAnimatorStopListener(stoplistener);
+ if (stoplistener == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to Create stoplistener!!");
+ return;
+ }
+
ShutDownImageAnimatorView->SetVisible(true);
//ShutDownImageAnimatorView->Start();
group->SetVisible(false);
group->Add(ShutDownImageAnimatorView);
- return group;
+ return ;
}
static uint8_t battery_falg=0;
group = nullptr;
}
+ FreeImagePathsArray(ShutDownPathsArray,SHUTDOWN_IMAGE_ANIMATOR_VIEW_NUM_FRAMES);
RootView::GetInstance()->Remove(UIViewGroup_lowpower);
delete UIViewGroup_lowpower;
if(battery_falg>=3)
{
group->SetVisible(true);
- UIImageAnimatorView::AnimatorStopListener *stoplistener = static_cast<UIImageAnimatorView::AnimatorStopListener *>(lowppowrAnimatorStopListener::GetInstance());
- ShutDownImageAnimatorView->SetAnimatorStopListener(stoplistener);
- if (stoplistener == nullptr)
- {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Failed to Create stoplistener!!");
- return NULL;
- }
ShutDownImageAnimatorView->Start();
}
return UIViewGroup_lowpower;
{
//UNUSED(view);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "xxxxxxxxxxxxxxxxxxxxOnAnimatorStop");
+
+ NotificationManager::GetInstance()->StopNotify();
+
if(battery_falg==4)
uapi_reboot_device();
else
uapi_poweroff_device(); // 关机
+
+
+
//NotificationManager::GetInstance()->StopNotify();
//
// if(strcmp(view.GetViewId(),LOW_POWER_BUTTON)!=0)