bool CheckViewParam(int16_t hideView, int16_t showView);\r
void ChangeView(int16_t hideView, int16_t showView);\r
UIScrollView *GetSystemScrollView(int ViewId);\r
+ /** 息屏再亮屏后表冠失效时,为当前显示的滚动视图重新申请焦点(含系统主界面、关于手表等所有 subview) */\r
+ void RequestFocusForCurrentView();\r
\r
private:\r
SystemAboutTheWatchView *p_SystemAboutTheWatchView{nullptr}; // 关于手表\r
UIImageView *NeedToUpdateImage{nullptr}; // 提示需要系统更新的icon图片\r
UIImageView *temp{nullptr};\r
bool viewInitStatus{false};\r
+ int16_t currentShowViewId_{SYSTEMVIEW}; // 当前显示的 subview,息屏亮屏后用于恢复表冠焦点\r
};\r
} // namespace OHOS\r
\r
void SystemPresenter::OnResume()\r
{\r
RootView::GetInstance()->SetOnKeyActListener(this);\r
+ SystemView *p_SystemView = SystemView::GetInstance();\r
+ if (p_SystemView != nullptr) {\r
+ p_SystemView->RequestFocusForCurrentView(); \r
+ }\r
}\r
\r
static uint32_t time = 0;\r
{\r
NeedToUpdateImageinit();\r
}\r
+ currentShowViewId_ = SYSTEMVIEW;\r
AddViewToRootContainer(SystemScrollView[SYSTEMVIEW]);\r
}\r
\r
- \r
+ void SystemView::RequestFocusForCurrentView()\r
+ {\r
+ // 系统主界面、关于手表等任意当前 subview 息屏亮屏后恢复表冠焦点\r
+ if (currentShowViewId_ >= 0 && currentShowViewId_ < MAX_SYSTEMVIEWID &&\r
+ SystemScrollView[currentShowViewId_] != nullptr) {\r
+ SystemScrollView[currentShowViewId_]->RequestFocus();\r
+ }\r
+ }\r
\r
\r
+ \r
+\r
// 0.跳转到系统视图,其他视图都市通过这个视图跳转\r
bool SystemView::ChangeToSystemView(int16_t thisView)\r
{\r
SystemScrollView[hideView]->SetVisible(false);\r
ClickFunc(showView);\r
SystemScrollView[showView]->SetVisible(true);\r
+ currentShowViewId_ = showView;\r
+ if (SystemScrollView[showView] != nullptr) {\r
+ SystemScrollView[showView]->RequestFocus();\r
+ }\r
Draw();\r
}\r
\r