2424 ElevatedButton ,
2525 Markdown ,
2626 Row ,
27+ colors ,
28+ OutlinedButton ,
2729 Text ,
2830 icons ,
31+ TextButton ,
32+ AlertDialog ,
2933)
34+ from flet .buttons import CountinuosRectangleBorder
3035
3136from views import BaseView
3237from app_state import AppState
@@ -44,7 +49,19 @@ def __init__(
4449 super ().__init__ (state = state , image = "requirements-default.png" )
4550 self .on_confirm = on_confirm
4651
52+ def open_find_version_dlg (self , e ):
53+ """Open the dialog to explain how to find the android and firmware version."""
54+ self .page .dialog = self .dlg_howto_find_versions
55+ self .dlg_howto_find_versions .open = True
56+ self .page .update ()
57+
58+ def close_find_version_dlg (self , e ):
59+ """Close the dialog to explain how to find the android and firmware version."""
60+ self .dlg_howto_find_versions .open = False
61+ self .page .update ()
62+
4763 def build (self ):
64+ # continue button
4865 self .continue_button = ElevatedButton (
4966 "Continue" ,
5067 on_click = self .on_confirm ,
@@ -53,6 +70,40 @@ def build(self):
5370 expand = True ,
5471 )
5572
73+ # dialog to explain howto find the android and firmware version
74+ self .dlg_howto_find_versions = AlertDialog (
75+ modal = True ,
76+ title = Text ("Where to find the current Android and/or firmware version?" ),
77+ content = Markdown (
78+ """
79+ ## Find your current Android Version
80+ Scroll down on the Settings screen and look for an "About phone", "About tablet", or "System" option.
81+ You'll usually find this at the very bottom of the main Settings screen, under System, but depending
82+ on your phone it could be different. If you do find a specific option for System, you can usually
83+ find the "About Phone" underneath that.
84+
85+ On the resulting screen, look for "Android version" to find the version of Android installed on your device.
86+
87+ ## Find your current device firmware version
88+ On the same screen you find the "Android version" you can also find the Firmware Version.
89+ On some devices, the build version is basically the firmware version.""" ,
90+ ),
91+ actions = [
92+ TextButton ("Close" , on_click = self .close_find_version_dlg ),
93+ ],
94+ actions_alignment = "end" ,
95+ shape = CountinuosRectangleBorder (radius = 0 ),
96+ )
97+ # create help/info button to show the help dialog
98+ info_button = OutlinedButton (
99+ "How to Find the version" ,
100+ on_click = self .open_find_version_dlg ,
101+ expand = False ,
102+ icon = icons .HELP_OUTLINE_OUTLINED ,
103+ icon_color = colors .DEEP_ORANGE_500 ,
104+ tooltip = "How to find the firmware and android version of your device." ,
105+ )
106+
56107 # build up the main view
57108 self .right_view .controls .extend (
58109 [
@@ -91,10 +142,18 @@ def enable_continue_button(e):
91142 Container (
92143 content = Column (
93144 [
145+ Row (
146+ [
147+ Text (
148+ f"Android Version { required_android_version } :" ,
149+ style = "titleSmall" ,
150+ ),
151+ info_button ,
152+ ],
153+ alignment = "spaceBetween" ,
154+ ),
94155 Markdown (
95- f"""
96- #### Android Version { required_android_version } :
97- Before following these instructions please ensure that the device is currently using Android { required_android_version } firmware.
156+ f"""Before following these instructions please ensure that the device is currently using Android { required_android_version } firmware.
98157If the vendor provided multiple updates for that version, e.g. security updates, make sure you are on the latest!
99158If your current installation is newer or older than Android { required_android_version } , please upgrade or downgrade to the required
100159version before proceeding (guides can be found on the internet!).
@@ -120,10 +179,18 @@ def enable_continue_button(e):
120179 Container (
121180 content = Column (
122181 [
182+ Row (
183+ [
184+ Text (
185+ f"Firmware Version { required_firmware_version } :" ,
186+ style = "titleSmall" ,
187+ ),
188+ info_button ,
189+ ],
190+ alignment = "spaceBetween" ,
191+ ),
123192 Markdown (
124- f"""
125- #### Firmware Version { required_firmware_version } :
126- Before following these instructions please ensure that the device is on firmware version { required_firmware_version } .
193+ f"""Before following these instructions please ensure that the device is on firmware version { required_firmware_version } .
127194To discern this, you can run the command `adb shell getprop ro.build.display.id` on the stock ROM.
128195If the device is not on the specified version, please follow the instructions below to install it.
129196 """
0 commit comments