Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-0.4.2-beta' into release…
Browse files Browse the repository at this point in the history
…-0.4.2-beta
  • Loading branch information
tsterbak committed Mar 27, 2023
2 parents c8aaaa0 + d7149c8 commit 6e5e2e7
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Linux is currently the best supported platform (tested with Ubuntu 20.04/22.04 L

## Officially supported devices

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


Support for these devices is provided as best effort, but things might still go wrong.
Expand Down
4 changes: 3 additions & 1 deletion openandroidinstaller/openandroidinstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@
Icon,
Image,
Page,
Text,
TextButton,
UserControl,
colors,
icons,
)
from loguru import logger

from styles import (
Text,
)
from app_state import AppState
from views import (
SelectFilesView,
Expand Down
30 changes: 30 additions & 0 deletions openandroidinstaller/styles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""This module contains different pre-configured style elements for building the application."""

# This file is part of OpenAndroidInstaller.
# OpenAndroidInstaller is free software: you can redistribute it and/or modify it under the terms of
# the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.

# OpenAndroidInstaller is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

# You should have received a copy of the GNU General Public License along with OpenAndroidInstaller.
# If not, see <https://www.gnu.org/licenses/>."""
# Author: Tobias Sterbak

import flet as ft


class Text(ft.Text):
"""Text element to replace the default text element from flet but is selectable."""

def __init__(self, *args, **kwargs):
super().__init__(selectable=True, *args, **kwargs)


class Markdown(ft.Markdown):
"""Markdown element to replace the markdown element from flet but is selectable."""

def __init__(self, *args, **kwargs):
super().__init__(selectable=True, *args, **kwargs)
6 changes: 4 additions & 2 deletions openandroidinstaller/views/addon_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
ElevatedButton,
OutlinedButton,
FilledButton,
Markdown,
Row,
Text,
colors,
icons,
TextButton,
Expand All @@ -35,6 +33,10 @@
)
from flet.buttons import CountinuosRectangleBorder

from styles import (
Text,
Markdown,
)
from views import BaseView
from app_state import AppState
from widgets import get_title, confirm_button
Expand Down
5 changes: 4 additions & 1 deletion openandroidinstaller/views/install_addons_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
Column,
ElevatedButton,
Row,
Text,
icons,
Switch,
colors,
)

from styles import (
Text,
Markdown,
)

Expand Down
5 changes: 4 additions & 1 deletion openandroidinstaller/views/install_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
Column,
ElevatedButton,
Row,
Text,
icons,
Switch,
colors,
)

from styles import (
Text,
Markdown,
)

Expand Down
6 changes: 4 additions & 2 deletions openandroidinstaller/views/requirements_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@
Container,
Divider,
ElevatedButton,
Markdown,
Row,
colors,
OutlinedButton,
Text,
icons,
TextButton,
AlertDialog,
)
from flet.buttons import CountinuosRectangleBorder

from styles import (
Text,
Markdown,
)
from views import BaseView
from app_state import AppState
from widgets import get_title
Expand Down
6 changes: 4 additions & 2 deletions openandroidinstaller/views/select_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
ElevatedButton,
OutlinedButton,
FilledButton,
Markdown,
Row,
Text,
colors,
icons,
TextButton,
Expand All @@ -35,6 +33,10 @@
)
from flet.buttons import CountinuosRectangleBorder

from styles import (
Text,
Markdown,
)
from views import BaseView
from app_state import AppState
from widgets import get_title, confirm_button
Expand Down
8 changes: 6 additions & 2 deletions openandroidinstaller/views/start_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@
ElevatedButton,
OutlinedButton,
FilledButton,
Markdown,
Row,
Text,
TextButton,
colors,
icons,
)
from flet.buttons import CountinuosRectangleBorder

from styles import (
Text,
Markdown,
)
from views import BaseView
from app_state import AppState
from widgets import get_title
Expand Down Expand Up @@ -252,6 +254,8 @@ def search_devices(self, e):
f"{device_name} (code: {self.state.config.device_code})"
)
self.device_name.color = colors.GREEN
# if there are no steps for bootloader unlocking, assume there is nothing to do and toggle the switch
self.bootloader_switch.value = True
else:
# failed to load config
logger.error(f"Failed to load config for {device_code}.")
Expand Down
6 changes: 5 additions & 1 deletion openandroidinstaller/views/step_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@
Column,
ElevatedButton,
Row,
Text,
icons,
TextField,
Switch,
colors,
)


from styles import (
Text,
)

from views import BaseView
from installer_config import Step
from app_state import AppState
Expand Down
4 changes: 3 additions & 1 deletion openandroidinstaller/views/success_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
from flet import (
ElevatedButton,
Row,
)

from styles import (
Text,
Markdown,
)

from views import BaseView
from app_state import AppState
from widgets import get_title
Expand Down
7 changes: 5 additions & 2 deletions openandroidinstaller/views/welcome_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
from flet import (
Divider,
ElevatedButton,
Markdown,
Row,
Text,
icons,
)

from styles import (
Text,
Markdown,
)

from views import BaseView
from app_state import AppState
from widgets import get_title
Expand Down
7 changes: 5 additions & 2 deletions openandroidinstaller/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@
ProgressRing,
ProgressBar,
Row,
Text,
alignment,
icons,
IconButton,
Image,
Column,
)

from styles import (
Text,
)


class TerminalBox(UserControl):
def __init__(self, expand: bool = True, visible: bool = False):
Expand All @@ -43,7 +46,7 @@ def __init__(self, expand: bool = True, visible: bool = False):
def build(self):
self._box = Container(
content=Column(
controls=[Text("", selectable=True)],
controls=[Text("")],
scroll="auto",
expand=True,
auto_scroll=True,
Expand Down

0 comments on commit 6e5e2e7

Please sign in to comment.