add callback for anchor in UC 65/118165/1 accepted/tizen/common/20170310.122314 accepted/tizen/ivi/20170310.102739 accepted/tizen/mobile/20170310.102723 accepted/tizen/tv/20170310.102731 accepted/tizen/unified/20170310.104714 accepted/tizen/wearable/20170310.102734 submit/tizen/20170310.050516 submit/tizen_unified/20170310.103557
authorjomui <jongmun.woo@samsung.com>
Thu, 9 Mar 2017 05:22:57 +0000 (14:22 +0900)
committerjomui <jongmun.woo@samsung.com>
Thu, 9 Mar 2017 05:23:14 +0000 (14:23 +0900)
Signed-off-by: jomui <jongmun.woo@samsung.com>
Change-Id: I0ec7f81c07e487231a1b6db093f81127a652de61

heremaps-uc/org.tizen.heremaps-uc.xml
heremaps-uc/src/heremaps-uc.c

index 18c4af6..0264e3d 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.heremaps-uc" api-version="2.4" version="1.1.0" install-location="internal-only">
+<manifest xmlns="http://tizen.org/ns/packages" package="org.tizen.heremaps-uc" api-version="2.4" version="1.1.1" install-location="internal-only">
        <label>HereMaps UC</label>
        <author email="cbible.kim@samsung.com" href="www.samsung.com">Seechan Kim</author>
        <author email="jongmun.woo@samsung.com" href="www.samsung.com">JongMun Woo</author>
index cfc74a3..51d6135 100644 (file)
@@ -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 = "<color=#006fd1ff underline=on underline_color=#006fd1ff><a href=http://here.com/terms/service-    terms>http://here.com/terms/service-terms</a></color>";
-       char *str3 = "<color=#006fd1ff underline=on underline_color=#006fd1ff><a href=http://here.com/privacy/privac    y-policy>http://here.com/privacy/privacy-policy</a></color>";
+       char *str2 = "<color=#006fd1ff underline=on underline_color=#006fd1ff><a href=http://here.com/terms/service-terms>http://here.com/terms/service-terms</a></color>";
+       char *str3 = "<color=#006fd1ff underline=on underline_color=#006fd1ff><a href=http://here.com/privacy/privacy-policy>http://here.com/privacy/privacy-policy</a></color>";
        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();
 }