summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdarsh Shree Ram <adarsh.ram@samsung.com>2016-10-28 14:13:45 +0530
committerAdarsh Shree Ram <adarsh.ram@samsung.com>2016-10-28 15:52:45 +0530
commit7382e837d182e68c5dcddb3f9ffb8100425a35be (patch)
tree3fc473fafe7e09e999c73ad17268c9191b065604
parent57e4c3c51c50e9e54dbda35145bbb7f71fbc62b9 (diff)
downloadalarm-7382e837d182e68c5dcddb3f9ffb8100425a35be.tar.gz
alarm-7382e837d182e68c5dcddb3f9ffb8100425a35be.tar.bz2
alarm-7382e837d182e68c5dcddb3f9ffb8100425a35be.zip
TSAM-9254 alarm issues related to popup tap correctedsubmit/tizen/20161028.102844
Change-Id: Id52acc31bd10b5f1b22811e405df954c4960a4fa
-rwxr-xr-xinc/alarm.h2
-rwxr-xr-xinc/view.h2
-rwxr-xr-xsrc/main.c14
-rwxr-xr-xsrc/view.c62
4 files changed, 65 insertions, 15 deletions
diff --git a/inc/alarm.h b/inc/alarm.h
index 53c453f..01bcea1 100755
--- a/inc/alarm.h
+++ b/inc/alarm.h
@@ -58,7 +58,7 @@ typedef enum {
NORMAL_MODE ,
EDIT_MODE,
} mode_type;
-void update_genlist(int last_alarm_id, int edit_mode, int type);
+void update_genlist(mode_type e, int type);
void update_genlist_first();
void populate_genlist();
void end_genlist();
diff --git a/inc/view.h b/inc/view.h
index 523615a..6c8c62a 100755
--- a/inc/view.h
+++ b/inc/view.h
@@ -46,6 +46,8 @@ Evas_Object *view_create_datetime(Evas_Object *parent, const char *style ,Eext_C
struct tm *view_get_datetime();
Eina_Bool view_get_is_select_mode(void);
void view_set_is_select_mode( Eina_Bool is_edit_mode);
+Evas_Object *view_get_circle_genlist(void);
+void view_set_circle_genlist(Evas_Object *circle_genlist);
void go_to_normal();
void view_destroy(void);
void view_alarm_destroy(void);
diff --git a/src/main.c b/src/main.c
index 03e5b40..1ceb1e8 100755
--- a/src/main.c
+++ b/src/main.c
@@ -1000,6 +1000,7 @@ void update_genlist_first()
_ALM_ENTER_;
Evas_Object *genlist = NULL;
Evas_Object *nf = NULL;
+ Evas_Object *circle_genlist = NULL;
Evas_Object *layout = view_get_base_layout();
Eina_List *local_data = view_get_local_data();
genlist = view_get_genlist();
@@ -1025,6 +1026,8 @@ void update_genlist_first()
populate_genlist();
end_genlist();
//ALM_INFO("local data count after %d ",loc_count);
+ circle_genlist = view_get_circle_genlist();
+ eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
view_send_signal_to_edje(layout, "genlist.show", "alarm");
local_data = view_get_local_data();
loc_count = eina_list_count(local_data);
@@ -1054,11 +1057,13 @@ void update_genlist_first()
}
-void update_genlist(int last_alarm_id, int edit_mode, int type)
+void update_genlist(mode_type e, int type)
{
_ALM_ENTER_;
+ int last_alarm_id = 0;
Evas_Object *genlist = NULL;
Evas_Object *nf = NULL;
+ Evas_Object *circle_genlist = NULL;
Evas_Object *layout = view_get_base_layout();
Eina_List *local_data = view_get_local_data();
genlist = view_get_genlist();
@@ -1066,6 +1071,7 @@ void update_genlist(int last_alarm_id, int edit_mode, int type)
if (genlist)
elm_genlist_clear(genlist);
ALM_INFO("reached 1");
+ ALM_INFO("mode type e is %d", e);
local_data = eina_list_free(local_data);
view_set_local_data(local_data);
@@ -1084,12 +1090,14 @@ void update_genlist(int last_alarm_id, int edit_mode, int type)
populate_genlist();
end_genlist();
//ALM_INFO("local data count after %d ",loc_count);
+ circle_genlist = view_get_circle_genlist();
+ eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
view_send_signal_to_edje(layout, "genlist.show", "alarm");
local_data = view_get_local_data();
loc_count = eina_list_count(local_data);
Elm_Object_Item *it = NULL;
struct genlist_item_data *gendata = NULL;
- if (edit_mode == 1) {
+ if (e == EDIT_MODE) {
if (type) //update
last_alarm_id = global_latest_alarm_id;
else {
@@ -1098,7 +1106,7 @@ void update_genlist(int last_alarm_id, int edit_mode, int type)
last_alarm_id = gendata->alarm_id;
}
- } else {
+ } else if (e == NORMAL_MODE) {
//add
last_alarm_id = global_latest_alarm_id;
}
diff --git a/src/view.c b/src/view.c
index 9d8f205..5e02886 100755
--- a/src/view.c
+++ b/src/view.c
@@ -48,7 +48,7 @@ static struct view_info {
Evas_Object *edit_button;
Evas_Object *edit_ctxpopup;
Evas_Object *delete_button;
-
+ Evas_Object *circle_genlist;
} s_info = {
.win = NULL,
.conform = NULL,
@@ -64,6 +64,7 @@ static struct view_info {
.edit_button = NULL,
.edit_ctxpopup = NULL,
.delete_button = NULL,
+ .circle_genlist = NULL,
};
static Elm_Genlist_Item_Class *_set_genlist_item_class(const char *style);
@@ -75,13 +76,25 @@ static void _popup_hide_cb(void *data, Evas_Object *obj, void *event_info);
static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void go_to_normal_mode_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
//static void _timeout_cb(void *data, Evas_Object *obj, void *event_info);
-
+mode_type f = EDIT_MODE;
Evas_Object *view_get_timepicker(void)
{
_ALM_ENTER_;
return s_info.datetime;
}
+Evas_Object *view_get_circle_genlist(void)
+{
+ _ALM_ENTER_;
+ return s_info.circle_genlist;
+}
+
+void view_set_circle_genlist(Evas_Object *circle_genlist)
+{
+ _ALM_ENTER_;
+ s_info.circle_genlist = circle_genlist;
+}
+
void view_free_s_info()
{
_ALM_ENTER_;
@@ -733,6 +746,17 @@ void view_set_text(Evas_Object *parent, const char *part_name, const char *text)
* @param[parent]: Object to which you want to set naviframe
* @Add callback function will be operated when back key is pressed.
*/
+static void
+eext_naviframe_back_cb1(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ _ALM_ENTER_;
+ ALM_INFO(" Circular genlist active ");
+ Evas_Object *circle_genlist = NULL;
+ circle_genlist = view_get_circle_genlist();
+ eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
+ elm_naviframe_item_pop(obj);
+
+}
Evas_Object *view_create_naviframe(Evas_Object *parent)
{
_ALM_ENTER_;
@@ -753,7 +777,7 @@ Evas_Object *view_create_naviframe(Evas_Object *parent)
nf = elm_naviframe_add(parent);
elm_object_part_content_set(parent, "elm.swallow.content", nf);
- eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
+ eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb1, NULL);
eext_object_event_callback_add(nf, EEXT_CALLBACK_MORE, eext_naviframe_more_cb, NULL);
evas_object_show(nf);
@@ -974,7 +998,7 @@ void go_to_normal()
eext_object_event_callback_del(layout, EEXT_CALLBACK_BACK, go_to_normal_mode_cb);
Evas_Object *nf = NULL;
nf = view_get_naviframe();
- eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
+ eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb1, NULL);
}
static void go_to_normal_mode_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
@@ -1010,7 +1034,7 @@ static void go_to_normal_mode_cb(void *data EINA_UNUSED, Evas_Object *obj, void
eext_object_event_callback_del(obj, EEXT_CALLBACK_BACK, go_to_normal_mode_cb);
Evas_Object *nf = NULL;
nf = view_get_naviframe();
- eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
+ eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb1, NULL);
//view_send_signal_to_edje(obj, "genlist.show", "alarm");
}
@@ -1041,7 +1065,7 @@ static void _gl_longpress_cb(void *data, Evas_Object *obj, void *event_info)
_ALM_ENTER_;
Evas_Object *nf = NULL;
nf = view_get_naviframe();
- eext_object_event_callback_del(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb);
+ eext_object_event_callback_del(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb1);
ALM_ERR("_gl_longpress_cb");
Elm_Object_Item *it = (Elm_Object_Item *)event_info;
@@ -1157,7 +1181,12 @@ Evas_Object *view_create_circle_genlist(Evas_Object *parent)
circle_genlist = eext_circle_object_genlist_add(genlist, s_info.circle_surface);
eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
-
+ view_set_circle_genlist(circle_genlist);
+#if 0
+ circle_genlist = view_get_circle_genlist();
+ eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
+ //evas_object_show(circle_genlist);
+#endif
evas_object_show(genlist);
return genlist;
@@ -1299,6 +1328,7 @@ Evas_Object *view_set_button(Evas_Object *parent, const char *part_name, const c
void view_create_text_popup(Evas_Object *parent, double timeout, const char *text, int id , mode_type e)
{
_ALM_ENTER_;
+ ALM_INFO("view_create_text_popup mode_type e is %d ", e);
Evas_Object *popup = NULL;
Evas_Object *nf = view_get_naviframe();
int e_m = view_get_is_select_mode();
@@ -1320,8 +1350,8 @@ void view_create_text_popup(Evas_Object *parent, double timeout, const char *tex
elm_image_file_set(img, file_path, NULL);
elm_object_part_content_set(popup, "toast,icon", img);
}
-
- evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL);
+ f = e;
+ evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, &f);
if (!e_m) {
if (e != NO_CALLBACK_MODE) {
if (e != EDIT_MODE)
@@ -1605,6 +1635,16 @@ static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
_ALM_ENTER_;
if (!obj) return;
elm_popup_dismiss(obj);
+ mode_type e = *((mode_type *)data);
+ if (e == EDIT_MODE)
+ ALM_INFO("edit mode");
+ else if (e == NORMAL_MODE)
+ ALM_INFO("normal mode");
+ ALM_INFO(" _block_clicked_cbmode type e is %d", e);
+ update_genlist(e, 0);
+ Evas_Object *nf = NULL;
+ nf = view_get_naviframe();
+ eext_object_event_callback_add(nf, EEXT_CALLBACK_BACK, eext_naviframe_back_cb1, NULL);
}
void _timeout_del_cb(void *data, Evas_Object *obj, void *event_info)
@@ -1614,7 +1654,7 @@ void _timeout_del_cb(void *data, Evas_Object *obj, void *event_info)
int last_alarm_id = (int)data;
ALM_INFO(" _timeout_del_cb last_alarm_id temp %ld ", last_alarm_id);
elm_popup_dismiss(obj);
- update_genlist(last_alarm_id , 1, 0);
+ update_genlist(EDIT_MODE, 0);
}
void _timeout_cb(void *data, Evas_Object *obj, void *event_info)
@@ -1624,7 +1664,7 @@ void _timeout_cb(void *data, Evas_Object *obj, void *event_info)
int last_alarm_id = (int)data;
ALM_INFO(" _timeout_cb last_alarm_id temp %ld ", last_alarm_id);
elm_popup_dismiss(obj);
- update_genlist(last_alarm_id , 0, 0);
+ update_genlist(NORMAL_MODE, 0);
}
/*