-c0389db02554db67956ab00cc608f7b642d47418
\ No newline at end of file
+5ffc4a57daf22835d2856aed71e3023a8c64c0ab
\ No newline at end of file
-C:\Users\caiking\project\1.haisi\FD230\code\sdk\tools\pkg\fwpkg\brandy\upload_app.fwpkg
\ No newline at end of file
+D:\work\haisi\FD230\code\sdk\tools\pkg\fwpkg\brandy\upload_app.fwpkg
\ No newline at end of file
-{"serialPortValue":"COM8","baudRateValue":"500000","stopBitValue":"0","verifyTypeValue":"0"}
\ No newline at end of file
+{"serialPortValue":"COM7","baudRateValue":"1000000","stopBitValue":"0","verifyTypeValue":"0"}
\ No newline at end of file
monitor_port =
monitor_speed = 115200
analysis_compiler_path = ./software/code/sdk/tools/bin/compiler/linx/linx_170/linx-llvm-binary-debug/linx-llvm-binary-release-win-musl/bin/riscv32
-compiler_bin_path = C:\Users\caiking\my_app\DevTools_CFBB_V1.0.6
+compiler_bin_path = D:\tool\DevTools_CFBB_V1.0.6
custom_build_command = brandy-native-js -release -nhso
analysis_rec_stats = 1
analysis_mode = 0
"DevEcoDebugInitPath": "${workspaceRoot}/.deveco/.debug-cache/brandy",
"servertype": "jlink",
"name": "brandy: DevEco GDB Launch",
- "executable": "C:/Users/caiking/project/1.haisi/FD230/./software/code/sdk/output/brandy/acore/brandy-liteos/application.elf",
- "toolchainBinDir": "C:/Users/caiking/my_app/DevTools_CFBB_V1.0.6/cc_riscv32_win_env",
+ "executable": "D:/work/haisi/FD230/./software/code/sdk/output/brandy/acore/brandy-liteos/application.elf",
+ "toolchainBinDir": "D:/tool/DevTools_CFBB_V1.0.6/cc_riscv32_win_env",
"projectEnvName": "brandy",
- "coreDir": "C:/Users/caiking/my_app/DevEco-Device-Tool/core",
+ "coreDir": "D:/tool/DevEco-Device-Tool/core",
"preLaunchTask": "deveco: run debug server - brandy",
"internalConsoleOptions": "openOnSessionStart"
},
"DevEcoDebugInitPath": "${workspaceRoot}/.deveco/.debug-cache/brandy",
"servertype": "jlink",
"name": "brandy: DevEco GDB Attach",
- "executable": "C:/Users/caiking/project/1.haisi/FD230/./software/code/sdk/output/brandy/acore/brandy-liteos/application.elf",
- "toolchainBinDir": "C:/Users/caiking/my_app/DevTools_CFBB_V1.0.6/cc_riscv32_win_env",
+ "executable": "D:/work/haisi/FD230/./software/code/sdk/output/brandy/acore/brandy-liteos/application.elf",
+ "toolchainBinDir": "D:/tool/DevTools_CFBB_V1.0.6/cc_riscv32_win_env",
"projectEnvName": "brandy",
- "coreDir": "C:/Users/caiking/my_app/DevEco-Device-Tool/core",
+ "coreDir": "D:/tool/DevEco-Device-Tool/core",
"preLaunchTask": "deveco: run debug server - brandy",
"internalConsoleOptions": "openOnSessionStart"
}
"problemMatcher": [
"$deveco"
],
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"run",
"--target",
"clean",
"--project-dir",
- "C:\\Users\\caiking\\project\\1.haisi\\FD230",
+ "D:\\work\\haisi\\FD230",
"--environment",
"brandy"
]
"problemMatcher": [
"$deveco"
],
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"run",
"--project-dir",
- "C:\\Users\\caiking\\project\\1.haisi\\FD230",
+ "D:\\work\\haisi\\FD230",
"--environment",
"brandy"
]
"problemMatcher": [
"$deveco"
],
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"run",
"--target",
"--target",
"buildprog",
"--project-dir",
- "C:\\Users\\caiking\\project\\1.haisi\\FD230",
+ "D:\\work\\haisi\\FD230",
"--environment",
"brandy"
]
"problemMatcher": [
"$deveco"
],
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"run",
"--target",
"problemMatcher": [
"$deveco"
],
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"run",
"--target",
"upload",
"--project-dir",
- "C:\\Users\\caiking\\project\\1.haisi\\FD230",
+ "D:\\work\\haisi\\FD230",
"--environment",
"brandy"
]
"problemMatcher": [
"$deveco"
],
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"run",
"--target",
"stackAnalysis",
"--project-dir",
- "C:\\Users\\caiking\\project\\1.haisi\\FD230",
+ "D:\\work\\haisi\\FD230",
"--environment",
"brandy"
]
"problemMatcher": [
"$deveco"
],
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"run",
"--target",
"imageAnalysis",
"--project-dir",
- "C:\\Users\\caiking\\project\\1.haisi\\FD230",
+ "D:\\work\\haisi\\FD230",
"--environment",
"brandy"
]
"endsPattern": "^.*Listening\\son\\sTCP/IP\\sport.*"
}
},
- "command": "C:\\Users\\caiking\\my_app\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
+ "command": "D:\\tool\\DevEco-Device-Tool\\core\\deveco-venv\\Scripts\\hos.exe",
"args": [
"debug",
"--interface=server",
static constexpr const char *B024_010_IMAGE_PATH = APP_RES_PATH "/SECONDHAND.bin";
static constexpr const char *B024_011_IMAGE_PATH = APP_RES_PATH "/MINUTEHAND.bin";
static constexpr const char *ALARM_ADD_BUTTON_PATH = APP_RES_PATH "/BLUE_ADD.bin";
+ static constexpr const char *ALARM_ADD_BUTTON_PATH_IMAGE = APP_RES_PATH "/ALARM_ADD_BACKGROUND.bin"; //闹钟增加背景图片
static constexpr const char *ALARM_CLOCK_CLOSE_ADD_PATH = APP_RES_PATH "/CLOSE_RING_CLOCK.bin";
static constexpr const char *ALARM_CLOCK_ADD_PATH = APP_RES_PATH "/POP_UP_CLOCK.bin";
static constexpr const char *ALARM_CLOCK_POP_ADD_PATH = APP_RES_PATH "/RING_CLOCK.bin";
#include "blood/include/BloodCheckView.h"
#include "blood/include/BloodShowPresenter.h"
#include "blood/include/BloodShowView.h"
-#include "blood/include/BloodErrorView.h"
-#include "blood/include/BloodErrorPresenter.h"
+//#include "blood/include/BloodErrorView.h"
+//#include "blood/include/BloodErrorPresenter.h"
#include "dial/include/DialPresenter.h"
#include "dial/include/DialView.h"
#include "displaybrightness/include/DisplayBrightnessPresenter.h"
#include "components/ui_view_group.h"
#include "components/ui_checkbox.h"
#include "components/ui_image_view.h"
+#include "components/ui_label_button_ext.h"
#include "gfx_utils/graphic_types.h"
#include "components/ui_button.h"
#include "components/ui_label_button.h"
namespace OHOS {
constexpr char* EVERY_DAY = (char *)"每天";
constexpr char* DO_NOT_REPEAT = (char *)"不重复";
-
+constexpr char* WORK_DAY =(char *)"工作日";
constexpr char* MON_DAY = (char *)"一 ";
constexpr char* TUE_DAY = (char *)"二 ";
constexpr char* WED_DAY = (char *)"三 ";
constexpr char* ALARM_CLOCK_FIVE = (char *)"alarmclock4";
constexpr char* ALARM_CLOCK_SIX = (char *)"alarmclock5";
+constexpr char* ALARM_LABELBUTTON_ONE = (char *)"alarmlabelbutton0";
+constexpr char* ALARM_LABELBUTTON_TWO = (char *)"alarmlabelbutton1";
+constexpr char* ALARM_LABELBUTTON_THREE = (char *)"alarmlabelbutton2";
+constexpr char* ALARM_LABELBUTTON_FOUR = (char *)"alarmlabelbutton3";
+constexpr char* ALARM_LABELBUTTON_FIVE = (char *)"alarmlabelbutton4";
+constexpr char* ALARM_LABELBUTTON_SIX = (char *)"alarmlabelbutton5";
+
constexpr int16_t SET_SIX = 6;
constexpr char* ALARM_STATUS[6] = {ALARM_STATUS_ONE, ALARM_STATUS_TWO, ALARM_STATUS_THREE, // 闹钟按钮最大个数为6个
constexpr char* ALARM_CLOCK[6] = {ALARM_CLOCK_ONE, ALARM_CLOCK_TWO, ALARM_CLOCK_THREE, // 闹钟个数最大个数为6个
ALARM_CLOCK_FOUR, ALARM_CLOCK_FIVE, ALARM_CLOCK_SIX};
constexpr char* WEEK_CONTAINER[7] = {SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY}; // 日期按钮最大个数为7个
-
+constexpr char* ALARM_LABELBUTTON[6] ={ALARM_LABELBUTTON_ONE,ALARM_LABELBUTTON_TWO,ALARM_LABELBUTTON_THREE,ALARM_LABELBUTTON_FOUR,ALARM_LABELBUTTON_FIVE,ALARM_LABELBUTTON_SIX};
typedef enum {
MAIN_INTERFACE = 0,
CHANGE_INTERFACE_CONFIG,
class MainAlarmView;
class AlarmPresenter : public Presenter<MainAlarmView>, public UIView::OnClickListener,
- public UITimePicker::SelectedListener, public UIView::OnDragListener {
+ public UITimePicker::SelectedListener, public UIView::OnDragListener,public UIView::OnLongPressListener {
public:
AlarmPresenter();
+ AlarmPresenter(UILabelButton * lb){
+ m_lb = lb;
+ }
virtual ~AlarmPresenter();
void OnStart() override;
void OnPause() override;
ColorType ShadowBlue(void);
bool OnClick(UIView &view, const ClickEvent &event) override;
bool OnDrag(UIView& view, const DragEvent& event) override;
+ bool OnLongPress(UIView& view, const LongPressEvent& event) override;
bool ClickFuncId(const char *buttonName);
bool ClickFuncView(UIView &view);
void OnTimePickerStoped(UITimePicker &picker) override;
uint16_t clockQty{0};
int16_t interListener;
bool buttonStratus = true;
+ UILabelButton* m_lb = nullptr;
};
}
#endif
\ No newline at end of file
#include "AlarmNewTimeView.h"
#include "AlarmMaxClock.h"
#include "AlarmClockModel.h"
-
+#include "components/ui_label_button.h"
namespace OHOS {
constexpr int16_t D_CLOCK_Y = 210;
constexpr int16_t LABEL_ZERO_Y = 270;
void ChangeView(int16_t hideView, int16_t showView);
void DropView(UIView& view);
void CreateImage();
+ void CreateLabel();
void RefreshAlarm(void);
bool ChangeMainAlarm(int16_t thisView);
bool ChangeConfig(int16_t thisView);
AlarmNewTimeView *newTimeView{nullptr};
AlarmMaxClock *maxClockView{nullptr};
UIScrollView *group{nullptr};
- UIToggleButton *statusButton[6]{nullptr}; // 6代表界面中最多存在六个按键
+ UILabel *label = nullptr;
+ /* -------------------------------------------------------------------------- */
UIImageView *addButton{nullptr};
- UIDigitalClock *dClock[6]{nullptr}; // 6代表界面中最多存在六个闹钟
- UILabel *dLabel[6]{nullptr}; // 6代表界面中显示闹钟日期的控件个数
+ UIImageView *dImageViewBackGround[6]{nullptr}; //6代表界面中最多存在6个闹钟背景图片
+ UIToggleButton *statusButton[6]{nullptr}; // 6代表界面中最多存在六个按键
+ UIDigitalClock *dClock[6]{nullptr}; //6代表界面中最多存在六个闹钟
+ UILabel *dLabel[6]{nullptr}; //6代表界面中显示闹钟日期的控件个数
+ UILabelButton *dLabelButton[6]{nullptr}; //6代表界面中最多存在6个标签按钮
+ /* -------------------------------------------------------------------------- */
UIScrollView *container[7]{nullptr}; // 7代表容器存有主界面以及跳转的四个副界面,用于跳转后显示或隐藏界面
uint8_t alarmHour, alarmMin;
int8_t dClockNum{-1};
int16_t weekStatus{-1};
- int16_t alarmPositionY{D_CLOCK_Y};
- int16_t labelPositionY{LABEL_ZERO_Y};
- int16_t alarmInterval{ALARM_INTER_ADD};
+ int16_t alarmPositionY{D_CLOCK_Y}; //210
+ int16_t alarmInterval{ALARM_INTER_ADD};//150
bool reflashStatus{false};
};
} // namespace OHOS
constexpr char *ALARM_CLOCK_DATA_PATH = (char *)"/user/res/alarm.bin";
constexpr char *ALARM_CLOCK_DIRECTORY = (char *)"/user/res/";
constexpr int ALARM_CLOCK_MAX = 5;
-constexpr uint8_t DELAY_TEM_MIN = 10;
+constexpr uint8_t DELAY_TEM_MIN = 5; //延时时间为5分钟
constexpr uint16_t CLOCK_FOUR = 4;
constexpr uint16_t CLOCK_MAX = 5;
constexpr uint16_t CLOCK_MUSIC_SET = 1;
constexpr int16_t MAX_DEFAULT_LIT_FONT2_LEN = 40;
constexpr int16_t MAX_BACK_BUTTON_HEIGHT_LEN = 64;
constexpr int16_t MAX_FONT_DEFAULT_SIZE_LEN = 24;
-constexpr int16_t MAX_DELETE_BUTTON_W_LEN = 320;
+constexpr int16_t MAX_DELETE_BUTTON_W_LEN = 466;
constexpr int16_t LABEL_DAY_WIDTH = 320;
constexpr int16_t MAX_DELETE_BUTTON_H_LEN = 100;
-constexpr int16_t MAX_DELETE_BUTTON_X_LEN = 63;
-constexpr int16_t MAX_DELETE_BUTTON_Y_LEN = 365;
+constexpr int16_t MAX_DELETE_BUTTON_X_LEN = 0;
+constexpr int16_t MAX_DELETE_BUTTON_Y_LEN = 366;
constexpr int16_t MAX_IMAGE_CHANGE_X_LEN = 370;
constexpr int16_t MAX_IMAGE_CHANGE1_Y_LEN = 210;
constexpr int16_t MAX_IMAGE_CHANGE2_Y_LEN = 350;
namespace OHOS {
#ifndef NEW_TIME
-#define NEW_TIME "设置时间"
+#define NEW_TIME "时间"
#endif
#define NEXT "下一步"
static AlarmNewTimeView *g_pAlarmNewTimeView = nullptr;
constexpr int16_t CONTAINER_X = 0;
constexpr int16_t CONTAINER_Y = 0;
-constexpr int16_t TITLE_X = 153;
-constexpr int16_t TITLE_Y = 30;
-constexpr int16_t TIME_PICKER_X = 75;
+constexpr int16_t TITLE_X = 203;
+constexpr int16_t TITLE_Y = 52;
+constexpr int16_t TIME_PICKER_X = 90;
+constexpr int16_t TIME_PICKER_Y = 138;
constexpr int16_t TIME_PICKER_WIDTH = 250;
constexpr int16_t TIME_ITEM_HEIGHT = 80;
-constexpr int16_t TIME_LABEL_BUTTON_X = 63;
-constexpr int16_t TIME_LABEL_BUTTON_Y = 360;
+constexpr int16_t TIME_LABEL_BUTTON_X = 0;
+constexpr int16_t TIME_LABEL_BUTTON_Y = 366;
constexpr int16_t LABEL_X = 0;
constexpr int16_t LABEL_Y = 45;
constexpr int16_t LABEL_BLANK = 38;
-constexpr int16_t LIST_W = 300;
-constexpr int16_t LIST_H = 260;
+constexpr int16_t LIST_W = 286;
+constexpr int16_t LIST_H = 180;
constexpr int16_t TITLE_LABEL_DEFAULT_HEIGHT = 50;
-constexpr int16_t BUTTON_WIDHT3 = 324;
-constexpr int16_t BUTTON_HEIGHT3 = 101;
+constexpr int16_t BUTTON_WIDHT3 = 466;
+constexpr int16_t BUTTON_HEIGHT3 = 100;
constexpr int16_t PICKER_FONT_SIZE = 25;
constexpr uint8_t BACKGROUND_FONT = 40;
constexpr uint8_t HIGHTLIGHT_FONT = 50;
-constexpr uint16_t LABEL_FONT = 40;
+constexpr uint16_t LABEL_FONT = 30;
AlarmNewTimeView::AlarmNewTimeView()
{
return;
}
picker->EnableSecond(false);
- picker->SetPosition(TIME_PICKER_X, LABEL_Y + LABEL_BLANK, LIST_W, LIST_H); // 652: x-coordinate
+ picker->SetPosition(TIME_PICKER_X, TIME_PICKER_Y, LIST_W, LIST_H); // 652: x-coordinate
picker->SetItemHeight(TIME_ITEM_HEIGHT);
picker->SetLoopState(0, true);
picker->SetLoopState(1, true);
{ALARM_CLOCK[FOURTH_ALARM], &AlarmPresenter::ClickAlarmClock},
{ALARM_CLOCK[FIVE_ALARM], &AlarmPresenter::ClickAlarmClock},
{ALARM_CLOCK[SIX_ALARM], &AlarmPresenter::ClickAlarmClock},
+ // {ALARM_LABELBUTTON[0],&AlarmPresenter::ClickAlarmClockDelete},
+ // {ALARM_LABELBUTTON[1],&AlarmPresenter::ClickJudgeDelete},
+ // {ALARM_LABELBUTTON[2],&AlarmPresenter::ClickAlarmTimeOk},
+ // {ALARM_LABELBUTTON[3],&AlarmPresenter::ClickAlarmNewTime},
+ // {ALARM_LABELBUTTON[4],&AlarmPresenter::ClickAlarmNext},
+ // {ALARM_LABELBUTTON[5],&AlarmPresenter::ClickAlarmWeekOk},
};
bool AlarmPresenter::ClickFuncId(const char *buttonName)
alarmWeek[num] = alarmWeek[num] ? CANCEL_DATA: SELECT_DATA;
if(alarmWeek[num] == CANCEL_DATA) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "alarmWeek[num] = %u", alarmWeek[num]);
- view.SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- dynamic_cast<UIButton &>(view).SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full,
+ view.SetStyle(STYLE_BACKGROUND_COLOR,Color::GetColorFromRGB(0x19, 0x19, 0x19).full);
+ dynamic_cast<UIButton &>(view).SetStyleForState(STYLE_BACKGROUND_COLOR,Color::GetColorFromRGB(0x19, 0x19, 0x19).full,
UIButton::PRESSED);
} else if (alarmWeek[num] == SELECT_DATA) {
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "alarmWeek[num] = %u", alarmWeek[num]);
- view.SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
- dynamic_cast<UIButton &>(view).SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full,
+ view.SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
+ dynamic_cast<UIButton &>(view).SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full,
UIButton::PRESSED);
}
}
if (jug == false) {
ClickFuncView(view);
}
+ if(strcmp(view.GetViewId(),ALARM_LABELBUTTON[0]) == 0)
+ {
+ printf("1111\n");
+ m_lb->SetStyle(STYLE_BACKGROUND_COLOR, 0xff292929);
+ m_lb->SetText("编辑");
+ //NativeAbility::GetInstance().ChangeSlice();
+ }
return true;
}
return true;
}
+bool AlarmPresenter::OnLongPress(UIView &view, const LongPressEvent &event)
+{
+ printf("2222\n");
+ m_lb->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff5a36);
+ m_lb->SetText("删除");
+ return true;
+}
}
\ No newline at end of file
#include "PhoneService.h"
namespace OHOS {
-#define RING_AGAIN "响铃将在十分钟后再次响起"
+#define RING_AGAIN "响铃将在五分钟后再次响起"
osTimerId_t g_stopAlarmRingHandle = NULL;
static AlarmRingView *g_pAlarmRingView = nullptr;
#include <string>
namespace OHOS {
-#define SET_THIS_TIME "设置时间"
+#define SET_THIS_TIME "时间"
#define SURE "确认"
static AlarmSetTimeView *g_pAlarmSetTimeView = nullptr;
constexpr int16_t CONTAINER_X = 0;
constexpr int16_t CONTAINER_Y = 0;
-constexpr int16_t TITLE_X = 153;
-constexpr int16_t TITLE_Y = 30;
+constexpr int16_t TITLE_X = 203;
+constexpr int16_t TITLE_Y = 52;
constexpr int16_t LABEL_X = 0;
constexpr int16_t LABEL_Y = 30;
constexpr int16_t LABEL_FONT = 40;
-constexpr int16_t TIME_PICKER_X = 75;
+constexpr int16_t TIME_PICKER_X = 90;
+constexpr int16_t TIME_PICKER_Y = 138;
constexpr int16_t TIME_PICKER_WIDTH = 250;
constexpr int16_t TIME_ITEM_HEIGHT = 80;
-constexpr int16_t TIME_LABEL_BUTTON_X = 63;
-constexpr int16_t TIME_LABEL_BUTTON_Y = 360;
+constexpr int16_t TIME_LABEL_BUTTON_X = 0;
+constexpr int16_t TIME_LABEL_BUTTON_Y = 366;
constexpr int16_t LABEL_BLANK = 38;
-constexpr int16_t LIST_W = 300;
-constexpr int16_t LIST_H = 250;
+constexpr int16_t LIST_W = 286;
+constexpr int16_t LIST_H = 180;
constexpr int16_t TITLE_LABEL_DEFAULT_HEIGHT = 50;
-constexpr int16_t BUTTON_WIDHT3 = 320;
-constexpr int16_t BUTTON_HEIGHT3 = 101;
+constexpr int16_t BUTTON_WIDHT3 = 466;
+constexpr int16_t BUTTON_HEIGHT3 = 100;
constexpr int16_t PICKER_FONT_SIZE = 25;
constexpr int16_t LABEL_TIME_FONT = 40;
constexpr uint8_t BACKGROUND_FONT = 40;
return nullptr;
}
picker->EnableSecond(false);
- picker->SetPosition(TIME_PICKER_X, LABEL_Y + LABEL_BLANK, LIST_W, LIST_H); // 652: x-coordinate
+ picker->SetPosition(TIME_PICKER_X, TIME_PICKER_Y, LIST_W, LIST_H); // 652: x-coordinate
picker->SetItemHeight(TIME_ITEM_HEIGHT);
picker->SetBackgroundFont(DEFAULT_VECTOR_FONT_FILENAME, BACKGROUND_FONT);
picker->SetHighlightFont(DEFAULT_VECTOR_FONT_FILENAME, HIGHTLIGHT_FONT);
#include "components/ui_digital_clock.h"
namespace OHOS {
-#define MON "星期一"
-#define TUE "星期二"
-#define WED "星期三"
-#define THUR "星期四"
-#define FRI "星期五"
-#define SAT "星期六"
-#define SUN "æ\98\9fæ\9c\9f天"
+#define MON "一"
+#define TUE "二"
+#define WED "三"
+#define THUR "四"
+#define FRI "五"
+#define SAT "六"
+#define SUN "æ\97¥"
#define RESPEAT "重复"
#define SURE "确认"
static AlarmSetWeekView *g_pAlarmSetWeekView = nullptr;
constexpr int16_t CONTAINER_X = 0;
constexpr int16_t CONTAINER_Y = 0;
-constexpr int16_t DEFAULT_FONT = 40;
+constexpr int16_t DEFAULT_FONT = 30;
constexpr int16_t REBOUND_SIZE = 50;
constexpr int16_t BORDER_WIDTH = 20;
constexpr int16_t SET_ZERO = 0;
-constexpr int16_t TITLE_X = 185;
-constexpr int16_t TITLE_Y = 30;
+constexpr int16_t TITLE_X = 203;
+constexpr int16_t TITLE_Y = 52;
constexpr int16_t LABEL_POSITION_SIZE = 150;
constexpr int16_t VIEW_BORDER_SIZE = 2;
constexpr int16_t BORDER_RADIUS_SIZE = 200;
constexpr int16_t VIEW_BUTTON_X = 100;
constexpr int16_t VIEW_BUTTON_Y = 70;
constexpr int16_t BUTTON_FONT_SIZE = 18;
-constexpr int16_t TIME_LABEL_BUTTON_X = 63;
-constexpr int16_t TIME_LABEL_BUTTON_Y = 360;
-constexpr int16_t BUTTON_WIDHT3 = 320;
-constexpr int16_t BUTTON_HEIGHT3 = 101;
-constexpr int16_t LABEL_WEEK_FONT = 40;
-constexpr int16_t BUTTON_WIDHT = 100;
-constexpr int16_t BUTTON_HEIGHT = 60;
+constexpr int16_t TIME_LABEL_BUTTON_X = 0;
+constexpr int16_t TIME_LABEL_BUTTON_Y = 366;
+constexpr int16_t BUTTON_WIDHT3 = 466;
+constexpr int16_t BUTTON_HEIGHT3 = 100;
+constexpr int16_t LABEL_WEEK_FONT = 30;
+constexpr int16_t BUTTON_WIDHT = 80;
+constexpr int16_t BUTTON_HEIGHT = 80;
constexpr int16_t BUTTON_FONT = 20;
-constexpr int16_t VIEW_POSITION_X = 60;
-constexpr int16_t VIEW_POSITION_X2 = 12;
-constexpr int16_t WEEK_Y1 = 130;
-constexpr int16_t WEEK_Y2 = 210;
-constexpr int16_t WEEK_GAP_X = 112;
-constexpr int16_t BUTTON_STYLE_BORDER_RADIUS_VALUE = 30;
-constexpr int16_t FONT_DEFAULT_SIZE = 30;
+constexpr int16_t VIEW_POSITION_X = 27;
+constexpr int16_t VIEW_POSITION_X2 = 83;
+constexpr int16_t WEEK_Y1 = 135;
+constexpr int16_t WEEK_Y2 = 245;
+constexpr int16_t WEEK_GAP_X = 110;
+constexpr int16_t BUTTON_STYLE_BORDER_RADIUS_VALUE = 100;
+constexpr int16_t FONT_DEFAULT_SIZE = 40;
constexpr int16_t WEEK_MON = 1;
constexpr int16_t WEEK_TUE = 2;
constexpr int16_t WEEK_WED = 3;
labelButton->SetStyleForState(STYLE_BORDER_RADIUS, BUTTON_STYLE_BORDER_RADIUS_VALUE, UIButton::PRESSED);
labelButton->SetStyleForState(STYLE_BORDER_RADIUS, BUTTON_STYLE_BORDER_RADIUS_VALUE, UIButton::INACTIVE);
labelButton->SetStyleForState(STYLE_BORDER_RADIUS, BUTTON_STYLE_BORDER_RADIUS_VALUE, UIButton::RELEASED);
- labelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::RELEASED);
- labelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
- labelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::INACTIVE);
+ labelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0x4fc34c, UIButton::RELEASED);
+ labelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0x4fc34c, UIButton::PRESSED);
+ labelButton->SetStyleForState(STYLE_BACKGROUND_COLOR, 0x4fc34c, UIButton::INACTIVE);
labelButton->SetStyleForState(STYLE_BORDER_WIDTH, VIEW_BORDER_SIZE, UIButton::RELEASED);
labelButton->SetStyleForState(STYLE_BORDER_WIDTH, VIEW_BORDER_SIZE, UIButton::PRESSED);
labelButton->SetStyleForState(STYLE_BORDER_WIDTH, VIEW_BORDER_SIZE, UIButton::INACTIVE);
labelButton->SetStyleForState(STYLE_BORDER_COLOR, Color::White().full, UIButton::RELEASED);
labelButton->SetStyleForState(STYLE_BORDER_COLOR, Color::White().full, UIButton::PRESSED);
labelButton->SetStyleForState(STYLE_BORDER_COLOR, Color::White().full, UIButton::INACTIVE);
- labelButton->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ labelButton->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full);
labelButton->SetStyle(STYLE_BORDER_WIDTH, VIEW_BORDER_SIZE);
labelButton->SetStyle(STYLE_BORDER_COLOR, Color::White().full);
labelButton->Resize(BUTTON_WIDHT, BUTTON_HEIGHT);
void AlarmSetWeekView::CreateWeekButton1(void)
{
- int viewPositionX = VIEW_POSITION_X; // 60 150
+ int viewPositionX = VIEW_POSITION_X; // 27 135
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::AlarmPresenter::GetInstance();
- buttonWeek[WEEK_MON] = CreateUILabelButton(MON, viewPositionX, WEEK_Y1);
+
+ buttonWeek[WEEK_SUN] = CreateUILabelButton(SUN, viewPositionX, WEEK_Y1);// (日,27,135)
+ if (buttonWeek[WEEK_SUN] == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonSun fail");
+ return;
+ }
+ group->Add(buttonWeek[WEEK_SUN]);
+ buttonWeek[WEEK_SUN]->SetOnClickListener(clickListener);
+ buttonWeek[WEEK_SUN]->SetViewId(SUNDAY);
+ viewPositionX += WEEK_GAP_X;
+
+ buttonWeek[WEEK_MON] = CreateUILabelButton(MON, viewPositionX, WEEK_Y1); // (一,137,135)
if (buttonWeek[WEEK_MON] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonMon fail");
return;
buttonWeek[WEEK_MON]->SetViewId(MONDAY);
viewPositionX += WEEK_GAP_X;
- buttonWeek[WEEK_TUE] = CreateUILabelButton(TUE, viewPositionX, WEEK_Y1);
+ buttonWeek[WEEK_TUE] = CreateUILabelButton(TUE, viewPositionX, WEEK_Y1);//(二,247,135)
if (buttonWeek[WEEK_TUE] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonTue fail");
return;
buttonWeek[WEEK_TUE]->SetViewId(TUESDAY);
viewPositionX += WEEK_GAP_X;
- buttonWeek[WEEK_WED] = CreateUILabelButton(WED, viewPositionX, WEEK_Y1);
+ buttonWeek[WEEK_WED] = CreateUILabelButton(WED, viewPositionX, WEEK_Y1); //(三,357,135)
if (buttonWeek[WEEK_WED] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonWed fail");
return;
void AlarmSetWeekView::CreateWeekButton2(void)
{
- int viewPositionX2 = VIEW_POSITION_X2; // 12 210
+ int viewPositionX2 = VIEW_POSITION_X2; // 83 245
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::AlarmPresenter::GetInstance();
- buttonWeek[WEEK_THUR] = CreateUILabelButton(THUR, viewPositionX2, WEEK_Y2);
+ buttonWeek[WEEK_THUR] = CreateUILabelButton(THUR, viewPositionX2, WEEK_Y2); //(四,83,135)
if (buttonWeek[WEEK_THUR] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonThur fail");
return;
buttonWeek[WEEK_THUR]->SetViewId(THURSDAY);
viewPositionX2 += WEEK_GAP_X;
- buttonWeek[WEEK_FRI] = CreateUILabelButton(FRI, viewPositionX2, WEEK_Y2);
+ buttonWeek[WEEK_FRI] = CreateUILabelButton(FRI, viewPositionX2, WEEK_Y2);//(五,193,135)
if (buttonWeek[WEEK_FRI] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonFri fail");
return;
buttonWeek[WEEK_FRI]->SetViewId(FRIDAY);
viewPositionX2 += WEEK_GAP_X;
- buttonWeek[WEEK_SAT] = CreateUILabelButton(SAT, viewPositionX2, WEEK_Y2);
+ buttonWeek[WEEK_SAT] = CreateUILabelButton(SAT, viewPositionX2, WEEK_Y2);//(六,303,135)
if (buttonWeek[WEEK_SAT] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonSat fail");
return;
group->Add(buttonWeek[WEEK_SAT]);
buttonWeek[WEEK_SAT]->SetOnClickListener(clickListener);
buttonWeek[WEEK_SAT]->SetViewId(SATURDAY);
- viewPositionX2 += WEEK_GAP_X;
- buttonWeek[WEEK_SUN] = CreateUILabelButton(SUN, viewPositionX2, WEEK_Y2);
- if (buttonWeek[WEEK_SUN] == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: new buttonSun fail");
- return;
- }
- group->Add(buttonWeek[WEEK_SUN]);
- buttonWeek[WEEK_SUN]->SetOnClickListener(clickListener);
- buttonWeek[WEEK_SUN]->SetViewId(SUNDAY);
}
void AlarmSetWeekView::SetLabelButton(void)
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView::RefreshStep1 buttonMon nullptr error!");
return;
}
- buttonWeek[WEEK_MON]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- buttonWeek[WEEK_MON]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ buttonWeek[WEEK_MON]->SetStyle(STYLE_BACKGROUND_COLOR, 0x191919);
+ buttonWeek[WEEK_MON]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full, UIButton::PRESSED);
if (buttonWeek[WEEK_TUE] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView::RefreshStep1 buttonTue nullptr error!");
return;
}
- buttonWeek[WEEK_TUE]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- buttonWeek[WEEK_TUE]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ buttonWeek[WEEK_TUE]->SetStyle(STYLE_BACKGROUND_COLOR,0x191919);
+ buttonWeek[WEEK_TUE]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full, UIButton::PRESSED);
if (buttonWeek[WEEK_WED] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView::RefreshStep1 buttonWed nullptr error!");
return;
}
- buttonWeek[WEEK_WED]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- buttonWeek[WEEK_WED]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ buttonWeek[WEEK_WED]->SetStyle(STYLE_BACKGROUND_COLOR,0x191919);
+ buttonWeek[WEEK_WED]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full, UIButton::PRESSED);
if (buttonWeek[WEEK_THUR] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView::RefreshStep1 buttonThur nullptr error!");
return;
}
- buttonWeek[WEEK_THUR]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- buttonWeek[WEEK_THUR]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ buttonWeek[WEEK_THUR]->SetStyle(STYLE_BACKGROUND_COLOR, 0x191919);
+ buttonWeek[WEEK_THUR]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full, UIButton::PRESSED);
if (buttonWeek[WEEK_FRI] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView::RefreshStep1 buttonFri nullptr error!");
return;
}
- buttonWeek[WEEK_FRI]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- buttonWeek[WEEK_FRI]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ buttonWeek[WEEK_FRI]->SetStyle(STYLE_BACKGROUND_COLOR, 0x191919);
+ buttonWeek[WEEK_FRI]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full, UIButton::PRESSED);
if (buttonWeek[WEEK_SAT] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView::RefreshStep1 buttonSat nullptr error!");
return;
}
- buttonWeek[WEEK_SAT]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- buttonWeek[WEEK_SAT]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ buttonWeek[WEEK_SAT]->SetStyle(STYLE_BACKGROUND_COLOR, 0x191919);
+ buttonWeek[WEEK_SAT]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full, UIButton::PRESSED);
if (buttonWeek[WEEK_SUN] == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView::RefreshStep1 buttonSun nullptr error!");
return;
}
- buttonWeek[WEEK_SUN]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
- buttonWeek[WEEK_SUN]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::Black().full, UIButton::PRESSED);
+ buttonWeek[WEEK_SUN]->SetStyle(STYLE_BACKGROUND_COLOR, 0x191919);
+ buttonWeek[WEEK_SUN]->SetStyleForState(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x19, 0x19, 0x19).full, UIButton::PRESSED);
}
void AlarmSetWeekView::RefreshSetWeek2(uint8_t week)
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmSetWeekView:: week = %u", week);
if ((week & 0x01) == 1) { // 判断星期天的位数是否为1
- buttonWeek[WEEK_SUN]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ buttonWeek[WEEK_SUN]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
AlarmPresenter::GetInstance()->alarmWeek[WEEK_SUN] = 1;
}
if ((week & 0x02) == 0x02) { // 判断星期一的位数是否为1
- buttonWeek[WEEK_MON]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ buttonWeek[WEEK_MON]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
AlarmPresenter::GetInstance()->alarmWeek[WEEK_MON] = 1;
}
if ((week & 0x04) == 0x04) { // 判断星期二的位数是否为1
- buttonWeek[WEEK_TUE]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ buttonWeek[WEEK_TUE]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
AlarmPresenter::GetInstance()->alarmWeek[WEEK_TUE] = 1;
}
if ((week & 0x08) == 0x08) { // 判断星期三的位数是否为1
- buttonWeek[WEEK_WED]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ buttonWeek[WEEK_WED]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
AlarmPresenter::GetInstance()->alarmWeek[WEEK_WED] = 1;
}
if ((week & 0x10) == 0x10) { // 判断星期四的位数是否为1
- buttonWeek[WEEK_THUR]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ buttonWeek[WEEK_THUR]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
AlarmPresenter::GetInstance()->alarmWeek[WEEK_THUR] = 1;
}
if ((week & 0x20) == 0x20) { // 判断星期五的位数是否为1
- buttonWeek[WEEK_FRI]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ buttonWeek[WEEK_FRI]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
AlarmPresenter::GetInstance()->alarmWeek[WEEK_FRI] = 1;
}
if ((week & 0x40) == 0x40) { // 判断星期六的位数是否为1
- buttonWeek[WEEK_SAT]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x6c, 0xB8, 0xFD).full);
+ buttonWeek[WEEK_SAT]->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(0x4f, 0xc3, 0x4c).full);
AlarmPresenter::GetInstance()->alarmWeek[WEEK_SAT] = 1;
}
}
constexpr int16_t ALARM_CLOCK_HEIGHT = 60;
constexpr int16_t LABEL_HEIGHT = 30;
constexpr int16_t WEEK_LABEL_HEIGHT = 85;
-constexpr int16_t ADD_BUTTON_X = 182;
-constexpr int16_t ADD_BUTTON_Y = 15;
-constexpr int16_t ADD_BUTTON_W = 100;
+constexpr int16_t ADD_BUTTON_X = 38;
+constexpr int16_t ADD_BUTTON_Y = 120;
+constexpr int16_t ADD_BUTTON_W = 390;
constexpr int16_t ADD_BUTTON_H = 100;
+constexpr int16_t dImageViewBackGround_X = 38 ;
+constexpr int16_t dImageViewBackGround_Y = 240;
+constexpr int16_t dImageViewBackGround_W = 390;
+constexpr int16_t dImageViewBackGround_H = 100;
+constexpr int16_t STATUS_BUTTON_X = 80;
+constexpr int16_t STATUS_BUTTON_Y = 153;
+constexpr int16_t STATUS_BUTTON_W = 40;
+constexpr int16_t STATUS_BUTTON_H = 40;
+constexpr int16_t DCLOCK_X = 135;
+constexpr int16_t DCLOCK_Y = 134;
+constexpr int16_t DCLOCK_W = 100;
+constexpr int16_t DCLOCK_H = 47;
+constexpr int16_t D_CLOCK_FONT_SIZE = 40;
+constexpr int16_t D_CLOCK_LABEL_FONT = 25;
+constexpr int16_t D_LABEL_X = 135;
+constexpr int16_t D_LABEL_Y = 181;
+constexpr int16_t D_LABEL_W = 150;
+constexpr int16_t D_LABEL_H = 43;
+constexpr int16_t D_LABELBUTTON_X = 297;
+constexpr int16_t D_LABELBUTTON_Y = 145;
+constexpr int16_t D_LABELBUTTON_W = 100;
+constexpr int16_t D_LABELBUTTON_H = 50;
+constexpr int16_t D_LABELBUTTON_FONT_SIZE = 20;
+constexpr int16_t D_LABELBUTTON_BORDER_RADIUS = 100;
+constexpr int16_t DEFAULT_H = 120 ;
constexpr int16_t ALARM_ONE_Y = 360;
constexpr int16_t ALARM_TWO_Y = 510;
constexpr int16_t ALARM_THREE_Y = 660;
constexpr int16_t LABEL_TWO_Y = 570;
constexpr int16_t LABEL_THREE_Y = 720;
constexpr int16_t LABEL_FOUR_Y = 870;
-constexpr int16_t STATUS_BUTTON_X = 320;
-constexpr int16_t STATUS_BUTTON_Y = 210;
-constexpr int16_t STATUS_BUTTON_W = 90;
-constexpr int16_t STATUS_BUTTON_H = 90;
-constexpr int16_t D_CLOCK_X = 80;
-constexpr int16_t D_CLOCK_FONT_SIZE = 55;
-constexpr int16_t D_CLOCK_LABEL_FONT = 25;
constexpr int16_t POSITION_ADD_Y = 110;
constexpr int16_t POSITION_BUTTON_ADD_Y = 85;
constexpr int16_t LABEL_SEMITRANSPARENT = 128;
judgeView = nullptr;
delete newTimeView;
newTimeView = nullptr;
+ delete label;
+ label = nullptr;
for (int alarmNum = SET_ZERO; alarmNum <= SET_FIVE; alarmNum++) {
+ if (dImageViewBackGround[alarmNum] != nullptr) {
+ delete dImageViewBackGround[alarmNum];
+ dImageViewBackGround[alarmNum] = nullptr;
+ }
+ if (dLabelButton[alarmNum] != nullptr) {
+ delete dLabelButton[alarmNum];
+ dLabelButton[alarmNum] = nullptr;
+ }
if (dClock[alarmNum] != nullptr) {
delete dClock[alarmNum];
dClock[alarmNum] = nullptr;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new addButton fail");
return;
}
- addButton->SetPosition(ADD_BUTTON_X, ADD_BUTTON_Y);
- addButton->SetWidth(ADD_BUTTON_W);
- addButton->SetHeight(ADD_BUTTON_H);
- addButton->SetSrc(ALARM_ADD_BUTTON_PATH);
+ addButton->SetPosition(ADD_BUTTON_X, ADD_BUTTON_Y,ADD_BUTTON_W,ADD_BUTTON_H);
+ addButton->SetSrc(ALARM_ADD_BUTTON_PATH_IMAGE);
addButton->SetViewId(ADD_BUTTON);
addButton->SetTouchable(true);
addButton->SetOnClickListener(clickListener);
group->Add(addButton);
}
+void MainAlarmView::CreateLabel()
+{
+ if (label == nullptr) {
+ label = new UILabel();
+ }
+ label->SetPosition(203, 52);
+ label->Resize(200, 60);
+ label->SetStyle(STYLE_TEXT_FONT, 30);
+ label->SetText("闹钟");
+ label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+ label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ label->SetRollSpeed(0);
+ label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+ // Add to rootView
+ group->Add(label);
+ label->SetVisible(true);
+}
+
+//新增闹钟
void MainAlarmView::NewClockCtl(int16_t alarmNum)
{
+ dImageViewBackGround[alarmNum] =new UIImageView();
+ if(dImageViewBackGround[alarmNum] == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new dImageViewBackGround[alarmNum] fail");
+ return;
+ }
+ if (alarmNum == 0) {
+ dImageViewBackGround[0]->SetPosition(dImageViewBackGround_X , dImageViewBackGround_Y, dImageViewBackGround_W, dImageViewBackGround_H);
+ } else {
+ dImageViewBackGround[alarmNum]->SetPosition(dImageViewBackGround_X, dImageViewBackGround[0]->GetY() + (DEFAULT_H * alarmNum), dImageViewBackGround_W, dImageViewBackGround_H);
+ }
+ dImageViewBackGround[alarmNum]->SetSrc(PNG_SETTING_BACKGROUND_IMAGE);
+ group->Add(dImageViewBackGround[alarmNum]);
+ /* -------------------------------------------------------------------------- */
+ statusButton[alarmNum] = new UIToggleButton();
+ if (statusButton[alarmNum] == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new statusButton[alarmNum] fail");
+ return;
+ }
+ statusButton[alarmNum]->SetViewId(ALARM_STATUS[alarmNum]);
+ if (alarmNum == 0) {
+ statusButton[0]->SetPosition(STATUS_BUTTON_X, STATUS_BUTTON_Y + DEFAULT_H, STATUS_BUTTON_W, STATUS_BUTTON_H);
+ } else {
+ statusButton[alarmNum]->SetPosition(STATUS_BUTTON_X, statusButton[0]->GetY() + (DEFAULT_H * alarmNum),STATUS_BUTTON_W, STATUS_BUTTON_H);
+
+ }
+ statusButton[alarmNum]->SetStyle(STYLE_BACKGROUND_OPA, alarmNum);
+ statusButton[alarmNum]->SetImages(PNG_CHECKBOX_ON_IMAGE,PNG_CHECKBOX_OFF_IMAGE);
+ UICheckBox::OnChangeListener *statusListener{nullptr};
+ statusListener = new AlarmStatusBtnChangeListener(reinterpret_cast<UIView*>(statusButton[alarmNum]));
+ if (statusListener == nullptr) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView::NewStatusButton statusListener nullptr!");
+ return;
+ }
+ statusButton[alarmNum]->SetOnChangeListener((UICheckBox::OnChangeListener *)statusListener);
+ group->Add(statusButton[alarmNum]);
+ /* -------------------------------------------------------------------------- */
UIView::OnClickListener *clockListener = (UIView::OnClickListener *)OHOS::AlarmPresenter::GetInstance();
dClock[alarmNum] = new UIDigitalClock();
if (dClock[alarmNum] == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new dClock fail");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new dClock[alarmNum] fail");
return;
}
dClock[alarmNum]->SetViewId(ALARM_CLOCK[alarmNum]);
dClock[alarmNum]->SetTouchable(true);
dClock[alarmNum]->SetOnClickListener(clockListener);
if (alarmNum == 0) {
- dClock[0]->SetPosition(D_CLOCK_X, alarmPositionY, ALARM_CLOCK_WIDTH, ALARM_CLOCK_HEIGHT);
+ dClock[0]->SetPosition(DCLOCK_X, DCLOCK_Y + DEFAULT_H, DCLOCK_W, DCLOCK_H);
} else {
- dClock[alarmNum]->SetPosition(D_CLOCK_X, dClock[0]->GetY() + (alarmInterval * alarmNum), ALARM_CLOCK_WIDTH, ALARM_CLOCK_HEIGHT);
+ dClock[alarmNum]->SetPosition(DCLOCK_X, dClock[0]->GetY() + (DEFAULT_H * alarmNum), DCLOCK_W, DCLOCK_H);
}
dClock[alarmNum]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, D_CLOCK_FONT_SIZE);
dClock[alarmNum]->SetDisplayMode(UIDigitalClock::DISPLAY_24_HOUR_NO_SECONDS);
group->Add(dClock[alarmNum]);
-
+ /* -------------------------------------------------------------------------- */
dLabel[alarmNum] = new UILabel();
if (dLabel[alarmNum] == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new dLabel fail");
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new dLabel[alarmNum] fail");
return;
}
if (alarmNum == 0) {
- dLabel[0]->SetPosition(D_CLOCK_X, labelPositionY, ALARM_CLOCK_WIDTH, WEEK_LABEL_HEIGHT);
+ dLabel[0]->SetPosition(D_LABEL_X, D_LABEL_Y + DEFAULT_H, D_LABEL_W, D_LABEL_H);
} else {
- dLabel[alarmNum]->SetPosition(D_CLOCK_X, dLabel[0]->GetY() + (alarmInterval * alarmNum), ALARM_CLOCK_WIDTH, WEEK_LABEL_HEIGHT);
+ dLabel[alarmNum]->SetPosition(D_LABEL_X, dLabel[0]->GetY() + (DEFAULT_H * alarmNum), D_LABEL_W, D_LABEL_H);
}
group->Add(dLabel[alarmNum]);
-
- statusButton[alarmNum] = new UIToggleButton();
- if (statusButton[alarmNum] == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new statusButton[alarmNum] fail");
+ /* -------------------------------------------------------------------------- */
+ dLabelButton[alarmNum] = new UILabelButton();
+ if (dLabelButton[alarmNum] == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView:: new dLabelButton[alarmNum] fail");
return;
}
- statusButton[alarmNum]->SetViewId(ALARM_STATUS[alarmNum]);
+
if (alarmNum == 0) {
- statusButton[0]->SetPosition(STATUS_BUTTON_X, alarmPositionY, STATUS_BUTTON_W, STATUS_BUTTON_H);
+ dLabelButton[0]->SetPosition(D_LABELBUTTON_X, D_LABELBUTTON_Y + DEFAULT_H, D_LABELBUTTON_W, D_LABELBUTTON_H);
} else {
- statusButton[alarmNum]->SetPosition(STATUS_BUTTON_X, statusButton[0]->GetY() + (alarmInterval * alarmNum), STATUS_BUTTON_W, STATUS_BUTTON_H);
-
- }
- statusButton[alarmNum]->SetStyle(STYLE_BACKGROUND_OPA, alarmNum);
- UICheckBox::OnChangeListener *statusListener{nullptr};
- statusListener = new AlarmStatusBtnChangeListener(reinterpret_cast<UIView*>(statusButton[alarmNum]));
- if (statusListener == nullptr) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MainAlarmView::NewStatusButton statusListener nullptr!");
- return;
+ dLabelButton[alarmNum]->SetPosition(D_LABELBUTTON_X, dLabelButton[0]->GetY() + (DEFAULT_H * alarmNum), D_LABELBUTTON_W, D_LABELBUTTON_H);
}
- statusButton[alarmNum]->SetOnChangeListener((UICheckBox::OnChangeListener *)statusListener);
- group->Add(statusButton[alarmNum]);
+ dLabelButton[alarmNum]->SetViewId(ALARM_LABELBUTTON[alarmNum]);
+ dLabelButton[alarmNum]->SetStyle(STYLE_BACKGROUND_COLOR, 0xff292929);
+ dLabelButton[alarmNum]->SetStyle(STYLE_BORDER_RADIUS, D_LABELBUTTON_BORDER_RADIUS);
+ dLabelButton[alarmNum]->SetText("编辑");
+ dLabelButton[alarmNum]->SetFont(DEFAULT_VECTOR_FONT_FILENAME, D_LABELBUTTON_FONT_SIZE);
+ dLabelButton[alarmNum]->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xffff5a36, UIButton::PRESSED);
+ dLabelButton[alarmNum]->SetStyleForState(STYLE_BORDER_COLOR, 0xffff5a36, UIButton::PRESSED);
+ dLabelButton[alarmNum]->SetStyleForState(STYLE_BORDER_RADIUS, D_LABELBUTTON_BORDER_RADIUS, UIButton::PRESSED);
+ //Add the CallBack about events
+ UIView::OnClickListener* labelButtonClick = static_cast<UIView::OnClickListener*>(new AlarmPresenter(dLabelButton[alarmNum]));
+ dLabelButton[alarmNum]->SetOnClickListener(labelButtonClick);
+ UIView::OnLongPressListener* labelButtonLongPress = static_cast<UIView::OnLongPressListener*>(new AlarmPresenter(dLabelButton[alarmNum]));
+ dLabelButton[alarmNum]->SetOnLongPressListener(labelButtonLongPress);
+ //Add to rootView
+ group->Add(dLabelButton[alarmNum]);
+ dLabelButton[alarmNum]->SetVisible(true);
+ /* -------------------------------------------------------------------------- */
}
void MainAlarmView::LabelGetWeek(uint8_t week, int16_t alarmNum)
}
group->SetPosition(CONTAINER_X, CONTAINER_Y, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
UIView::OnClickListener *clickListener = (UIView::OnClickListener *)OHOS::AlarmPresenter::GetInstance();
+ CreateLabel();
CreateImage();
group->SetTouchable(true);
}
group->ScrollBy(0, ADD_BUTTON_Y - addButton->GetY());
if (dClockNum > (i - 1)) {
+ group->Remove(dImageViewBackGround[dClockNum]);
+ delete dImageViewBackGround[dClockNum];
+ dImageViewBackGround[dClockNum] = nullptr;
+
+ group->Remove(dLabelButton[dClockNum]);
+ delete dLabelButton[dClockNum];
+ dLabelButton[dClockNum] = nullptr;
+
group->Remove(dClock[dClockNum]);
delete dClock[dClockNum];
dClock[dClockNum] = nullptr;
playersView->PlayerModelButtonSetSrc(PLAYER_PLAYERSMODEL_SEQUENCE); // 顺序
break;
case REPEATS:
- playersView->PlayerModelButtonSetSrc(PLAYER_PLAYERSMODEL_REPEATS); // 重复
+ playersView->PlayerModelButtonSetSrc(PLAYER_PLAYERSMODEL_REPEATS); //
break;
case RANDOM:
playersView->PlayerModelButtonSetSrc(PLAYER_PLAYERSMODEL_RANDOM); // 随机