diff --git a/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp b/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp index ffd3b38..b2820fd 100644 --- a/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp +++ b/TouchGFX/generated/gui_generated/src/driverview_screen/DriverViewViewBase.cpp @@ -102,7 +102,7 @@ DriverViewViewBase::DriverViewViewBase() : fieldTypeSelection.setPosition(15, 95, 150, 225); fieldTypeSelection.setHorizontal(false); fieldTypeSelection.setCircular(true); - fieldTypeSelection.setEasingEquation(touchgfx::EasingEquations::backEaseOut); + fieldTypeSelection.setEasingEquation(touchgfx::EasingEquations::linearEaseOut); fieldTypeSelection.setSwipeAcceleration(10); fieldTypeSelection.setDragAcceleration(10); fieldTypeSelection.setNumberOfItems(1); diff --git a/TouchGFX/gui/include/gui/driverview_screen/DriverViewView.hpp b/TouchGFX/gui/include/gui/driverview_screen/DriverViewView.hpp index bf8b3cc..26cbc47 100644 --- a/TouchGFX/gui/include/gui/driverview_screen/DriverViewView.hpp +++ b/TouchGFX/gui/include/gui/driverview_screen/DriverViewView.hpp @@ -38,7 +38,7 @@ private: DriverViewField &getField(size_t i); void updateSelectedField(size_t select); - void updateSelectedFieldType(size_t select); + void updateSelectedFieldType(size_t select, bool animate = true); size_t selectedField; size_t selectedFieldType; diff --git a/TouchGFX/gui/src/driverview_screen/DriverViewView.cpp b/TouchGFX/gui/src/driverview_screen/DriverViewView.cpp index b9238dc..3c182a7 100644 --- a/TouchGFX/gui/src/driverview_screen/DriverViewView.cpp +++ b/TouchGFX/gui/src/driverview_screen/DriverViewView.cpp @@ -138,15 +138,22 @@ void DriverViewView::updateSelectedField(size_t selected) { fieldTypeSelection.invalidate(); selectedField = selected; - updateSelectedFieldType(fieldTypes[selectedField]); + updateSelectedFieldType(fieldTypes[selectedField], false); } -void DriverViewView::updateSelectedFieldType(size_t selected) { +void DriverViewView::updateSelectedFieldType(size_t selected, bool animate) { size_t previousSelected = selectedFieldType; selectedFieldType = selected; // Trigger update of the background fieldTypeSelection.itemChanged(previousSelected); fieldTypeSelection.itemChanged(selectedFieldType); - fieldTypeSelection.animateToItem(selectedFieldType, 0); + int16_t steps = animate ? 2 : 0; + if (selectedFieldType == 0) { + // Just animating to 0 looks very broken when scrolling forwards. Animating + // to DataFieldType_COUNT looks good in both directions. + fieldTypeSelection.animateToItem(DataFieldType_COUNT, steps); + } else { + fieldTypeSelection.animateToItem(selectedFieldType, steps); + } } diff --git a/TouchGFX/steering-wheel.touchgfx b/TouchGFX/steering-wheel.touchgfx index 72117a4..60ba093 100644 --- a/TouchGFX/steering-wheel.touchgfx +++ b/TouchGFX/steering-wheel.touchgfx @@ -436,7 +436,7 @@ "IsCircular": true, "ItemTemplateName": "DriverViewFieldSelection", "NumberofItems": 1, - "Easing": "Back", + "Easing": "Linear", "EasingOption": "Out", "SwipeAcceleration": 1.0, "DragAcceleration": 1.0