* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-21 11:54:00
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-26 20:21:33
+ * @LastEditTime: 2024-09-11 15:28:39
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/include/dropdown/DropDownCardPage1.h
*/
#ifndef __DROPDOWN_CARD_PAGE1_H__
void Updat4GState(bool state);
void UpdateDnotdisturbState(bool state);
void UpdateSleepModelState(bool state);
+ void Refresh4GState();
private:
UIToggleButton *ToggleButtonInit(ToggleButtonConfig &toggleButtonConfig);
{
UpdataBaseData();
PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition();
- PullUpDown_StartTimer(1000);
+ PullUpDown_StartTimer(2000);
}
else
{
/* -------------------------------------------------------------------------- */
// 声明定时器变量
static osTimerId_t g_timer = NULL;
- static uint8_t UPDATETIME = 2; // 2秒
+ static uint8_t UPDATETIME = 20; // 20秒
uint8_t MainPresenterSample::g_PullUpDownTimes = UPDATETIME;
/*定时器到期时的处理*/
static void PullUpDown_TimerCallbackProc(int data)
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PullUpDown_TimerCallbackProc");
- MainPresenterSample::g_PullUpDownTimes--;
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d", MainPresenterSample::g_PullUpDownTimes);
- if (MainPresenterSample::g_PullUpDownTimes <= 0)
+ if (uapi_get_screen_state() == 1) // 息屏状态下若停留在下拉界面,20s后无操作停止更新数据
+ {
+ MainPresenterSample::g_PullUpDownTimes -= 2;
+ WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "%d", MainPresenterSample::g_PullUpDownTimes);
+ if (MainPresenterSample::g_PullUpDownTimes <= 0) {
+ GraphicService::GetInstance()->PostGraphicEvent(std::bind(&MainPresenterSample::PullUpDown_StopTimer, MainPresenterSample::GetInstance()));
+ }
+ }
+ else //亮屏状态下每2s刷新一次下拉数据
{
MainPresenterSample::g_PullUpDownTimes = UPDATETIME;
-
if (PullUpDownView::GetInstance() != nullptr)
{
PullUpDownView::GetInstance()->UpdateSignalStrengthStatusAndBatteryPosition();
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PullUpDownView::GetInstance fail!!");
}
}
-
- if (uapi_get_screen_state() == 1) // 息屏停止更新数据
- {
- GraphicService::GetInstance()->PostGraphicEvent(std::bind(&MainPresenterSample::PullUpDown_StopTimer, MainPresenterSample::GetInstance()));
- }
-
return;
}
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-06-26 18:14:24
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-29 10:16:29
+ * @LastEditTime: 2024-09-11 16:16:01
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/PullUpDownView.cpp
*/
}
}
}
+ /*4g开关的状态刷新*/
+ if(DropDownCardPage1::GetInstance())
+ {
+ DropDownCardPage1::GetInstance()->Refresh4GState();
+ }
}
// 更新信号强度显示
void PullUpDownView::UpdateSignalBarDisplay(int signalBars, bool state)
* @Author: luozheng 1732036298@qq.com
* @Date: 2024-08-21 11:54:00
* @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-08-31 11:05:12
+ * @LastEditTime: 2024-09-11 15:29:18
* @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/main/src/dropdown/DropDownCardPage1.cpp
*/
#include "main/include/dropdown/DropDownCardPage1.h"
}
}
+ //刷新4g开关显示
+ void DropDownCardPage1::Refresh4GState()
+ {
+ Updat4GState(uapi_cat1_get_power_stat());
+ }
+
void DropDownCardPage1::UpdateDnotdisturbState(bool state)
{
if (toggleButton[DropDownCardPage1::toggleButton_DNOTDISTURB] != nullptr)