png/pedometer/icon_goal.png
png/pedometer/icon_bodyweight.png
png/pedometer/icon_bodyheight.png
- png/pedometer/icon_cancel.png
- png/pedometer/icon_ok.png
+ #png/pedometer/icon_cancel.png
+ #png/pedometer/icon_ok.png
png/pedometer/icon_cal.png
png/pedometer/icon_step.png
png/pedometer/icon_distance.png
* GLOBAL FUNCTION
**********************/
#ifdef __MMI_ZHSX_SUPPORT__
-static char city_buff[MMI_WEATHER_CITY_NAME_LEN_MAX] = {0};
static app_adaptor_weather_t s_weather_info = {0};
void mmi_weather_info_set(app_adaptor_weather_t * weather)
{
- s_weather_info.weather_id = weather->weather_id;
- s_weather_info.current_temperature = weather->current_temperature;
- s_weather_info.lowest_temperature = weather->lowest_temperature;
- s_weather_info.highest_temperature = weather->highest_temperature;
- _lv_memcpy(s_weather_info.city, weather->city, MMI_WEATHER_CITY_NAME_LEN_MAX);
+ if(0 != strlen(weather->city))
+ {
+ _lv_memcpy(&s_weather_info, weather, sizeof(app_adaptor_weather_t));
+ }
}
void app_adaptor_get_weather_req(app_adaptor_weather_t * weather)
{
#ifdef __MMI_ZHSX_SUPPORT__
- s_weather_info.city = city_buff;
if(0 != strlen(s_weather_info.city))
{
_lv_memcpy(weather, &s_weather_info, sizeof(app_adaptor_weather_t));
}
+ else
+ {
+ _lv_memset_00(weather, sizeof(app_adaptor_weather_t));
+ }
#else
static uint8_t dummy_read_count = 1;
/**************************Pedometer ********************/
+#ifdef __MMI_ZHSX_SUPPORT__
+static nv_watch_pedometer_step_t s_pedometer_data = {0};
+uint32_t s_sensor_last_steps = 0;
+
+uint8_t asl_pedometer_sensor_id_get(void)
+{
+ return 0;
+}
+
+void asl_pedometer_poweron_on_init(void)
+{
+ hal_rtc_t today;
+ Hal_Rtc_Gettime(&today);
+
+ nv_pedometer_step_data_get(&s_pedometer_data);
+ if (today.tm_mday != s_pedometer_data.date.tm_mday)
+ {
+ memset(&s_pedometer_data, 0x0, sizeof(nv_watch_pedometer_step_t));
+ memcpy(&(s_pedometer_data.date), &today, sizeof(hal_rtc_t));
+ nv_pedometer_step_data_save(&s_pedometer_data);
+ }
+}
+
+uint32_t asl_pedometer_steps_get(void)
+{
+ return s_pedometer_data.step;
+}
+
+void asl_pedometer_steps_save(void)
+{
+ hal_rtc_t date = {0};
+ uint32_t steps = get_xmotion_steps();
+
+ Hal_Rtc_Gettime(&date);
+ memcpy(&(s_pedometer_data.date), &date, sizeof(hal_rtc_t));
+
+ printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d\n", __FUNCTION__, __LINE__, s_pedometer_data.step, steps, s_sensor_last_steps);
+
+ s_pedometer_data.step += steps - s_sensor_last_steps;
+ s_sensor_last_steps = steps;
+
+ nv_pedometer_step_data_save(&s_pedometer_data);
+}
+
+void asl_pedometer_steps_clear(void)
+{
+ s_sensor_last_steps = 0;
+ memset(&s_pedometer_data, 0x0, sizeof(nv_watch_pedometer_step_t));
+ nv_pedometer_step_data_save(&s_pedometer_data);
+
+ hal_xmotion_steps_clear();
+}
+
+void asl_pedometer_xyz_get(int16_t *x, int16_t *y, int16_t *z)
+{
+ return ;
+}
+
+#else
+
uint8_t asl_pedometer_sensor_id_get(void)
{
#if USE_BT_SENSOR_HUB
#endif
}
+#endif
+
+
/********************************hr_bp_bo **********************/
#if 0
uint16_t asl_HeartRate_hr_value_get(void)
#include <stdbool.h>
#include "app_adaptor_timing_control.h"
+#ifdef __MMI_ZHSX_SUPPORT__
+
+static void * timing_control_timer = NULL;
+static uint8_t s_step_clear_flag = 0;
+
+#define TIMING_TIMER_INTERVAL (20 * 1000) // ms
+
+static void timing_timer_callback(uint32_t param)
+{
+ hal_rtc_t time;
+
+ Hal_Rtc_Gettime(&time);
+
+ printf("[@CHENG_DEBUG][%s][%d]: %d,%d,%d\n", __FUNCTION__, __LINE__, time.tm_hour, time.tm_min, time.tm_sec);
+
+ if(0 == time.tm_min && 0 == time.tm_hour)
+ {
+ if(0 == s_step_clear_flag)
+ {
+ s_step_clear_flag = 1;
+ asl_pedometer_steps_clear();
+ }
+ }
+ else
+ {
+ s_step_clear_flag = 0;
+ }
+
+ asl_pedometer_steps_save();
+
+ uos_timer_stop(timing_control_timer);
+ uos_timer_start(timing_control_timer, MS_TO_TICKS(TIMING_TIMER_INTERVAL), 0, timing_timer_callback, NULL);
+}
+
+void app_adaptor_timing_control_init(void)
+{
+ uos_timer_create(&timing_control_timer);
+ uos_timer_start(timing_control_timer, MS_TO_TICKS(TIMING_TIMER_INTERVAL), 0, timing_timer_callback, NULL);
+}
+
+#else
/**********************
* TYPEDEFS
return;
}
+
+#endif
+
"VoLTE业务未开通,请检查SIM卡并且当前网络已支持VoLTE",
/*weather.c*/
- "æ\97 æ³\95è\8e·å\8f\96数据, 请稍侯",
+ "æ\9a\82æ\97 数据, 请稍侯",
"晴",
"多云",
"小雨",
#if USE_LV_WATCH_APP_ADAPTOR != 0
+#ifdef __MMI_ZHSX_SUPPORT__
+#define MMI_WEATHER_CITY_NAME_LEN_MAX (64)
+#endif
+
enum
{
WATCH_WEATHER_ID_SUNNY = 0,
int8_t highest_temperature;
uint8_t uv;
uint16_t aqi;
+#ifdef __MMI_ZHSX_SUPPORT__
+ char city[MMI_WEATHER_CITY_NAME_LEN_MAX];
+#else
char *city;
+#endif
} app_adaptor_weather_t;
enum {
#ifdef __MMI_ZHSX_SUPPORT__
#include "ui_nvm_interface.h"
-#define MMI_WEATHER_CITY_NAME_LEN_MAX (64)
-
void mmi_weather_info_set(app_adaptor_weather_t * weather);
-
void mmi_health_info_get(nv_watch_health_info_t * health_info);
void mmi_health_info_set(nv_watch_health_info_t * health_info);
#endif
/**********************
* GLOBAL FUNCTIONS
***********************/
+#ifdef __MMI_ZHSX_SUPPORT__
+lv_obj_t * factorymode_reset_create(lv_obj_t * activity_obj)
+{
+ if(NULL == activity_obj)
+ {
+ lv_watch_activity_ext_t activity_ext;
+ memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t));
+ activity_ext.actId = ACT_ID_FACTORY_MODE_RESET;
+ activity_ext.create = factorymode_reset_create;
+ activity_ext.prepare_destory = factorymode_reset_prepare_destory;
+ activity_obj = lv_watch_creat_activity_obj(&activity_ext);
+ if(NULL == activity_obj)
+ return NULL;
+ }
+
+ lv_obj_t * obj = lv_watch_obj_create(activity_obj);
+ if(NULL == obj)
+ return NULL;
+
+ lv_obj_t * label = lv_label_create(obj, NULL);
+ lv_obj_set_size(label, LV_HOR_RES, LV_VER_RES / 6);
+ lv_label_set_text_id(label, WATCH_TEXT_ID_FACTORY_RESET);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20_gray);
+ lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 25);
+
+ lv_obj_t * label_tip = lv_label_create(obj, NULL);
+ lv_label_set_text_id(label_tip, WATCH_TEXT_ID_FACTORY_RESET_Q);
+ lv_label_set_long_mode(label_tip, LV_LABEL_LONG_BREAK);
+ lv_obj_set_width(label_tip, LV_HOR_RES * 3 / 4);
+ lv_obj_align(label_tip, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
+ lv_obj_add_style(label_tip, LV_LABEL_PART_MAIN, &lv_watch_font26);
+
+ lv_obj_t * btn_yes = lv_imgbtn_create(obj, NULL);
+ lv_imgbtn_set_src(btn_yes, LV_BTN_STATE_RELEASED, ICON_OK);
+ lv_imgbtn_set_src(btn_yes, LV_BTN_STATE_PRESSED, ICON_OK);
+ lv_obj_align(btn_yes, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 20, -20);
+ lv_obj_set_event_cb(btn_yes, factoryreset_yes_btn_event_cb);
+ lv_watch_obj_add_element(btn_yes);
+
+ lv_obj_t * btn_no = lv_imgbtn_create(obj, NULL);
+ lv_imgbtn_set_src(btn_no, LV_BTN_STATE_RELEASED, ICON_CANCEL);
+ lv_imgbtn_set_src(btn_no, LV_BTN_STATE_PRESSED, ICON_CANCEL);
+ lv_obj_align(btn_no, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, -20, -20);
+ lv_obj_set_event_cb(btn_no, factoryreset_no_btn_event_cb);
+ lv_watch_obj_add_element(btn_no);
+
+ return obj;
+}
+#else
lv_obj_t * factorymode_reset_create(lv_obj_t * activity_obj)
{
lv_obj_t * obj;
return obj;
}
+#endif
/**********************
* STATIC FUNCTIONS
break;
}
+ uos_timer_stop(s_health_measure_process_timer_id);
uos_timer_start(s_health_measure_process_timer_id, MS_TO_TICKS(MMI_HEALTH_MEASURE_CYCLE_DURATION), 0, mmi_health_measure_process_timer_handle, NULL);
}
}
**********************/
static lv_signal_cb_t ancestor_launcher_tileview_scrl_signal;
static lv_point_t * menu_valid_pos = NULL;
-static const lv_point_t dp_valid_pos[] = {{0, 0}, {1, 0}, {2, 0}};
+//static const lv_point_t dp_valid_pos[] = {{0, 0}, {1, 0}, {2, 0}};
/**********************
* MACROS
**********************/
ext->leds[1] = NULL;
ext->leds[2] = NULL;
- lv_tileview_set_valid_positions(tileview, dp_valid_pos, 3);
+ //lv_tileview_set_valid_positions(tileview, dp_valid_pos, 3);
lv_tileview_set_edge_flash(tileview, true);
lv_tileview_set_anim_time(tileview, 50);
lv_tileview_set_tab_switch_limit(tileview, 60);
ext->leds[2] = NULL;
ext->pedometer_dot = NULL;
ext->pull_up_start = 0;
- lv_tileview_set_valid_positions(tileview, dp_valid_pos, 3);
+ //lv_tileview_set_valid_positions(tileview, dp_valid_pos, 3);
lv_tileview_set_edge_flash(tileview, true);
lv_tileview_set_anim_time(tileview, 60);
lv_page_set_scrollbar_mode(tileview, LV_SCROLLBAR_MODE_OFF);
if(obj == NULL) return;
}
+#ifdef __MMI_ZHSX_SUPPORT__
+lv_obj_t * restart_create(lv_obj_t * activity_obj)
+{
+ lv_obj_t * obj;
+ lv_obj_t * label;
+ lv_obj_t * label_tip;
+ lv_obj_t * content;
+ lv_obj_t * btn_no;
+ lv_obj_t * btn_yes;
+
+ if(NULL == activity_obj)
+ {
+ lv_watch_activity_ext_t activity_ext;
+ memset(&activity_ext, 0, sizeof(lv_watch_activity_ext_t));
+ activity_ext.actId = ACT_ID_RESTART;
+ activity_ext.create = restart_create;
+ activity_ext.prepare_destory = restart_prepare_destory;
+ activity_obj = lv_watch_creat_activity_obj(&activity_ext);
+ if(NULL == activity_obj)
+ return NULL;
+ }
+
+ obj = lv_watch_obj_create(activity_obj);
+ if(NULL == obj)
+ return NULL;
+
+ label = lv_label_create(obj, NULL);
+ lv_obj_set_size(label, LV_HOR_RES, LV_VER_RES / 6);
+ lv_label_set_text_id(label, WATCH_TEXT_ID_RESTART);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20_gray);
+ lv_obj_align(label, obj, LV_ALIGN_IN_TOP_MID, 0, 25);
+
+ content = lv_cont_create(obj, NULL);
+ lv_obj_add_style(content, LV_CONT_PART_MAIN, &lv_watch_style_transp);
+ lv_cont_set_fit(content, LV_FIT_TIGHT);
+ lv_cont_set_layout(content, LV_LAYOUT_CENTER);
+ lv_obj_align(content, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
+ lv_obj_set_click(content, false);
+ lv_watch_obj_add_element(content);
+
+ label_tip = lv_label_create(content, NULL);
+ lv_label_set_text_id(label_tip, WATCH_TEXT_ID_RESTART_Q);
+ lv_obj_add_style(label_tip, LV_LABEL_PART_MAIN, &lv_watch_font26);
+
+ btn_yes = lv_imgbtn_create(obj, NULL);
+ lv_imgbtn_set_src(btn_yes, LV_BTN_STATE_RELEASED, ICON_OK);
+ lv_imgbtn_set_src(btn_yes, LV_BTN_STATE_PRESSED, ICON_OK);
+ lv_obj_align(btn_yes, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 20, -20);
+ lv_obj_set_event_cb(btn_yes, restart_yes_btn_action);
+ lv_watch_obj_add_element(btn_yes);
+
+ btn_no = lv_imgbtn_create(obj, NULL);
+ lv_imgbtn_set_src(btn_no, LV_BTN_STATE_RELEASED, ICON_CANCEL);
+ lv_imgbtn_set_src(btn_no, LV_BTN_STATE_PRESSED, ICON_CANCEL);
+ lv_obj_align(btn_no, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, -20, -20);
+ lv_obj_set_event_cb(btn_no, restart_no_btn_action);
+ lv_watch_obj_add_element(btn_no);
+
+ return obj;
+}
+#else
lv_obj_t * restart_create(lv_obj_t * activity_obj)
{
lv_obj_t * obj;
return obj;
}
+#endif
void restart_btn_action(lv_obj_t * btn, lv_event_t event)
{
lv_img_set_src(img, weather_list[9].img_src);
lv_obj_t * label = lv_label_create(content, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font30);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26);
lv_label_set_text_id(label, weather_list[9].txtId);
lv_obj_set_click(label, false);
return(content);
}
-static lv_obj_t * weather_content_create(lv_obj_t * par, app_adaptor_weather_t * weather)
+static lv_obj_t * weather_image_content_create(lv_obj_t * par, app_adaptor_weather_t * weather)
{
lv_obj_t * content = lv_watch_cont_create(par, LV_LAYOUT_COLUMN_MID, &lv_style_transp_fit, lv_obj_get_width(par));
lv_obj_t * img = lv_img_create(content, NULL);
lv_img_set_src(img, weather_list[index].img_src);
lv_obj_t * label = lv_label_create(content, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26);
lv_label_set_text_id(label, weather_list[index].txtId);
return(content);
}
-static lv_obj_t * temperature_content_create(lv_obj_t * par, app_adaptor_weather_t * weather)
+static lv_obj_t * weather_temperature_content_create(lv_obj_t * par, app_adaptor_weather_t * weather)
{
- char str[10] = "";
-
- lv_obj_t * content = lv_watch_cont_create(par, LV_LAYOUT_COLUMN_LEFT, &lv_watch_style_transp, lv_obj_get_width(par) / 2);
+ char str[16] = "";
+ //uint16_t w_temp_unit[4] = {0x2103};
+
+ //lv_obj_t * content = lv_watch_cont_create(par, LV_LAYOUT_ROW_MID, &lv_watch_style_transp, lv_obj_get_width(par) / 2);
+ lv_obj_t * content = lv_cont_create(par, NULL);
+ lv_cont_set_fit2(content, LV_FIT_NONE, LV_FIT_TIGHT);
+ lv_obj_set_width(content, lv_obj_get_width(par));
+ lv_obj_add_style(content, LV_OBJ_PART_MAIN, &lv_watch_style_transp);
+ //lv_cont_set_layout(content, cont_layout);
+ lv_obj_set_click(content, false);
lv_obj_set_base_dir(content, LV_BIDI_DIR_LTR);
+ lv_cont_set_layout(content, LV_LAYOUT_OFF);
- lv_obj_t * label = lv_label_create(content, NULL);
- lv_obj_set_style_local_pad_inner(content, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font40_yellow);
- snprintf(str, 10, "%d", weather->current_temperature);
- lv_label_set_text(label, str);
- lv_obj_set_click(label, false);
-
- label = lv_label_create(content, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font10);
- lv_label_set_text(label, "o");
- lv_obj_set_click(label, false);
- lv_obj_set_style_local_pad_top(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, -2);
-
- label = lv_label_create(content, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font40_yellow);
- lv_label_set_text(label, "C");
- lv_obj_set_click(label, false);
-
-
- lv_obj_t * content1 = lv_watch_cont_create(content, LV_LAYOUT_ROW_TOP, &lv_watch_style_transp, lv_obj_get_width(par) / 2);
- lv_obj_align(content1, label, LV_ALIGN_OUT_RIGHT_MID, 0, 0);
- lv_obj_set_style_local_pad_inner(content1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
- label = lv_label_create(content1, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
- snprintf(str, 10, "%d-%d", weather->lowest_temperature, weather->highest_temperature);
- lv_label_set_text(label, str);
- lv_obj_set_click(label, false);
-
- label = lv_label_create(content1, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font10);
- lv_obj_set_style_local_pad_top(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, -2);
- lv_label_set_text(label, "o");
- lv_obj_set_click(label, false);
-
- label = lv_label_create(content1, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font20);
- lv_label_set_text(label, "C");
- lv_obj_set_click(label, false);
+ lv_obj_t * label1 = lv_label_create(content, NULL);
+ lv_obj_add_style(label1, LV_LABEL_PART_MAIN, &lv_watch_font30_yellow);
+ sprintf(str, "%d %s", weather->current_temperature, lang_get_text_by_id(WATCH_TEXT_ID_TEMPERATURE_UNIT)); // temp_unit);
+ //sprintf(str, "%d %s", 28, lang_get_text_by_id(WATCH_TEXT_ID_TEMPERATURE_UNIT));
+ lv_label_set_text(label1, str);
+ lv_obj_set_click(label1, false);
+ lv_obj_align(label1, content, LV_ALIGN_IN_LEFT_MID, 30, 0);
+
+ lv_obj_t * label2 = lv_label_create(content, NULL);
+ lv_obj_add_style(label2, LV_LABEL_PART_MAIN, &lv_watch_font20);
+ sprintf(str, "%d--%d %s", weather->lowest_temperature, weather->highest_temperature, lang_get_text_by_id(WATCH_TEXT_ID_TEMPERATURE_UNIT));
+ //sprintf(str, "%d-%d %s", 23, 32, lang_get_text_by_id(WATCH_TEXT_ID_TEMPERATURE_UNIT));
+ lv_label_set_text(label2, str);
+ lv_obj_set_click(label2, false);
+ lv_obj_align(label2, content, LV_ALIGN_IN_RIGHT_MID, -20, 0);
return(content);
}
-static lv_obj_t * detail_content_create(lv_obj_t * par, app_adaptor_weather_t * weather)
+static lv_obj_t * weather_city_content_create(lv_obj_t * par, app_adaptor_weather_t * weather)
{
- lv_obj_t * content = lv_watch_cont_create(par, LV_LAYOUT_COLUMN_MID, &lv_watch_style_transp, lv_obj_get_width(par));
+ //lv_obj_t * content = lv_watch_cont_create(par, LV_LAYOUT_COLUMN_MID, &lv_watch_style_transp, lv_obj_get_width(par));
+ lv_obj_t * content = lv_cont_create(par, NULL);
+ lv_cont_set_fit2(content, LV_FIT_NONE, LV_FIT_TIGHT);
+ lv_obj_set_width(content, lv_obj_get_width(par));
+ lv_obj_add_style(content, LV_OBJ_PART_MAIN, &lv_watch_style_transp);
+ //lv_cont_set_layout(content, cont_layout);
+ lv_obj_set_click(content, false);
lv_obj_set_base_dir(content, LV_BIDI_DIR_LTR);
lv_cont_set_layout(content, LV_LAYOUT_OFF);
lv_obj_t * label = lv_label_create(content, NULL);
- lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font30);
+ lv_obj_add_style(label, LV_LABEL_PART_MAIN, &lv_watch_font26);
if(0 != strlen(weather->city))
lv_label_set_text(label, weather->city);
else
lv_label_set_text(label, "");
+ //lv_label_set_text_id(label, WATCH_TEXT_ID_SUNDAY);
+ lv_label_set_long_mode(label, LV_LABEL_LONG_SROLL_CIRC);
+ lv_obj_align(label, content, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_click(label, false);
void weather_update(lv_obj_t * cont)
{
- app_adaptor_weather_t weather_info = {};
+ app_adaptor_weather_t weather_info = {0};
+
app_adaptor_get_weather_req(&weather_info);
lv_watch_png_cache_all_free();
weather_ext->content3 = NULL;
}
+ printf("[@CHENG_DEBUG][%s][%d]: %s\n", __FUNCTION__, __LINE__, weather_info.city);
+
if(0 == strlen(weather_info.city))
- {
+ {
weather_ext->content1 = weather_content_no_info_create(cont);
lv_obj_align(weather_ext->content1, cont, LV_ALIGN_IN_TOP_MID, 0, 20);
}
else
- {
- weather_ext->content1 = weather_content_create(cont, &weather_info);
+ {
+ weather_ext->content1 = weather_image_content_create(cont, &weather_info);
lv_obj_align(weather_ext->content1, cont, LV_ALIGN_IN_TOP_MID, 0, 20);
- weather_ext->content2 = temperature_content_create(cont, &weather_info);
- lv_obj_align(weather_ext->content2, weather_ext->content1, LV_ALIGN_OUT_BOTTOM_LEFT, 20, 10);
+ weather_ext->content2 = weather_temperature_content_create(cont, &weather_info);
+ lv_obj_align(weather_ext->content2, weather_ext->content1, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
- weather_ext->content3 = detail_content_create(cont, &weather_info);
- lv_obj_align(weather_ext->content3, weather_ext->content2, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
+ weather_ext->content3 = weather_city_content_create(cont, &weather_info);
+ lv_obj_align(weather_ext->content3, weather_ext->content2, LV_ALIGN_OUT_BOTTOM_MID, 0, 15);
}
}
//set text id of btn label, it will update language when language changed
lv_label_set_text_id(label, txtId);
#ifdef __MMI_ZHSX_SUPPORT__
- //lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font26);
+ lv_obj_add_style(label, LV_OBJ_PART_MAIN, &lv_watch_font26);
#endif
return btn;
#define ICON_SETTING_RESTORE "R:/png/setting/icon_setting_restore.png"
#define ICON_CANCEL_BIG "R:/png/dialog_selection/icon_cancel_big.png"
#define ICON_CONFIRM_BIG "R:/png/dialog_selection/icon_confirm_big.png"
+#define ICON_CANCEL ICON_CANCEL_BIG
+#define ICON_OK ICON_CONFIRM_BIG
#define ICON_SETTING_BLUETOOTH "R:/png/setting/icon_setting_bluetooth.png"
#define ICON_SETTING_WLAN "R:/png/setting/icon_setting_wlan.png"
#define ICON_SETTING_WIFI_FULL "R:/png/setting/icon_setting_wifi_full.png"
#define ICON_BODYHEIGHT "R:/png/pedometer/icon_bodyheight.png"
#define ICON_BODYWEIGHT "R:/png/pedometer/icon_bodyweight.png"
#define ICON_GOAL "R:/png/pedometer/icon_goal.png"
-#define ICON_OK "R:/png/pedometer/icon_ok.png"
-#define ICON_CANCEL "R:/png/pedometer/icon_cancel.png"
+//#define ICON_OK "R:/png/pedometer/icon_ok.png"
+//#define ICON_CANCEL "R:/png/pedometer/icon_cancel.png"
#define ICON_STEP "R:/png/pedometer/icon_step.png"
#define ICON_CAL "R:/png/pedometer/icon_cal.png"
#define ICON_DISTANCE "R:/png/pedometer/icon_distance.png"
{
LOCATION_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__);
+ uos_timer_stop(s_watch_location_timer_id);
uos_timer_start(s_watch_location_timer_id, MS_TO_TICKS(MMI_WATCH_LOCATION_PROCESS_DURATION), 0, mmi_watch_location_mission_timer_cb, NULL);
}
}
mmi_health_measure_blood_timed_action(false, cur_time_stamp);
mmi_health_measure_spo2_timed_action(false, cur_time_stamp);
+ uos_timer_stop(s_watch_timed_mission_timer_id);
uos_timer_start(s_watch_timed_mission_timer_id, MS_TO_TICKS(1000 * 20), 0, mmi_protocol_watch_timed_mission_timer_cb, NULL);
}
s_watch_heartbeat_action_time_stamp = cur_time_stamp;
}
+ uos_timer_stop(s_watch_heartbeat_action_timer_id);
uos_timer_start(s_watch_heartbeat_action_timer_id, MS_TO_TICKS(1000 * 20), 0, mmi_protocol_watch_heartbeat_timer_cb, NULL);
}
unsigned char * temp_ptr = NULL;
app_adaptor_weather_t weather_info = {0};
- char city_name[MMI_WEATHER_CITY_NAME_LEN_MAX] = {0};
uint8_t i = 0;
//date
//city
for(i = 0; i*4 < strlen(next_buff); i++)
{
- city_name[i] = mmi_hex_string_to_number(next_buff + i*4, 4);
+ weather_info.city[i] = mmi_hex_string_to_number(next_buff + i*4, 4);
}
- weather_info.city = city_name;
mmi_weather_info_set(&weather_info);
}
+void mmi_wstr_to_str(const uint16_t * src, uint8 * dst)
+{
+ return ;
+
+#if 0
+ uint8 *return_str = dst;
+ if(NULL == src || NULL == dst)
+ {
+ return ;
+ }
+ while( !(*src & 0xFF00) && '\0' != (*dst++ = *src++) )
+ {
+ ;
+ }
+
+#elif 0
+
+ uint8 index = 0;
+ uint16_t * ptr = src;
+
+ if(NULL == src || NULL == dst)
+ {
+ return ;
+ }
+
+ while(*ptr)
+ {
+ if(256 > *src)
+ {
+ if(*ptr == 162) // \80
+ {
+ dst[index++] = 0xac;
+ dst[index] = 0x20;
+ }
+ else
+ {
+ dst[index++] = *((uint8 *)(ptr));
+ dst[index] = 0;
+ }
+ }
+ else
+ {
+ dst[index++] = *((uint8 *)(ptr));
+ dst[index] = *(((uint8 *)(ptr)) + 1);
+ }
+
+ ptr++;
+ }
+
+#endif
+}
signed int mmi_hex_string_to_number(signed char* hex_str, unsigned char hex_str_len);
+void mmi_wstr_to_str(const uint16_t * src, uint8 * dst);
#endif