Skip to content

Commit

Permalink
changed navigation bar color
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinceOfPuppers committed Dec 3, 2020
1 parent ffb9ad7 commit c0f2c09
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 22 deletions.
2 changes: 1 addition & 1 deletion buildozer.spec
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ osx.kivy_version = 1.9.1
#

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

# (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/leaves1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sync_dl_gui/assets/leaves2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions sync_dl_gui/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def append(self,text):
self.scrollView.scroll_y = 0



class PlaylistList(GridLayout):
def __init__(self, **kwargs):
super(PlaylistList, self).__init__(**kwargs)
Expand Down Expand Up @@ -170,7 +169,6 @@ def __init__(self,**kwargs):
self.use_bubble = True

def _hide_cut_copy_paste(self, win=None):

bubble = self._bubble

if not bubble:
Expand Down
27 changes: 26 additions & 1 deletion sync_dl_gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,41 @@
import certifi
from time import sleep


class Main(App):
def build(self):

layout = Builder.load_file('main.kv')

if kivy.utils.platform == "android":
from android.runnable import run_on_ui_thread
@run_on_ui_thread
def changeBarColor():
if kivy.utils.platform == "android":

from jnius import autoclass


Color = autoclass("android.graphics.Color")
WindowManager = autoclass('android.view.WindowManager$LayoutParams')
activity = autoclass('org.kivy.android.PythonActivity').mActivity

window = activity.getWindow()
window.clearFlags(WindowManager.FLAG_TRANSLUCENT_STATUS)
window.addFlags(WindowManager.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.setStatusBarColor(Color.parseColor("#000000"))
window.setNavigationBarColor(Color.parseColor("#000000"))

changeBarColor()
return layout

# methods used within kv scripts
def relSize(self,x,y):
'''converts size from proportion of screen to actual size'''
return (2*Window.width*x,2*Window.height*y)





def permissionsGranted():
return check_permission(Permission.READ_EXTERNAL_STORAGE) and check_permission(Permission.WRITE_EXTERNAL_STORAGE)
Expand All @@ -48,6 +71,8 @@ def getPermissions():
cfg.musicDir = '/storage/emulated/0/Music'
if not os.path.exists(cfg.musicDir):
raise Exception(f"{cfg.musicDir} Doesnt Exist")




os.environ['SSL_CERT_FILE'] = certifi.where()
Expand Down
10 changes: 2 additions & 8 deletions sync_dl_gui/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ 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 Expand Up @@ -156,8 +150,8 @@ def cancel(self):
noInterrupt.simulateSigint()

def info(self):
runner.addJob(cmds.compareMetaData,f"{cfg.musicDir}/{self.plName}")
runner.addJob(cmds.showPlaylist,f"{cfg.musicDir}/{self.plName}",'')
#runner.addJob(cmds.compareMetaData,f"{cfg.musicDir}/{self.plName}")
runner.addJob(cmds.showPlaylist,f"{cfg.musicDir}/{self.plName}",'\n')

class ReOrderScreen(Screen):
plName = ''
Expand Down
16 changes: 8 additions & 8 deletions sync_dl_gui/screens/mainScreen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
row_default_height: root.height*0.07



Button:
size_hint_y:None
background_color:darkGreyA
text: 'Close'
height: root.height*0.1
on_release:
root.close()
#
#Button:
# size_hint_y:None
# background_color:darkGreyA
# text: 'Close'
# height: root.height*0.1
# on_release:
# root.close()
5 changes: 3 additions & 2 deletions sync_dl_gui/screens/settingsScreen.kv
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@

SettingTextEntry:
text: root.getSyncDlVersion()

readonly:True
use_bubble:False
#readonly:True



LabelPlate:
Expand Down

0 comments on commit c0f2c09

Please sign in to comment.