Merge pull request #72 from jaicis/Chatroom

worked on new kivymd version(0.104.1) updation and filemanager custom…
This commit is contained in:
navjotcis 2020-06-11 15:52:27 +05:30 committed by GitHub
commit 56c69625c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
146 changed files with 214 additions and 219 deletions

2
.gitignore vendored
View File

@ -21,4 +21,4 @@ build
pyan/
.buildozer/
bin/
src/images/default_identicon/
src/images/kivy/default_identicon/*png

View File

@ -9,7 +9,8 @@ isort==4.3.21
Kivy==1.11.1
Kivy-Garden==0.1.4
kivy-garden.qrcode==2019.914
kivymd==0.104.0
#-e git+https://github.com/surbhicis/KivyMD-1#egg=kivymd
-e git+https://github.com/navjotcis/KivyMD#egg=kivymd
lazy-object-proxy==1.4.3
mccabe==0.6.1
numpy==1.18.4

@ -1 +0,0 @@
Subproject commit 5aa322da9179dae305fde5af1db516c1ad9baea4

View File

@ -1,41 +0,0 @@
"""
src/bitmessagekivy/android/python-for-android/recipes/kivymd/__init__.py
=================================
"""
# pylint: disable=import-error
from os.path import join
from pythonforandroid.recipe import PythonRecipe
# from pythonforandroid.util import ensure_dir
class KivyMDRecipe(PythonRecipe):
"""This recipe installs KivyMD into the android dist from source"""
version = 'master'
url = 'https://github.com/surbhicis/kivymd/archive/master.zip'
depends = ['kivy']
site_packages_name = 'kivymd'
call_hostpython_via_targetpython = False
def should_build(self, arch): # pylint: disable=no-self-use, unused-argument
"""Method helps to build the application"""
return True
def get_recipe_env(self, arch):
"""Method is used for getting all the env paths"""
env = super(KivyMDRecipe, self).get_recipe_env(arch)
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7'
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
' -lpython2.7'
if 'sdl2' in self.ctx.recipe_build_order:
env['USE_SDL2'] = '1'
env['KIVY_SDL2_PATH'] = ':'.join([
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include'),
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_image'),
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer'),
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf'), ])
return env
recipe = KivyMDRecipe()

View File

@ -1,36 +0,0 @@
diff -Naurp KivyMD.orig/kivymd/button.py KivyMD/kivymd/button.py
--- KivyMD.orig/kivymd/button.py 2017-08-25 13:12:34.000000000 +0200
+++ KivyMD/kivymd/button.py 2018-07-10 10:37:55.719440354 +0200
@@ -175,7 +175,8 @@ class BaseButton(ThemableBehavior, Butto
self._current_button_color = self.md_bg_color_disabled
else:
self._current_button_color = self.md_bg_color
- super(BaseButton, self).on_disabled(instance, value)
+ # To add compatibility to last kivy (disabled is now an Alias property)
+ # super(BaseButton, self).on_disabled(instance, value)
class BasePressedButton(BaseButton):
diff -Naurp KivyMD.orig/kivymd/selectioncontrols.py KivyMD/kivymd/selectioncontrols.py
--- KivyMD.orig/kivymd/selectioncontrols.py 2017-08-25 13:12:34.000000000 +0200
+++ KivyMD/kivymd/selectioncontrols.py 2018-07-10 10:40:06.971439102 +0200
@@ -45,6 +45,7 @@ Builder.load_string('''
pos: self.pos
<MDSwitch>:
+ _thumb_pos: (self.right - dp(12), self.center_y - dp(12)) if self.active else (self.x - dp(12), self.center_y - dp(12))
canvas.before:
Color:
rgba: self._track_color_disabled if self.disabled else \
diff -Naurp KivyMD.orig/kivymd/tabs.py KivyMD/kivymd/tabs.py
--- KivyMD.orig/kivymd/tabs.py 2017-08-25 13:12:34.000000000 +0200
+++ KivyMD/kivymd/tabs.py 2018-07-10 10:39:20.603439544 +0200
@@ -185,7 +185,7 @@ class MDBottomNavigationBar(ThemableBeha
class MDTabHeader(MDFlatButton):
""" Internal widget for headers based on MDFlatButton"""
-
+
width = BoundedNumericProperty(dp(0), min=dp(72), max=dp(264), errorhandler=lambda x: dp(72))
tab = ObjectProperty(None)
panel = ObjectProperty(None)

View File

@ -1,5 +1,5 @@
<ArrowImg@Image>:
source: './images/down-arrow.png' if self.parent.is_open == True else './images/right-arrow.png'
source: app.image_path +('/down-arrow.png' if self.parent.is_open == True else '/right-arrow.png')
size: 15, 15
x: self.parent.x + self.parent.width - self.width - 5
y: self.parent.y + self.parent.height/2 - self.height + 5

View File

@ -18,6 +18,9 @@
multiline: False
required: True
helper_text_mode: "on_error"
canvas.before:
Color:
rgba: (0,0,0,1)
BoxLayout:
size_hint_y: None
@ -66,6 +69,9 @@
size_hint_y: None
multiline: False
helper_text_mode: "on_error"
canvas.before:
Color:
rgba: (0,0,0,1)
MyMDTextField:
id: body
@ -75,6 +81,9 @@
font_size: '15sp'
required: True
helper_text_mode: "on_error"
canvas.before:
Color:
rgba: (0,0,0,1)
BoxLayout:
spacing:50

View File

@ -74,4 +74,7 @@
line_color_focus: [0,0,0,0]
markup: True
font_size: '15sp'
canvas.before:
Color:
rgba: (0,0,0,1)
Loader:

View File

@ -21,21 +21,21 @@
ProductLayout:
heading_text: "Gas (Play Billing Codelab)"
price_text: "$0.99"
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/buynew1.png"
source: app.image_path + "/payment/buynew1.png"
description_text: "Buy gasoline to ride!"
product_id: "SKUGASBILLING"
ProductLayout:
heading_text: "Upgrade your car (Play Billing Codelab)"
price_text: "$1.49"
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/buynew1.png"
source: app.image_path + "/payment/buynew1.png"
description_text: "Buy a premium outfit for your car!"
product_id: "SKUUPGRADECAR"
ProductLayout:
heading_text: "Month in gold status (Play Billing Codelab)"
price_text: "$0.99"
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/buynew1.png"
source: app.image_path + "/payment/buynew1.png"
description_text: "Enjoy a gold status for a month!"
product_id: "SKUMONTHLYGOLD"
@ -45,7 +45,7 @@
ProductLayout:
heading_text: "Gas (Play Billing Codelab)"
price_text: "$0.99"
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/buynew1.png"
source: app.image_path + "/payment/buynew1.png"
description_text: "Buy gasoline to ride!"
product_id: "SKUONETIMEGAS"
@ -55,14 +55,14 @@
ProductLayout:
heading_text: "Gas (Play Billing Codelab)"
price_text: "$0.99"
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/buynew1.png"
source: app.image_path + "/payment/buynew1.png"
description_text: "Buy gasoline to ride!"
product_id: "SKUANNUALGAS"
ProductLayout:
heading_text: "Year in gold status (Play Billing Codelab)"
price_text: "$10.99"
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/buynew1.png"
source: app.image_path + "/payment/buynew1.png"
description_text: "Enjoy a gold status for a year!"
product_id: "SKUANNUALGOLD"
@ -232,22 +232,22 @@
height:self.minimum_height
ListItemWithLabel:
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/gplay.png"
source: app.image_path + "/payment/gplay.png"
text: "Google Play"
method_name: "gplay"
recent: True
ListItemWithLabel:
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/btc.png"
source: app.image_path + "/payment/btc.png"
text: "BTC"
method_name: "btc"
ListItemWithLabel:
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/paypal.png"
source: app.image_path + "/payment/paypal.png"
text: "Paypal"
method_name: "som"
ListItemWithLabel:
source: "/home/surbhi/Downloads/peter3/PyBitmessage/src/images/buy.png"
source: app.image_path + "/payment/buy.png"
text: "One more method"
method_name: "omm"

View File

@ -6,7 +6,7 @@
disabled: True
background_disabled_normal: "White.png"
Image:
source: './images/loader.zip'
source: app.image_path + '/loader.zip'
anim_delay: 0
#mipmap: True
size: root.size
@ -18,7 +18,7 @@
height: 2*(label.height + address.height) + 10
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
title: 'add contact\'s'
background: './images/popup.jpeg'
background: app.image_path + '/popup.jpeg'
title_size: sp(20)
title_color: 0.4, 0.3765, 0.3451, 1
auto_dismiss: False
@ -94,7 +94,7 @@
size_hint : (None,None)
height: 4*(add_label.height)
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
background: './images/popup.jpeg'
background: app.image_path + '/popup.jpeg'
separator_height: 0
auto_dismiss: False
BoxLayout:
@ -190,7 +190,7 @@
size_hint : (None,None)
height: 4.5*(myaddr_label.height+ my_add_btn.children[0].height)
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
background: './images/popup.jpeg'
background: app.image_path + '/popup.jpeg'
auto_dismiss: False
separator_height: 0
BoxLayout:
@ -276,7 +276,7 @@
size_hint : (None,None)
height: 1.3*(popup_label.height+ my_add_btn.children[0].height)
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
background: './images/popup.jpeg'
background: app.image_path + '/popup.jpeg'
auto_dismiss: False
separator_height: 0
BoxLayout:
@ -337,7 +337,7 @@
size_hint : (None,None)
# height: 2*(sd_label.height+ sd_btn.children[0].height)
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
background: './images/popup.jpeg'
background: app.image_path + '/popup.jpeg'
auto_dismiss: False
separator_height: 0
BoxLayout:

View File

@ -65,6 +65,7 @@
height: "200dp"
MDIconButton:
id: file_manager
icon: "file-image"
x: root.parent.x + dp(10)
pos_hint: {"top": 1, 'right': 1}
@ -73,6 +74,8 @@
# md_bg_color: app.theme_cls.primary_color
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color
opacity: 1 if app.current_address_label() else 0
disabled: False if app.current_address_label() else True
BoxLayout:
id: top_box
@ -322,6 +325,9 @@ NavigationLayout:
halign: 'center'
font_size: dp(15)
bold: True
canvas.before:
Color:
rgba: (0,0,0,1)
# MDLabel:
# size_hint_y: None
# font_style: 'Body1'

View File

@ -108,6 +108,7 @@ from kivy.utils import platform
from kivymd.uix.button import MDIconButton
from kivymd.uix.dialog import MDDialog
from kivymd.uix.label import MDLabel
from kivymd.uix.button import MDFlatButton
from kivymd.uix.list import (
ILeftBody,
ILeftBodyTouch,
@ -134,7 +135,6 @@ from semaphores import kivyuisignaler
import state
from addresses import decodeAddress
from kivy.uix.modalview import ModalView
from datetime import datetime
from kivymd.uix.behaviors.elevation import RectangularElevationBehavior
from kivymd.uix.bottomsheet import MDCustomBottomSheet
@ -155,6 +155,8 @@ KVFILES = [
'chat_room', 'chat_list'
]
ThemeClsColor = [0.12, 0.58, 0.95, 1]
def toast(text):
"""Method will display the toast message"""
@ -291,10 +293,10 @@ class Inbox(Screen):
meny = TwoLineAvatarIconListItem(
text=item['text'], secondary_text=item['secondary_text'],
theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)
text_color=ThemeClsColor)
meny._txt_right_pad = dp(70)
meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format(
source= state.imageDir +'/text_images/{}.png'.format(
avatarImageFirstLetter(item['secondary_text'].strip()))))
meny.bind(on_press=partial(self.inbox_detail, item['msgid']))
meny.add_widget(AddTimeWidget(item['received']))
@ -477,14 +479,14 @@ class MyAddress(Screen):
meny = CustomTwoLineAvatarIconListItem(
text=item['text'], secondary_text=item['secondary_text'],
theme_text_color='Custom' if is_enable == 'true' else 'Primary',
text_color=NavigateApp().theme_cls.primary_color,)
text_color=ThemeClsColor,)
meny._txt_right_pad = dp(70)
try:
meny.canvas.children[6].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5]
except Exception:
meny.canvas.children[9].rgba = [0, 0, 0, 0] if is_enable == 'true' else [0.5, 0.5, 0.5, 0.5]
meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format(
source= state.imageDir + '/text_images/{}.png'.format(
avatarImageFirstLetter(item['text'].strip()))))
meny.bind(on_press=partial(
self.myadd_detail, item['secondary_text'], item['text']))
@ -494,7 +496,7 @@ class MyAddress(Screen):
size=[85 if platform == 'android' else 50, 60],
text='Active', halign='center',
font_style='Body1', theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color
text_color=ThemeClsColor
)
badge_obj.font_size = '13sp'
meny.add_widget(badge_obj)
@ -527,17 +529,26 @@ class MyAddress(Screen):
p.set_address(fromaddress, label)
else:
width = .8 if platform == 'android' else .55
msg_dialog = MDDialog(
dialog_box=MDDialog(
text='Address is not currently active. Please click on Toggle button to active it.',
title='', size_hint=(width, .25), text_button_ok='Ok',
events_callback=self.callback_for_menu_items)
msg_dialog.open()
size_hint=(width, .25),
buttons=[
MDFlatButton(
text="Ok", on_release=lambda x: callback_for_menu_items("Ok")
),
],)
dialog_box.open()
@staticmethod
def callback_for_menu_items(text_item, *arg):
"""Callback of alert box"""
dialog_box.dismiss()
toast(text_item)
# @staticmethod
# def callback_for_menu_items(text_item, *arg):
# """Callback of alert box"""
# toast(text_item)
def refresh_callback(self, *args):
"""Method updates the state of application,
While the spinner remains on the screen"""
@ -654,9 +665,9 @@ class AddressBook(Screen):
for item in self.queryreturn[start_index:end_index]:
meny = TwoLineAvatarIconListItem(
text=item[0], secondary_text=item[1], theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)
text_color=ThemeClsColor)
meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format(
source=state.imageDir + '/text_images/{}.png'.format(
avatarImageFirstLetter(item[0].strip()))))
meny.bind(on_press=partial(
self.addBook_detail, item[1], item[0]))
@ -873,17 +884,26 @@ class DropDownWidget(BoxLayout):
def address_error_message(self, msg):
"""Generates error message"""
width = .8 if platform == 'android' else .55
msg_dialog = MDDialog(
dialog_box=MDDialog(
text=msg,
title='', size_hint=(width, .25), text_button_ok='Ok',
events_callback=self.callback_for_menu_items)
msg_dialog.open()
size_hint=(width, .25),
buttons=[
MDFlatButton(
text="Ok", on_release=lambda x: callback_for_menu_items("Ok")
),
],)
dialog_box.open()
@staticmethod
def callback_for_menu_items(text_item, *arg):
"""Callback of alert box"""
dialog_box.dismiss()
toast(text_item)
# @staticmethod
# def callback_for_menu_items(text_item, *arg):
# """Callback of alert box"""
# toast(text_item)
def reset_composer(self):
"""Method will reset composer"""
self.ids.ti.text = ''
@ -1265,10 +1285,10 @@ class Sent(Screen):
meny = TwoLineAvatarIconListItem(
text=item['text'], secondary_text=item['secondary_text'],
theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)
text_color=ThemeClsColor)
meny._txt_right_pad = dp(70)
meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format(
source=state.imageDir + '/text_images/{}.png'.format(
avatarImageFirstLetter(item['secondary_text'].strip()))))
meny.bind(on_press=partial(self.sent_detail, item['ackdata']))
meny.add_widget(AddTimeWidget(item['senttime']))
@ -1484,9 +1504,9 @@ class Trash(Screen):
secondary_text=(item[2][:50] + '........' if len(
subject) >= 50 else (subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''),
theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)
text_color=ThemeClsColor)
meny._txt_right_pad = dp(70)
img_latter = './images/text_images/{}.png'.format(
img_latter =state.imageDir + '/text_images/{}.png'.format(
subject[0].upper() if (subject[0].upper() >= 'A' and subject[0].upper() <= 'Z') else '!')
meny.add_widget(AvatarSampleWidget(source=img_latter))
meny.add_widget(AddTimeWidget(item[7]))
@ -1539,22 +1559,34 @@ class Trash(Screen):
def delete_confirmation(self):
"""Show confirmation delete popup"""
width = .8 if platform == 'android' else .55
delete_msg_dialog = MDDialog(
dialog_box=MDDialog(
text='Are you sure you want to delete this'
' message permanently from trash?',
title='',
size_hint=(width, .25),
text_button_ok='Yes',
text_button_cancel='No',
events_callback=self.callback_for_delete_msg)
delete_msg_dialog.open()
buttons=[
MDFlatButton(
text="Yes", on_release=lambda x: callback_for_delete_msg("Yes")
),
MDFlatButton(
text="No",on_release=lambda x: callback_for_delete_msg("No"),
),
],)
dialog_box.open()
def callback_for_delete_msg(self, text_item, *arg):
def callback_for_delete_msg(text_item, *arg):
"""Getting the callback of alert box"""
if text_item == 'Yes':
self.delete_message_from_trash()
else:
toast(text_item)
dialog_box.dismiss()
# def callback_for_delete_msg(self, text_item, *arg):
# """Getting the callback of alert box"""
# if text_item == 'Yes':
# self.delete_message_from_trash()
# else:
# toast(text_item)
def delete_message_from_trash(self):
"""Deleting message from trash"""
@ -1625,6 +1657,10 @@ class NavigateApp(MDApp):
imgstatus = False
count = 0
manager_open = False
file_manager = None
# state.imageDir = os.path.join(os.path.abspath(os.path.join(__file__ ,"../../..")),'images', 'kivy')
state.imageDir = os.path.join('./images', 'kivy')
image_path = state.imageDir
def build(self):
"""Method builds the widget"""
@ -1658,7 +1694,7 @@ class NavigateApp(MDApp):
def getCurrentAccountData(self, text):
"""Get Current Address Account Data"""
if os.path.exists('./images/default_identicon/{}.png'.format(text)):
if os.path.exists(state.imageDir + '/default_identicon/{}.png'.format(text)):
self.load_selected_Image(text)
else:
self.set_identicon(text)
@ -1672,8 +1708,16 @@ class NavigateApp(MDApp):
for nav_obj in self.root.ids.content_drawer.children[
0].children[0].children[0].children:
nav_obj.active = True if nav_obj.text == 'Inbox' else False
self.fileManagerSetting()
Clock.schedule_once(self.setCurrentAccountData, 0.5)
def fileManagerSetting(self):
"""This method is for file manager setting"""
if not self.root.ids.content_drawer.ids.file_manager.opacity and \
self.root.ids.content_drawer.ids.file_manager.disabled:
self.root.ids.content_drawer.ids.file_manager.opacity = 1
self.root.ids.content_drawer.ids.file_manager.disabled = False
def setCurrentAccountData(self, dt=0):
"""This method set the current accout data on all the screens"""
self.root.ids.sc1.ids.ml.clear_widgets()
@ -1714,20 +1758,20 @@ class NavigateApp(MDApp):
"""Getting Default Account Data"""
if BMConfigParser().addresses():
img = identiconGeneration.generate(BMConfigParser().addresses()[0])
self.createFolder('./images/default_identicon/')
self.createFolder(state.imageDir + '/default_identicon/')
if platform == 'android':
# android_path = os.path.expanduser
# ("~/user/0/org.test.bitapp/files/app/")
if not os.path.exists('./images/default_identicon/{}.png'.format(
if not os.path.exists(state.imageDir + '/default_identicon/{}.png'.format(
BMConfigParser().addresses()[0])):
android_path = os.path.join(
os.environ['ANDROID_PRIVATE'] + '/app/')
img.texture.save('{1}/images/default_identicon/{0}.png'.format(
img.texture.save('{1}/kivy/default_identicon/{0}.png'.format(
BMConfigParser().addresses()[0], android_path))
else:
if not os.path.exists('./images/default_identicon/{}.png'.format(
if not os.path.exists(state.imageDir + '/default_identicon/{}.png'.format(
BMConfigParser().addresses()[0])):
img.texture.save('./images/default_identicon/{}.png'.format(
img.texture.save(state.imageDir + '/default_identicon/{}.png'.format(
BMConfigParser().addresses()[0]))
return BMConfigParser().addresses()[0]
return 'Select Address'
@ -1745,17 +1789,17 @@ class NavigateApp(MDApp):
def get_default_image():
"""Getting default image on address"""
if BMConfigParser().addresses():
return './images/default_identicon/{}.png'.format(
return state.imageDir + '/default_identicon/{}.png'.format(
BMConfigParser().addresses()[0])
return './images/no_identicons.png'
return state.imageDir + '/no_identicons.png'
@staticmethod
def get_default_logo():
"""Getting default logo image"""
if BMConfigParser().addresses():
return './images/default_identicon/{}.png'.format(
return state.imageDir + '/default_identicon/{}.png'.format(
BMConfigParser().addresses()[0])
return './images/drawer_logo1.png'
return state.imageDir + '/drawer_logo1.png'
@staticmethod
def addressexist():
@ -2148,68 +2192,57 @@ class NavigateApp(MDApp):
"""This method open the file manager of local system"""
from kivymd.uix.filemanager import MDFileManager
self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False)
if not self.file_manager:
self.file_manager = MDFileManager(
exit_manager=self.exit_manager,
select_path=self.select_path,
previous=False,
ext=['.png', '.jpg']
)
self.manager.add_widget(self.file_manager)
# self.file_manager.show(os.environ["HOME"])
self.file_manager.previous = False
self.file_manager.current_path = '/'
if platform == 'android':
from android.permissions import request_permissions, Permission
request_permissions([Permission.WRITE_EXTERNAL_STORAGE, Permission.READ_EXTERNAL_STORAGE])
# from android.storage import app_storage_path
# settings_path = app_storage_path()
# print('path1................................', settings_path)
# from android.storage import primary_external_storage_path
# primary_ext_storage = primary_external_storage_path()
# print('path1................................', primary_ext_storage)
# from android.storage import secondary_external_storage_path
# secondary_ext_storage = secondary_external_storage_path()
# print('path1................................', secondary_ext_storage)
# from kivy.app import user_data_dir
# from os.path import dirname, join
# out = join(dirname(user_data_dir), 'DCIM')
# DCIM = join('/sdcard', 'DCIM')
self.file_manager.show(os.getenv('EXTERNAL_STORAGE') if platform == 'android' else os.environ["HOME"])
# self.file_manager.show(os.getenv('EXTERNAL_STORAGE'))
from android.permissions import request_permissions, Permission, check_permission
if check_permission(Permission.WRITE_EXTERNAL_STORAGE) and \
check_permission(Permission.READ_EXTERNAL_STORAGE):
self.file_manager.show(os.getenv('EXTERNAL_STORAGE'))
self.manager_open = True
else:
request_permissions([Permission.WRITE_EXTERNAL_STORAGE, Permission.READ_EXTERNAL_STORAGE])
else:
self.file_manager.show(os.environ["HOME"])
self.manager_open = True
self.manager.open()
def select_path(self, path):
"""This method is used to save the select image"""
try:
from PIL import Image as PilImage
newImg = PilImage.open(path).resize((300, 300))
if platform == 'android':
android_path = os.path.join(
os.environ['ANDROID_PRIVATE'] + '/app/')
newImg.save('{1}/images/default_identicon/{0}.png'.format(
newImg.save('{1}/kivy/default_identicon/{0}.png'.format(
state.association, android_path))
else:
if not os.path.exists('./images/default_identicon/'):
os.makedirs('./images/default_identicon/')
newImg.save('./images/default_identicon/{0}.png'.format(state.association))
if not os.path.exists(state.imageDir + '/default_identicon/'):
os.makedirs(state.imageDir + '/default_identicon/')
newImg.save(state.imageDir + '/default_identicon/{0}.png'.format(state.association))
self.load_selected_Image(state.association)
self.exit_manager()
toast('Image changed')
except Exception:
toast('Exit')
self.exit_manager()
def exit_manager(self, *args):
"""Called when the user reaches the root of the directory tree."""
self.manager.dismiss()
self.manager_open = False
self.file_manager.close()
def load_selected_Image(self, curerentAddr):
"""This method load the selected image on screen"""
top_box_obj = self.root.ids.content_drawer.ids.top_box.children[0]
# spinner_img_obj = self.root.ids.content_drawer.ids.btn.children[1]
# spinner_img_obj.source = top_box_obj.source ='./images/default_identicon/{0}.png'.format(curerentAddr)
top_box_obj.source = './images/default_identicon/{0}.png'.format(curerentAddr)
top_box_obj.source = state.imageDir + '/default_identicon/{0}.png'.format(curerentAddr)
top_box_obj.reload()
# spinner_img_obj.reload()
@ -2441,8 +2474,8 @@ class MailDetail(Screen): # pylint: disable=too-many-instance-attributes
if len(data[0]) == 7:
self.status = data[0][4]
self.time_tag = ShowTimeHistoy(data[0][4]) if state.detailPageType == 'inbox' else ShowTimeHistoy(data[0][6])
self.avatarImg = './images/avatar.png' if state.detailPageType == 'draft' else (
'./images/text_images/{0}.png'.format(avatarImageFirstLetter(self.subject.strip())))
self.avatarImg = state.imageDir + '/avatar.png' if state.detailPageType == 'draft' else (
state.imageDir + '/text_images/{0}.png'.format(avatarImageFirstLetter(self.subject.strip())))
self.timeinseconds = data[0][4] if state.detailPageType == 'inbox' else data[0][6]
def delete_mail(self):
@ -2673,6 +2706,9 @@ class ShowQRCode(Screen):
"""Method used for showing QR Code"""
self.ids.qr.clear_widgets()
state.kivyapp.set_toolbar_for_QrCode()
try:
from kivy.garden.qrcode import QRCodeWidget
except Exception as e:
from kivy_garden.qrcode import QRCodeWidget
try:
address = self.manager.get_parent_window().children[0].address
@ -2761,10 +2797,10 @@ class Draft(Screen):
meny = TwoLineAvatarIconListItem(
text='Draft', secondary_text=item['text'],
theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)
text_color=ThemeClsColor)
meny._txt_right_pad = dp(70)
meny.add_widget(AvatarSampleWidget(
source='./images/avatar.png'))
source=state.imageDir + '/avatar.png'))
meny.bind(on_press=partial(
self.draft_detail, item['ackdata']))
meny.add_widget(AddTimeWidget(item['senttime']))
@ -2964,10 +3000,10 @@ class Allmails(Screen):
subject) >= 50 else (
subject + ',' + body)[0:50] + '........').replace('\t', '').replace(' ', ''),
theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)
text_color=ThemeClsColor)
meny._txt_right_pad = dp(70)
meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format(
source= state.imageDir +'/text_images/{}.png'.format(
avatarImageFirstLetter(body.strip()))))
meny.bind(on_press=partial(
self.mail_detail, item[5], item[4]))
@ -3246,21 +3282,33 @@ class OneLineListTitle(OneLineListItem):
def copymessageTitle(self, text):
"""this method is for displaying dialog box"""
width = .8 if platform == 'android' else .55
msg_dialog = MDDialog(
dialog_box=MDDialog(
text=text,
title='', size_hint=(width, .25),
text_button_cancel='Cancel',
text_button_ok='Copy',
events_callback=self.callback_for_copy_title)
msg_dialog.open()
size_hint=(width, .25),
buttons=[
MDFlatButton(
text="Copy", on_release=lambda x: callback_for_copy_title(text)
),
MDFlatButton(
text="Cancel",on_release=lambda x: callback_for_copy_title(text),
),
],)
dialog_box.open()
@staticmethod
def callback_for_copy_title(text_item, *arg):
"""Callback of alert box"""
if text_item == 'Copy':
Clipboard.copy(str(arg[0].text))
Clipboard.copy()
dialog_box.dismiss()
toast(text_item)
# @staticmethod
# def callback_for_copy_title(text_item, *arg):
# """Callback of alert box"""
# if text_item == 'Copy':
# Clipboard.copy(str(arg[0].text))
# toast(text_item)
class ToAddrBoxlayout(BoxLayout):
"""class for BoxLayout behaviour"""
@ -3340,9 +3388,9 @@ class ChatList(Screen):
for item in self.queryreturn:
meny = TwoLineAvatarIconListItem(
text=item[0], secondary_text=item[1], theme_text_color='Custom',
text_color=NavigateApp().theme_cls.primary_color)
text_color=ThemeClsColor)
meny.add_widget(AvatarSampleWidget(
source='./images/text_images/{}.png'.format(
source= state.imageDir + '/text_images/{}.png'.format(
avatarImageFirstLetter(item[0].strip()))))
meny.bind(on_release=partial(
self.redirect_to_chat, item[0], item[1]))

View File

@ -48,7 +48,8 @@ requirements =
pillow,
bitmsghash,
#git+https://github.com/surbhicis/KivyMD-1.git,
git+https://github.com/surbhicis/KivyMD-1#egg=kivymd,
#git+https://github.com/surbhicis/KivyMD-1#egg=kivymd,
git+https://github.com/navjotcis/KivyMD#egg=kivymd,
kivy-garden,
qrcode,
msgpack
@ -194,6 +195,9 @@ android.sdk = 20
# (list) Java classes to add as activities to the manifest.
#android.add_activites = com.example.ExampleActivity
# (str) python-for-android branch to use, defaults to stable
# p4a.branch = master
# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME
@ -248,10 +252,10 @@ android.arch = arm64-v8a
p4a.branch = develop
# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =
# p4a.source_dir = /home/cis/Music/androidp4a/python-for-android
# (str) The directory in which python-for-android should look for your own build recipes (if any)
p4a.local_recipes = /home/surbhi/Downloads/peter3/PyBitmessage/src/bitmessagekivy/android/python-for-android/recipes/
p4a.local_recipes = %(source.dir)s/bitmessagekivy/android/python-for-android/recipes/
# (str) Filename to the hook for p4a
#p4a.hook =

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
src/images/kivy/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

BIN
src/images/kivy/inbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/images/kivy/me.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

View File

Before

Width:  |  Height:  |  Size: 197 B

After

Width:  |  Height:  |  Size: 197 B

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
src/images/kivy/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

BIN
src/images/kivy/redicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

BIN
src/images/kivy/send.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Some files were not shown because too many files have changed in this diff Show More