SEC_TO_MILLI +
uSecond / USEC_TO_MILLI);
sweepClock->SetSweepTime12Hour(realHour, realMinute, realMilliSecond, 1);
+ RootView::GetInstance()->Invalidate();
}
private:
}
}
+ // 播放视频
+ videoPlay_->StartVideoPlay();
+
+ // Add ImageView to App
+ if (image1_ == nullptr)
+ {
+ image1_ = new UIImageView();
+ }
+ image1_->SetPosition(0, 0); // widget's left position and top position
+ image1_->Resize(466, 466); // widget's width and height
+ image1_->SetViewId("image1"); // Set style
+ image1_->SetStyle(STYLE_BORDER_OPA, 0xb2);
+ image1_->SetStyle(STYLE_BORDER_COLOR, 0xff0b1928);
+ // Add to rootView
+ container_->Add(image1_);
+ image1_->SetVisible(true);
+
// Add SweepClock to App
if (sweepClock1_ == nullptr)
{
sweepClock1_->SetViewId("sweepClock1"); // Set style
sweepClock1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff000000);
sweepClock1_->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
+ sweepClock1_->SetStyle(STYLE_BORDER_OPA, 0xb2);
+ sweepClock1_->SetStyle(STYLE_BORDER_COLOR, 0xff0b1928);
// Set additional property
sweepClock1_->SetWorkMode(UISweepClock::WorkMode::NORMAL);
- sweepClock1_->SetHandLine(UISweepClock::HandType::HOUR_HAND, {233, 101}, {0, 132}, Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0xff), 5, 132, 255);
- sweepClock1_->SetHandLine(UISweepClock::HandType::MINUTE_HAND, {233, 56}, {0, 177}, Color::GetColorFromRGBA(0x00, 0xff, 0x00, 0xff), 3, 177, 255);
- sweepClock1_->SetHandLine(UISweepClock::HandType::SECOND_HAND, {233, 10}, {0, 223}, Color::GetColorFromRGBA(0xff, 0x00, 0x00, 0xff), 1, 223, 255);
+ Image *sweepClock1HourImage = new Image();
+ sweepClock1HourImage->SetSrc("/user/res/Dial/hour.bin");
+ sweepClock1_->SetHandImage(UISweepClock::HandType::HOUR_HAND, *sweepClock1HourImage, {221, 87}, {12, 146});
+ Image *sweepClock1MinuteImage = new Image();
+
+ sweepClock1MinuteImage->SetSrc("/user/res/Dial/minute.bin");
+ sweepClock1_->SetHandImage(UISweepClock::HandType::MINUTE_HAND, *sweepClock1MinuteImage, {221, 33}, {12, 200});
+ Image *sweepClock1SecondImage = new Image();
+ sweepClock1SecondImage->SetSrc("/user/res/Dial/second.bin");
+ sweepClock1_->SetHandImage(UISweepClock::HandType::SECOND_HAND, *sweepClock1SecondImage, {221, 28}, {12, 205});
uint16_t sweepClock1realMilliSecond = 40 * 1000;
sweepClock1_->SetSweepTime12Hour(10, 20, sweepClock1realMilliSecond, true);
sweepClock1callback_ = new SweepClockCallback(sweepClock1_);
- sweepClock1animator_ = new Animator(sweepClock1callback_, sweepClock1_, 0, true);
+ sweepClock1animator_ = new Animator(sweepClock1callback_, sweepClock1_, 1000, true);
sweepClock1animator_->Start();
// Add to rootView
void UITestVideoPlay::TearDown()
{
- if (animator_ != nullptr)
- {
- animator_->Stop();
- delete animator_;
- animator_ = nullptr;
- }
+ // if (animator_ != nullptr)
+ // {
+ // animator_->Stop();
+ // delete animator_;
+ // animator_ = nullptr;
+ // }
- if (callBack_ != nullptr)
- {
- delete callBack_;
- callBack_ = nullptr;
- }
+ // if (callBack_ != nullptr)
+ // {
+ // delete callBack_;
+ // callBack_ = nullptr;
+ // }
if (sweepClock1callback_ != nullptr)
{
delete sweepClock1callback_;