Skip to content

Commit

Permalink
font change and more responsive ui
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinceOfPuppers committed Dec 3, 2020
1 parent af4f9fa commit ffb9ad7
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 37 deletions.
6 changes: 3 additions & 3 deletions buildozer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ package.domain = org.test
source.dir = sync_dl_gui

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas
source.include_exts = py,png,jpg,kv,atlas,ttf

# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png
source.include_patterns = sync_dl_gui/assets/*

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec
Expand Down Expand Up @@ -75,7 +75,7 @@ osx.kivy_version = 1.9.1
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0
fullscreen = 1

# (string) Presplash background color (for android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
Expand Down
Binary file added sync_dl_gui/assets/DroidSansFallback.ttf
Binary file not shown.
File renamed without changes
21 changes: 10 additions & 11 deletions sync_dl_gui/elements.kv
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,18 @@
<Console>
foreground_color: white
background_color: darkGreyA
font_name: 'RobotoMono-Regular'
font_name:'assets/DroidSansFallback.ttf'
font_size:sp(13)







<DragLabel>
# Define the properties for the DragLabel
drag_rectangle: self.x, self.y, self.width, self.height
drag_timeout: 10000000
drag_distance: 0
font_size: sp(12)
font_size:sp(13)

font_name:'assets/DroidSansFallback.ttf'

<SongList>
cols:1
Expand All @@ -77,27 +74,29 @@
text:''

<LabelPlate@Button>
font_name:'assets/DroidSansFallback.ttf'
disabled: True
font_size: sp(20)
disabled_color:self.color
background_disabled_normal: self.background_normal


<Button@Button>:
font_name:'assets/DroidSansFallback.ttf'
background_color: greyA
font_size: sp(20)

<Title@LabelPlate>:

font_name:'assets/DroidSansFallback.ttf'
background_color: darkGreyA
font_size: sp(60)
font_size: sp(40)
size_hint_y:None
height: 2*self.font_size


<Header@LabelPlate>:
font_name:'assets/DroidSansFallback.ttf'
size_hint_y:None
background_color: darkGreyA
font_size: sp(60)
font_size: sp(40)
height: 2*self.font_size

20 changes: 17 additions & 3 deletions sync_dl_gui/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from kivy.uix.gridlayout import GridLayout
from kivy.uix.behaviors import DragBehavior
from kivy.metrics import sp
from kivy.properties import ObjectProperty

import sys
import os
Expand All @@ -36,6 +37,9 @@ def emit(self, record):
Clock.schedule_once(lambda x:self.console.append(self.format(record)))

class Console(TextInput):

scrollView = ObjectProperty(None)

def __init__(self, **kwargs):
super(Console, self).__init__(**kwargs)
self.keyboard_mode= 'managed'
Expand All @@ -45,12 +49,21 @@ def __init__(self, **kwargs):

def on_focus(self,instance, value):
self.focus=False


def on_double_tap(self):
self.focus=False

def on_triple_tap(self):
self.focus=False

def on_quad_touch(self):
self.focus=False
def append(self,text):
self.cursor=(0,sys.maxsize)
self.readonly=False
self.insert_text(f' ~ {text}\n')
self.readonly=True
self.scrollView.scroll_y = 0



Expand Down Expand Up @@ -116,11 +129,12 @@ def __init__(self,grid,initalIndex, **kwargs):
self.moving = False
self.grid = grid
self.initalIndex = initalIndex
self.font_size = sp(15)

self.size_hint_y = None
self.dragFontSize = 1.4*self.font_size
self.height = 2*self.font_size
self.initalFontSize = self.font_size
self.dragFontSize = sp(17)



def findNearestSlot(self):
Expand Down
2 changes: 1 addition & 1 deletion sync_dl_gui/main.kv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FloatLayout:
anchor_x: 'center'
anchor_y: 'center'
Image:
source: 'test.jpg'
source: 'assets/test.jpg'
allow_stretch: True
keep_ratio: True
size_hint_y: None
Expand Down
4 changes: 2 additions & 2 deletions sync_dl_gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import sync_dl.config as cfg
import os
from android.permissions import request_permissions, Permission

import youtube_dl
import shutil
import certifi
Expand Down Expand Up @@ -58,7 +58,7 @@ def getPermissions():
cfg.params['ignoreerrors'] = True
#cfg.params['logger'] = cfg.logger
cfg.params['postprocessors'] = []



Main().run()
8 changes: 8 additions & 0 deletions sync_dl_gui/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from sync_dl import noInterrupt
import sync_dl.config as cfg
import time
import sys

from elements import Console,PlaylistList

Expand Down Expand Up @@ -104,6 +105,13 @@ def __init__(self, **kwargs):
def on_pre_enter(self):
if self.playlists:
self.playlists.updateList()

def close(self):
if kivy.utils.platform=='android':
app = App.get_running_app()
app.stop()
else:
sys.exit()


class NewPlScreen(Screen):
Expand Down
10 changes: 6 additions & 4 deletions sync_dl_gui/screens/existingPlScreen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@

cols:1

Console:
id: console



ScrollView:
Console:
scrollView:self.parent
size_hint_y: None
height: max(self.minimum_height,self.parent.height)
id: console
GridLayout:
cols:2
size_hint_y:None
Expand Down
23 changes: 16 additions & 7 deletions sync_dl_gui/screens/mainScreen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@

console:console

Console:
size_hint_y:None
height: root.height*0.6
id: console
ScrollView:
Console:
scrollView:self.parent
size_hint_y: None
height: max(self.minimum_height,self.parent.height)
id: console

GridLayout:
spacing:(gaps,gaps)
cols:2
Expand Down Expand Up @@ -64,6 +67,12 @@
height: self.minimum_height
row_default_height: root.height*0.07

Header:
text:''
height: root.height*0.05


Button:
size_hint_y:None
background_color:darkGreyA
text: 'Close'
height: root.height*0.1
on_release:
root.close()
10 changes: 8 additions & 2 deletions sync_dl_gui/screens/newPlScreen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@
GridLayout:
padding:(gaps,gaps)
cols:1
Console:
id: console

ScrollView:
Console:
scrollView:self.parent
size_hint_y: None
height: max(self.minimum_height,self.parent.height)
id: console



GridLayout:
Expand Down
13 changes: 9 additions & 4 deletions sync_dl_gui/screens/settingsScreen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,17 @@
on_release:
root.setMusicDir()

Console:

ScrollView:
size_hint_y:None
height: root.height*0.1
halign:'center'

id: console
Console:
scrollView:self.parent
size_hint_y:None

halign:'center'
height: max(self.minimum_height,self.parent.height)
id: console


GridLayout:
Expand Down

0 comments on commit ffb9ad7

Please sign in to comment.