Moved empty_screen() to common.py
This commit is contained in:
parent
e8805ce19c
commit
f48b96aa0d
|
@ -17,7 +17,7 @@ import os
|
|||
|
||||
from debug import logger
|
||||
from bitmessagekivy.baseclass.common import (
|
||||
avatarImageFirstLetter, toast,
|
||||
avatarImageFirstLetter, toast, empty_screen_label,
|
||||
ThemeClsColor, SwipeToDeleteItem
|
||||
)
|
||||
from bitmessagekivy.baseclass.popup import AddbookDetailPopup
|
||||
|
@ -31,6 +31,8 @@ class AddressBook(Screen, HelperAddressBook):
|
|||
has_refreshed = True
|
||||
address_label = StringProperty()
|
||||
address = StringProperty()
|
||||
label_str = "No contact found yet......"
|
||||
no_search_res_found = "No search result found"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Getting AddressBook Details"""
|
||||
|
@ -69,7 +71,7 @@ class AddressBook(Screen, HelperAddressBook):
|
|||
# halign='center',
|
||||
# size_hint_y=None,
|
||||
# valign='top')
|
||||
self.ids.ml.add_widget(self.default_label_when_empty())
|
||||
self.ids.ml.add_widget(empty_screen_label(self.label_str, self.no_search_res_found))
|
||||
|
||||
def set_mdList(self, start_index, end_index):
|
||||
"""Creating the mdList"""
|
||||
|
|
|
@ -8,23 +8,26 @@ from kivymd.uix.label import MDLabel
|
|||
|
||||
from bitmessagekivy.baseclass.popup import AddbookDetailPopup
|
||||
|
||||
no_address_found = "No contact found yet...??..."
|
||||
empty_search_label = "No contact found!??"
|
||||
|
||||
label_str = "No contact found yet......"
|
||||
no_search_res_found = "No contact found!"
|
||||
|
||||
|
||||
class DefaultLabelMixin(object):
|
||||
|
||||
@staticmethod
|
||||
def default_label_when_empty():
|
||||
content = MDLabel(
|
||||
font_style='Caption',
|
||||
theme_text_color='Primary',
|
||||
# TODO: searcing_text(typo) need to create a kivy_state.py and add kivy related variables
|
||||
text=empty_search_label if state.searcing_text else no_address_found,
|
||||
halign='center', size_hint_y=None, valign='top')
|
||||
return content
|
||||
|
||||
pass
|
||||
"""
|
||||
# @staticmethod
|
||||
# def default_label_when_empty():
|
||||
# content = MDLabel(
|
||||
# font_style='Caption',
|
||||
# theme_text_color='Primary',
|
||||
# # TODO: searcing_text(typo) need to create a kivy_state.py and add kivy related variables
|
||||
# text=no_search_res_found if state.searcing_text else label_str,
|
||||
# halign='center',
|
||||
# size_hint_y=None,
|
||||
# valign='top')
|
||||
# return content
|
||||
"""
|
||||
|
||||
class HelperAddressBook(DefaultLabelMixin):
|
||||
"""Widget used in Addressbook are here"""
|
||||
|
|
Reference in New Issue
Block a user