diff options
author | Jihoon Jung <jh8801.jung@samsung.com> | 2016-11-22 16:52:37 +0900 |
---|---|---|
committer | Jihoon Jung <jh8801.jung@samsung.com> | 2016-11-22 17:06:27 +0900 |
commit | 1199767b5f260183b125db2881766b6a6777e30e (patch) | |
tree | 6e92a443662f0437cb2c0fb2038def274af19084 | |
parent | d7b7e2cd9dc9c11fe0cfbc651c178cb3bd4d7c78 (diff) | |
download | ug-nfc-efl-1199767b5f260183b125db2881766b6a6777e30e.tar.gz ug-nfc-efl-1199767b5f260183b125db2881766b6a6777e30e.tar.bz2 ug-nfc-efl-1199767b5f260183b125db2881766b6a6777e30e.zip |
Add implemenation for appcontrol extra datasubmit/tizen_3.0/20161122.080837accepted/tizen/3.0/wearable/20161123.083831accepted/tizen/3.0/mobile/20161123.083826accepted/tizen/3.0/common/20161123.140934
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I45add68229d90ad037fb1c1345ddd449ea22a099
-rw-r--r-- | packaging/ug-nfc-efl.spec | 2 | ||||
-rwxr-xr-x | wearable/app/include/nsa-main.h | 8 | ||||
-rwxr-xr-x | wearable/app/src/nsa-main.c | 61 | ||||
-rwxr-xr-x | wearable/app/src/nsa-view-main.c | 7 | ||||
-rwxr-xr-x | wearable/app/src/nsa-view-tap-n-pay.c | 6 |
5 files changed, 70 insertions, 14 deletions
diff --git a/packaging/ug-nfc-efl.spec b/packaging/ug-nfc-efl.spec index bc83d31..33a4c0f 100644 --- a/packaging/ug-nfc-efl.spec +++ b/packaging/ug-nfc-efl.spec @@ -16,7 +16,7 @@ ExcludeArch: %{arm} %ix86 x86_64 Name: ug-nfc-efl Summary: NFC Setting UI -Version: 3.1.3 +Version: 3.1.4 Release: 0 Group: App/Network License: Flora-1.1 diff --git a/wearable/app/include/nsa-main.h b/wearable/app/include/nsa-main.h index f1b70ae..8b2c1ef 100755 --- a/wearable/app/include/nsa-main.h +++ b/wearable/app/include/nsa-main.h @@ -53,11 +53,17 @@ typedef struct { int aid_count; } wallet_info_t; +typedef enum { + NSA_OP_NFC = 1, + NSA_OP_TAP_N_PAY = 2 +} nsa_operation_type; + typedef struct { Evas_Object *main_win; Evas_Object *main_layout; Evas_Object *main_bg; Evas_Object *conform; + Evas_Object *main_circle_obj; Eext_Circle_Surface *circle_surface; Evas_Object *popup; @@ -72,6 +78,8 @@ typedef struct { int payment_wallet_cnt; GArray *payment_wallet_list; Evas_Object *radio_main; + + nsa_operation_type op_type; } appdata; #ifdef __cplusplus diff --git a/wearable/app/src/nsa-main.c b/wearable/app/src/nsa-main.c index 9371d39..a92fc61 100755 --- a/wearable/app/src/nsa-main.c +++ b/wearable/app/src/nsa-main.c @@ -34,7 +34,7 @@ static void __back_clicked_cb(void *data, Evas_Object *obj, void *event_info) elm_naviframe_item_pop(ad->navi_frame); - if (ad->current_view == V_TAP_N_PAY) { + if (ad->current_view == V_TAP_N_PAY && ad->op_type != NSA_OP_TAP_N_PAY) { Evas_Object *circle_obj; /* release Tap & Pay view */ @@ -57,11 +57,8 @@ static void __back_clicked_cb(void *data, Evas_Object *obj, void *event_info) ad->radio_main = NULL; ad->current_view = V_MAIN; - circle_obj = eext_circle_object_genlist_add(ad->main_genlist, ad->circle_surface); - eext_circle_object_genlist_scroller_policy_set(circle_obj, - ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - eext_rotary_object_event_activated_set(circle_obj, EINA_TRUE); - } else if (ad->current_view == V_MAIN) { + eext_rotary_object_event_activated_set(ad->main_circle_obj, EINA_TRUE); + } else { /* release Main view and exit application */ NSA_MEM_FREE(ad->payment_handler); @@ -102,6 +99,47 @@ void _nsa_main_app_terminate(void *user_data) NSA_DEBUG("_nsa_main_app_terminate end"); } +static void __parse_service(app_control_h service, void *user_data) +{ + appdata *ad = user_data; + char *operation = NULL; + char *app_id = NULL; + char *ex_data = NULL; + + ret_if(ad == NULL); + + app_control_get_operation(service, &operation); + app_control_get_app_id(service, &app_id); + app_control_get_extra_data(service, "type", &ex_data); + + NSA_DEBUG("operation [%s] >>>>> ", GET_SAFE_STRING(operation)); + NSA_DEBUG("app_id [%s] >>>>> ", GET_SAFE_STRING(app_id)); + NSA_DEBUG("extra data [%s] >>>>> ", GET_SAFE_STRING(ex_data)); + + ad->op_type = NSA_OP_NFC; + if (!ex_data) { + NSA_DEBUG_ERR("extra data is NULL"); + goto end; + } + + if (strncmp(operation, APP_CONTROL_OPERATION_SETTING_NFC, + strlen(APP_CONTROL_OPERATION_SETTING_NFC)) == 0) { + /* launched by app-control */ + if (strncmp(ex_data, "nfc", strlen("nfc")) == 0) { + ad->op_type = NSA_OP_NFC; + } else if (strncmp(ex_data, "tap_n_pay", strlen("tap_n_pay")) == 0) { + ad->op_type = NSA_OP_TAP_N_PAY; + } + } + +end: + NSA_MEM_FREE(operation); + NSA_MEM_FREE(app_id); + NSA_MEM_FREE(ex_data); + + return; +} + void _nsa_main_app_service(app_control_h service, void *user_data) { appdata *ad = user_data; @@ -137,7 +175,16 @@ void _nsa_main_app_service(app_control_h service, void *user_data) elm_object_part_content_set(ad->main_layout, "elm.swallow.content", ad->navi_frame); eext_object_event_callback_add(ad->navi_frame, EEXT_CALLBACK_BACK, __back_clicked_cb, ad); - _nsa_view_main_create(ad); + /* parse service data */ + __parse_service(service, ad); + + /* launch nss */ + if (ad->op_type == NSA_OP_TAP_N_PAY){ + _nsa_view_tap_n_pay_create(ad); + } else { + _nsa_view_main_create(ad); + } + elm_win_activate(ad->main_win); NSA_DEBUG("_nsa_main_app_service end"); diff --git a/wearable/app/src/nsa-view-main.c b/wearable/app/src/nsa-view-main.c index 715cc3e..b2cb7ff 100755 --- a/wearable/app/src/nsa-view-main.c +++ b/wearable/app/src/nsa-view-main.c @@ -206,7 +206,6 @@ static Evas_Object *__create_nfc_setting_list(void *data) appdata *ad = data; Evas_Object *genlist; - Evas_Object *circle_obj; Elm_Genlist_Item_Class *itc_title, *itc_on_off, *itc_list, *itc_padding; retv_if(ad == NULL, NULL); @@ -220,10 +219,10 @@ static Evas_Object *__create_nfc_setting_list(void *data) /* set genlist property */ elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); - circle_obj = eext_circle_object_genlist_add(genlist, ad->circle_surface); - eext_circle_object_genlist_scroller_policy_set(circle_obj, + ad->main_circle_obj = eext_circle_object_genlist_add(genlist, ad->circle_surface); + eext_circle_object_genlist_scroller_policy_set(ad->main_circle_obj, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); - eext_rotary_object_event_activated_set(circle_obj, EINA_TRUE); + eext_rotary_object_event_activated_set(ad->main_circle_obj, EINA_TRUE); /* create genlist class + */ itc_title = elm_genlist_item_class_new(); diff --git a/wearable/app/src/nsa-view-tap-n-pay.c b/wearable/app/src/nsa-view-tap-n-pay.c index 0ccfa2b..1ef7560 100755 --- a/wearable/app/src/nsa-view-tap-n-pay.c +++ b/wearable/app/src/nsa-view-tap-n-pay.c @@ -84,6 +84,7 @@ static Evas_Object *__create_no_contents_ly(void *data) appdata *ad = data; Evas_Object *sc, *ly, *image, *circle_obj; Evas_Object *label; + char title[256]; retv_if(ad == NULL, NULL); @@ -116,7 +117,8 @@ static Evas_Object *__create_no_contents_ly(void *data) evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_label_wrap_width_set(label, 226); - elm_object_text_set(label, "<font=Tizen:style=Medium font_size=30 color=#0094ffff align=center text_class=tizen>Tap and pay</font>"); + snprintf(title, 256, "<font=Tizen:style=Medium font_size=30 color=#0094ffff align=center text_class=tizen>%s</font>", IDS_TAP_AND_PAY); + elm_object_text_set(label, title); elm_object_part_content_set(ly, "elm.text.title", label); evas_object_show(label); @@ -500,7 +502,7 @@ bool _nsa_view_tap_n_pay_create(void *data) retv_if(layout == NULL, false); - elm_naviframe_item_push(ad->navi_frame, "TAP", NULL, NULL, layout, "empty"); + elm_naviframe_item_push(ad->navi_frame, NULL, NULL, NULL, layout, "empty"); ad->current_view = V_TAP_N_PAY; return true; |