| 26 | } |
| 27 | |
| 28 | void IntervalSelectionActivity::loop() { |
| 29 | if (ignoreConfirmRelease) { |
| 30 | if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) { |
| 31 | ignoreConfirmRelease = false; |
| 32 | return; |
| 33 | } |
| 34 | if (!mappedInput.isPressed(MappedInputManager::Button::Confirm)) { |
| 35 | ignoreConfirmRelease = false; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | if (mappedInput.wasReleased(MappedInputManager::Button::Back)) { |
| 40 | ActivityResult result; |
| 41 | result.isCancelled = true; |
| 42 | setResult(std::move(result)); |
| 43 | finish(); |
| 44 | return; |
| 45 | } |
| 46 | |
| 47 | if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) { |
| 48 | setResult(IntervalResult{static_cast<uint32_t>(value)}); |
| 49 | finish(); |
| 50 | return; |
| 51 | } |
| 52 | |
| 53 | buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Left}, [this] { adjustValue(-smallStep); }); |
| 54 | buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Right}, [this] { adjustValue(smallStep); }); |
| 55 | buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Up}, [this] { adjustValue(largeStep); }); |
| 56 | buttonNavigator.onPressAndContinuous({MappedInputManager::Button::Down}, [this] { adjustValue(-largeStep); }); |
| 57 | } |
| 58 | |
| 59 | void IntervalSelectionActivity::render(RenderLock&&) { |
| 60 | renderer.clearScreen(); |
nothing calls this directly
no test coverage detected