Skip to content

Commit

Permalink
nbgl: Add nbgl_useCaseForwardOnlyReviewNoSkip()
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed Dec 1, 2023
1 parent e3f06b3 commit a3ade94
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib_nbgl/include/nbgl_use_case.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ 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,
Expand Down
41 changes: 40 additions & 1 deletion lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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".
Expand Down

0 comments on commit a3ade94

Please sign in to comment.