From: Yunjin Lee Date: Mon, 23 Jul 2018 06:31:11 +0000 (+0900) Subject: Modify to handle rotary event using circle surface X-Git-Tag: submit/tizen/20181127.060637~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e7e7ffa75138ac7285e196a7f43d5ce0390edfa;p=platform%2Fcore%2Fsecurity%2Faskuser.git Modify to handle rotary event using circle surface Change-Id: I978001e1a5c9461b81f9f631db1fda33f7ff56f0 Signed-off-by: Yunjin Lee Signed-off-by: Tomasz Swierczek --- diff --git a/src/notification-daemon/ui/PopupCheckWearable.h b/src/notification-daemon/ui/PopupCheckWearable.h index a6ea88c..ab58552 100644 --- a/src/notification-daemon/ui/PopupCheckWearable.h +++ b/src/notification-daemon/ui/PopupCheckWearable.h @@ -41,25 +41,6 @@ public: ~PopupCheckWearable() { vconf_ignore_key_changed(VCONFKEY_LANGSET, &PopupCheckWearable::langChangedCb); } - static Eina_Bool rotaryChangedCb(void *data, Evas_Object *, Eext_Rotary_Event_Info *info) { - Evas_Object *scroller = (Evas_Object *)data; - Evas_Coord sx, sy, sw, sh, y, h; - elm_scroller_region_get(scroller, &sx, &sy, &sw, &sh); - evas_object_geometry_get(scroller, NULL, &y, NULL, &h); - - if (info->direction == EEXT_ROTARY_DIRECTION_CLOCKWISE) { - if (sy + (sh/2) <= y + sh + h) - elm_scroller_region_bring_in(scroller, sx, sy+(sh/2), sw, sh); - else if (sy < y + sh + h) - elm_scroller_region_bring_in(scroller, sx, y + sh + h, sw, sh); - } else { - if (sy - (sh/2) >= 0) - elm_scroller_region_bring_in(scroller, sx, sy-(sh/2), sw, sh); - else if (sy > 0) - elm_scroller_region_bring_in(scroller, sx, 0, sw, sh); - } - return EINA_TRUE; - } static void langChangedCb(keynode_t *, void *data) { PopupCheckWearable *popup = static_cast(data); @@ -71,17 +52,45 @@ public: elm_atspi_accessible_name_set(popup->m_denyButton, Po::getDenyButtonMsg().c_str()); } + virtual void create() { elm_object_style_set(m_popup, "circle"); elm_popup_scrollable_set(m_popup, EINA_FALSE); + m_conform = elm_conformant_add(m_parent); + if (m_conform == nullptr) { + ALOGE("EFL : Failed to add conformant"); + throw Exception("Enlightenment failed"); + } + evas_object_size_hint_weight_set(m_conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(m_parent, m_conform); + evas_object_show(m_conform); + + circle_surface = eext_circle_surface_conformant_add(m_conform); + if (circle_surface == nullptr) { + ALOGE("EFL : Failed to add circle surface"); + throw Exception("Enlightenment failed"); + } + m_scroller = elm_scroller_add(m_popup); + if (m_scroller == nullptr) { + ALOGE("EFL : Failed to add scroller"); + throw Exception("Enlightenment failed"); + } elm_object_style_set(m_scroller, "list_effect"); elm_scroller_policy_set(m_scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); evas_object_size_hint_weight_set(m_scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(m_scroller, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_content_set(m_popup, m_scroller); + eext_scroller = eext_circle_object_scroller_add(m_scroller, circle_surface); + if (eext_scroller == nullptr) { + ALOGE("EFL : Failed to add eext_scroller"); + throw Exception("Enlightenment failed"); + } + eext_circle_object_scroller_policy_set(eext_scroller, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF); + + m_layout = elm_layout_add(m_popup); if (m_layout == nullptr) { ALOGE("EFL : Failed to add layout"); @@ -99,8 +108,7 @@ public: evas_object_size_hint_weight_set(m_layoutInner, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_content_set(m_layout, "elm.swallow.content", m_layoutInner); - eext_rotary_object_event_callback_add(m_scroller, rotaryChangedCb, m_scroller); - eext_rotary_object_event_activated_set(m_scroller, EINA_TRUE); + eext_rotary_object_event_activated_set(eext_scroller, EINA_TRUE); m_content = elm_label_add(m_layoutInner); if (m_content == nullptr) { @@ -186,6 +194,9 @@ private: Evas_Object *m_layout = nullptr; Evas_Object *m_layoutInner = nullptr; Evas_Object *m_scroller = nullptr; + Evas_Object *eext_scroller = nullptr; + Eext_Circle_Surface *circle_surface = nullptr; + Evas_Object *m_conform = nullptr; std::string m_pkgId; std::string m_privacy; };