From b99e6069c1b0749a4811c4d222c5009cbad1edc8 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 16 Oct 2018 15:13:09 -0700 Subject: Add function to show localized rescue party menu Add a function in screenUI to display the pre-generated graphs for rescue party. If these graphs are not valid, falls back to display the old text strings. Right now we haven't generated the localized graphs yet, so the UI always shows the TextMenu. Bug: 116655889 Test: check rescue party under recovery Change-Id: I0558cb536b659cdc25c8b7946d3a39820935b003 --- wear_ui.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'wear_ui.cpp') diff --git a/wear_ui.cpp b/wear_ui.cpp index 8f3bc7bbe..0611f94c9 100644 --- a/wear_ui.cpp +++ b/wear_ui.cpp @@ -95,13 +95,14 @@ void WearRecoveryUI::update_progress_locked() { void WearRecoveryUI::SetStage(int /* current */, int /* max */) {} -void WearRecoveryUI::StartMenu(const std::vector& headers, - const std::vector& items, size_t initial_selection) { - std::lock_guard lg(updateMutex); +std::unique_ptr WearRecoveryUI::CreateMenu(const std::vector& text_headers, + const std::vector& text_items, + size_t initial_selection) const { if (text_rows_ > 0 && text_cols_ > 0) { - menu_ = std::make_unique(scrollable_menu_, text_rows_ - menu_unusable_rows_ - 1, - text_cols_ - 1, headers, items, initial_selection, - char_height_, *this); - update_screen_locked(); + return std::make_unique(scrollable_menu_, text_rows_ - menu_unusable_rows_ - 1, + text_cols_ - 1, text_headers, text_items, initial_selection, + char_height_, *this); } + + return nullptr; } -- cgit v1.2.3