Constant for empty screen label
This commit is contained in:
parent
348bee0a06
commit
e8805ce19c
|
@ -13,6 +13,7 @@ from kivymd.uix.label import MDLabel
|
||||||
from kivy.uix.screenmanager import Screen
|
from kivy.uix.screenmanager import Screen
|
||||||
|
|
||||||
import state
|
import state
|
||||||
|
import os
|
||||||
|
|
||||||
from debug import logger
|
from debug import logger
|
||||||
from bitmessagekivy.baseclass.common import (
|
from bitmessagekivy.baseclass.common import (
|
||||||
|
@ -83,8 +84,9 @@ class AddressBook(Screen, HelperAddressBook):
|
||||||
# listItem.add_widget(AvatarSampleWidget(
|
# listItem.add_widget(AvatarSampleWidget(
|
||||||
# source=state.imageDir + '/text_images/{}.png'.format(
|
# source=state.imageDir + '/text_images/{}.png'.format(
|
||||||
# avatarImageFirstLetter(item[0].strip()))))
|
# avatarImageFirstLetter(item[0].strip()))))
|
||||||
image = state.imageDir + "/text_images/{}.png".format(
|
image = os.path.join(
|
||||||
avatarImageFirstLetter(item[0].strip()))
|
state.imageDir, "text_images", "{}.png".format(avatarImageFirstLetter(item[0].strip()))
|
||||||
|
)
|
||||||
message_row.ids.avater_img.source = image
|
message_row.ids.avater_img.source = image
|
||||||
listItem.bind(on_release=partial(
|
listItem.bind(on_release=partial(
|
||||||
self.addBook_detail, item[1], item[0], message_row))
|
self.addBook_detail, item[1], item[0], message_row))
|
||||||
|
|
|
@ -8,19 +8,26 @@ from kivymd.uix.label import MDLabel
|
||||||
|
|
||||||
from bitmessagekivy.baseclass.popup import AddbookDetailPopup
|
from bitmessagekivy.baseclass.popup import AddbookDetailPopup
|
||||||
|
|
||||||
|
no_address_found = "No contact found yet...??..."
|
||||||
|
empty_search_label = "No contact found!??"
|
||||||
|
|
||||||
class HelperAddressBook(object):
|
|
||||||
"""Widget used in Addressbook are here"""
|
|
||||||
|
class DefaultLabelMixin(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def default_label_when_empty():
|
def default_label_when_empty():
|
||||||
content = MDLabel(
|
content = MDLabel(
|
||||||
font_style='Caption',
|
font_style='Caption',
|
||||||
theme_text_color='Primary',
|
theme_text_color='Primary',
|
||||||
# TODO: searcing_text(typo) need to create a kivy_state.py and add kivy related variables
|
# TODO: searcing_text(typo) need to create a kivy_state.py and add kivy related variables
|
||||||
text="No contact found!" if state.searcing_text
|
text=empty_search_label if state.searcing_text else no_address_found,
|
||||||
else "No contact found yet...... ", halign='center', size_hint_y=None, valign='top')
|
halign='center', size_hint_y=None, valign='top')
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
class HelperAddressBook(DefaultLabelMixin):
|
||||||
|
"""Widget used in Addressbook are here"""
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def address_detail_popup(obj, send_message, update_address, close_popup, width):
|
def address_detail_popup(obj, send_message, update_address, close_popup, width):
|
||||||
|
|
Reference in New Issue
Block a user