#ifdef SUPPORT_AT_OHOSFWK
#include "ui_screennotify.h"
#endif
-namespace OHOS {
-static DialVideoView* g_video = nullptr;
+namespace OHOS
+{
+ static DialVideoView *g_video = nullptr;
#ifdef SUPPORT_AT_OHOSFWK
-static void ScreenStatusNotify(ScreenStatus status)
-{
- if (g_video == nullptr) {
- return;
- }
- if (status == SCREEN_STATUS_OFF && g_video->IsPlayed()) {
- g_video->PausePlay();
- } else if (status == SCREEN_STATUS_ON) {
- if (g_video->IsPaused()) {
- g_video->ResumePlay();
- } else if (!g_video->IsPlayed()) {
- g_video->StartPlay();
+ static void ScreenStatusNotify(ScreenStatus status)
+ {
+ if (g_video == nullptr)
+ {
+ return;
+ }
+ if (status == SCREEN_STATUS_OFF && g_video->IsPlayed())
+ {
+ g_video->PausePlay();
+ }
+ else if (status == SCREEN_STATUS_ON)
+ {
+ if (g_video->IsPaused())
+ {
+ g_video->ResumePlay();
+ }
+ else if (!g_video->IsPlayed())
+ {
+ g_video->StartPlay();
+ }
}
}
-}
#endif
-DialViewGroup::DialViewGroup(void)
-{
- SetTouchable(true);
- SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
- SetCoverable(true);
-}
+ DialViewGroup::DialViewGroup(void)
+ {
+ SetTouchable(true);
+ SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
+ SetCoverable(true);
+ }
-DialViewGroup::~DialViewGroup(void)
-{
- if (video_ != nullptr) {
+ DialViewGroup::~DialViewGroup(void)
+ {
+ if (video_ != nullptr)
+ {
#ifdef SUPPORT_AT_OHOSFWK
- deregisterNotifyScreenStatus(ScreenStatusNotify);
+ deregisterNotifyScreenStatus(ScreenStatusNotify);
#endif
- g_video = nullptr;
- }
- if (kaleidoscope_ != nullptr) {
- kaleidoscope_->ClearFocus();
- kaleidoscope_ = nullptr;
- }
- ClearDial();
-}
-
-void DialViewGroup::ClearDial()
-{
- ImageCacheManager::GetInstance().UnloadAllInMultiRes(filePath_);
- ListNode<DialDataType>* passiveNode = passiveUpdateTypes_.Head();
- while (passiveNode != passiveUpdateTypes_.End()) {
- DialDataType type = passiveNode->data_;
- ModelDialDataFactory::GetInstance().UnRegisterDialDataListener(type);
- passiveNode = passiveNode->next_;
- }
- passiveUpdateTypes_.Clear();
-
- ListNode<DialClick>* clickNode = dialClicks_.Head();
- while (clickNode != dialClicks_.End()) {
- DialClick click = clickNode->data_;
- if (!click.isSliceType) {
- UIFree(click.bundleName);
+ g_video = nullptr;
+ }
+ if (kaleidoscope_ != nullptr)
+ {
+ kaleidoscope_->ClearFocus();
+ kaleidoscope_ = nullptr;
}
- clickNode = clickNode->next_;
+ ClearDial();
}
- dialClicks_.Clear();
-
- periodicUpdateTypes_.Clear();
- dataTypeMap_.clear();
+ void DialViewGroup::ClearDial()
+ {
+ ImageCacheManager::GetInstance().UnloadAllInMultiRes(filePath_);
+ ListNode<DialDataType> *passiveNode = passiveUpdateTypes_.Head();
+ while (passiveNode != passiveUpdateTypes_.End())
+ {
+ DialDataType type = passiveNode->data_;
+ ModelDialDataFactory::GetInstance().UnRegisterDialDataListener(type);
+ passiveNode = passiveNode->next_;
+ }
+ passiveUpdateTypes_.Clear();
+
+ ListNode<DialClick> *clickNode = dialClicks_.Head();
+ while (clickNode != dialClicks_.End())
+ {
+ DialClick click = clickNode->data_;
+ if (!click.isSliceType)
+ {
+ UIFree(click.bundleName);
+ }
+ clickNode = clickNode->next_;
+ }
+ dialClicks_.Clear();
- ListNode<UIView*>* viewNode = dialViews_.Head();
- while (viewNode != dialViews_.End()) {
- UIViewGroup::Remove(viewNode->data_);
- delete(viewNode->data_);
- viewNode = viewNode->next_;
- }
- dialViews_.Clear();
+ periodicUpdateTypes_.Clear();
- period_ = DEFAULT_TASK_PERIOD;
+ dataTypeMap_.clear();
- video_ = nullptr;
+ ListNode<UIView *> *viewNode = dialViews_.Head();
+ while (viewNode != dialViews_.End())
+ {
+ UIViewGroup::Remove(viewNode->data_);
+ delete (viewNode->data_);
+ viewNode = viewNode->next_;
+ }
+ dialViews_.Clear();
- if (fp_ != nullptr) {
- fclose(fp_);
- fp_ = nullptr;
- }
-}
+ period_ = DEFAULT_TASK_PERIOD;
-void DialViewGroup::SetDial(std::string filePath)
-{
- ClearDial();
- resPreloaded_ = false;
- filePath_ = filePath;
-}
+ video_ = nullptr;
-void DialViewGroup::PreLoad(void)
-{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialViewGroup::PreLoad");
- uint32_t startTime_ = HALTick::GetInstance().GetTime();
- if (!resPreloaded_) {
- fp_ = fopen(filePath_.c_str(), "rb");
- if (fp_ == nullptr) {
- GRAPHIC_LOGE("cannot open file: %s\n", filePath_.c_str());
- return;
+ if (fp_ != nullptr)
+ {
+ fclose(fp_);
+ fp_ = nullptr;
}
- DialBinParser::GetInstance()->UpdateDial(filePath_, fp_, this);
- resPreloaded_ = true;
}
- if(!resLoadStatus)
+ void DialViewGroup::SetDial(std::string filePath)
{
- // if(PullUpDownView::GetInstance()!=nullptr)
- // {
- // PullUpDownView::GetInstance()->PreLoad();
- // }
-
- // if(MessageControlView::GetInstance()!=nullptr)
- // {
- // MessageControlView::GetInstance()->PreLoad();
- // }
- resLoadStatus = true;
+ ClearDial();
+ resPreloaded_ = false;
+ filePath_ = filePath;
}
- uint32_t elapseTime = HALTick::GetInstance().GetElapseTime(startTime_);
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialViewGroup::GetElapseTime %d", elapseTime);
-}
-void DialViewGroup::UnLoad(void)
-{
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialViewGroup::UnLoad");
- if(resLoadStatus)
+ void DialViewGroup::PreLoad(void)
{
- // if(PullUpDownView::GetInstance()!=nullptr)
- // {
- // PullUpDownView::GetInstance()->UnLoad();
- // }
-
- // if(MessageControlView::GetInstance()!=nullptr)
- // {
- // MessageControlView::GetInstance()->UnLoad();
- // }
- resLoadStatus = false;
- }
-}
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialViewGroup::PreLoad");
+ uint32_t startTime_ = HALTick::GetInstance().GetTime();
+ if (!resPreloaded_)
+ {
+ fp_ = fopen(filePath_.c_str(), "rb");
+ if (fp_ == nullptr)
+ {
+ GRAPHIC_LOGE("cannot open file: %s\n", filePath_.c_str());
+ return;
+ }
+ DialBinParser::GetInstance()->UpdateDial(filePath_, fp_, this);
+ resPreloaded_ = true;
+ }
-void DialViewGroup::ProcessData(DialDataType type, DialView* view)
-{
- int16_t value = static_cast<int16_t>(type) >> 13; // 13: bit shift
- if (value == 0) { // 0: float
- float floatData = 0;
- ModelDialDataFactory::GetInstance().GetDialFloatData(type, floatData);
- view->HandleFloatData(floatData);
- } else if (value == 1) { // 1: text
- std::string* textData = nullptr;
- int16_t num = 0;
- ModelDialDataFactory::GetInstance().GetDialTextData(type, textData, num);
- view->HandleTextData(textData, num);
- } else if (value == 2) { // 2: multifloat
- float* floatsData = nullptr;
- int16_t num = 0;
- ModelDialDataFactory::GetInstance().GetDialFloatData(type, floatsData, num);
- view->HandleFloatData(floatsData, num);
+ if (!resLoadStatus)
+ {
+ /*打印已经注册的表盘model类型*/
+ ModelDialDataFactory::GetInstance().DumpModules();
+ resLoadStatus = true;
+ }
+ uint32_t elapseTime = HALTick::GetInstance().GetElapseTime(startTime_);
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialViewGroup::GetElapseTime %d", elapseTime);
}
-}
-void DialViewGroup::AddView(UIView* view, bool isDialVideoView)
-{
- if (view == nullptr) {
- GRAPHIC_LOGE("Parameter is nullptr.\n");
- return;
+ void DialViewGroup::UnLoad(void)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DialViewGroup::UnLoad");
+ if (resLoadStatus)
+ {
+ resLoadStatus = false;
+ }
}
- dialViews_.PushBack(view);
- Add(view);
- if (view->GetViewType() == UI_KALEIDOSCOPE_VIEW) {
- kaleidoscope_ = dynamic_cast<UIKaleidoscopeView*>(view);
+ void DialViewGroup::ProcessData(DialDataType type, DialView *view)
+ {
+ int16_t value = static_cast<int16_t>(type) >> 14; // 14: bit shift
+ if (value == 0)
+ { // 0: float
+ float floatData = 0;
+ ModelDialDataFactory::GetInstance().GetDialFloatData(type, floatData);
+ view->HandleFloatData(floatData);
+ }
+ else if (value == 1)
+ { // 1: text
+ std::string *textData = nullptr;
+ int16_t num = 0;
+ bool ret = ModelDialDataFactory::GetInstance().GetDialTextData(type, textData, num);
+ // printf("ModelDialDataFactory type %d num %d ret %d \r\n", type, num, ret);
+ view->HandleTextData(textData, num);
+ }
+ else if (value == 2)
+ { // 2: multifloat
+ float *floatsData = nullptr;
+ int16_t num = 0;
+ ModelDialDataFactory::GetInstance().GetDialFloatData(type, floatsData, num);
+ view->HandleFloatData(floatsData, num);
+ }
}
- if (isDialVideoView) {
- if (video_ != nullptr) {
- GRAPHIC_LOGE("Already added a video view.\n");
+ void DialViewGroup::AddView(UIView *view, bool isDialVideoView)
+ {
+ if (view == nullptr)
+ {
+ GRAPHIC_LOGE("Parameter is nullptr.\n");
return;
}
- video_ = reinterpret_cast<DialVideoView*>(view);
- g_video = video_;
+ dialViews_.PushBack(view);
+ Add(view);
+
+ if (view->GetViewType() == UI_KALEIDOSCOPE_VIEW)
+ {
+ kaleidoscope_ = dynamic_cast<UIKaleidoscopeView *>(view);
+ }
+
+ if (isDialVideoView)
+ {
+ if (video_ != nullptr)
+ {
+ GRAPHIC_LOGE("Already added a video view.\n");
+ return;
+ }
+ video_ = reinterpret_cast<DialVideoView *>(view);
+ g_video = video_;
#ifdef SUPPORT_AT_OHOSFWK
- registerNotifyScreenStatus(ScreenStatusNotify);
+ registerNotifyScreenStatus(ScreenStatusNotify);
#endif
+ }
}
-}
-void DialViewGroup::AddView(DialDataType type, DialView* view, bool isPeriodic)
-{
- if (view == nullptr) {
- GRAPHIC_LOGE("Parameter is nullptr.\n");
- return;
+ void DialViewGroup::AddView(DialDataType type, DialView *view, bool isPeriodic)
+ {
+ if (view == nullptr)
+ {
+ GRAPHIC_LOGE("Parameter is nullptr.\n");
+ return;
+ }
+
+ dataTypeMap_.insert(std::make_pair(static_cast<int16_t>(type), view));
+ if (isPeriodic)
+ {
+ periodicUpdateTypes_.PushBack(type);
+ }
+ else
+ {
+ ModelDialDataFactory::GetInstance().RegisterDialDataListener(type, this);
+ passiveUpdateTypes_.PushBack(type);
+ }
+ dialViews_.PushBack(dynamic_cast<UIView *>(view));
+ ProcessData(type, view);
+ Add(dynamic_cast<UIView *>(view));
}
- dataTypeMap_.insert(std::make_pair(static_cast<int16_t>(type), view));
- if (isPeriodic) {
- periodicUpdateTypes_.PushBack(type);
- } else {
- ModelDialDataFactory::GetInstance().RegisterDialDataListener(type, this);
- passiveUpdateTypes_.PushBack(type);
+ void DialViewGroup::SetPeriod(uint32_t period)
+ {
+ if (period_ < DEFAULT_TASK_PERIOD)
+ {
+ period_ = DEFAULT_TASK_PERIOD;
+ }
+ else
+ {
+ period_ = period;
+ }
}
- dialViews_.PushBack(dynamic_cast<UIView*>(view));
- ProcessData(type, view);
- Add(dynamic_cast<UIView*>(view));
-}
-void DialViewGroup::SetPeriod(uint32_t period)
-{
- if (period_ < DEFAULT_TASK_PERIOD) {
- period_ = DEFAULT_TASK_PERIOD;
- } else {
- period_ = period;
+ uint32_t DialViewGroup::GetPeriod()
+ {
+ return period_;
}
-}
-uint32_t DialViewGroup::GetPeriod()
-{
- return period_;
-}
+ void DialViewGroup::UpdateViewsByPeriodicUpdateData()
+ {
+ ListNode<DialDataType> *node = periodicUpdateTypes_.Head();
+ while (node != periodicUpdateTypes_.End())
+ {
+ DialDataType type = node->data_;
+ auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
+ if (iter != dataTypeMap_.end())
+ {
+ ProcessData(type, iter->second);
+ }
+ node = node->next_;
+ }
+ if (LowPowerManager::GetInstance()->IsLiteSurfaceInRootView())
+ {
+ Invalidate();
+ }
+ }
-void DialViewGroup::UpdateViewsByPeriodicUpdateData()
-{
- ListNode<DialDataType>* node = periodicUpdateTypes_.Head();
- while (node != periodicUpdateTypes_.End()) {
- DialDataType type = node->data_;
+ void DialViewGroup::OnDialFloatDataUpdate(DialDataType type, float data)
+ {
auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
- if (iter != dataTypeMap_.end()) {
- ProcessData(type, iter->second);
+ if (iter != dataTypeMap_.end())
+ {
+ DialView *view = iter->second;
+ view->HandleFloatData(data);
}
- node = node->next_;
- }
- if (LowPowerManager::GetInstance()->IsLiteSurfaceInRootView()) {
- Invalidate();
}
-}
-void DialViewGroup::OnDialFloatDataUpdate(DialDataType type, float data)
-{
- auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
- if (iter != dataTypeMap_.end()) {
- DialView* view = iter->second;
- view->HandleFloatData(data);
+ void DialViewGroup::OnDialFloatDataUpdate(DialDataType type, const float *data, uint16_t num)
+ {
+ auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
+ if (iter != dataTypeMap_.end())
+ {
+ DialView *view = iter->second;
+ view->HandleFloatData(data, num);
+ }
}
-}
-void DialViewGroup::OnDialFloatDataUpdate(DialDataType type, const float* data, uint16_t num)
-{
- auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
- if (iter != dataTypeMap_.end()) {
- DialView* view = iter->second;
- view->HandleFloatData(data, num);
+ void DialViewGroup::OnDialTextDataUpdate(DialDataType type, const std::string *data, uint16_t num)
+ {
+ auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
+ if (iter != dataTypeMap_.end())
+ {
+ DialView *view = iter->second;
+ view->HandleTextData(data, num);
+ }
}
-}
-void DialViewGroup::OnDialTextDataUpdate(DialDataType type, const std::string* data, uint16_t num)
-{
- auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
- if (iter != dataTypeMap_.end()) {
- DialView* view = iter->second;
- view->HandleTextData(data, num);
+ void DialViewGroup::AddDialClick(Rect &rect, const char *bundleName)
+ {
+ if (bundleName == nullptr)
+ {
+ return;
+ }
+ uint32_t len = static_cast<uint32_t>(strlen(bundleName));
+ char *name = static_cast<char *>(UIMalloc(++len));
+ if (name == nullptr)
+ {
+ return;
+ }
+ if (memcpy_s(name, len, bundleName, len) != EOK)
+ {
+ UIFree(name);
+ name = nullptr;
+ return;
+ }
+ name[len] = '\0';
+ DialClick click = {rect, false, {.bundleName = name}};
+ dialClicks_.PushBack(click);
}
-}
-void DialViewGroup::AddDialClick(Rect& rect, const char* bundleName)
-{
- if (bundleName == nullptr) {
- return;
- }
- uint32_t len = static_cast<uint32_t>(strlen(bundleName));
- char* name = static_cast<char*>(UIMalloc(++len));
- if (name == nullptr) {
- return;
- }
- if (memcpy_s(name, len, bundleName, len) != EOK) {
- UIFree(name);
- name = nullptr;
- return;
- }
- name[len] = '\0';
- DialClick click = {rect, false, {.bundleName = name}};
- dialClicks_.PushBack(click);
-}
+ void DialViewGroup::AddDialClick(Rect &rect, uint32_t sliceId)
+ {
+ if (sliceId == 0)
+ {
+ return;
+ }
-void DialViewGroup::AddDialClick(Rect& rect, uint32_t sliceId)
-{
- if (sliceId == 0) {
- return;
+ DialClick click = {rect, true, {.sliceId = sliceId}};
+ dialClicks_.PushBack(click);
}
- DialClick click = {rect, true, {.sliceId = sliceId}};
- dialClicks_.PushBack(click);
-}
-
-bool DialViewGroup::OnClickEvent(const ClickEvent& event)
-{
- Point point = event.GetCurrentPos();
- ListNode<DialClick>* node = dialClicks_.Head();
- while (node != dialClicks_.End()) {
- DialClick dialClick = node->data_;
- if (dialClick.area.IsContains(point)) {
- if (dialClick.isSliceType) {
- NativeAbility::GetInstance().ChangeSlice(dialClick.sliceId);
- } else {
+ bool DialViewGroup::OnClickEvent(const ClickEvent &event)
+ {
+ Point point = event.GetCurrentPos();
+ ListNode<DialClick> *node = dialClicks_.Head();
+ while (node != dialClicks_.End())
+ {
+ DialClick dialClick = node->data_;
+ if (dialClick.area.IsContains(point))
+ {
+ if (dialClick.isSliceType)
+ {
+ NativeAbility::GetInstance().ChangeSlice(dialClick.sliceId);
+ }
+ else
+ {
#ifdef JS_ENABLE
- StartJsApp(dialClick.bundleName);
+ StartJsApp(dialClick.bundleName);
#endif
+ }
+ return true;
}
- return true;
+ node = node->next_;
}
- node = node->next_;
+ return false;
}
- return false;
-}
-void DialViewGroup::ScrollBegin(bool isActive)
-{
- if (kaleidoscope_ != nullptr) {
- if (isActive) {
- kaleidoscope_->ClearFocus();
- kaleidoscope_->StopRotateAnimator();
+ void DialViewGroup::ScrollBegin(bool isActive)
+ {
+ if (kaleidoscope_ != nullptr)
+ {
+ if (isActive)
+ {
+ kaleidoscope_->ClearFocus();
+ kaleidoscope_->StopRotateAnimator();
+ }
+ return;
}
- return;
- }
- if (video_ == nullptr) {
- return;
- }
- if (video_->IsPlayed()) {
- video_->PausePlay();
+ if (video_ == nullptr)
+ {
+ return;
+ }
+ if (video_->IsPlayed())
+ {
+ video_->PausePlay();
+ }
}
-}
-void DialViewGroup::ScrollEnd(bool isActive)
-{
- if (kaleidoscope_ != nullptr) {
- if (isActive) {
- kaleidoscope_->StartRotateAnimator();
- kaleidoscope_->RequestFocus();
+ void DialViewGroup::ScrollEnd(bool isActive)
+ {
+ if (kaleidoscope_ != nullptr)
+ {
+ if (isActive)
+ {
+ kaleidoscope_->StartRotateAnimator();
+ kaleidoscope_->RequestFocus();
+ }
+ return;
}
- return;
- }
- if (video_ == nullptr) {
- return;
- }
+ if (video_ == nullptr)
+ {
+ return;
+ }
- if (isActive) {
- if (video_->IsPaused()) {
- video_->ResumePlay();
- } else if (!video_->IsPlayed()) {
- video_->StartPlay();
+ if (isActive)
+ {
+ if (video_->IsPaused())
+ {
+ video_->ResumePlay();
+ }
+ else if (!video_->IsPlayed())
+ {
+ video_->StartPlay();
+ }
+ g_video = video_;
}
- g_video = video_;
- } else {
- if (video_->IsPaused() || video_->IsPlayed()) {
- video_->StopPlay();
+ else
+ {
+ if (video_->IsPaused() || video_->IsPlayed())
+ {
+ video_->StopPlay();
+ }
+ ClearCache();
+ g_video = nullptr;
}
- ClearCache();
- g_video = nullptr;
}
-}
-void DialViewGroup::CoverBegin(bool isCovered)
-{
- if (kaleidoscope_ != nullptr) {
- if (!isCovered) {
- kaleidoscope_->StopRotateAnimator();
- kaleidoscope_->ClearFocus();
+ void DialViewGroup::CoverBegin(bool isCovered)
+ {
+ if (kaleidoscope_ != nullptr)
+ {
+ if (!isCovered)
+ {
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
+ }
+ return;
}
- return;
- }
- if (video_ == nullptr) {
- return;
+ if (video_ == nullptr)
+ {
+ return;
+ }
+
+ if (video_->IsPlayed())
+ {
+ video_->PausePlay();
+ }
}
- if (video_->IsPlayed()) {
- video_->PausePlay();
+ void DialViewGroup::CoverEnd(bool isCovered)
+ {
+ if (kaleidoscope_ != nullptr)
+ {
+ if (!isCovered)
+ {
+ kaleidoscope_->RequestFocus();
+ kaleidoscope_->StartRotateAnimator();
+ }
+ return;
+ }
+ if (video_ == nullptr)
+ {
+ return;
+ }
+ if (isCovered)
+ {
+ g_video = nullptr;
+ }
+ else
+ {
+ if (video_->IsPaused())
+ {
+ video_->ResumePlay();
+ }
+ else if (!video_->IsPlayed())
+ {
+ video_->StartPlay();
+ }
+ g_video = video_;
+ }
}
-}
-void DialViewGroup::CoverEnd(bool isCovered)
-{
- if (kaleidoscope_ != nullptr) {
- if (!isCovered) {
+ void DialViewGroup::OnActive(void)
+ {
+ if (video_ != nullptr)
+ {
+ if (video_->IsPaused())
+ {
+ video_->ResumePlay();
+ }
+ else if (!video_->IsPlayed())
+ {
+ video_->StartPlay();
+ }
+ g_video = video_;
+ }
+ else if (kaleidoscope_ != nullptr)
+ {
kaleidoscope_->RequestFocus();
kaleidoscope_->StartRotateAnimator();
}
- return;
- }
- if (video_ == nullptr) {
- return;
}
- if (isCovered) {
- g_video = nullptr;
- } else {
- if (video_->IsPaused()) {
- video_->ResumePlay();
- } else if (!video_->IsPlayed()) {
- video_->StartPlay();
- }
- g_video = video_;
- }
-}
-void DialViewGroup::OnActive(void)
-{
- if (video_ != nullptr) {
- if (video_->IsPaused()) {
- video_->ResumePlay();
- } else if (!video_->IsPlayed()) {
- video_->StartPlay();
- }
- g_video = video_;
- } else if (kaleidoscope_ != nullptr) {
- kaleidoscope_->RequestFocus();
- kaleidoscope_->StartRotateAnimator();
- }
-}
-
-void DialViewGroup::OnInactive(void)
-{
- if (video_ != nullptr) {
- if (!video_->IsStopped()) {
- video_->StopPlay();
- }
- g_video = nullptr;
- } else if (kaleidoscope_ != nullptr) {
- kaleidoscope_->StopRotateAnimator();
- kaleidoscope_->ClearFocus();
+ void DialViewGroup::OnInactive(void)
+ {
+ if (video_ != nullptr)
+ {
+ if (!video_->IsStopped())
+ {
+ video_->StopPlay();
+ }
+ g_video = nullptr;
+ }
+ else if (kaleidoscope_ != nullptr)
+ {
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
+ }
}
}
-}