diff --git a/lib_nbgl/include/nbgl_use_case.h b/lib_nbgl/include/nbgl_use_case.h index 7bae356a7..ace6a703e 100644 --- a/lib_nbgl/include/nbgl_use_case.h +++ b/lib_nbgl/include/nbgl_use_case.h @@ -177,6 +177,10 @@ void nbgl_useCaseForwardOnlyReview(const char *rejectText, nbgl_layoutTouchCallback_t buttonCallback, nbgl_navCallback_t navCallback, nbgl_choiceCallback_t choiceCallback); +void nbgl_useCaseForwardOnlyReviewNoSkip(const char *rejectText, + nbgl_layoutTouchCallback_t buttonCallback, + nbgl_navCallback_t navCallback, + nbgl_choiceCallback_t choiceCallback) void nbgl_useCaseStaticReview(const nbgl_layoutTagValueList_t *tagValueList, const nbgl_pageInfoLongPress_t *infoLongPress, const char *rejectText, diff --git a/lib_nbgl/src/nbgl_use_case.c b/lib_nbgl/src/nbgl_use_case.c index a8910331f..2a878f884 100644 --- a/lib_nbgl/src/nbgl_use_case.c +++ b/lib_nbgl/src/nbgl_use_case.c @@ -1209,7 +1209,7 @@ void nbgl_useCaseRegularReview(uint8_t initPage, * @brief Draws a flow of pages of a review, without back key. * It is possible to go to next page thanks to "tap to continue". * For each page, the given navCallback will be called to get the content. Only 'type' and - * union has to be set in this content + * union has to be set in this content * * @param rejectText text to use in footer * @param buttonCallback callback called when a potential button (details or long press) in the @@ -1245,6 +1245,45 @@ void nbgl_useCaseForwardOnlyReview(const char *rejectText, displayReviewPage(0, false); } +/** + * @brief Draws a flow of pages of a review, without back key. + * It is possible to go to next page thanks to "tap to continue". + * For each page, the given navCallback will be called to get the content. Only 'type' and + * union has to be set in this content + * + * @param rejectText text to use in footer + * @param buttonCallback callback called when a potential button (details or long press) in the + * content is touched + * @param navCallback callback called when navigation "tap to continue" is touched, to get the + * content of next page + * @param choiceCallback callback called when either long_press or footer is called (param is true + * for long press) + */ +void nbgl_useCaseForwardOnlyReviewNoSkip(const char *rejectText, + nbgl_layoutTouchCallback_t buttonCallback, + nbgl_navCallback_t navCallback, + nbgl_choiceCallback_t choiceCallback) +{ + // memorize context + onChoice = choiceCallback; + onNav = navCallback; + onControls = buttonCallback; + forwardNavOnly = true; + + // fill navigation structure + navInfo.nbPages = 0; + navInfo.navType = NAV_WITH_TAP; + navInfo.quitToken = REJECT_TOKEN; + navInfo.navWithTap.nextPageToken = NEXT_TOKEN; + navInfo.navWithTap.quitText = rejectText; + navInfo.navWithTap.backToken = BACK_TOKEN; + navInfo.navWithTap.skipText = NULL; + navInfo.progressIndicator = true; + navInfo.tuneId = TUNE_TAP_CASUAL; + + displayReviewPage(0, false); +} + /** * @brief Draws a flow of pages of a review. A back key is available on top-left of the screen, * except in first page It is possible to go to next page thanks to "tap to continue".