From af9afcb3659a5012668b7cc615612f543b457891 Mon Sep 17 00:00:00 2001 From: Navjot Date: Wed, 18 Sep 2019 13:14:00 +0530 Subject: [PATCH] workred on identicon issue for android devices --- src/bitmessagekivy/main.kv | 2 +- src/bitmessagekivy/mpybit.py | 20 +++++++++----------- src/buildozer.spec | 3 ++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/bitmessagekivy/main.kv b/src/bitmessagekivy/main.kv index 78b52d97..b69b633a 100644 --- a/src/bitmessagekivy/main.kv +++ b/src/bitmessagekivy/main.kv @@ -650,7 +650,7 @@ NavigationLayout: do_scroll_x: False BoxLayout: orientation: 'vertical' - padding: [dp(app.window_size[0]/4*1.1), dp(10)] + padding: [dp(app.window_size[0]/16 if app.window_size[0] <= 720 else app.window_size[0]/4*1.1), dp(10)] spacing: 12 size_hint_y: None height: self.minimum_height + dp(app.window_size[1]) if app.window_size[1] > app.window_size[0] else dp(app.window_size[0]) diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index e3225c8c..a3ce0960 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -57,9 +57,10 @@ import state from uikivysignaler import UIkivySignaler # pylint: disable=unused-argument, too-few-public-methods, import-error - -if platform == 'linux': - import identiconGeneration +import identiconGeneration +import os +from kivy.core.clipboard import Clipboard +# pylint: disable=unused-argument, too-few-public-methods def toast(text): @@ -1028,8 +1029,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods def getCurrentAccountData(self, text): """Get Current Address Account Data.""" - if platform == 'linux': - self.set_identicon(text) + self.set_identicon(text) address_label = self.current_address_label( BMConfigParser().get(text, 'label'), text) self.root_window.children[1].ids.toolbar.title = address_label @@ -1089,10 +1089,9 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods def getDefaultAccData(self): """Getting Default Account Data.""" if BMConfigParser().addresses(): - if platform == 'linux': - img = identiconGeneration.generate(BMConfigParser().addresses()[0]) - self.createFolder('./images/default_identicon/') - img.texture.save('./images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0])) + img = identiconGeneration.generate(BMConfigParser().addresses()[0]) + self.createFolder('./images/default_identicon/') + img.texture.save('./images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0])) return BMConfigParser().addresses()[0] return 'Select Address' @@ -1109,8 +1108,7 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods def get_default_image(): """Getting default image on address""" if BMConfigParser().addresses(): - if platform == 'linux': - return './images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0]) + return './images/default_identicon/{}.png'.format(BMConfigParser().addresses()[0]) return '' @staticmethod diff --git a/src/buildozer.spec b/src/buildozer.spec index 25080ba6..9ed79860 100644 --- a/src/buildozer.spec +++ b/src/buildozer.spec @@ -44,7 +44,8 @@ requirements = bitmsghash, kivymd, kivy-garden, - qrcode + qrcode, + Pillow # (str) Custom source folders for requirements # Sets custom source for any requirements with recipes