Skip to content

Commit

Permalink
Merge pull request #2 from HackXIt/develop
Browse files Browse the repository at this point in the history
Merge latest develop (UI Frontend changed to KivyMD)
  • Loading branch information
HackXIt authored Mar 28, 2024
2 parents 2815442 + 8a91ea6 commit 1695eb3
Show file tree
Hide file tree
Showing 26 changed files with 1,623 additions and 472 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/windows/build_exe_onefile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $TargetSpecFile = "$Target.spec"

# Copy SpeechJokey.spec from .github/static to the current directory
Copy-Item ".github/static/$TargetSpecFile" -Destination "."
Copy-Item ".github/static/speech-jokey.png" -Destination "."
Copy-Item ".github/static/speech-jokey.ico" -Destination "."

# Remove null bytes from spec file (PyInstaller compatibility issue)
(Get-Content .\$TargetSpecFile) -replace "`0", "" | Set-Content .\$TargetSpecFile
Expand Down
2 changes: 1 addition & 1 deletion .github/static/SpeechJokey.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from kivymd import hooks_path as kivymd_hooks_path

block_cipher = None
app_name = 'SpeechJokey'
win_icon = '.\speech-jokey.png'
win_icon = '.\speech-jokey.ico'

a = Analysis(
['src\\main.py'],
Expand Down
Binary file added .github/static/speech-jokey.ico
Binary file not shown.
122 changes: 122 additions & 0 deletions playground/expansion_panel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import asynckivy
from kivy.animation import Animation
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.uix.behaviors import ButtonBehavior

from kivymd.app import MDApp
from kivymd.uix.behaviors import RotateBehavior
from kivymd.uix.expansionpanel import MDExpansionPanel
from kivymd.uix.list import MDListItemTrailingIcon

KV = '''
<ExpansionPanelItem>
MDExpansionPanelHeader:
MDListItem:
theme_bg_color: "Custom"
md_bg_color: self.theme_cls.surfaceContainerLowColor
ripple_effect: False
MDListItemSupportingText:
text: "Supporting text"
TrailingPressedIconButton:
id: chevron
icon: "chevron-right"
on_release: app.tap_expansion_chevron(root, chevron)
MDExpansionPanelContent:
orientation: "vertical"
padding: "12dp", 0, "12dp", "12dp"
md_bg_color: self.theme_cls.surfaceContainerLowestColor
MDLabel:
text: "Channel information"
adaptive_height: True
padding_x: "16dp"
padding_y: "12dp"
MDListItem:
theme_bg_color: "Custom"
md_bg_color: self.theme_cls.surfaceContainerLowestColor
MDListItemLeadingIcon:
icon: "email"
MDListItemHeadlineText:
text: "Email"
MDListItemSupportingText:
text: "kivydevelopment@gmail.com"
MDListItem:
theme_bg_color: "Custom"
md_bg_color: self.theme_cls.surfaceContainerLowestColor
MDListItemLeadingIcon:
icon: "instagram"
MDListItemHeadlineText:
text: "Instagram"
MDListItemSupportingText:
text: "Account"
MDListItemTertiaryText:
text: "www.instagram.com/KivyMD"
MDScreen:
md_bg_color: self.theme_cls.backgroundColor
ScrollView:
size_hint_x: .5
pos_hint: {"center_x": .5, "center_y": .5}
MDList:
id: container
'''


class ExpansionPanelItem(MDExpansionPanel):
...


class TrailingPressedIconButton(
ButtonBehavior, RotateBehavior, MDListItemTrailingIcon
):
...


class Example(MDApp):
def on_start(self):
async def set_panel_list():
for i in range(12):
await asynckivy.sleep(0)
self.root.ids.container.add_widget(ExpansionPanelItem())

super().on_start()
asynckivy.start(set_panel_list())

def build(self):
self.theme_cls.theme_style = "Dark"
return Builder.load_string(KV)

def tap_expansion_chevron(
self, panel: MDExpansionPanel, chevron: TrailingPressedIconButton
):
Animation(
padding=[0, dp(12), 0, dp(12)]
if not panel.is_open
else [0, 0, 0, 0],
d=0.2,
).start(panel)
panel.open() if not panel.is_open else panel.close()
panel.set_chevron_down(
chevron
) if not panel.is_open else panel.set_chevron_up(chevron)

if __name__ == '__main__':
Example().run()
657 changes: 384 additions & 273 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ keywords = ["speech-synthesis", "ML", "cerebral-pulsy"]

[tool.poetry.dependencies]
python = ">=3.9,<3.12" # Lower than 3.12 because of kivy compatibility (3.7 - 3.11)
kivy = { version = "2.2.1", extras = ["base"] }
kivy = { version = "2.3.0", extras = ["base"] }
six = "^1.16.0"
buildozer = "^1.5.0"
pyinstaller = "^5.6.2"
kivymd = "^1.1.1"
elevenlabs = "^0.2.26"
pyaudio = "^0.2.14"
kivymd = {url = "https://github.com/kivymd/KivyMD/archive/master.zip"}

[build-system]
requires = ["poetry-core"]
Expand Down
Binary file added speech-jokey.ico
Binary file not shown.
Loading

0 comments on commit 1695eb3

Please sign in to comment.