From: jomui Date: Thu, 9 Mar 2017 05:22:57 +0000 (+0900) Subject: add callback for anchor in UC X-Git-Tag: submit/tizen/20170310.050516^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=596dbe4d79aed15b0f7a272b21866d6fccfb3beb;p=platform%2Fcore%2Flocation%2Fmaps-plugin-here.git add callback for anchor in UC Signed-off-by: jomui Change-Id: I0ec7f81c07e487231a1b6db093f81127a652de61 --- diff --git a/heremaps-uc/org.tizen.heremaps-uc.xml b/heremaps-uc/org.tizen.heremaps-uc.xml index 18c4af6..0264e3d 100644 --- a/heremaps-uc/org.tizen.heremaps-uc.xml +++ b/heremaps-uc/org.tizen.heremaps-uc.xml @@ -1,5 +1,5 @@ - + Seechan Kim JongMun Woo diff --git a/heremaps-uc/src/heremaps-uc.c b/heremaps-uc/src/heremaps-uc.c index cfc74a3..51d6135 100644 --- a/heremaps-uc/src/heremaps-uc.c +++ b/heremaps-uc/src/heremaps-uc.c @@ -173,6 +173,20 @@ static Evas_Object *create_win(const char *name) return eo; } +static void anchor_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + LS_FUNC_ENTER + Elm_Entry_Anchor_Info *ai = event_info; + LS_RETURN_IF_FAILED(ai); + + app_control_h ac = NULL; + app_control_create(&ac); + app_control_set_operation(ac, APP_CONTROL_OPERATION_VIEW); + app_control_set_uri(ac, ai->name); + app_control_send_launch_request(ac, NULL, NULL); + app_control_destroy(ac); +} + static Evas_Object *create_popup_wearable(Evas_Object *layout, heremaps_uc_app_data *ad) { LS_FUNC_ENTER @@ -210,6 +224,7 @@ static Evas_Object *create_popup_wearable(Evas_Object *layout, heremaps_uc_app_d elm_entry_editable_set(entry, EINA_FALSE); elm_object_part_text_set(entry, "elm.text", text); elm_entry_text_style_user_push(entry, "DEFAULT='align=center'"); + evas_object_smart_callback_add(entry, "anchor,clicked", anchor_clicked_cb, NULL); elm_box_pack_end(box, entry); evas_object_show(entry); @@ -240,13 +255,27 @@ static Evas_Object *create_popup(Evas_Object *layout, heremaps_uc_app_data *ad) evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(popup, "title,text", P_("IDS_POSITIONING_CONSENT_TITLE")); + Evas_Object *box = elm_box_add(popup); + elm_box_align_set(box, 0.5, 0); + elm_object_part_content_set(popup, "elm.swallow.content", box); + evas_object_show(box); + char buf[4096] = {0}; char *str1 = P_("IDS_POSITIONING_CONSENT_BODY"); - char *str2 = "http://here.com/terms/service-terms"; - char *str3 = "http://here.com/privacy/privacy-policy"; + char *str2 = "http://here.com/terms/service-terms"; + char *str3 = "http://here.com/privacy/privacy-policy"; snprintf(buf, 4096, str1, str2, str3); char *text = strdup(buf); - elm_object_text_set(popup, text); + + Evas_Object* entry = elm_entry_add(box); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0.0); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_entry_editable_set(entry, EINA_FALSE); + elm_object_part_text_set(entry, "elm.text", text); + elm_entry_text_style_user_push(entry, "DEFAULT='align=center'"); + evas_object_smart_callback_add(entry, "anchor,clicked", anchor_clicked_cb, NULL); + elm_box_pack_end(box, entry); + evas_object_show(entry); /* Disagree button */ disagree_btn = elm_button_add(popup); @@ -286,7 +315,7 @@ static void _app_pause_cb(void *user_data) LS_RETURN_IF_FAILED(ad); if (ad->btn_clicked == 0) - save_vconf(0); + save_vconf(0); elm_exit(); }