+++ /dev/null
-#include "dial/include/DialSetupView.h"
-
-#include "common/image_cache_manager.h"
-#include "UiConfig.h"
-#include "ui_resource_image.h"
-#include <ui_scroll_view.h>
-#include "components/ui_button.h"
-namespace OHOS
-{
-
- static DialSetupView *g_pDialSetupView{nullptr};
-
- DialSetupView::DialSetupView()
- {
-
- g_pDialSetupView = this;
- }
-
- DialSetupView::~DialSetupView()
- {
- DeInit();
- g_pDialSetupView = nullptr;
- }
-
- DialSetupView *DialSetupView::GetInstance()
- {
-
- return g_pDialSetupView;
- }
- void DialSetupView::Init()
- {
- if (container_ == nullptr)
- {
- container_ = new UIViewGroup();
- container_->SetPosition(0, 0, 466, 466);
- container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
- }
-
- // Add Label to App
- if (label1_ == nullptr)
- {
- label1_ = new UILabel();
- }
- label1_->SetPosition(158, 52); // widget's left position and top position
- label1_->Resize(150, 35); // widget's width and height
- label1_->SetViewId("label1"); // Set style
- label1_->SetStyle(STYLE_TEXT_FONT, 30);
-
- // Set additional property
- label1_->SetText("表盘安装中");
- label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
- label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- label1_->SetRollSpeed(0);
- label1_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
-
- // Add to rootView
- container_->Add(label1_);
- label1_->SetVisible(true);
-
- // Add ImageView to App
- if (image2_ == nullptr)
- {
- image2_ = new UIImageView();
- }
- image2_->SetPosition(183, 136); // widget's left position and top position
- image2_->Resize(100, 110); // widget's width and height
- image2_->SetViewId("Steup"); // Set style
-
- // Set additional property
-#ifdef _WIN32
- char *image2imagesPath = "c:/Users/caiking/project/image_converter_tool/output/DialSetup/setup.bin";
-#else
- char *image2imagesPath = "/user/res/Dial/setup.bin";
-#endif
- image2_->SetSrc(image2imagesPath);
-
- // Add to rootView
- container_->Add(image2_);
- image2_->SetVisible(true);
-
- // Add Label to App
- if (label2_ == nullptr)
- {
- label2_ = new UILabel();
- }
- label2_->SetPosition(68, 280); // widget's left position and top position
- label2_->Resize(400, 124); // widget's width and height
- label2_->SetViewId("label2"); // Set style
- label2_->SetStyle(STYLE_TEXT_FONT, 30);
-
- // Set additional property
- label2_->SetText("正在安装表盘,请不要做\n其他操作或关闭手表");
- label2_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
- label2_->SetTextColor(Color::GetColorFromRGBA(0x99, 0x99, 0x99, 0xff));
- label2_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
- label2_->SetRollSpeed(0);
- label2_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
-
- // Add to rootView
- container_->Add(label2_);
- label2_->SetVisible(true);
- }
-
- void DialSetupView::DeInit()
- {
- if (container_ != nullptr)
- {
- container_->RemoveAll();
- delete container_;
- container_ = nullptr;
- }
- if (label1_ != nullptr)
- {
- delete label1_;
- label1_ = nullptr;
- }
- if (image2_ != nullptr)
- {
- delete image2_;
- image2_ = nullptr;
- }
- if (label2_ != nullptr)
- {
- delete label2_;
- label2_ = nullptr;
- }
- }
-
- UIView *DialSetupView::GetView()
- {
- Init();
- return container_;
- }
- void DialSetupView::OnStart()
- {
- container_ = new UIViewGroup();
- if (container_ == nullptr)
- {
- return;
- }
- container_->SetPosition(0, 0);
- container_->SetWidth(Screen::GetInstance().GetWidth());
- container_->SetHeight(Screen::GetInstance().GetHeight());
- container_->SetTouchable(true);
- container_->SetDraggable(true);
-
- GetView();
- RootView::GetInstance()->Add(container_);
- }
-
- void DialSetupView::OnSetUpView()
- {
-
- View<DialSetupPresenter>::OnSetUpView();
- Draw();
- }
-
- void DialSetupView::OnTearDownView()
- {
-
- View<DialSetupPresenter>::OnTearDownView();
- return;
- }
-
- void DialSetupView::OnStop()
- {
- View<DialSetupPresenter>::OnStop();
- RootView::GetInstance()->RemoveAll();
- return;
- }
-}
\ No newline at end of file