Indicator and Notification bar not visible. 88/91988/9
authorm.kawonczyk <m.kawonczyk@samsung.com>
Wed, 12 Oct 2016 12:11:00 +0000 (14:11 +0200)
committerMaciej Kawo?czyk <m.kawonczyk@samsung.com>
Thu, 13 Oct 2016 10:02:07 +0000 (03:02 -0700)
[Issue]    http://suprem.sec.samsung.net/jira/browse/TWF-2245
[Problem]  Indicator with background wasn't visible.
[Solution] Created custom conformant that enables visible bg
           in scrollable indicator mode. Added background.
[Verify]   Open browser, try showing indicator (scroll down
           on top of the browser). Indicator should become
           visible. Scroll down again. Notification bar should
           become visible.

Change-Id: Idde83c578c32b84c7ec11341058f5456c82049aa

services/SimpleUI/ViewManager.cpp
services/SimpleUI/ViewManager.h
services/SimpleUI/edc/ViewManager.edc

index 49f5561aa0755963edd99dfa41d8c3539f99f6ae..885577272f226f897507cf7eb2f36d9c56ae0fa2 100755 (executable)
@@ -46,8 +46,22 @@ void ViewManager::init(Evas_Object* parentWindow)
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
     M_ASSERT(parentWindow);
 
+    std::string edjFilePath = EDJE_DIR;
+    edjFilePath.append("SimpleUI/ViewManager.edj");
+
     m_conformant = elm_conformant_add(parentWindow);
+    if (!elm_layout_file_set(m_conformant, edjFilePath.c_str(), "elm/conformant/custom_conformant"))
+        BROWSER_LOGD("[%s:%d] elm_layout_file_set falied !!!",__PRETTY_FUNCTION__, __LINE__);
     evas_object_size_hint_weight_set(m_conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+    Evas_Object *bg = elm_bg_add(m_conformant);
+    elm_bg_color_set(bg, BG_COLOR_R, BG_COLOR_G, BG_COLOR_B);
+    evas_object_show(bg);
+    elm_object_part_content_set(m_conformant, "elm.swallow.indicator_bg", bg);
+
+    elm_win_indicator_mode_set(parentWindow, ELM_WIN_INDICATOR_SHOW);
+    elm_win_indicator_opacity_set(parentWindow, ELM_WIN_INDICATOR_TRANSPARENT);
+
     evas_object_show(m_conformant);
     elm_win_resize_object_add(parentWindow, m_conformant);
 
@@ -61,12 +75,8 @@ void ViewManager::init(Evas_Object* parentWindow)
     evas_object_show(m_mainLayout);
     elm_box_pack_end(bx, m_mainLayout);
 
-    Eina_Bool ret = elm_layout_file_set(
-        m_mainLayout,
-        (std::string(EDJE_DIR) + std::string("SimpleUI/ViewManager.edj")).c_str(),
-        "main_layout");
-    if (!ret)
-        BROWSER_LOGD("[%s:%d]  elm_layout_file_set falied !!!",__PRETTY_FUNCTION__, __LINE__);
+    if (!elm_layout_file_set(m_mainLayout, edjFilePath.c_str(), "main_layout"))
+        BROWSER_LOGD("[%s:%d] elm_layout_file_set falied !!!",__PRETTY_FUNCTION__, __LINE__);
 
     elm_object_content_set(m_conformant, bx);
 }
index 9a7984f0627b48100b59ddbac0f45f19d0655581..822510bd88c5a7e35893ef4f7b813322bd124a98 100644 (file)
@@ -122,6 +122,10 @@ private:
     Evas_Object* m_conformant;
     Evas_Object* m_parentWindow;
     std::stack<sAUI> m_viewStack;
+
+    const int BG_COLOR_R = 61;
+    const int BG_COLOR_G = 184;
+    const int BG_COLOR_B = 204;
 };
 
 }//namespace base_ui
index 0912fd13f2b0369647e42f6df9d512e9672104c3..eb49dbf216c103f5ed672d8e2453e0524d7a01aa 100644 (file)
 #define IME_PORTRAIT_HEIGHT 435
 #define IME_LANDSCAPE_HEIGHT 0   //TODO: Change it when landscape IME will be available
 
+#define ATTACH_PANEL_TRANS_TIME 0.2
+#define ATTACH_PANEL_STATE_HIDE 0
+#define ATTACH_PANEL_STATE_HALF 1
+#define ATTACH_PANEL_STATE_FULL 2
+
+#define INDICATOR_MODE_UNKNOWN 0
+#define INDICATOR_MODE_HIDE 1
+#define INDICATOR_MODE_SHOW 2
+
+#define INDICATOR_OPACITY_UNKNOWN 0
+#define INDICATOR_OPACITY_OPAQUE 1
+#define INDICATOR_OPACITY_TRANSLUCENT 2
+#define INDICATOR_OPACITY_TRANSPARENT 3
+#define INDICATOR_OPACITY_BGTRANSPARENT 4
+
+#define INDICATOR_ROTATION_PORTRAIT 0
+#define INDICATOR_ROTATION_LANDSCAPE 1
+
+#define LAYOUT_INDICATOR_HEIGHT_INC 42
+
 collections { base_scale: 2.0;
+
+    group { name: "elm/conformant/custom_conformant";
+       script {
+          // legacy support
+          public clipboard_disable = 0;     //check clipboard enable/disable
+          public keypad_disable = 0;        //check virtualkeypad enable/disable
+          public attach_panel_state = ATTACH_PANEL_STATE_HIDE;  //check attach_panel state
+          public overlap_mode = 0;          //Overlap mode
+          // centralized variables
+          public indicator_mode = 0;
+          public indicator_opacity = 0;
+          public indicator_rotation = 0;
+       }
+       parts {
+          part { name: "base";
+             type: SPACER;
+             description { state: "default" 0.0;
+             }
+          }
+          part { name: "indicator_base";
+             type: SPACER;
+             scale: 1;
+             description { state: "default" 0.0;
+                fixed: 0 1;
+                align: 0.5 0.0;
+                min: 0 LAYOUT_INDICATOR_HEIGHT_INC;
+                rel2.relative: 1.0 0.0;
+             }
+             description { state: "hide" 0.0;
+                inherit: "default" 0.0;
+                min: 0 0;
+             }
+          }
+          part { name: "indicator_adapter";
+             type: SPACER;
+             scale: 1;
+             description { state: "default" 0.0;
+                fixed: 0 1;
+                align: 0.5 0.0;
+                min: 0 LAYOUT_INDICATOR_HEIGHT_INC;
+                rel2.relative: 1.0 0.0;
+             }
+             //just in case: hide
+            description { state: "hide" 0.0;
+                inherit: "default" 0.0;
+                align: 0.5 1.0;
+                min: 0 LAYOUT_INDICATOR_HEIGHT_INC;
+             }
+          }
+          part { name: "elm.swallow.content";
+             type: SWALLOW;
+             scale: 1;
+             description { state: "default" 0.0;
+                rel1.relative: 0.0 1.0;
+                rel1.to: "indicator_base";
+                rel2.relative: 1.0 0.0;
+                rel2.to: "sip_area";
+             }
+             description { state: "disable_sip" 0.0;
+                inherit: "default" 0.0;
+                rel2.relative: 1.0 1.0;
+                rel2.to: "base";
+             }
+             description { state: "show_attach_panel" 0.0; //attach_panel: visible
+                inherit: "default" 0.0;
+                rel2.to: "elm.swallow.attach_panel_base";
+             }
+          }
+          part { name: "elm.swallow.ug";
+             type: SWALLOW;
+             scale: 1;
+             description { state: "default" 0.0;
+                rel1.to: "elm.swallow.content";
+                rel2.to: "elm.swallow.content";
+             }
+          }
+          part { name: "indicator_bg";
+             type: RECT;
+             clip_to: "overlap_clipper";
+             description { state: "default" 0.0;
+                rel1 { to: "indicator_adapter"; }
+                rel2 { to: "indicator_adapter"; }
+                color: 61 184 204 255;
+             }
+             description { state: "transparent" 0.0;
+                inherit: "default" 0.0;
+                color: 0 0 0 0;
+             }
+             description { state: "translucent" 0.0;
+                inherit: "default" 0.0;
+                color: 0 0 0 127;
+             }
+          }
+          part { name: "elm.swallow.indicator_bg";
+             type: SWALLOW;
+             clip_to: "overlap_clipper";
+             description { state: "default" 0.0;
+                rel1.to: "indicator_bg";
+                rel2.to: "indicator_bg";
+             }
+             description { state: "transparent" 0.0;
+                inherit: "default" 0.0;
+                visible: 1;
+             }
+          }
+          part { name: "overlap_clipper";
+             type: RECT;
+             description { state: "default" 0.0;
+                rel1.to: "indicator_bg";
+                rel2.to: "indicator_bg";
+             }
+             description { state: "overlap" 0.0;
+                inherit: "default" 0.0;
+                visible: 0;
+             }
+          }
+          part { name: "elm.swallow.indicator";
+             type: SWALLOW;
+             scale: 1;
+             description { state: "default" 0.0;
+                rel1.to: "indicator_adapter";
+                rel2.to: "indicator_adapter";
+             }
+          }
+          part { name: "elm.swallow.attach_panel_base";
+             type: SWALLOW;
+             description { state: "default" 0.0;
+                fixed: 0 1;
+                align: 0.0 1.0;
+                rel1.relative: 0.0 1.0;
+             }
+          }
+          part { name: "elm.swallow.attach_panel";
+             type: SWALLOW;
+             description { state: "default" 0.0;
+                fixed: 0 1;
+                rel1.to_y: "elm.swallow.attach_panel_base";
+                rel2.to_y: "elm.swallow.attach_panel_base";
+                visible: 0;
+             }
+             description { state: "half" 0.0;
+                inherit: "default" 0.0;
+                visible: 1;
+             }
+             description { state: "full" 0.0;
+                inherit: "default" 0.0;
+                rel1.to_y: "indicator_bg";
+                rel1.relative: 0.0 1.0;
+                visible: 1;
+             }
+          }
+          part { name: "sip_area";
+             type: SPACER;
+             description { state: "default" 0.0;
+                fixed: 0 1;
+                min: 0 0;
+                rel1.to_y: "elm.swallow.virtualkeypad";
+                rel2.to_y: "elm.swallow.virtualkeypad";
+             }
+             description { state: "clipboard_on" 0.0;
+                inherit: "default" 0.0;
+                rel1.to_y: "elm.swallow.clipboard";
+                rel2.to_y: "elm.swallow.clipboard";
+             }
+          }
+          part { name: "elm.swallow.clipboard";
+             type: SWALLOW;
+             description { state: "default" 0.0;
+                fixed: 0 1;
+                align: 0.0 1.0;
+                rel1.relative: 0.0 1.0;
+             }
+          }
+          part { name: "elm.swallow.virtualkeypad";
+             type: SWALLOW;
+             description { state: "default" 0.0;
+                fixed: 0 1;
+                align: 0.0 1.0;
+                rel1.relative: 0.0 1.0;
+             }
+          }
+       }
+       programs {
+          program { name: "show_indicator";
+             signal: "elm,state,indicator,show";
+             source: "elm";
+             script {
+                set_int(indicator_mode, INDICATOR_MODE_SHOW);
+                run_program(PROGRAM:"update_indicator_adapter");
+             }
+          }
+          program { name: "hide_indicator";
+             signal: "elm,state,indicator,hide";
+             source: "elm";
+             script {
+                set_int(indicator_mode, INDICATOR_MODE_HIDE);
+                run_program(PROGRAM:"update_indicator_adapter");
+             }
+          }
+          program { name: "show_indicator_effect"; //show indicator using effect
+              signal: "indicator,show,effect";
+              source: "elm";
+              action: STATE_SET "default" 0.0;
+              target: "indicator_adapter";
+              transition: DECELERATE 0.2;
+          }
+          program { name: "hide_indicator_effect"; //hide indicator using effect
+              signal: "indicator,hide,effect";
+              source: "elm";
+              action: STATE_SET "hide" 0.0;
+              target: "indicator_adapter";
+              transition: DECELERATE 0.2;
+          }
+          program { name: "opaque_indicator";
+              signal: "elm,state,indicator,opaque";
+              source: "elm";
+              script {
+                 set_int(indicator_opacity, INDICATOR_OPACITY_OPAQUE);
+                 run_program(PROGRAM:"update_indicator_adapter");
+              }
+          }
+          program { name: "transparent_indicator";
+              signal: "elm,state,indicator,transparent";
+              source: "elm";
+              script {
+                 set_int(indicator_opacity, INDICATOR_OPACITY_TRANSPARENT);
+                 run_program(PROGRAM:"update_indicator_adapter");
+              }
+          }
+          program { name: "translucent_indicator";
+              signal: "elm,state,indicator,translucent";
+              source: "elm";
+              script {
+                 set_int(indicator_opacity, INDICATOR_OPACITY_TRANSLUCENT);
+                 run_program(PROGRAM:"update_indicator_adapter");
+              }
+          }
+          program { name: "bg_transparent_indicator";
+              signal: "elm,state,indicator,bg_transparent";
+              source: "elm";
+              script {
+                 set_int(indicator_opacity, INDICATOR_OPACITY_BGTRANSPARENT);
+                 run_program(PROGRAM:"update_indicator_adapter");
+              }
+          }
+          program { name: "show_full_attach_panel";
+             signal: "elm,state,attach_panel,show,full";
+             source: "";
+             script {
+                set_int(attach_panel_state, ATTACH_PANEL_STATE_FULL);
+             }
+             after: "show_full_attach_panel2";
+          }
+          program { name: "show_full_attach_panel2";
+             action: STATE_SET "full" 0.0;
+             target: "elm.swallow.attach_panel";
+             transition: DECELERATE ATTACH_PANEL_TRANS_TIME;
+          }
+          program { name: "show_half_attach_panel";
+             signal: "elm,state,attach_panel,show,half";
+             source: "";
+             script {
+                set_int(attach_panel_state, ATTACH_PANEL_STATE_HALF);
+             }
+             after: "show_half_attach_panel2";
+          }
+          program { name: "show_half_attach_panel2";
+             action: STATE_SET "half" 0.0;
+             target: "elm.swallow.attach_panel";
+             transition: DECELERATE ATTACH_PANEL_TRANS_TIME;
+          }
+          program { name: "show_attach_panel_started";
+             signal: "elm,state,attach_panel,show,started";
+             source: "";
+             script {
+                set_int(attach_panel_state, ATTACH_PANEL_STATE_HALF);
+                //set attach_panel state
+                set_state(PART:"elm.swallow.attach_panel", "half", 0.0);
+                //set content state
+                set_state(PART:"elm.swallow.content", "show_attach_panel", 0.0);
+             }
+          }
+          program { name: "hide_attach_panel_finished";
+             signal: "elm,state,attach_panel,hide,finished";
+             source: "";
+             script {
+                set_int(attach_panel_state, ATTACH_PANEL_STATE_HIDE);
+                //set attach_panel state
+                set_state(PART:"elm.swallow.attach_panel", "default", 0.0);
+                //set content state
+                if (get_int(keypad_disable) == 1 && get_int(clipboard_disable) == 1)
+                  set_state(PART:"elm.swallow.content", "disable_sip", 0.0);
+                else
+                  set_state(PART:"elm.swallow.content", "default", 0.0);
+             }
+          }
+          program { name: "enable_clipboard";
+             signal: "elm,state,clipboard,enable";
+             source: "";
+             script {
+                set_int(clipboard_disable, 0);
+                //set content state
+                set_state(PART:"elm.swallow.content", "default", 0.0);
+                set_state(PART:"sip_area", "default", 0.0);
+             }
+          }
+          program { name: "disable_clipboard";
+             signal: "elm,state,clipboard,disable";
+             source: "";
+             script {
+                set_int(clipboard_disable, 1);
+                set_state(PART:"sip_area", "default", 0.0);
+                if (get_int(attach_panel_state) != ATTACH_PANEL_STATE_HIDE) {
+                   set_state(PART:"elm.swallow.content", "show_attach_panel", 0.0);
+                }
+                else {
+                   if (get_int(keypad_disable) == 1)
+                     set_state(PART:"elm.swallow.content", "disable_sip", 0.0);
+                   else
+                     set_state(PART:"elm.swallow.content", "default", 0.0);
+                }
+             }
+          }
+          program { name: "enable_virtualkeypad";
+             signal: "elm,state,virtualkeypad,enable";
+             source: "";
+             script {
+                set_int(keypad_disable, 0);
+                set_state(PART:"elm.swallow.content", "default", 0.0);
+                set_state(PART:"sip_area", "default", 0.0);
+             }
+          }
+          program { name: "disable_virtualkeypad";
+             signal: "elm,state,virtualkeypad,disable";
+             source: "";
+             script {
+                set_int(keypad_disable, 1);
+                if (get_int(attach_panel_state) != ATTACH_PANEL_STATE_HIDE) {
+                   set_state(PART:"elm.swallow.content", "show_attach_panel", 0.0);
+                }
+                else {
+                   if (get_int(clipboard_disable) == 1)
+                     {
+                        set_state(PART:"sip_area", "clipboard_on", 0.0);
+                        set_state(PART:"elm.swallow.content", "disable_sip", 0.0);
+                     }
+                   else
+                     set_state(PART:"elm.swallow.content", "default", 0.0);
+                }
+             }
+          }
+          program { name: "change_to_landscape";
+             script {
+                set_int(indicator_rotation, INDICATOR_ROTATION_LANDSCAPE);
+                run_program(PROGRAM:"update_indicator_adapter");
+             }
+          }
+          program { name: "change_to_portrait";
+             script {
+                set_int(indicator_rotation, INDICATOR_ROTATION_PORTRAIT);
+                run_program(PROGRAM:"update_indicator_adapter");
+             }
+          }
+          program { name: "overlap_mode";
+             signal: "elm,state,indicator,overlap";
+             source: "elm";
+             script {
+                set_int(overlap_mode, 1);
+                run_program(PROGRAM:"update_indicator_adapter");
+             }
+          }
+          program { name: "nooverlap_mode";
+             signal: "elm,state,indicator,nooverlap";
+             source: "elm";
+             script {
+                set_int(overlap_mode, 0);
+                run_program(PROGRAM:"update_indicator_adapter");
+             }
+          }
+          program { name: "update_indicator_adapter";
+             script {
+                // indicator base/adapter update
+                if (get_int(indicator_mode) == INDICATOR_MODE_SHOW) {
+                  if (get_int(indicator_rotation) == INDICATOR_ROTATION_PORTRAIT) {
+                    if ((get_int(indicator_opacity) == INDICATOR_OPACITY_OPAQUE) ||
+                        (get_int(indicator_opacity) == INDICATOR_OPACITY_UNKNOWN)) {
+                      set_state(PART:"indicator_base", "default", 0.0);
+                      set_state(PART:"indicator_adapter", "default", 0.0);
+                    } else if (get_int(indicator_opacity) == INDICATOR_OPACITY_TRANSPARENT) {
+                      set_state(PART:"indicator_base", "hide", 0.0);
+                      set_state(PART:"indicator_adapter", "hide", 0.0);
+                    } else {
+                      set_state(PART:"indicator_base", "hide", 0.0);
+                      set_state(PART:"indicator_adapter", "default", 0.0);
+                    }
+                  } else { // LANDSCAPE
+                    set_state(PART:"indicator_base", "hide", 0.0);
+                    set_state(PART:"indicator_adapter", "hide", 0.0);
+                  }
+                } else { // HIDE
+                  set_state(PART:"indicator_base", "hide", 0.0);
+                  set_state(PART:"indicator_adapter", "hide", 0.0);
+                }
+                // indicator bg update
+                if (get_int(indicator_rotation) == INDICATOR_ROTATION_PORTRAIT) {
+                  if (get_int(indicator_opacity) == INDICATOR_OPACITY_TRANSPARENT) {
+                    set_state(PART:"indicator_bg", "transparent", 0.0);
+                    set_state(PART:"elm.swallow.indicator_bg", "transparent", 0.0);
+                  } else if (get_int(indicator_opacity) == INDICATOR_OPACITY_TRANSLUCENT) {
+                    set_state(PART:"indicator_bg", "translucent", 0.0);
+                    set_state(PART:"elm.swallow.indicator_bg", "transparent", 0.0);
+                  } else if (get_int(indicator_opacity) == INDICATOR_OPACITY_BGTRANSPARENT) {
+                    set_state(PART:"indicator_bg", "transparent", 0.0);
+                    set_state(PART:"elm.swallow.indicator_bg", "transparent", 0.0);
+                  } else { // OPAQUE here
+                    set_state(PART:"indicator_bg", "default", 0.0);
+                    set_state(PART:"elm.swallow.indicator_bg", "default", 0.0);
+                  }
+                } else {
+                  set_state(PART:"indicator_bg", "transparent", 0.0);
+                  set_state(PART:"elm.swallow.indicator_bg", "transparent", 0.0);
+                }
+                // legacy support
+                if (get_int(overlap_mode) == 1 ) {
+                  set_state(PART:"overlap_clipper", "overlap", 0.0);
+                } else {
+                  set_state(PART:"overlap_clipper", "default", 0.0);
+                }
+             }
+          }
+          program { name: "landscape_mode";
+             source: "elm";
+             signal: "elm,state,orient,90";
+             after: "change_to_landscape";
+          }
+          program { name: "landscape_mode2";
+             source: "elm";
+             signal: "elm,state,orient,270";
+             after: "change_to_landscape";
+          }
+          program { name: "portrait_mode";
+             source: "elm";
+             signal: "elm,state,orient,0";
+             after: "change_to_portrait";
+          }
+          program { name: "portrait_mode2";
+             source: "elm";
+             signal: "elm,state,orient,180";
+             after: "change_to_portrait";
+          }
+       }
+    }
+
     group {
         name: "main_layout";
         parts {