From 00e5ed711dd142226716f1fa614b5666f55b36d4 Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Thu, 18 Apr 2024 15:12:11 +0200 Subject: [PATCH] ux_sync: add nbgl_useCaseReviewLight (cherry picked from commit c951b1c0b8948e2c215fa79fa140d42c5a165329) --- lib_ux_sync/include/ux_sync.h | 7 +++++++ lib_ux_sync/src/ux_sync.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/lib_ux_sync/include/ux_sync.h b/lib_ux_sync/include/ux_sync.h index c03003df5..bba5145f6 100644 --- a/lib_ux_sync/include/ux_sync.h +++ b/lib_ux_sync/include/ux_sync.h @@ -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, diff --git a/lib_ux_sync/src/ux_sync.c b/lib_ux_sync/src/ux_sync.c index a58691ae0..7a2a50604 100644 --- a/lib_ux_sync/src/ux_sync.c +++ b/lib_ux_sync/src/ux_sync.c @@ -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,