4646 UserControl ,
4747 FloatingActionButton ,
4848 VerticalDivider ,
49+ Markdown ,
4950 colors ,
5051 icons ,
5152)
6869from widgets import call_button , confirm_button , get_title , link_button
6970
7071# Toggle to True for development purposes
71- DEVELOPMENT = False
72- DEVELOPMENT_CONFIG = "yuga " # "a3y17lte" # "sargo"
72+ DEVELOPMENT = False
73+ DEVELOPMENT_CONFIG = "sargo " # "a3y17lte" # "sargo"
7374
7475
7576PLATFORM = sys .platform
@@ -125,8 +126,13 @@ def build(self):
125126 self .dlg_help_developer_options = AlertDialog (
126127 modal = True ,
127128 title = Text ("How to enable developer options and OEM unlocking" ),
128- content = Text (
129- "To do this, tap seven times on the build number in the 'System'- or 'About the phone'-Menu in Settings. Then in developer options, toggle OEM unlocking and USB-Debugging."
129+ content = Markdown (
130+ """
131+ To do this, tap seven times on the build number in the 'System'- or 'About the phone'-Menu in Settings. You can also use the phones own search to look for `build number`.
132+ Then go back to the main menu and look for 'developer options'. You can also search for it in your phone.
133+ When you are in developer options, toggle OEM unlocking and USB-Debugging. If your phone is already connected to your PC, a pop-up might appear. Allow USB debugging in the pop-up on your phone.
134+ Now you are ready to continue.
135+ """
130136 ),
131137 actions = [
132138 TextButton ("Close" , on_click = self .close_developer_options_dlg ),
@@ -174,7 +180,7 @@ def check_bootloader_unlocked(e):
174180 ),
175181 Row (
176182 [
177- FilledButton (
183+ ElevatedButton (
178184 "How do I enable developer mode?" ,
179185 on_click = self .open_developer_options_dlg ,
180186 expand = True ,
@@ -196,7 +202,7 @@ def check_bootloader_unlocked(e):
196202 ),
197203 Row (
198204 [
199- ElevatedButton (
205+ FilledButton (
200206 "Search device" ,
201207 on_click = self .search_devices ,
202208 icon = icons .PHONE_ANDROID ,
@@ -309,7 +315,7 @@ def build(self):
309315 Column (
310316 [
311317 Text (
312- "You can download supported image and recovery file for your device here:"
318+ "You can bring your own image and recovery or you download the officially supported image and recovery file for your device here:"
313319 ),
314320 Row (
315321 [
@@ -323,6 +329,13 @@ def build(self):
323329 ),
324330 ]
325331 ),
332+ Markdown (
333+ f"""
334+ The image file should look something like `lineage-19.1-20221101-nightly-{ self .state .config .metadata .get ('devicecode' )} -signed.zip`
335+ and the recovery like `lineage-19.1-20221101-recovery-{ self .state .config .metadata .get ('devicecode' )} .img`
336+ or `twrp-3.6.2_9-0-{ self .state .config .metadata .get ('devicecode' )} .img`.
337+ """
338+ ),
326339 Divider (),
327340 ]
328341 )
@@ -382,11 +395,11 @@ def enable_button_if_ready(self, e):
382395 recovery_path = self .state .recovery_path ,
383396 ):
384397 # if image and recovery work for device allow to move on, otherwise display message
385- self .info_field .controls . append (
398+ self .info_field .controls = [
386399 Text (
387400 "Image and recovery don't work with the device. Please select different ones."
388401 )
389- )
402+ ]
390403 self .right_view .update ()
391404 return
392405 self .info_field .controls = []
@@ -518,8 +531,9 @@ def load_config(self, device_code: str) -> Optional[str]:
518531 return self .config .metadata .get ("devicename" , "No device name in config." )
519532
520533 def pick_image_result (self , e : FilePickerResultEvent ):
521- self .selected_image .value += (
522- ", " .join (map (lambda f : f .name , e .files )) if e .files else "Cancelled!"
534+ path = ", " .join (map (lambda f : f .name , e .files )) if e .files else "Cancelled!"
535+ self .selected_image .value = (
536+ self .selected_image .value .split (":" )[0 ] + f": { path } "
523537 )
524538 if e .files :
525539 self .image_path = e .files [0 ].path
@@ -530,8 +544,9 @@ def pick_image_result(self, e: FilePickerResultEvent):
530544 self .selected_image .update ()
531545
532546 def pick_recovery_result (self , e : FilePickerResultEvent ):
533- self .selected_recovery .value += (
534- ", " .join (map (lambda f : f .name , e .files )) if e .files else "Cancelled!"
547+ path = ", " .join (map (lambda f : f .name , e .files )) if e .files else "Cancelled!"
548+ self .selected_recovery .value = (
549+ self .selected_recovery .value .split (":" )[0 ] + f": { path } "
535550 )
536551 if e .files :
537552 self .recovery_path = e .files [0 ].path
@@ -713,15 +728,14 @@ def close_banner(e):
713728 bgcolor = colors .AMBER_100 ,
714729 leading = Icon (icons .WARNING_AMBER_ROUNDED , color = colors .AMBER , size = 40 ),
715730 content = Text (
716- "Important: Please read through the instructions at least once before actually following them, so as to avoid any problems due to any missed steps !"
731+ "These instructions only work if you follow every section and step precisely. Do not continue after something fails !"
717732 ),
718733 actions = [
719734 TextButton ("I understand" , on_click = close_banner ),
720735 ],
721736 )
722- # TODO: disable the banner for now
723- # page.banner.open = True
724- # page.update()
737+ page .banner .open = True
738+ page .update ()
725739
726740 # create application instance
727741 app = MainView ()
0 commit comments