Title of popup disappear in the first tap on key icon 38/78738/2
authorm.kawonczyk <m.kawonczyk@samsung.com>
Wed, 6 Jul 2016 14:32:32 +0000 (16:32 +0200)
committerm.kawonczyk <m.kawonczyk@samsung.com>
Wed, 6 Jul 2016 14:39:32 +0000 (16:39 +0200)
[Issue]    http://suprem.sec.samsung.net/jira/browse/TSAM-5967
[Problem]  Title of the popup is not visible. Popup max height
           is to big when showed. When popup was opened on
           landscape and rotated to vertical, it was possible
           to scroll horizontal.
[Solution] Register on wm,rotation,change callback to notify
           elm_object on different maximum size before it is
           resized and repainted. Tried using edc programs on
           resize, it was working, however transition wasn't
           smooth enought.
[Verify]   Open wp.com and click on on lock icon. Rotate to
           landscape and vertical. Everything should be
           visible. Open popup when device is landscape and
           rotate. Horizontal scroller shouldn't be allowed
           and whole text should be visible.

Change-Id: I19f5f65965ff22c666a8f4c9769fbac511e4e9b4

core/AbstractInterfaces/AbstractPopup.h
services/CertificateService/CertificateContents.cpp
services/SimpleUI/ContentPopup_mob.cpp
services/SimpleUI/ContentPopup_mob.h
services/SimpleUI/InputPopup.h
services/SimpleUI/SimplePopup.h
services/SimpleUI/SimpleUI.cpp
services/SimpleUI/TextPopup_mob.h

index e99cedb2967a556f986898ed9659962476ba7274..9d513204c592146449b6360e6751abc3bd1e7d63 100644 (file)
@@ -64,6 +64,13 @@ public:
      */
     virtual void onBackPressed() = 0;
 
+#if PROFILE_MOBILE
+    /**
+     * @brief virtual method to handle orientation changed
+     */
+    virtual void orientationChanged() = 0;
+#endif
+
     virtual ~AbstractPopup() {};
 };
 
index 8c915a0e19377b7a7ac0c3c52c6e4631697d0d67..4a33fb37473072f96547164b411a152216b1f662 100644 (file)
@@ -220,8 +220,12 @@ Evas_Object* CertificateContents::createGenlist(Evas_Object* parent)
         evas_object_del(m_genlist);
     }
     m_genlist = elm_genlist_add(parent);
+
+    elm_scroller_policy_set(m_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_ON);
+    elm_genlist_mode_set(m_genlist, ELM_LIST_COMPRESS);
     evas_object_size_hint_weight_set(m_genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
     evas_object_size_hint_align_set(m_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
     evas_object_show(m_genlist);
 
     Elm_Genlist_Item_Class *auth_item_class = elm_genlist_item_class_new();
index 64753dee99b1f8ffce157f196fd95c713188b4ab..e4f13bbdcb51618a98b3c5994095b7e0d8750560 100644 (file)
@@ -54,6 +54,7 @@ void ContentPopup::show()
 {
     evas_object_show(m_layout);
     elm_object_part_content_set(m_parent, "popup_content", m_layout);
+    orientationChanged();
     popupShown(this);
 }
 
@@ -146,26 +147,24 @@ void ContentPopup::_layout_resize_cb(void* data, Evas* /*e*/, Evas_Object* /*obj
     BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
 
     auto self = static_cast<ContentPopup*>(data);
-    int w, h;
-    evas_object_geometry_get(self->m_layout, NULL, NULL, &w, &h);
+    int w;
+    evas_object_geometry_get(self->m_layout, NULL, NULL, &w, NULL);
     w -= 2 * Z3_SCALE_SIZE(MARGIN);
     elm_label_wrap_width_set(self->m_content, w);
+}
 
-    int x,y;
-    evas_object_geometry_get(self->m_content, NULL, NULL, &x, &y);
+void ContentPopup::orientationChanged()
+{
+    BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
 
-    auto landscapeSignal = self->isLandscape();
-    bool landscape = false;
-    if (!landscapeSignal)
+    auto landscapeSignal = isLandscape();
+    if (landscapeSignal) {
+        if (*landscapeSignal)
+            evas_object_size_hint_max_set(m_scroller, -1, MAX_HEIGHT_LANDSCAPE);
+        else
+            evas_object_size_hint_max_set(m_scroller, -1, MAX_HEIGHT);
+    } else
         BROWSER_LOGW("[%s:%d] Wrong boost signal value!", __PRETTY_FUNCTION__, __LINE__);
-    else
-        landscape = *landscapeSignal;
-
-    int maxHeight = landscape ? MAX_HEIGHT_LANDSCAPE : MAX_HEIGHT;
-    if (y < maxHeight)
-        evas_object_size_hint_max_set(self->m_scroller, w, y);
-    else
-        evas_object_size_hint_max_set(self->m_scroller, w, maxHeight);
 }
 
 
index fff8e62c3cea35bda53f98a82341a18edd371d97..708c7580b3f4e065ed768e95fe44d89c11db9518 100644 (file)
@@ -42,6 +42,7 @@ public:
     void show();
     void dismiss();
     void onBackPressed();
+    void orientationChanged();
 
     void setTitle(const std::string& title);
     void setContent(Evas_Object* content);
index 95414ec814046e68beb8fb219754e84e7515e70a..18eaab65891cac80a21989304bddeb9291ad6f96 100644 (file)
@@ -46,6 +46,9 @@ public:
     void show();
     void dismiss();
     void onBackPressed();
+#if PROFILE_MOBILE
+    void orientationChanged() {};
+#endif
 
     void setContent(Evas_Object *content);
     void setInput(const std::string &input);
index 6100899dd2da43914c59019e35e24ae6e985039e..875778a591809e6133ef9fa1a1b9c67c2c0f9967 100644 (file)
@@ -62,6 +62,9 @@ public:
     void show();
     void dismiss();
     void onBackPressed();
+#if PROFILE_MOBILE
+    void orientationChanged() {};
+#endif
 
     void setTitle(const std::string &title);
     void setMessage(const std::string &message);
index d0e554bf057cb6a60ea535e729ccb3fa5937f7f0..bd1cf104f105966fb4898261fcd9963d2787dfcc 100644 (file)
@@ -1119,6 +1119,8 @@ void SimpleUI::onRotation()
     m_webPageUI->orientationChanged();
     m_tabUI->orientationChanged();
     m_webEngine->orientationChanged();
+    if (!m_popupVector.empty())
+        m_popupVector.back()->orientationChanged();
 }
 
 void SimpleUI::__orientation_changed(void* data, Evas_Object*, void*)
index c25aea52d4a29f81a4c9ad8d34dfceaeab29eefd..ed43c960460b7b34a144e105d0b97e72916b871c 100644 (file)
@@ -42,6 +42,9 @@ public:
     void show();
     void dismiss();
     void onBackPressed();
+#if PROFILE_MOBILE
+    void orientationChanged() {};
+#endif
 
     void setTitle(const std::string& title);
     void setMessage(const std::string& message);