[windicator] implementing swipe down effect by using quickpanel apis 12/98412/1 accepted/tizen/wearable/20161117.084700 submit/tizen/20161117.074907 submit/tizen_3.0/20161117.074846
authorIrfan Abdul <irfan.abdul@samsung.com>
Thu, 17 Nov 2016 07:31:35 +0000 (13:01 +0530)
committerirfan abdul <irfan.abdul@samsung.com>
Thu, 17 Nov 2016 07:41:28 +0000 (23:41 -0800)
Change-Id: Id6229a9e335f1ace837777c24a0746e90c44a46c
(cherry picked from commit ed206c9c09c4390066d2f6236f5b133e65c875bc)

CMakeLists.txt
include/windicator.h [changed mode: 0644->0755]
packaging/org.tizen.windicator.spec [changed mode: 0644->0755]
res/edje/windicator_moment_bar.edc [changed mode: 0644->0755]
src/windicator.c
src/windicator_moment_bar.c
src/windicator_util.c

index 5efe3d868070c7c485483c0fedfb7ede15137447..9aa115d31334d39ec8bb4e45e441004d082abd72 100755 (executable)
@@ -57,7 +57,7 @@ pkg_check_modules(pkgs REQUIRED elementary ecore-imf appcore-common appcore-efl
                                 ecore ecore-input ecore-evas capi-appfw-application
                                 feedback appsvc deviced capi-system-device capi-system-info
                                capi-media-sound-manager efl-extension capi-system-system-settings
-                               capi-ui-efl-util aul pkgmgr pkgmgr-info
+                               capi-ui-efl-util aul pkgmgr pkgmgr-info tzsh-quickpanel-service
 )
 
 #??
old mode 100644 (file)
new mode 100755 (executable)
index 4d54cb0..9ab17d6
@@ -1,9 +1,26 @@
+/*
+ * Samsung API
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 #include <Elementary.h>
 #include <Eina.h>
 #include <efl_extension.h>
 #include <device/power.h>
 #include <feedback.h>
 #include <efl_util.h>
+#include "tzsh_quickpanel_service.h"
 
 #if !defined(PACKAGE)
 #  define PACKAGE "windicator"
@@ -32,7 +49,6 @@
 #define DYNAMIC_ICON_WIDTH 24
 #define DYNAMIC_ICON_HEIGHT 26
 
-//#define ICON_PATH "/usr/apps/org.tizen.windicator/res/image/windicator/"
 #define ICON_PATH "image/windicator"
 
 #define PATH_MAX       4096
@@ -75,8 +91,6 @@ struct appdata
     int is_tutorial;
     int is_poweroff_state;
     int moment_bar_rotary_index;
-    int is_getting_back;
-
     /* RSSI, Connection */
     int rssi_hide;
     int connection_hide;
@@ -94,7 +108,6 @@ struct appdata
     Evas *moment_bar_evas;
     Ecore_Evas *moment_bar_ee;
     Evas_Object *moment_bar_win;
-    Evas_Object *moment_bar_bg;
     Evas_Object *moment_bar_conformant;
     Eext_Circle_Surface *moment_bar_circle_surface;
     Evas_Object *moment_bar_first_page_layout;
@@ -205,6 +218,7 @@ struct appdata
     Ecore_Event_Handler *hdl_client_message;
     int momentbar_showing;
     void* msg_handle;
+    tzsh_quickpanel_service_h qp_service;
 };
 struct appdata *windicator_appdata_get(void);
 void windicator_lo_update(void* data);
old mode 100644 (file)
new mode 100755 (executable)
index c50e0e3..9f6f838
@@ -33,7 +33,7 @@ BuildRequires: pkgconfig(pkgmgr-info)
 BuildRequires: pkgconfig(aul)
 BuildRequires: gettext-tools
 BuildRequires: edje-bin, embryo-bin
-
+BuildRequires: pkgconfig(tzsh-quickpanel-service)
 %description
 Notification panel for wearable devices
 
old mode 100644 (file)
new mode 100755 (executable)
index f7c41e2..3c46835
@@ -89,6 +89,7 @@ group {
                part {
                        name : "rect.bg";
                        type : RECT;
+                       clip_to: "mask";
                        scale : 1;
                        description {
                                state : "default" 0.0;
@@ -98,33 +99,18 @@ group {
                                color : 0 0 0 255;
                        }
                }
-         /*
+
                part {
-                       name : "img.bg";
-                       type : IMAGE;
-                       scale : 1;
-                       description {
-                               state : "default" 0.0;
-                               min : WIN_WIDTH WIN_HEIGHT;
-                               max : WIN_WIDTH WIN_HEIGHT;
-                               fixed : 1 1;
-                               image.normal: "b_moment_bar_detail_bg.png";
-                               color_class : "AO013";
-                       }
+                          name: "mask";
+                          type: IMAGE;
+                          description 
+                          {
+                             state: "default" 0.0;
+                               rel1 { relative : 0.0 0.0; to : "rect.bg"; }
+                               rel2 { relative : 1.0 1.0; to : "rect.bg"; }
+                             image.normal: "b_moment_bar_detail_bg.png";
+                          }
                }
-               part {
-                       name : "img.bg.cover";
-                       type : IMAGE;
-                       scale : 1;
-                       description {
-                               state : "default" 0.0;
-                               min : WIN_WIDTH WIN_HEIGHT;
-                               max : WIN_WIDTH WIN_HEIGHT;
-                               fixed : 1 1;
-                               image.normal: "b_moment_bar_detail_bg_cover.png";
-                               color_class : "AO0131";
-                       }
-               }*/
 #if 0
                /* Icons */
                // Battery
index aaad30bbb905951fb731aa8d900a0822e2b155b3..fb2d65b587f2b47a2658a71b5f81b53dd39c3b80 100755 (executable)
@@ -19,6 +19,7 @@
 #include <Elementary.h>
 #include <appcore-efl.h>
 #include <app.h>
+#include <tzsh_quickpanel_service.h>
 
 #include "windicator.h"
 #include "log.h"
@@ -56,15 +57,12 @@ static void _init_variables(void *data)
        ad->down_key_handler = NULL;
        ad->is_tutorial = 0;
        ad->moment_bar_rotary_index = 0;
-       ad->is_getting_back = 0;
-
        /* RSSI, Connection */
        ad->rssi_hide = 1;
        ad->connection_hide = 1;
 
        /* Moment Bar */
        ad->moment_bar_win = NULL;
-       ad->moment_bar_bg = NULL;
        ad->moment_bar_conformant = NULL;
        ad->moment_bar_circle_surface = NULL;
        ad->moment_bar_first_page_layout = NULL;
@@ -164,6 +162,15 @@ void create_moments_bar_win(void *user_data)
        struct appdata *ad = (struct appdata *)user_data;
        elm_config_preferred_engine_set("opengl_x11");
        _init_variables(ad);
+       tzsh_quickpanel_service_h qp_service;
+       tzsh_region_h region;
+       tzsh_window tz_win;
+       tzsh_h tzsh = NULL;
+       tzsh = tzsh_create(TZSH_TOOLKIT_TYPE_EFL);
+       if (!tzsh) {
+               _E("Failed to create tzsh\n");
+               return;
+       }
 
        /* initialize Moment Bar */
        if (WINDICATOR_ERROR_OK != windicator_moment_bar_init(ad)) {
@@ -174,8 +181,18 @@ void create_moments_bar_win(void *user_data)
        if (WINDICATOR_ERROR_OK != windicator_moment_view_init(ad)) {
                _E("Failed to intialize moment view");
        }
-       //evas_object_show(ad->moment_view_win);
-       //evas_object_show(ad->moment_bar_win);
+       tz_win = elm_win_window_id_get(ad->moment_bar_win);
+       if (!tz_win) {
+               _E("Failed to get window ID\n");
+               return;
+       }
+       qp_service = tzsh_quickpanel_service_create(tzsh, tz_win);
+       ad->qp_service = qp_service;
+       tzsh_quickpanel_service_effect_type_set(qp_service, TZSH_QUICKPANEL_SERVICE_EFFECT_TYPE_MOVE);
+       region = tzsh_region_create(tzsh);
+       tzsh_region_add(region, 0, 300, 360, 60);
+       tzsh_quickpanel_service_handler_region_set(qp_service, 0, region);
+       tzsh_region_destroy(region);
 }
 
 static bool app_create(void *data)
index e6e5a5891a2b4789a20abe78f9db9c198c45b6f1..c3798ff17d8e3c410b09891e2221c8f958561315 100755 (executable)
@@ -16,6 +16,7 @@
  */
 
 #include <efl_extension.h>
+#include <tzsh_quickpanel_service.h>
 
 #include "windicator.h"
 #include "log.h"
@@ -177,15 +178,8 @@ static Eina_Bool _key_release_event_cb(void *data, int type, void *event)
        _D("Key(%s) pressed", ev->keyname);
 
         if (!strcmp(ev->keyname, KEY_BACK)) {
-               if (ad->is_getting_back == 0) {
                _D("Moment bar status -> idle. (Hide Moment bar)");
-               ad->is_getting_back = 1; // ad->is_getting_back will be set 0 in moment_bar_show
-               //windicator_hide_moment_bar_directly(ad);
-               //elm_exit() is bad to use it here. Replace it asap once alternative way is found.
-               elm_exit();
-               } else {
-               _D("Back key animation is operating, so skip back key event");
-               }
+               tzsh_quickpanel_service_hide(ad->qp_service);
        }
        return EINA_FALSE;
 }
@@ -202,7 +196,7 @@ static Eina_Bool _down_release_event_cb(void *data, int type, void *event)
 
        if(!strcmp(ev->keyname, KEY_DOWN)) {
                _D("Moment bar status -> Exit. (Exit Moment bar)");
-               elm_exit();
+               tzsh_quickpanel_service_hide(ad->qp_service);
        }
        return EINA_FALSE;
 }
@@ -273,8 +267,6 @@ windicator_error_e windicator_moment_bar_show(void *data)
        retv_if(ad == NULL, WINDICATOR_ERROR_INVALID_PARAMETER);
        _I("Show Moment Bar : dynamic_layout(%p)", ad->moment_bar_dynamic_layout);
 
-       ad->is_getting_back = 0;
-
        /* update LO layout */
        windicator_lo_update(ad);
 
@@ -340,10 +332,6 @@ windicator_error_e windicator_moment_bar_init(void *data)
        ad->moment_bar_evas = evas_object_evas_get(ad->moment_bar_win);
        ad->moment_bar_ee = ecore_evas_ecore_evas_get(ad->moment_bar_evas);
 
-       /* create moment bar bg */
-       ad->moment_bar_bg = windicator_util_bg_create(ad->moment_bar_win);
-       retv_if(ad->moment_bar_bg == NULL, WINDICATOR_ERROR_FAIL);
-
        /* create moment bar conformant */
        ad->moment_bar_conformant = windicator_util_conformant_create(ad->moment_bar_win);
        retv_if(ad->moment_bar_conformant == NULL, WINDICATOR_ERROR_FAIL);
index 6940336130b157a182dfdfd2d06fd0319c826674..0ab6898b3d253a5aba8ba37dab42f6515adb6bae 100755 (executable)
@@ -135,6 +135,7 @@ Evas_Object* windicator_util_win_create(const char *name, Eina_Bool is_alpha, wi
                elm_win_borderless_set(win, EINA_TRUE);
                elm_win_autodel_set(win, EINA_TRUE);
                elm_win_role_set(win, "no-dim");
+               elm_win_alpha_set(win, EINA_TRUE);
 
                if (elm_win_wm_rotation_supported_get(win)) {
                        int rots[4] = { 0, 90, 180, 270 };
@@ -150,6 +151,7 @@ Evas_Object* windicator_util_win_create(const char *name, Eina_Bool is_alpha, wi
                retv_if(!win, NULL);
                elm_win_title_set(win, name);
                elm_win_autodel_set(win, EINA_TRUE);
+               elm_win_alpha_set(win, EINA_TRUE);
                if (elm_win_wm_rotation_supported_get(win)) {
                        int rots[4] = { 0, 90, 180, 270 };
                        elm_win_wm_rotation_available_rotations_set(win, (const int*)(&rots), 4);