[Email] Improve click animation on star buttons in composer and viewer module 50/88150/4 submit/tizen/20160928.142423
authorAndriy Kolesnichenko <a.kolesniche@samsung.com>
Tue, 13 Sep 2016 16:39:42 +0000 (19:39 +0300)
committerAndriy Kolesnichenko <a.kolesniche@samsung.com>
Fri, 16 Sep 2016 10:52:25 +0000 (13:52 +0300)
Change-Id: I11888d0a10d1088cedfc97a24ee8b4d55c756f55
Signed-off-by: Andriy Kolesnichenko <a.kolesniche@samsung.com>
edc/common/email-flat-buttons.edc
edc/mailbox/email-mailbox-theme.edc
edc/viewer/email-viewer-subject-layout.edc
modules/mailbox/inc/email-mailbox-util.h
modules/mailbox/src/email-mailbox-list.c
modules/viewer/src/email-viewer-contents.c
modules/viewer/src/email-viewer-header.c

index 7d854fe..58ac20a 100644 (file)
@@ -325,12 +325,13 @@ plugins {
                } \
        }
 
-#define FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, vg_effect_start_koeff, vg_effect_end_koeff, part_ext) \
+#define FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, image_pressed, color_normal, color_press, color_dim, min_width, min_height, vg_effect_start_koeff, vg_effect_end_koeff, part_ext) \
        group { name: "elm/button/base/email.flat.square."style_name; \
                data.item: "vector_ux" "no_bg"; \
                data.item: "corner_radius" FLAT_SQUARE_BTN_CORNER_RADIUS; \
                images { \
                        image: image_normal COMP; \
+                       image: image_pressed COMP; \
                } \
                script { \
                        public mouse_down = 0; \
@@ -413,6 +414,7 @@ plugins {
                                } \
                                description { state: "pressed" 0.0; \
                                                inherit: "default" 0.0; \
+                                               image.normal: image_pressed; \
                                                color: color_press; \
                                } \
                                description { state: "disabled" 0.0; \
@@ -891,16 +893,22 @@ plugins {
        FLAT_CIRCLE_BTN_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, 0.7, 1.0)
 
 #define FLAT_SQUARE_BTN_VI_OUTER_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height) \
-       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, 1.0, 1.3,)
+       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, image_normal, color_normal, color_press, color_dim, min_width, min_height, 1.0, 1.3,)
 
 #define FLAT_SQUARE_BTN_VI_INNER_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height) \
-       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, 0.7, 1.0,)
+       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, image_normal, color_normal, color_press, color_dim, min_width, min_height, 0.7, 1.0,)
 
 #define FLAT_SQUARE_BTN_VI_OUTER_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, part_ext) \
-       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, 1.0, 1.3, part_ext)
+       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, image_normal, color_normal, color_press, color_dim, min_width, min_height, 1.0, 1.3, part_ext)
 
 #define FLAT_SQUARE_BTN_VI_INNER_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, part_ext) \
-       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, color_normal, color_press, color_dim, min_width, min_height, 0.7, 1.0, part_ext)
+       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_normal, image_normal, color_normal, color_press, color_dim, min_width, min_height, 0.7, 1.0, part_ext)
+
+#define FLAT_SQUARE_TOGGLE_BTN_VI_INNER_STYLE(style_name, image_unpressed, image_pressed, color_normal, color_press, color_dim, min_width, min_height) \
+       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_unpressed, image_pressed, color_normal, color_press, color_dim, min_width, min_height, 0.7, 1.0, )
+
+#define FLAT_SQUARE_TOGGLE_BTN_VI_OUTER_STYLE(style_name, image_unpressed, image_pressed, color_normal, color_press, color_dim, min_width, min_height) \
+       FLAT_SQUARE_BTN_CUSTOM_STYLE(style_name, image_unpressed, image_pressed, color_normal, color_press, color_dim, min_width, min_height, 1.0, 1.3, )
 
 #define FLAT_TEXT_BTN_VI_OUTER_STYLE(style_name, text_style_normal, text_style_press, text_style_dim) \
        FLAT_TEXT_BTN_STYLE(style_name, text_style_normal, text_style_press, text_style_dim, 1.0, 1.3)
index 633db90..27fc282 100644 (file)
                }
        }
 
-FLAT_SQUARE_BTN_VI_INNER_STYLE("mbox.favourite_on", "list_icon/index_icon_favorite_on.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80);
-FLAT_SQUARE_BTN_VI_INNER_STYLE("mbox.favourite_off", "list_icon/index_icon_favorite_off.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80);
+FLAT_SQUARE_TOGGLE_BTN_VI_INNER_STYLE("mbox.favourite", "list_icon/index_icon_favorite_off.png", "list_icon/index_icon_favorite_on.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80);
index a110e0e..22a4eaa 100644 (file)
@@ -398,5 +398,5 @@ group {
        }
 
 FLAT_TEXT_BTN_VI_OUTER_STYLE("body_button", "body_button_style_default", "body_button_style_press", "body_button_style_dim");
-FLAT_SQUARE_BTN_VI_INNER_STYLE("ev.favourite_on", "viewer_icon/email_icon_favorite_on.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80);
-FLAT_SQUARE_BTN_VI_INNER_STYLE("ev.favourite_off", "viewer_icon/email_icon_favorite_off.png", STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80);
+FLAT_SQUARE_TOGGLE_BTN_VI_INNER_STYLE("ev.favourite", "viewer_icon/email_icon_favorite_off.png", "viewer_icon/email_icon_favorite_on.png", \
+       STAR_BTN_NORMAL_COLOR, STAR_BTN_NORMAL_COLOR, STAR_BTN_DIM_COLOR, 80, 80)
index 2479433..2191342 100644 (file)
                                        if(ld) {\
                                                switch(flag_type) { \
                                                        case EMAIL_FLAG_NONE:\
-                                                       elm_object_style_set(ld->check_favorite_btn, "email.flat.square.mbox.favourite_off"); \
+                                                       elm_object_signal_emit(ld->check_favorite_btn, "button_unpress", ""); \
                                                        break;\
                                                        case EMAIL_FLAG_FLAGED:\
-                                                       elm_object_style_set(ld->check_favorite_btn, "email.flat.square.mbox.favourite_on"); \
+                                                       elm_object_signal_emit(ld->check_favorite_btn, "button_press", ""); \
                                                        break;\
                                                } \
                                                break;\
index 075bd85..95033f9 100644 (file)
@@ -261,11 +261,12 @@ static Evas_Object *_mail_item_gl_star_btn_add(Evas_Object *parent, MailItemData
        Evas_Object *star_btn = elm_button_add(parent);
        evas_object_repeat_events_set(star_btn, EINA_FALSE);
        evas_object_propagate_events_set(star_btn, EINA_FALSE);
+       elm_object_style_set(star_btn, "email.flat.square.mbox.favourite");
 
        if (ld->flag_type == EMAIL_FLAG_NONE) {
-               elm_object_style_set(star_btn, "email.flat.square.mbox.favourite_off");
+               elm_object_signal_emit(star_btn, "button_unpress", "");
        } else {
-               elm_object_style_set(star_btn, "email.flat.square.mbox.favourite_on");
+               elm_object_signal_emit(star_btn, "button_press", "");
        }
 
        if (!ld->view->b_editmode) {
index 18b3638..cd301ae 100644 (file)
@@ -900,6 +900,8 @@ Evas_Object *viewer_create_webview(EmailViewerView *view)
                debug_error("SET show images is FAILED!");
        }
 
+       ewk_view_main_frame_scrollbar_visible_set(view->webview, EINA_FALSE);
+
        /*ewk_view_unfocus_allow_callback_set(view->webview, _viewer_webkit_unfocused_cb, view);*/
        evas_object_propagate_events_set(ewk_view, EINA_FALSE);
 
index a0d9154..0ed94f2 100644 (file)
@@ -96,6 +96,7 @@ static void _header_create_subject_layout(EmailViewerView *view)
 
        if ((view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (view->viewer_type == EMAIL_VIEWER)) {
                view->favourite_btn = elm_button_add(view->subject_ly);
+               elm_object_style_set(view->favourite_btn, "email.flat.square.ev.favourite");
                evas_object_smart_callback_add(view->favourite_btn, "clicked", _header_favorite_clicked_cb, view);
                elm_object_part_content_set(view->subject_ly, "swallow.favourite.btn", view->favourite_btn);
        }
@@ -652,10 +653,10 @@ void header_update_favorite_icon(EmailViewerView *view)
 
        switch (view->favorite) {
                case EMAIL_FLAG_NONE:
-                       elm_object_style_set(view->favourite_btn, "email.flat.square.ev.favourite_off");
+                       elm_object_signal_emit(view->favourite_btn, "button_unpress", "");
                        break;
                case EMAIL_FLAG_FLAGED:
-                       elm_object_style_set(view->favourite_btn, "email.flat.square.ev.favourite_on");
+                       elm_object_signal_emit(view->favourite_btn, "button_press", "");
                        break;
        }
 }