Skip to content

Commit

Permalink
ux_sync: add nbgl_useCaseReviewLight
Browse files Browse the repository at this point in the history
(cherry picked from commit c951b1c)
  • Loading branch information
sgliner-ledger authored and fbeutin-ledger committed Apr 22, 2024
1 parent 84b1609 commit 00e5ed7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib_ux_sync/include/ux_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ ux_sync_ret_t ux_sync_review(nbgl_operationType_t operationType,
const char *reviewSubTitle,
const char *finishTitle);

ux_sync_ret_t ux_sync_reviewLight(nbgl_operationType_t operationType,
const nbgl_layoutTagValueList_t *tagValueList,
const nbgl_icon_details_t *icon,
const char *reviewTitle,
const char *reviewSubTitle,
const char *finishTitle);

ux_sync_ret_t ux_sync_addressReview(const char *address,
const nbgl_layoutTagValueList_t *additionalTagValueList,
const nbgl_icon_details_t *icon,
Expand Down
34 changes: 34 additions & 0 deletions lib_ux_sync/src/ux_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,40 @@ ux_sync_ret_t ux_sync_review(nbgl_operationType_t operationType,
return ux_sync_wait(false);
}

/**
* @brief Draws a flow of pages of a light 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".
* @note All tag/value pairs are provided in the API and the number of pages is automatically
* computed, the last page being a short press one
*
* @param operationType type of operation (Operation, Transaction, Message)
* @param tagValueList list of tag/value pairs
* @param icon icon used on first and last review page
* @param reviewTitle string used in the first review page
* @param reviewSubTitle string to set under reviewTitle (can be NULL)
* @param finishTitle string used in the last review page
*
* @return ret code:
* - UX_SYNC_RET_APPROVED
* - UX_SYNC_RET_REJECTED
*/
ux_sync_ret_t ux_sync_reviewLight(nbgl_operationType_t operationType,
const nbgl_layoutTagValueList_t *tagValueList,
const nbgl_icon_details_t *icon,
const char *reviewTitle,
const char *reviewSubTitle,
const char *finishTitle)
{
ux_sync_init();
nbgl_useCaseReviewLight(operationType,
tagValueList,
icon,
reviewTitle,
reviewSubTitle,
finishTitle,
choice_callback);
return ux_sync_wait(false);
}
/**
* @brief Draws a flow of pages of an extended address verification page.
* A back key is available on top-left of the screen,
Expand Down

0 comments on commit 00e5ed7

Please sign in to comment.