namespace OHOS {
static const int DIR_MASK=0xfff00000;
static const int PNG_MASK=0x000fffff;
- static const int CLOCK_BIGCIRCLE_IMAGE_PATH = 0x100001;
- static const int CLOCK_CIRCLE_IMAGE_PATH = 0x100002;
- static const int CLOCK_FIRDAY_IMAGE_PATH = 0x100003;
- static const int CLOCK_HAND24HOUR_IMAGE_PATH = 0x100004;
- static const int CLOCK_HEARTRATE_IMAGE_PATH = 0x100005;
- static const int CLOCK_HOURHAND = 0x100006;
- static const int CLOCK_MAIN_FACE_IMAGE = 0x100007;
- static const int CLOCK_MEDCIRCLE_IMAGE_PATH = 0x100008;
- static const int CLOCK_MINUTEHAND = 0x100009;
- static const int CLOCK_MONDAY_IMAGE_PATH = 0x10000a;
- static const int CLOCK_PROGRESS_IMAGE_PATH = 0x10000b;
- static const int CLOCK_SATURDAY_IMAGE_PATH = 0x10000c;
- static const int CLOCK_SECONDHAND = 0x10000d;
- static const int CLOCK_SHOE_IMAGE = 0x10000e;
- static const int CLOCK_SMALLCIRCLE_IMAGE_PATH = 0x10000f;
- static const int CLOCK_SUNDAY_IMAGE_PATH = 0x100010;
- static const int CLOCK_THURSDAY_IMAGE_PATH = 0x100011;
- static const int CLOCK_TUESDAY_IMAGE_PATH = 0x100012;
- static const int CLOCK_WEDNESDAY_IMAGE_PATH = 0x100013;
+ static const int CLOCK_CLASSIC_GEOMETRY = 0x100001;
+ static const int CLOCK_HOUR = 0x100002;
+ static const int CLOCK_MINUTE = 0x100003;
+ static const int CLOCK_SECOND = 0x100004;
static const int COMPASS_COMPASS = 0x200001;
static const int COMPASS_CORRESPONDENCE_DEGREE = 0x200002;
static const int COMPASS_ROTATE_CENTER_IMAGE = 0x200003;
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
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;
}
+#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;
}
return false;
}
+
mainSweepClock->Add(curFace);
+#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)