Skip to content

Commit 6e5e2e7

Browse files
committed
Merge remote-tracking branch 'origin/release-0.4.2-beta' into release-0.4.2-beta
2 parents c8aaaa0 + d7149c8 commit 6e5e2e7

File tree

13 files changed

+78
-18
lines changed

13 files changed

+78
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 L
6262

6363
## Officially supported devices
6464

65-
Currently, the **we support 56 devices** by various vendors and working on adding more soon!
65+
Currently, the **we support 57 devices** by various vendors and working on adding more soon!
6666

6767

6868
Support for these devices is provided as best effort, but things might still go wrong.

openandroidinstaller/openandroidinstaller.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@
3131
Icon,
3232
Image,
3333
Page,
34-
Text,
3534
TextButton,
3635
UserControl,
3736
colors,
3837
icons,
3938
)
4039
from loguru import logger
4140

41+
from styles import (
42+
Text,
43+
)
4244
from app_state import AppState
4345
from views import (
4446
SelectFilesView,

openandroidinstaller/styles.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""This module contains different pre-configured style elements for building the application."""
2+
3+
# This file is part of OpenAndroidInstaller.
4+
# OpenAndroidInstaller is free software: you can redistribute it and/or modify it under the terms of
5+
# the GNU General Public License as published by the Free Software Foundation,
6+
# either version 3 of the License, or (at your option) any later version.
7+
8+
# OpenAndroidInstaller is distributed in the hope that it will be useful, but WITHOUT ANY
9+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
10+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
11+
12+
# You should have received a copy of the GNU General Public License along with OpenAndroidInstaller.
13+
# If not, see <https://www.gnu.org/licenses/>."""
14+
# Author: Tobias Sterbak
15+
16+
import flet as ft
17+
18+
19+
class Text(ft.Text):
20+
"""Text element to replace the default text element from flet but is selectable."""
21+
22+
def __init__(self, *args, **kwargs):
23+
super().__init__(selectable=True, *args, **kwargs)
24+
25+
26+
class Markdown(ft.Markdown):
27+
"""Markdown element to replace the markdown element from flet but is selectable."""
28+
29+
def __init__(self, *args, **kwargs):
30+
super().__init__(selectable=True, *args, **kwargs)

openandroidinstaller/views/addon_view.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
ElevatedButton,
2424
OutlinedButton,
2525
FilledButton,
26-
Markdown,
2726
Row,
28-
Text,
2927
colors,
3028
icons,
3129
TextButton,
@@ -35,6 +33,10 @@
3533
)
3634
from flet.buttons import CountinuosRectangleBorder
3735

36+
from styles import (
37+
Text,
38+
Markdown,
39+
)
3840
from views import BaseView
3941
from app_state import AppState
4042
from widgets import get_title, confirm_button

openandroidinstaller/views/install_addons_view.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
Column,
2222
ElevatedButton,
2323
Row,
24-
Text,
2524
icons,
2625
Switch,
2726
colors,
27+
)
28+
29+
from styles import (
30+
Text,
2831
Markdown,
2932
)
3033

openandroidinstaller/views/install_view.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
Column,
2222
ElevatedButton,
2323
Row,
24-
Text,
2524
icons,
2625
Switch,
2726
colors,
27+
)
28+
29+
from styles import (
30+
Text,
2831
Markdown,
2932
)
3033

openandroidinstaller/views/requirements_view.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@
2222
Container,
2323
Divider,
2424
ElevatedButton,
25-
Markdown,
2625
Row,
2726
colors,
2827
OutlinedButton,
29-
Text,
3028
icons,
3129
TextButton,
3230
AlertDialog,
3331
)
3432
from flet.buttons import CountinuosRectangleBorder
3533

34+
from styles import (
35+
Text,
36+
Markdown,
37+
)
3638
from views import BaseView
3739
from app_state import AppState
3840
from widgets import get_title

openandroidinstaller/views/select_view.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
ElevatedButton,
2424
OutlinedButton,
2525
FilledButton,
26-
Markdown,
2726
Row,
28-
Text,
2927
colors,
3028
icons,
3129
TextButton,
@@ -35,6 +33,10 @@
3533
)
3634
from flet.buttons import CountinuosRectangleBorder
3735

36+
from styles import (
37+
Text,
38+
Markdown,
39+
)
3840
from views import BaseView
3941
from app_state import AppState
4042
from widgets import get_title, confirm_button

openandroidinstaller/views/start_view.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@
2525
ElevatedButton,
2626
OutlinedButton,
2727
FilledButton,
28-
Markdown,
2928
Row,
30-
Text,
3129
TextButton,
3230
colors,
3331
icons,
3432
)
3533
from flet.buttons import CountinuosRectangleBorder
3634

35+
from styles import (
36+
Text,
37+
Markdown,
38+
)
3739
from views import BaseView
3840
from app_state import AppState
3941
from widgets import get_title
@@ -252,6 +254,8 @@ def search_devices(self, e):
252254
f"{device_name} (code: {self.state.config.device_code})"
253255
)
254256
self.device_name.color = colors.GREEN
257+
# if there are no steps for bootloader unlocking, assume there is nothing to do and toggle the switch
258+
self.bootloader_switch.value = True
255259
else:
256260
# failed to load config
257261
logger.error(f"Failed to load config for {device_code}.")

openandroidinstaller/views/step_view.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@
2222
Column,
2323
ElevatedButton,
2424
Row,
25-
Text,
2625
icons,
2726
TextField,
2827
Switch,
2928
colors,
3029
)
3130

31+
32+
from styles import (
33+
Text,
34+
)
35+
3236
from views import BaseView
3337
from installer_config import Step
3438
from app_state import AppState

0 commit comments

Comments
 (0)