Skip to content

Commit 62be5c3

Browse files
author
rudu
committed
Added device specific notes
1 parent f656346 commit 62be5c3

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ Every config file should have `metadata` with the following fields:
215215
- `device_code`: str; The official device code.
216216
- `supported_device_codes`: List[str]; A list of supported device codes for the config. The config will be loaded based on this field.
217217
- `twrp-link`: [OPTIONAL] str; name of the corresponding twrp page.
218+
- `notes`: [OPTIONAL] str; specific phone information, showed before choosing ROM / recovery
218219

219220
In addition to these metadata, every config can have optional `requirements`. If these are set, the user is asked to check if they are meet.
220221
- `android`: [OPTIONAL] int|str; Android version to install prior to installing a custom ROM.

‎openandroidinstaller/installer_config.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def validate_config(config: str) -> bool:
166166
"device_code": str,
167167
"supported_device_codes": [str],
168168
schema.Optional("twrp-link"): str,
169+
schema.Optional("notes"): str,
169170
},
170171
schema.Optional("requirements"): {
171172
schema.Optional("android"): schema.Or(str, int),

‎openandroidinstaller/views/select_view.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,20 @@ def build(self):
144144

145145
# text row to show infos during the process
146146
self.info_field = Row()
147+
148+
# Device specific notes
149+
if "notes" in self.state.config.metadata:
150+
self.right_view.controls.extend(
151+
[
152+
Text(
153+
"Important notes for your device",
154+
style="titleSmall",
155+
color=colors.RED,
156+
weight="bold",
157+
),
158+
Markdown(f"""{self.state.config.metadata['notes']}"""),
159+
]
160+
)
147161
# if there is an available download, show the button to the page
148162
if self.download_link:
149163
twrp_download_link = f"https://dl.twrp.me/{self.state.config.twrp_link if self.state.config.twrp_link else self.state.config.device_code}"

0 commit comments

Comments
 (0)