From 04bd4994c326a1af80f6c83aa8319954f596421c Mon Sep 17 00:00:00 2001 From: jomui Date: Tue, 18 Apr 2017 10:12:18 +0900 Subject: [PATCH] add UC popup for TV profile Signed-off-by: jomui Change-Id: Id44ada0de9e0b3b77ffa768cd120501966e1aa12 --- .../src/heremaps-uc-launcher.h | 4 +- heremaps-uc/src/heremaps-uc.c | 67 ++++++++++++++++++- maps-plugin-here.changes | 5 ++ packaging/maps-plugin-here.spec | 2 +- 4 files changed, 74 insertions(+), 4 deletions(-) diff --git a/heremaps-uc-launcher/src/heremaps-uc-launcher.h b/heremaps-uc-launcher/src/heremaps-uc-launcher.h index 9749068..bebbe66 100644 --- a/heremaps-uc-launcher/src/heremaps-uc-launcher.h +++ b/heremaps-uc-launcher/src/heremaps-uc-launcher.h @@ -80,8 +80,8 @@ extern "C" { #define dgettext_noop(s) (s) #define N_(s) dgettext_noop(s) -#define LS_FUNC_ENTER LS_LOGD("(%s) ENTER", __FUNCTION__); -#define LS_FUNC_EXIT LS_LOGD("(%s) EXIT", __FUNCTION__); +#define LS_FUNC_ENTER LS_LOGD("(%s) ENTER", __FUNCTION__); +#define LS_FUNC_EXIT LS_LOGD("(%s) EXIT", __FUNCTION__); diff --git a/heremaps-uc/src/heremaps-uc.c b/heremaps-uc/src/heremaps-uc.c index 51d6135..6eab4e2 100644 --- a/heremaps-uc/src/heremaps-uc.c +++ b/heremaps-uc/src/heremaps-uc.c @@ -187,6 +187,70 @@ static void anchor_clicked_cb(void *data, Evas_Object *obj, void *event_info) app_control_destroy(ac); } +static Evas_Object *create_popup_tv(Evas_Object *layout, heremaps_uc_app_data *ad) +{ + LS_FUNC_ENTER + Evas_Object *popup; + Evas_Object *disagree_btn, *agree_btn; + + /* popup */ + popup = elm_popup_add(layout); + elm_object_style_set(popup, "default"); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, back_btn_cb, 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); + evas_object_show(box); + + Evas_Object *scroller = elm_scroller_add(box); + elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE); + elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_padding_set(scroller, 5, 5, 0, 0); + evas_object_show(scroller); + + 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"; + snprintf(buf, 4096, str1, str2, str3); + char *text = strdup(buf); + + Evas_Object* entry = elm_entry_add(scroller); + evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_padding_set(entry, 5, 5, 0, 0); + 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 color=#000000'"); + evas_object_show(entry); + + elm_object_content_set(scroller, entry); + elm_box_pack_end(box, scroller); + elm_object_part_content_set(popup, "elm.swallow.content", box); + + /* Disagree button */ + disagree_btn = elm_button_add(popup); + elm_object_style_set(disagree_btn, "popup"); + elm_object_text_set(disagree_btn, P_("IDS_ST_BUTTON_DISAGREE")); + elm_object_part_content_set(popup, "button1", disagree_btn); + evas_object_smart_callback_add(disagree_btn, "clicked", disagree_btn_cb, ad); + + /* Agree button */ + agree_btn = elm_button_add(popup); + elm_object_style_set(agree_btn, "popup"); + elm_object_text_set(agree_btn, P_("IDS_ST_BUTTON_AGREE")); + elm_object_part_content_set(popup, "button2", agree_btn); + evas_object_smart_callback_add(agree_btn, "clicked", agree_btn_cb, ad); + + evas_object_show(popup); + LS_FUNC_EXIT + return popup; +} + static Evas_Object *create_popup_wearable(Evas_Object *layout, heremaps_uc_app_data *ad) { LS_FUNC_ENTER @@ -224,7 +288,6 @@ 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); @@ -351,6 +414,8 @@ static void _app_control_cb(app_control_h app_control, void *user_data) if (_get_tizen_profile() == TIZEN_PROFILE_WEARABLE) ad->popup = create_popup_wearable(ad->layout_main, ad); + else if (_get_tizen_profile() == TIZEN_PROFILE_TV) + ad->popup = create_popup_tv(ad->layout_main, ad); else ad->popup = create_popup(ad->layout_main, ad); diff --git a/maps-plugin-here.changes b/maps-plugin-here.changes index 65267e3..1675d85 100644 --- a/maps-plugin-here.changes +++ b/maps-plugin-here.changes @@ -1,3 +1,8 @@ +[Version] maps-plugin-here_0.3.20 +[Date] 14 Apr 2017 +[Title] Add UC popup for TV profile +[Developer] Jongmun Woo + [Version] maps-plugin-here_0.3.19 [Date] 17 Apr 2017 [Title] Rebuild HERE Maps engine with gcc62 diff --git a/packaging/maps-plugin-here.spec b/packaging/maps-plugin-here.spec index fc5bb78..3906431 100644 --- a/packaging/maps-plugin-here.spec +++ b/packaging/maps-plugin-here.spec @@ -1,6 +1,6 @@ Name: maps-plugin-here Summary: Tizen HERE Maps Plug-in Library -Version: 0.3.19 +Version: 0.3.20 Release: 1 Group: Location/Libraries License: Apache-2.0 and HERE -- 2.34.1