aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao2017-08-14 01:48:55 -0500
committerTao Bao2017-08-15 17:10:21 -0500
commit2bbc6d642d1fbfb007905d95b629fe5f833b2a1b (patch)
tree3e6e9cdb3e14e52d19c0a029c8cb7ee71db73619 /recovery.cpp
parent0459799ea83d669df089c670f244771b7be211e3 (diff)
downloadplatform-bootable-recovery-2bbc6d642d1fbfb007905d95b629fe5f833b2a1b.tar.gz
platform-bootable-recovery-2bbc6d642d1fbfb007905d95b629fe5f833b2a1b.tar.xz
platform-bootable-recovery-2bbc6d642d1fbfb007905d95b629fe5f833b2a1b.zip
screen_ui: Word-wrap menu headers.
This CL adds ScreenRecoveryUI::DrawWrappedTextLines() to better handle long menu header texts. It does a word wrap at spaces, if available. This avoids fixed-length menu headers being truncated on small screens. Bug: 64293520 Test: On bullhead, boot into recovery with --prompt_and_wipe_data, and check the prompt texts. Change-Id: Ia22746583516dd230567a267584aca558429395e
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 233e5624..c5ead451 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -757,12 +757,13 @@ static bool wipe_data(Device* device) {
757} 757}
758 758
759static bool prompt_and_wipe_data(Device* device) { 759static bool prompt_and_wipe_data(Device* device) {
760 // Use a single string and let ScreenRecoveryUI handles the wrapping.
760 const char* const headers[] = { 761 const char* const headers[] = {
761 "Can't load Android system. Your data may be corrupt.", 762 "Can't load Android system. Your data may be corrupt. "
762 "If you continue to get this message, you may need to", 763 "If you continue to get this message, you may need to "
763 "perform a factory data reset and erase all user data", 764 "perform a factory data reset and erase all user data "
764 "stored on this device.", 765 "stored on this device.",
765 NULL 766 nullptr
766 }; 767 };
767 const char* const items[] = { 768 const char* const items[] = {
768 "Try again", 769 "Try again",