diff options
author | Kartik Tidke <kr.tidke@samsung.com> | 2018-08-27 22:22:55 +0530 |
---|---|---|
committer | Kartik Tidke <kr.tidke@samsung.com> | 2018-08-27 22:39:11 +0530 |
commit | 5f0b5c963a9a116eb8bb98316ddc5209782001b8 (patch) | |
tree | 34de3a2d2727042ba294622cd04ec95372e21585 | |
parent | abb558384a0d83118eed9b71861f4863b2072347 (diff) | |
download | analog-watch-5f0b5c963a9a116eb8bb98316ddc5209782001b8.tar.gz analog-watch-5f0b5c963a9a116eb8bb98316ddc5209782001b8.tar.bz2 analog-watch-5f0b5c963a9a116eb8bb98316ddc5209782001b8.zip |
Apply watchface-complication version 2submit/tizen/20180827.173855
Change-Id: I8c1bbb56a23310f502e7d27c46c11da5942878dd
Signed-off-by: Kartik Tidke <kr.tidke@samsung.com>
-rw-r--r-- | complication-provider/src/complication-provider.c | 2 | ||||
-rw-r--r-- | src/comp-manager.c | 31 |
2 files changed, 20 insertions, 13 deletions
diff --git a/complication-provider/src/complication-provider.c b/complication-provider/src/complication-provider.c index d7fdcd6..8223277 100644 --- a/complication-provider/src/complication-provider.c +++ b/complication-provider/src/complication-provider.c @@ -41,8 +41,6 @@ void __on_update_request(const char *provider_id, const char *req_appid, if (ret != DEVICE_ERROR_NONE) dlog_print(DLOG_ERROR, LOG_TAG, "failed to get battery percent : %d", ret); - watchface_complication_provider_data_set_type(shared_data, type); - if (type == WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT) { snprintf(num_str, sizeof(num_str), "%d", pct); watchface_complication_provider_data_set_short_text(shared_data, num_str); diff --git a/src/comp-manager.c b/src/comp-manager.c index 147cadf..0fee940 100644 --- a/src/comp-manager.c +++ b/src/comp-manager.c @@ -31,6 +31,8 @@ static void _comp_on_ready_for_edit_cb(watchface_editable_container_h, const cha static void _comp_init_editable(); static void _comp_init_complication(); static int _comp_battery_get_status(); +static void _on_complication_error_cb(int complication_id, const char* provider_id, + watchface_complication_type_e type, watchface_complication_error_e error, void* user_data); static complication_h _comp; @@ -50,6 +52,13 @@ char _dial_styles[DIAL_NUM][5] = { "05", }; +static void _on_complication_error_cb(int complication_id, const char* provider_id, + watchface_complication_type_e type, watchface_complication_error_e error, + void* user_data) +{ + __E("complication(%d) can not use (%s), %d", complication_id, + provider_id, error); +} /* * @brief provide the battery level @@ -119,7 +128,7 @@ void _comp_init_complication() WATCHFACE_COMPLICATION_TYPE_NO_DATA, WATCHFACE_COMPLICATION_TYPE_NO_DATA|WATCHFACE_COMPLICATION_TYPE_SHORT_TEXT|WATCHFACE_COMPLICATION_TYPE_LONG_TEXT |WATCHFACE_COMPLICATION_TYPE_RANGED_VALUE|WATCHFACE_COMPLICATION_TYPE_TIME|WATCHFACE_COMPLICATION_TYPE_ICON, - WATCHFACE_COMPLICATION_SHAPE_TYPE_CIRCLE, &_comp); + WATCHFACE_COMPLICATION_EVENT_NONE, &_comp); ret = watchface_complication_allowed_list_create(&allowed_list); @@ -137,7 +146,7 @@ void _comp_init_complication() watchface_complication_allowed_list_clear(_comp); ret = watchface_complication_get_current_provider_id(_comp, ¤t_comp_id); - watchface_complication_add_updated_cb(_comp, _comp_on_complication_update, NULL); + watchface_complication_add_updated_cb(_comp, _comp_on_complication_update, _on_complication_error_cb, NULL); if (ret == WATCHFACE_COMPLICATION_ERROR_NONE) { watchface_complication_get_current_type(_comp, &cur_type); __D("watchface_complication_get_current_type %d", cur_type); @@ -228,7 +237,7 @@ void _comp_on_editable_update(const watchface_editable_h handle, */ void _comp_on_ready_for_edit_cb(watchface_editable_container_h ed_con_h, const char *editor_appid, void *user_data) { - watchface_editable_geo_h geometry; + watchface_editable_highlight_h hi; complication_candidates_list_h candidates_list = NULL; bundle *edit_data; int current_idx = 0; @@ -252,10 +261,10 @@ void _comp_on_ready_for_edit_cb(watchface_editable_container_h ed_con_h, const c } } - watchface_editable_geometry_create(&geometry); - watchface_editable_geometry_set(geometry, 100, 100, 100, 100); + watchface_editable_highlight_create(&hi, WATCHFACE_EDITABLE_SHAPE_TYPE_CIRCLE); + watchface_editable_highlight_set_geometry(hi, 100, 100, 100, 100); watchface_editable_add_design_element(ed_con_h, DIAL_EDIT, current_idx, - candidates_list, geometry, "Dial"); + candidates_list, hi, "Dial"); watchface_editable_candidates_list_destroy(candidates_list); /* Hands */ @@ -274,17 +283,17 @@ void _comp_on_ready_for_edit_cb(watchface_editable_container_h ed_con_h, const c } } - watchface_editable_geometry_set(geometry, 100, 100, 100, 100); + watchface_editable_highlight_set_geometry(hi, 100, 100, 100, 100); watchface_editable_add_design_element(ed_con_h, HANDS_EDIT, current_idx, - candidates_list, geometry, "Hand"); + candidates_list, hi, "Hand"); watchface_editable_candidates_list_destroy(candidates_list); /* Battery */ - watchface_editable_geometry_set(geometry, 100, 100, 100, 100); - watchface_editable_add_complication(ed_con_h, RIGHT_COMP, _comp, geometry); + watchface_editable_highlight_set_geometry(hi, 100, 100, 100, 100); + watchface_editable_add_complication(ed_con_h, RIGHT_COMP, _comp, hi); watchface_editable_request_edit(ed_con_h, _comp_on_editable_update, user_data); - watchface_editable_geometry_destroy(geometry); + watchface_editable_highlight_destroy(hi); } /* |