static const int PLAYER_PLAYERSMODEL_REPEATS = 0x20000c;
static const int PLAYER_PLAYERHIGHLIGHT = 0x20000d;
static const int PLAYER_PRE_BUTTOW = 0x20000e;
- static const int CLOCK_HAND24HOUR_IMAGE_PATH = 0x300001;
- static const int CLOCK_BIGCIRCLE_IMAGE_PATH = 0x300002;
- static const int CLOCK_PROGRESS_IMAGE_PATH = 0x300003;
- static const int CLOCK_HOURHAND = 0x300004;
- static const int CLOCK_MONDAY_IMAGE_PATH = 0x300005;
- static const int CLOCK_CIRCLE_IMAGE_PATH = 0x300006;
- static const int CLOCK_SHOE_IMAGE = 0x300007;
- static const int CLOCK_FIRDAY_IMAGE_PATH = 0x300008;
- static const int CLOCK_WEDNESDAY_IMAGE_PATH = 0x300009;
- static const int CLOCK_SUNDAY_IMAGE_PATH = 0x30000a;
- static const int CLOCK_SATURDAY_IMAGE_PATH = 0x30000b;
- static const int CLOCK_MINUTEHAND = 0x30000c;
- static const int CLOCK_MEDCIRCLE_IMAGE_PATH = 0x30000d;
- static const int CLOCK_HEARTRATE_IMAGE_PATH = 0x30000e;
- static const int CLOCK_MAIN_FACE_IMAGE = 0x30000f;
- static const int CLOCK_SMALLCIRCLE_IMAGE_PATH = 0x300010;
- static const int CLOCK_THURSDAY_IMAGE_PATH = 0x300011;
- static const int CLOCK_SECONDHAND = 0x300012;
- static const int CLOCK_TUESDAY_IMAGE_PATH = 0x300013;
+ static const int CLOCK_CLOCK0 = 0x300001;
+ static const int CLOCK_CLOCK1 = 0x300002;
+ static const int CLOCK_CLOCK10 = 0x300003;
+ static const int CLOCK_CLOCK12 = 0x300004;
+ static const int CLOCK_CLOCK13 = 0x300005;
+ static const int CLOCK_CLOCK14 = 0x300006;
+ static const int CLOCK_CLOCK15 = 0x300007;
+ static const int CLOCK_CLOCK16 = 0x300008;
+ static const int CLOCK_CLOCK18 = 0x300009;
+ static const int CLOCK_CLOCK2 = 0x30000a;
+ static const int CLOCK_CLOCK4 = 0x30000b;
+ static const int CLOCK_CLOCK5 = 0x30000c;
+ static const int CLOCK_CLOCK6 = 0x30000d;
+ static const int CLOCK_CLOCK7 = 0x30000e;
+ static const int CLOCK_CLOCK8 = 0x30000f;
+ static const int CLOCK_CLOCK9 = 0x300010;
+ static const int CLOCK_CLASSIC_GEOMETRY = 0x300011;
+ static const int CLOCK_CLOCK_HOUR = 0x300012;
+ static const int CLOCK_CLOCK_MINUTE = 0x300013;
+ static const int CLOCK_CLOCK_SECOND = 0x300014;
+ static const int CLOCK_HOUR = 0x300015;
+ static const int CLOCK_MINUTE = 0x300016;
+ static const int CLOCK_SECOND = 0x300017;
static const int DROPDOWN_DROPDOWN_BLUETOOTH = 0x400001;
static const int DROPDOWN_DROPDOWN_DN_DISTURB = 0x400002;
static const int DROPDOWN_DROPDOWN_BLUETOOTH_B = 0x400003;
namespace OHOS {
static MainClockView *g_pMainClockView = nullptr;
+
+#if 0
static constexpr uint16_t FONT_DEFAULT_SIZE = 25;
static constexpr uint16_t FONT_TEXT_SIZE = 24;
static constexpr uint16_t STEP_LABEL_X = 100;
static constexpr uint16_t SMALLCIRCLE_POSITION_Y = 202;
static constexpr uint16_t WEEKDAY_POSITION_X = 193;
static constexpr uint16_t WEEKDAY_POSITION_Y = 127;
+#endif
+
+static constexpr uint16_t SECOND_POINT_POSITION_X = 221;
+static constexpr uint16_t SECOND_POINT_POSITION_Y = 28;
+static constexpr uint16_t MINUTE_POINT_POSITION_X = 221;
+static constexpr uint16_t MINUTE_POINT_POSITION_Y = 33;
+static constexpr uint16_t HOUR_POINT_POSITION_X = 221;
+static constexpr uint16_t HOUR_POINT_POSITION_Y = 87;
+
+static constexpr uint16_t SECOND_POINT_CENTER_X = 12;
+static constexpr uint16_t SECOND_POINT_CENTER_Y = 205;
+static constexpr uint16_t MINUTE_POINT_CENTER_X = 12;
+static constexpr uint16_t MINUTE_POINT_CENTER_Y = 200;
+static constexpr uint16_t HOUR_POINT_CENTER_X = 12;
+static constexpr uint16_t HOUR_POINT_CENTER_Y = 146;
+
+
+
+
+
+
MainClockView::MainClockView()
{
clockAnimator = nullptr;
}
mainSweepClock->RemoveAll();
+ #if 0
delete curFace;
curFace = nullptr;
delete stepLabel;
Remove(mainSweepClock);
delete mainSweepClock;
mainSweepClock = nullptr;
+#endif
g_pMainClockView = nullptr;
}
void MainClockView::InitStepValue()
{
+#if 0
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainClockView::InitStepValue");
uint32_t stepValue;
int weekToday = ActivityModel::GetInstance()->GetWeekToday();
stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::RELEASED);
stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::PRESSED);
stepLabel->SetStyleForState(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT, UIButton::INACTIVE);
+#endif
}
bool MainClockView::InitLabelView(void)
{
+#if 0
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::MainPresenterSample::GetInstance();
stepLabel = new UILabelButton();
if (stepLabel == nullptr) {
weekLabel->SetText("2");
weekLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_TEXT_SIZE);
weekLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
+#endif
+#if 1
+ printf("lable init\n");
+ batteryLabel = new UILabel();
+ if (batteryLabel == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "batteryLabel new fail");
+ return false;
+ }
+ batteryLabel->SetPosition(228, 52); // widget's left position and top position
+ batteryLabel->Resize(66, 33);
+ batteryLabel->SetText("2%");
+ batteryLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ batteryLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 28);
+ batteryLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_TRANSPARENT);
+ mainSweepClock->Add(batteryLabel);
+ batteryLabel->SetVisible(true);
+
+ if (dataLabel == nullptr) {
+ dataLabel = new UILabel();
+ }
+ dataLabel->SetPosition(177, 358); // widget's left position and top position
+ dataLabel->Resize(200, 60); // widget's width and height
+ dataLabel->SetViewId("data");// Set style
+ dataLabel->SetStyle(STYLE_TEXT_FONT, 30);
+ dataLabel->SetStyle(STYLE_LINE_HEIGHT, 30);
+ dataLabel->SetText("12月22号");
+ dataLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+ dataLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ dataLabel->SetRollSpeed(0);
+ dataLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ mainSweepClock->Add(dataLabel);
+ dataLabel->SetVisible(true);
+
+ if (weekLabel == nullptr) {
+ weekLabel = new UILabel();
+ }
+ weekLabel->SetPosition(194, 395); // widget's left position and top position
+ weekLabel->Resize(200, 60); // widget's width and height
+ weekLabel->SetViewId("weekday");// Set style
+ weekLabel->SetStyle(STYLE_TEXT_FONT, 26);
+ weekLabel->SetStyle(STYLE_LINE_HEIGHT, 30);
+ weekLabel->SetText("星期五");
+ weekLabel->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+ weekLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ weekLabel->SetRollSpeed(0);
+ weekLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 26);
+
+ mainSweepClock->Add(weekLabel);
+ weekLabel->SetVisible(true);
+#endif
return true;
}
bool MainClockView::InitCenterCircleView(void)
{
+#if 0
bigCircle = new Image();
if (bigCircle == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bigCircle new fail");
if (LoadClockImage(smallCircle, CLOCK_CIRCLE_IMAGE_PATH) == false) {
return false;
}
+#endif
return true;
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "secondHand new fail");
return false;
}
- if (LoadClockImage(secondHand, CLOCK_SECONDHAND) == false) {
+ if (LoadClockImage(secondHand, CLOCK_SECOND) == false) {
return false;
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "minuteHand new fail");
return false;
}
- if (LoadClockImage(minuteHand, CLOCK_MINUTEHAND) == false) {
+ if (LoadClockImage(minuteHand, CLOCK_MINUTE) == false) {
return false;
}
hourHand = new Image();
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hourHand new fail");
return false;
}
- if (LoadClockImage(hourHand, CLOCK_HOURHAND) == false) {
+ if (LoadClockImage(hourHand, CLOCK_HOUR) == false) {
return false;
}
-
+#if 0
hand24Hour = new Image();
if (hand24Hour == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "hand24Hour new fail");
if (LoadClockImage(hand24Hour, CLOCK_HAND24HOUR_IMAGE_PATH) == false) {
return false;
}
+#endif
return true;
}
}
curFace->SetPosition(0, 0);
- if (LoadClockImage(curFace, CLOCK_MAIN_FACE_IMAGE) == false) {
+ if (LoadClockImage(curFace, CLOCK_CLASSIC_GEOMETRY) == false) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "curFace LoadClockImage CLOCK_MAIN_FACE_IMAGE fail");
return false;
}
-
+ InitLabelView();
+#if 0
if (InitLabelView() == false) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "InitLabelView() fail");
return false;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "progress LoadClockImage CLOCK_PROGRESS_IMAGE_PATH fail");
return false;
}
-
+#endif
InitHandView();
+#if 0
weekDay = new UIImageView();
if (weekDay == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "weekDay new fail");
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "weekDay LoadClockImage CLOCK_THURSDAY_IMAGE_PATH fail");
return false;
}
+#endif
return true;
}
}
mainSweepClock->Add(curFace);
+ mainSweepClock->Add(weekLabel);
+ mainSweepClock->Add(dataLabel);
+ mainSweepClock->Add(batteryLabel);
+#if 0
mainSweepClock->Add(stepLabel);
mainSweepClock->Add(heartRate);
mainSweepClock->Add(weekLabel);
mainSweepClock->Add(weekDay);
mainSweepClock->Add(progress);
mainSweepClock->Add(batteryLabel);
+#endif
+
Add(mainSweepClock);
mainSweepClock->SetDragParentInstead(true);
// {214, 3}: position x, y {14, 223}: center x, y
mainSweepClock->SetHandImage(UISweepClock::HandType::SECOND_HAND, *secondHand,
- { POINT_POSITION_X, SECOND_POINT_POSITION_Y }, { POINT_CENTER_X, POINT_CENTER_Y });
+ { SECOND_POINT_POSITION_X, SECOND_POINT_POSITION_Y }, { SECOND_POINT_CENTER_X, SECOND_POINT_CENTER_Y });
mainSweepClock->SetHandImage(UISweepClock::HandType::MINUTE_HAND, *minuteHand,
- { POINT_POSITION_X, POINT_POSITION_Y }, { POINT_CENTER_X, POINT_CENTER_Y });
- mainSweepClock->SetHandImage(UISweepClock::HandType::HOUR_HAND, *hourHand, { POINT_POSITION_X, POINT_POSITION_Y },
- { POINT_CENTER_X, POINT_CENTER_Y });
+ { MINUTE_POINT_POSITION_X, MINUTE_POINT_POSITION_Y }, { MINUTE_POINT_CENTER_X, MINUTE_POINT_CENTER_Y });
+ mainSweepClock->SetHandImage(UISweepClock::HandType::HOUR_HAND, *hourHand, { HOUR_POINT_POSITION_X, HOUR_POINT_POSITION_Y },
+ { HOUR_POINT_CENTER_X, HOUR_POINT_CENTER_Y });
+#if 0
mainSweepClock->SetHandCircleImage(UISweepClock::HandType::SECOND_HAND, *smallCircle,
{ SMALLCIRCLE_POSITION_X, SMALLCIRCLE_POSITION_Y });
mainSweepClock->SetHandCircleImage(UISweepClock::HandType::MINUTE_HAND, *medCircle,
{ MEDCIRCLE_POSITION_X, MEDCIRCLE_POSITION_Y });
mainSweepClock->SetHandCircleImage(UISweepClock::HandType::HOUR_HAND, *bigCircle,
{ BIGCIRCLE_POSITION_X, BIGCIRCLE_POSITION_Y });
-
+#endif
mainSweepClock->SetInitTime24Hour(0, 0, 0);
mainSweepClock->SetWorkMode(UISweepClock::WorkMode::NORMAL);
InitDateTime();
void MainClockView::RefreshStep(int step)
{
+#if 0
char stepChar[STEP_CHAR_NUM] = {0};
(void)sprintf_s(stepChar, STEP_CHAR_NUM, "%d", step);
stepLabel->SetText(stepChar);
+#endif
}
void MainClockView::RefreshHeartRate(int value)
{
+#if 0
if (value == 0) {
heartRateLabel->SetText("--");
return;
(void)sprintf_s(heartRateChar, STEP_CHAR_NUM, "%d", value);
heartRateLabel->SetText(heartRateChar);
+#endif
}
void MainClockView::InitDateTime(void)