Menu gestures divided into scrollable, and non scrollable versions. 82/158882/4
authorPawel Kurowski <p.kurowski2@samsung.com>
Fri, 3 Nov 2017 17:04:59 +0000 (18:04 +0100)
committerPawel Kurowski <p.kurowski2@samsung.com>
Tue, 7 Nov 2017 18:44:18 +0000 (19:44 +0100)
Change-Id: I8768534f180ef7df0e4fdb1abe46e143989074ce

src/MenuBuilder.cpp
src/SelectActivity.cpp
tests/ui-scenarios/MenuBuilderTests.cpp

index 0edb8c9..0e047c9 100644 (file)
@@ -659,7 +659,13 @@ MenuBuilderImplementation::MenuBuilderImplementation()
                        homeScreen, back, buttonsAndKeys
                }
        }));
-       addToMap("IDS_MENU_GESTURES", std::make_shared<MenuImplementation>(MenuImplementation {
+       addToMap("IDS_MENU_GESTURES_NOT_SROLLABLE", std::make_shared<MenuImplementation>(MenuImplementation {
+               {
+                       swipeUp, swipeDown, swipeLeft, swipeRight,
+                       touchHold, drag, touchHoldThenDrag
+               }
+       }));
+       addToMap("IDS_MENU_GESTURES_SCROLLABLE", std::make_shared<MenuImplementation>(MenuImplementation {
                {
                        swipeUp, swipeDown, swipeLeft, swipeRight,
                        autoScroll, touchHold, drag, touchHoldThenDrag
index fd84db4..af04944 100644 (file)
@@ -325,12 +325,12 @@ void SelectActivity::navigateThroughSubMenu(const std::string &subMenuLabel)
 {
        if (subMenuLabel == "PREVIOUS_MENU") {
                navigateBack();
-       } else {
+       } else { //TODO this part should be refactored, select shouldn't perform additional logic depending on menu name
                if (subMenuLabel == "IDS_MENU_EDIT_TEXT")
                        Singleton<VConfInterface>::instance().set(TEXT_EDITION_MODE, 1);
 
                nestedMenusLabels.push_back(subMenuLabel);
-               if (subMenuLabel == "IDS_MENU_AUTO_SCROLL" && scrollableUiElement) {
+               if (subMenuLabel == "IDS_MENU_AUTO_SCROLL") {
                        DEBUG("creating scroll activities data");
                        scrollActivitiesData = createScrollActivitiesData(scrollableUiElement);
                        Singleton<UniversalSwitch>::instance().setScrollActivitiesData(scrollActivitiesData);
@@ -381,6 +381,10 @@ std::string SelectActivity::getCompleteLabelOfMenu()
                           .get(AUTO_SCROLL_KEY, false) ? "IDS_MENU_AUTO_SCROLL_ON" : "IDS_MENU_AUTO_SCROLL_OFF";
        }
 
+
+       if (nestedMenusLabels.back() == "IDS_MENU_GESTURES")
+               return scrollableUiElement ? "IDS_MENU_GESTURES_SCROLLABLE" : "IDS_MENU_GESTURES_NOT_SROLLABLE";
+
        if (nestedMenusLabels.back() == "IDS_MENU_BUTTONS_KEYS")
                return getCompleteLabelOfButtonsKeysMenu();
 
index c434a83..b8e74bb 100644 (file)
@@ -234,10 +234,15 @@ TEST_F(MenuBuilderTest, testContentOfMenuMainDuringCall)
 
 TEST_F(MenuBuilderTest, testContentOfMenuGestures)
 {
-       testMenuContent("IDS_MENU_GESTURES", {
+       testMenuContent("IDS_MENU_GESTURES_SCROLLABLE", {
                "IDS_SWIPE_UP", "IDS_SWIPE_DOWN", "IDS_SWIPE_LEFT", "IDS_SWIPE_RIGHT",
                "IDS_AUTO_SCROLL", "IDS_TOUCH_AND_HOLD", "IDS_DRAG", "IDS_TOUCH_HOLD_THEN_DRAG"
        });
+
+       testMenuContent("IDS_MENU_GESTURES_NOT_SROLLABLE", {
+               "IDS_SWIPE_UP", "IDS_SWIPE_DOWN", "IDS_SWIPE_LEFT", "IDS_SWIPE_RIGHT",
+               "IDS_TOUCH_AND_HOLD", "IDS_DRAG", "IDS_TOUCH_HOLD_THEN_DRAG"
+       });
 }
 
 TEST_F(MenuBuilderTest, testContentOfMenuActions)