~aleteoryx/muditaos

d7779322eb99a6d0e4b102678c3616d33aa2a67a — Paweł Joński 4 years ago a6d7721
[BH-1178] Fix onboarding guidelines

Fix onboarding guidelines:
- exiting info screen only on specific keypresses
- deep press up also activatess info screen
- deep press info screen also works on other info screens
- fixed Polish deep press json.
M image/assets/lang/Polski.json => image/assets/lang/Polski.json +1 -1
@@ 624,7 624,7 @@
  "app_bell_onboarding_info_rotate": "<text font='gt_pressura' weight='regular' size='38'>Obróć, </text><text font='gt_pressura' weight='light' size='38'>aby wybrać</text>",
  "app_bell_onboarding_info_light_click": "<text font='gt_pressura' weight='regular' size='38'>Kliknij lekko, </text><text font='gt_pressura' weight='light' size='38'>aby kontynuować</text>",
  "app_bell_onboarding_info_deep_click_warning": "<text font='gt_pressura' weight='light' size='38'>Głęboko </text><text font='gt_pressura' weight='regular' size='38'>wciśnięty</text>",
  "app_bell_onboarding_info_deep_click_correction": "<text font='gt_pressura' weight='light' size='38'>Bądź bardziej delikatny, <br></br>spróbuj </text><text font='gt_pressura' weight='regular' size='38'>tym razem </text><text font='gt_pressura' weight='light' size='38'>lekko kliknąć</text>",
  "app_bell_onboarding_info_deep_click_correction": "<text font='gt_pressura' weight='light' size='38'>Bądź bardziej delikatny,<br></br>spróbuj </text><text font='gt_pressura' weight='regular' size='38'>tym razem<br></br></text><text font='gt_pressura' weight='light' size='38'>lekko kliknąć</text>",
  "app_bell_settings_advanced": "Zaawansowane",
  "app_bell_settings_time_units": "Czas i jednostki",
  "app_bell_settings_advanced_temp_scale": "Skala temperatury",

M products/BellHybrid/apps/application-bell-onboarding/ApplicationBellOnBoarding.cpp => products/BellHybrid/apps/application-bell-onboarding/ApplicationBellOnBoarding.cpp +47 -16
@@ 158,7 158,8 @@ namespace app
        auto currentWindow = getCurrentWindow()->getName();
        return (currentWindow != gui::name::window::main_window &&
                currentWindow != gui::window::name::finalizeOnBoardingWindow &&
                currentWindow != gui::window::name::informationOnBoardingWindow);
                (currentWindow != gui::window::name::informationOnBoardingWindow ||
                 informationState == OnBoarding::InformationStates::DeepClickWarningInfo));
    }

    void ApplicationBellOnBoarding::startTimerOnWindows()


@@ 183,6 184,8 @@ namespace app

            informationState = OnBoarding::InformationStates::DeepClickCorrectionInfo;
            displayInformation(msg->getWindowName());
        }
        if (selectedWindowCondition && informationState == OnBoarding::InformationStates::DeepClickCorrectionInfo) {
            informationState = OnBoarding::InformationStates::RotateInfo;
        }



@@ 201,29 204,57 @@ namespace app
        auto inputEvent = static_cast<AppInputEventMessage *>(msgl)->getEvent();

        if (isInformationPromptPermittedOnCurrentWindow()) {
            startTimerOnWindows();

            if (inputEvent.isKeyRelease(gui::KeyCode::KEY_UP) || inputEvent.isKeyRelease(gui::KeyCode::KEY_DOWN)) {
                informationState = OnBoarding::InformationStates::LightClickInfo;
            }
            else if (inputEvent.isKeyRelease(gui::KeyCode::KEY_RIGHT)) {
            else if (inputEvent.isKeyRelease(gui::KeyCode::KEY_RIGHT) ||
                     inputEvent.isKeyRelease(gui::KeyCode::KEY_LEFT)) {
                informationState = OnBoarding::InformationStates::DeepClickWarningInfo;
                displayInformation(getCurrentWindow()->getName());
                if (getCurrentWindow()->getName() == gui::window::name::informationOnBoardingWindow) {
                    displayInformation(getPrevWindow());
                }
                else {
                    displayInformation(getCurrentWindow()->getName());
                }
            }
            else if (inputEvent.isKeyRelease(gui::KeyCode::KEY_ENTER)) {
                informationState = OnBoarding::InformationStates::RotateInfo;
                if (informationState == OnBoarding::InformationStates::DeepClickWarningInfo) {
                    informationPromptTimer.stop();
                    informationState = OnBoarding::InformationStates::DeepClickCorrectionInfo;
                    displayInformation(getPrevWindow());
                }
                else {
                    informationState = OnBoarding::InformationStates::RotateInfo;
                }
            }

            return false;
        }

        if (inputEvent.isKeyRelease(gui::KeyCode::KEY_ENTER) &&
            informationState == OnBoarding::InformationStates::DeepClickWarningInfo) {
            informationState = OnBoarding::InformationStates::DeepClickCorrectionInfo;

            displayInformation(getPrevWindow());
            informationState = OnBoarding::InformationStates::RotateInfo;
            return true;
        else {
            if (getCurrentWindow()->getName() == gui::window::name::informationOnBoardingWindow) {
                switch (informationState) {
                case OnBoarding::InformationStates::DeepClickCorrectionInfo:
                    if (inputEvent.isKeyRelease(gui::KeyCode::KEY_ENTER)) {
                        switchWindow(getPrevWindow());
                        return true;
                    }
                    break;
                case OnBoarding::InformationStates::LightClickInfo:
                    if (inputEvent.isKeyRelease(gui::KeyCode::KEY_ENTER)) {
                        switchWindow(getPrevWindow());
                        return true;
                    }
                    break;
                case OnBoarding::InformationStates::RotateInfo:
                    if (inputEvent.isKeyRelease(gui::KeyCode::KEY_UP) ||
                        inputEvent.isKeyRelease(gui::KeyCode::KEY_DOWN) ||
                        inputEvent.isKeyRelease(gui::KeyCode::KEY_ENTER)) {
                        switchWindow(getPrevWindow());
                        return true;
                    }
                    break;
                default:
                    break;
                }
            }
        }

        return false;

M products/BellHybrid/apps/application-bell-onboarding/windows/OnBoardingInstructionPromptWindow.cpp => products/BellHybrid/apps/application-bell-onboarding/windows/OnBoardingInstructionPromptWindow.cpp +1 -4
@@ 27,10 27,7 @@ namespace gui

    bool OnBoardingInstructionPromptWindow::onInput(const InputEvent &inputEvent)
    {
        if (inputEvent.isShortRelease(KeyCode::KEY_ENTER)) {
            application->switchWindow(windowToReturn);
            return true;
        }
        // Inputs are handled on Application level
        return false;
    }
} // namespace gui